@font-face {
  font-family: Atkinson;
  src: url(public/fonts/atkinson-hyperlegible-next-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Atkinson;
  src: url(public/fonts/atkinson-hyperlegible-next-700.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url(public/fonts/barlow-condensed-600.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: light;
  --page: #f7f4e8;
  --panel: #fffcef;
  --ink: #172820;
  --sub: #4f6256;
  --court: #123d32;
  --primary: #123d32;
  --onprimary: #fffbee;
  --line: #c8cebc;
  --accent: #e97940;
  --field: #fffbee;
  --edge: #a9b198;
  font:
    16px/1.45 Atkinson,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--page);
}
:root[data-theme="Dark"] {
  color-scheme: dark;
  --page: #14251f;
  --panel: #1c3028;
  --ink: #f6f3e4;
  --sub: #beccbc;
  --primary: #c9e7bf;
  --onprimary: #13291e;
  --line: #4e6658;
  --field: #264536;
  --edge: #95a98b;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="System"] {
    color-scheme: dark;
    --page: #14251f;
    --panel: #1c3028;
    --ink: #f6f3e4;
    --sub: #beccbc;
    --primary: #c9e7bf;
    --onprimary: #13291e;
    --line: #4e6658;
    --field: #264536;
    --edge: #95a98b;
  }
}
:root[data-theme="High contrast"] {
  --page: white;
  --ink: #000;
  --sub: #222;
  --panel: white;
  --line: #111;
  --primary: #000;
  --court: #08190f;
  --edge: #111;
  --accent: #ff8f45;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #dc651c;
  outline-offset: 3px;
}
button {
  touch-action: manipulation;
}
a {
  color: var(--ink);
}
h1,
h2,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.05;
}
h1,
h2 {
  font-family: Barlow, "Arial Narrow", sans-serif;
  font-weight: 600;
}
button {
  border: 0;
  background: none;
}
main,
.mast-inner {
  max-width: 1032px;
  margin: auto;
  padding-inline: clamp(14px, 4vw, 38px);
}
main {
  padding-bottom: 60px;
}
.mast {
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding-top: env(safe-area-inset-top);
}
nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
nav button,
.quiet,
.text-button {
  font-weight: 700;
  min-height: 48px;
  padding: 5px 9px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font:
    600 32px Barlow,
    sans-serif;
  letter-spacing: -1px;
  padding: 0;
  min-height: 48px;
}
.monogram {
  display: grid;
  place-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fffbee;
  background: #123d32;
  border-bottom: 4px solid #e97940;
  font:
    600 22px Barlow,
    sans-serif;
}
.settings,
.icon {
  font-size: 22px;
  min-width: 48px;
  min-height: 48px;
}
.eyebrow,
.placement-count {
  font:
    bold 0.74rem/1.3 Atkinson,
    sans-serif;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.serve-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 0.98fr;
  gap: clamp(16px, 4vw, 50px);
  align-items: center;
  padding: clamp(30px, 5vw, 63px) 0;
}
.hero h1 {
  font-size: clamp(66px, 8vw, 106px);
  letter-spacing: -0.045em;
  line-height: 0.89;
  margin: 18px 0 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--primary);
}
.hero p {
  color: var(--sub);
  font-size: 1.08rem;
  max-width: 32ch;
  margin-bottom: 24px;
}
.primary,
.secondary {
  border-radius: 7px;
  padding: 12px 18px;
  font-weight: 700;
  min-height: 48px;
}
.primary {
  background: var(--primary);
  color: var(--onprimary);
}
.secondary {
  background: var(--panel);
  border: 1px solid var(--line);
}
.primary span {
  margin-left: 14px;
}
.primary:disabled,
.secondary:disabled {
  opacity: 0.52;
}
.primary:hover:enabled,
.secondary:hover:enabled {
  filter: brightness(0.94);
}
.court-art {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1.27;
  background: #164636;
  border: 7px solid #20543e;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 #142f2330;
  transform: rotate(1deg);
}
.court-lines {
  position: absolute;
  z-index: -1;
  inset: 7%;
  border: 2px solid #adc9ab77;
  background: linear-gradient(
    90deg,
    transparent 49.7%,
    #adc9ab66 49.7% 50.2%,
    transparent 50.2%
  );
}
.court-lines:before {
  content: "";
  position: absolute;
  inset: 14% -12%;
  border-block: 2px solid #adc9ab77;
}
.court-lines:after {
  content: "";
  position: absolute;
  inset: 49% -12% auto;
  height: 3px;
  background: #b6c9a9aa;
}
.art-tiles,
.art-before,
.art-score {
  transform: rotate(-8deg);
}
.art-before,
.art-score {
  font:
    600 clamp(1rem, 2vw, 1.5rem) Barlow,
    sans-serif;
  color: #e0ecce;
  background: #164636;
  padding: 0 8px;
}
.art-before {
  align-self: flex-start;
  margin: 0 0 12px 17%;
}
.art-tiles {
  display: flex;
  gap: 4px;
}
.art-tiles b {
  display: grid;
  place-content: center;
  position: relative;
  width: clamp(39px, 5.9vw, 74px);
  aspect-ratio: 1;
  border-radius: 6px;
  color: #183023;
  background: #fffbea;
  box-shadow: 0 5px #acb39c;
  font:
    700 clamp(24px, 4.7vw, 56px)/1 Atkinson,
    sans-serif;
}
.art-tiles b:first-child {
  border-bottom: 5px solid #e97940;
}
.art-tiles small {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font:
    700 10px Atkinson,
    sans-serif;
}
.art-score {
  align-self: flex-end;
  margin: 15px 14% 0 0;
}
.art-score span {
  color: #ffac7b;
}
.play-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}
.daily-card,
.play-menu,
.inbox,
.history,
.puzzle-intro,
.result,
.landing {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: clamp(16px, 3vw, 28px);
}
.daily-card {
  border-top: 4px solid var(--accent);
}
.daily-card .eyebrow,
.section-head > span {
  color: var(--sub);
}
.daily-card h2,
.play-menu h2,
.section-head h2 {
  font-size: 2rem;
  margin: 10px 0;
}
.daily-card p,
.landing p,
.puzzle-intro p {
  color: var(--sub);
}
.text-button,
.quiet,
.word-link {
  color: var(--primary);
}
.text-button {
  padding-inline: 0;
}
.menu-row,
.match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  min-height: 48px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.menu-row span,
.match-row i {
  margin-left: auto;
}
.inbox {
  margin: 0 0 18px;
}
.match-row b {
  min-width: 50px;
}
.match-row span,
.history-row > span {
  color: var(--sub);
  font-size: 0.85rem;
}
.court-view,
.court-title,
.scoreboard,
.playing,
.hand,
.landing,
.result,
.puzzle-intro,
.notice,
.history {
  max-width: 680px;
  margin-inline: auto;
}
.court-title,
.section-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.court-title {
  padding: 25px 0 13px;
}
.court-title h1,
.landing h1 {
  font-size: clamp(2.35rem, 7vw, 4rem);
  margin: 3px 0;
}
.court-title .eyebrow {
  color: var(--sub);
}
.scoreboard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 15px;
}
.side {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.side span {
  font-weight: 700;
}
.side b {
  font:
    600 2.1rem/1 Barlow,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
.side.serving span {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}
.scoreboard i {
  color: var(--sub);
  font-style: normal;
}
.playing {
  background: var(--court);
  color: #fffbea;
  padding: clamp(12px, 3.6vw, 26px);
  border-radius: 12px 12px 0 0;
}
.playing header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.placement-count {
  color: #c3d6c8;
  font-size: 0.66rem;
}
.slots,
.rack {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(3px, 1vw, 8px);
  margin: 20px auto 10px;
}
.rack {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 420px;
  margin: 12px auto;
}
.slot,
.tile,
.rack-hole {
  display: grid;
  place-content: center;
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 7px;
  user-select: none;
  -webkit-user-select: none;
}
.slot b,
.tile b {
  font:
    700 clamp(22px, 6vw, 43px)/1 Atkinson,
    sans-serif;
}
.slot small,
.tile small {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-size: clamp(0.65rem, 1.7vw, 0.85rem);
  line-height: 1;
}
.filled,
.tile {
  background: #fffbea;
  color: #172820;
  box-shadow: inset 0 -3px #bcc3aa;
}
.empty {
  background: #164a3c;
  color: #dce8d9;
  border: 1px dashed #94b1a0;
  font-weight: 700;
}
.staged {
  outline: 2px solid #fffbea;
  outline-offset: 2px;
  box-shadow: inset 0 -5px #e97940;
  touch-action: none;
}
.changed:before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 30%;
  width: 40%;
  height: 3px;
  background: #b34b20;
}
.board-note {
  font-size: 0.9rem;
  color: #deeadb;
  margin-top: 12px;
  min-height: 1.4em;
}
.hand {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  padding: 12px clamp(14px, 3vw, 26px) 16px;
  background: var(--panel);
}
.hand h2 {
  font-size: 1.45rem;
}
.tile {
  border: 1px solid #a2ad96;
  touch-action: none;
}
.picked {
  outline: 3px solid #bd5321;
  outline-offset: 2px;
  transform: translateY(-3px);
}
.rack-hole {
  border: 1px dashed var(--edge);
}
.feedback {
  font-size: 0.88rem;
  color: var(--sub);
  min-height: 1.5em;
  text-align: center;
  margin: 12px 0;
}
.actions {
  display: flex;
  gap: 8px;
}
.actions .primary {
  flex: 1;
}
.details {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.details:empty {
  display: none;
}
.history,
.result,
.puzzle-intro,
.notice {
  margin-block: 14px;
}
.history h2 {
  font-size: 1.6rem;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-top: 1px solid var(--line);
}
.history-row strong {
  margin-left: auto;
}
.word-link {
  min-height: 48px;
}
.puzzle-intro {
  padding-block: 14px;
}
.opponent {
  display: inline-flex;
  vertical-align: middle;
  gap: 4px;
  margin: 0 0 0 10px;
}
.opponent .tile {
  width: 30px;
  aspect-ratio: 1;
  box-shadow: none;
}
.opponent b {
  font-size: 14px;
}
.opponent small {
  font-size: 7px;
  bottom: 2px;
  right: 2px;
}
.notice {
  padding: 10px 14px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
}
.landing {
  margin-top: 30px;
}
.result h2 {
  font-size: 2.5rem;
  margin: 9px 0;
}
.result details {
  padding: 8px 0;
}
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -50%);
}
dialog {
  width: min(440px, calc(100% - 24px));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  padding: 20px;
}
dialog::backdrop {
  background: #102619a8;
}
.dialog-head h2 {
  margin: 0;
  font-size: 2rem;
}
.dialog-head {
  margin-bottom: 12px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 10px 0;
}
legend {
  color: var(--sub);
  margin-bottom: 7px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 6px 0;
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--primary);
}
.choice b,
.choice small {
  display: block;
}
.choice small,
.fine {
  color: var(--sub);
  font-size: 0.85rem;
}
input,
select {
  background: var(--field);
  color: var(--ink);
  padding: 8px;
  border: 1px solid var(--edge);
  border-radius: 5px;
}
input:not([type="radio"]) {
  width: 100%;
}
.full {
  width: 100%;
  margin-top: 15px;
}
.fine {
  margin-top: 15px;
}
#toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  background: #152b22;
  color: white;
  border: 1px solid #b8ceba;
  border-radius: 8px;
  padding: 10px 16px;
}
dialog:modal ~ #toast {
  z-index: 100;
}
.hand .quiet {
  font-size: 0.85rem;
}
[hidden] {
  display: none !important;
}
@media (min-width: 900px) {
  .court-view:has(.history) {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(235px, 1fr);
    gap: 0 20px;
    align-items: start;
  }
  .court-view:has(.history) > * {
    grid-column: 1;
    width: 100%;
  }
  .court-view:has(.history) > .history {
    grid-column: 2;
    grid-row: 3 / span 6;
  }
  .court-view:has(.history) > .quiet {
    width: auto;
  }
}
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr 0.77fr;
    gap: 12px;
    padding: 26px 0;
  }
  .hero h1 {
    font-size: clamp(49px, 9vw, 63px);
    margin: 10px 0 14px;
  }
  .hero p {
    font-size: 0.94rem;
    margin-bottom: 16px;
  }
  .hero .eyebrow {
    font-size: 0.59rem;
  }
  .court-art {
    aspect-ratio: 0.79;
    border-width: 4px;
    transform: rotate(1deg);
  }
  .art-tiles {
    gap: 2px;
  }
  .art-tiles b {
    width: clamp(24px, 6.15vw, 39px);
    font-size: clamp(18px, 4vw, 24px);
    border-radius: 3px;
  }
  .art-tiles small {
    font-size: 6px;
    bottom: 1px;
    right: 2px;
  }
  .art-before,
  .art-score {
    font-size: 0.85rem;
  }
  .play-grid {
    grid-template-columns: 1fr;
  }
  .mast-inner {
    min-height: 58px;
  }
  .brand {
    font-size: 27px;
  }
  nav {
    gap: 0;
  }
  .settings {
    font-size: 19px;
  }
  nav button {
    font-size: 0.86rem;
  }
  .daily-card h2,
  .play-menu h2 {
    font-size: 1.75rem;
  }
  .hero .primary {
    padding-inline: 12px;
  }
  .court-title {
    padding-top: 16px;
  }
  .slots {
    margin-top: 16px;
  }
}
@media (max-width: 365px) {
  main {
    padding-inline: 8px;
  }
  .playing {
    padding-inline: 5px;
  }
  .slots {
    gap: 2px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .court-art {
    display: none;
  }
  .board-note {
    padding-inline: 6px;
  }
  .slot,
  .tile {
    min-height: 48px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .staged {
    animation: place 0.12s ease-out;
  }
  @keyframes place {
    from {
      transform: translateY(3px);
    }
    to {
      transform: none;
    }
  }
}
.mini-board {
  display: flex;
  gap: 3px;
  margin: 12px 0;
}
.mini-board b {
  background: var(--court);
  color: #fffbea;
  border-radius: 3px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 27px;
  font-size: 0.92rem;
}
.home > .inbox:first-child {
  margin-top: 18px;
}
dialog label:has(#player-name),
dialog label:has(#theme) {
  display: grid;
  gap: 5px;
  margin: 12px 0;
}
.launch-link {
  display: inline-block;
  padding: 12px 0;
  font-weight: bold;
}
.side span {
  overflow-wrap: anywhere;
}
.side {
  min-width: 0;
}
.scoreboard {
  flex-wrap: wrap;
}
.slot,
.tile {
  min-height: 48px;
}
