:root {
  color-scheme: light;
  --paper: #f8f4eb;
  --card: #fffdf7;
  --ink: #25251c;
  --muted: #5d5b50;
  --line: #837c6d;
  --accent: #283f33;
  --tint: #dce9d9;
  font: 100%/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
header, main, #notice, #feedback { width: min(100% - 16px, 36rem); margin-inline: auto; }
header { padding: 6px 6px 8px; }
header a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  font: bold 2rem/1 Georgia, serif; color: var(--ink); text-decoration: none;
}
main { display: grid; gap: 10px; padding-bottom: 12px; }
h1, h2 { font: bold 1.65rem/1.15 Georgia, serif; margin: 0 0 10px; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; }
p { margin: 6px 0 12px; overflow-wrap: anywhere; }
.panel { padding: 12px; border: 1px solid #d1c8b8; background: var(--card); border-radius: 12px; }
.entry { padding: 16px; }
.entry-panels { display: grid; gap: 12px; }
.entry-actions.actions { margin-top: 0; }
.language-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.language-picker legend { padding: 0; font-weight: 650; }
.language-options { display: flex; gap: 6px; margin-top: 6px; }
.language-tile { position: relative; margin: 0; }
.language-tile input {
  position: absolute;
  inset: 0;
  margin: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.language-tile span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  font-weight: 700;
}
.language-en span { color: #923d38; }
.language-fr span { color: #244ca0; }
.language-tile input:checked + span { border: 2px solid var(--accent); background: var(--selected); }
.language-tile input:focus-visible + span { outline: 2px solid #244ca0; outline-offset: 2px; }

label { display: block; font-weight: 650; margin-block: 6px; }
button, input, select, summary, .link-control {
  min-height: 44px; min-width: 44px; font: inherit; color: inherit;
}
button, input, select {
  border: 1px solid var(--line); border-radius: 7px; background: var(--card); padding: 6px 9px;
}
button { cursor: pointer; }
input, select { width: 100%; }
button:disabled { cursor: default; color: var(--muted); background: #ede9df; }
button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
button.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: bold; }
button.primary:disabled { background: #ede9df; color: var(--muted); border-color: var(--line); }
:focus-visible { outline: 3px solid #9e491d; outline-offset: 2px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.link-control { display: inline-flex; align-items: center; color: var(--accent); }
.button-link {
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--card);
  font-weight: bold;
  text-decoration: none;
}
.seats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rankings .seats {
  margin-bottom: 0;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
.seats li { padding: 3px 6px; background: var(--paper); border-radius: 4px; overflow-wrap: anywhere; }
.seats span { display: block; font-size: .875rem; color: var(--muted); }
.board { margin-block: 10px 3px; font-size: 0; line-height: 0; }
.word-gap { font-size: 1rem; word-spacing: 5px; }
.word-start { display: inline-block; vertical-align: top; white-space: nowrap; }
.spot {
  display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px;
  border: 1px solid transparent; border-radius: 6px; font: bold 1.35rem/1 Georgia, serif; padding: 0;
  vertical-align: top; margin: 0 3px 8px 0;
}
.spot.hidden { border-bottom: 2px solid var(--line); background: #f1ede4; }
button.spot.hidden { border: 1px solid var(--line); border-bottom-width: 2px; }
button.spot[aria-pressed="true"] { background: var(--tint); }
.spot.has-deductions::after { content: '…'; position: absolute; bottom: 0; right: 3px; font: .75rem system-ui; }
.spot.has-deductions, .spot.wrap-end { position: relative; }
.spot.wrap-end::before {
  content: '-';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  font: bold 16px/1 system-ui, sans-serif;
  pointer-events: none;
}
.spot.new { text-decoration: underline; text-underline-offset: 4px; }
.spot.punctuation { width: 12px; min-width: 12px; }
.word-tag { display: inline-block; vertical-align: top; margin-inline: 4px; font-size: .875rem; font-weight: 700; line-height: 44px; }
.effect { border-left: 3px solid var(--accent); padding: 4px 8px; background: var(--tint); }
.letters small { display: block; }
.letters .payout { color: #686868; }
.letters button[aria-pressed="true"] .payout { color: #555; }
.letters, .keyboard-bottom { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.letters > *, .keyboard-bottom > * { flex: 0 0 44px; }
.letters button { padding: 3px 0; line-height: 1.15; }
.letters .keyboard-bottom { flex-basis: 100%; }
.letters .action-key { font-size: 1.45rem; font-weight: 700; }
.letters .cancel-key {
  display: grid;
  place-items: center;
  background: #923d38;
  border-color: #923d38;
  color: var(--paper);
  font-size: 1.75rem;
  line-height: 1;
}
.letters .cancel-key span { transform: translateY(-1px); }
.letters small { font-size: .625rem; }
details { margin-top: 8px; }
summary { cursor: pointer; padding: 10px 4px; font-weight: 650; }
.power-controls { padding-block: 12px; }
.history li { margin-block: 6px; overflow-wrap: anywhere; }
#feedback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#notice { position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 12px; background: #fff0d7; border: 1px solid var(--line); border-radius: 8px; }
#notice:empty { display: none; }

/* Portrait and component tokens from the Inkling mobile design handoff. */
:root {
  --paper: #f8f3e8;
  --card: #fffcf4;
  --ink: #173d33;
  --muted: #495e52;
  --line: #6d8174;
  --accent: #173d33;
  --tint: #e1e9d9;
  --selected: #f4c66a;
  font: 100%/1.4 system-ui, sans-serif;
}
header { width: 100%; background: var(--accent); padding: 4px max(12px, calc((100% - 36rem) / 2)); margin-bottom: 12px; }
header a { color: var(--paper); }
.wordmark { display: inline-flex; align-items: center; }
.wordmark-tile {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: .87em;
  height: .96em;
  margin-inline: .06em;
  border-radius: 4px;
  background: var(--selected);
  color: var(--accent);
  transform: rotate(-7deg);
}
.wordmark-points {
  position: absolute;
  top: 1px;
  right: 2px;
  color: #514c42;
  font: bold 9px/1 system-ui, sans-serif;
}
main { width: min(100% - 24px, 36rem); gap: 12px; }
h1 { font-size: 28px; }
h2 { font-size: 24px; }
:focus-visible { outline: 2px solid #244ca0; outline-offset: 2px; }
button[aria-pressed="true"], button.spot[aria-pressed="true"] {
  background: var(--selected); border: 2px solid var(--accent); box-shadow: none;
}
button.primary { color: var(--paper); }
.seats li { border: 1px solid var(--line); border-radius: 8px; }
.seats li.current { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.seats span, .letters small { font-size: 13px; }
.rankings .seats li {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 80px;
  text-align: center;
}
.rankings .seats span {
  display: grid;
  place-items: center;
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.spot { font-size: 22px; border-color: var(--line); border-radius: 7px; }
.spot.revealed { background: var(--tint); }
.spot.punctuation { background: transparent; border-color: transparent; }
.spot.hidden, button.spot.hidden { border: 1px dashed var(--line); background: var(--card); }
button.spot[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--selected); }
.letters .locked { border: 2px dashed var(--accent); }
.letters button:disabled small { font-size: 10px; }
.powers { padding-block: 0; }
.powers details { margin-top: 0; }
.power-status { font-size: 13px; margin-block: 12px; }
.ad-placeholder {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(320px, 100%);
  height: 100px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
}
.ad-placeholder.ad-tall { height: 250px; }
.ad-placeholder.ad-side { display: none; }
@media (min-width: 1224px) and (min-height: 680px) {
  main { position: relative; }
  .ad-placeholder.ad-side {
    display: grid;
    position: absolute;
    top: 0;
    width: 300px;
    height: 600px;
  }
  .ad-left { left: calc(50% - 600px); }
  .ad-right { right: calc(50% - 600px); }
}
.history, .effect { background: var(--tint); }
@media (max-width: 370px) {
  .table, .controls { padding-inline: 0; border-color: transparent; background: transparent; }
}

.letters .reference-key {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 3px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  text-align: center;
  line-height: 1.15;
}
.letters .reference-key.unavailable {
  background: #ede9df;
  color: var(--muted);
}
.letters .reference-key.unavailable small { font-size: 10px; }
.letters .ruled-out {
  background-image: repeating-linear-gradient(135deg, #fff 0 5px, #e2e2e2 5px 10px);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.power-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.power-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.power-key, .power-info summary {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}
.power-key svg { width: 24px; height: 24px; }
.powers .power-info { margin-top: 4px; }
.power-info summary { font-size: 22px; list-style: none; }
.power-info summary::-webkit-details-marker { display: none; }
.power-info dl { margin: 4px 0 12px; }
.power-info dt { font-weight: 700; }
.power-info dd { margin: 0 0 8px; }

.phrase-list-title { margin-top: 16px; }
.phrase-list {
  display: grid;
  gap: 4px;
  list-style: none;
  padding: 0;
}
.phrase-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding-block: 4px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
#admin-error:empty, #admin-status:empty { display: none; }

.phrase-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.phrase-pages p { margin: 0; text-align: center; }

.phrase-dialog {
  width: min(34rem, calc(100% - 24px));
  max-height: calc(100% - 24px);
  color: var(--ink);
}
.phrase-dialog::backdrop { background: rgb(23 61 51 / 45%); }
.phrase-dialog textarea {
  width: 100%;
  min-height: 110px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.import-skipped { padding-inline-start: 20px; }
#import-result:empty, #import-error:empty, .import-skipped:empty { margin: 0; }

.phrase-language { display: block; color: var(--muted); }

.phrase-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.simulate-phrase {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--accent);
}
@media (max-width: 440px) {
  .phrase-list li { grid-template-columns: minmax(0, 1fr); }
}
.simulation-tools .actions { margin-top: 4px; }


.rankings .open-seat { border-style: dashed; color: var(--muted); }
.invite-controls { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; }
.invite-controls .copy-icon { display: grid; place-items: center; padding: 0; }
.lobby-wait { margin-bottom: 0; }
