/* Playfair Display for the wordmark and buttons, Inter for everything that has to be read at
   length. Both self-hosted — see fonts.css. */

:root {
  --yellow: #ffd21e;
  --orange: #ff8a00;
  --ink: #16160f;
  --muted: #6b6b63;
  --line: #e4e4dd;
  --bg: #ffffff;
  --tint: #fff8ec;
  --radius: 12px;

  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Column layout so the footer sits at the bottom of the viewport on short pages instead of
   hanging directly under the content. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Wide enough that a full poll link fits on one line next to its label, tag and Copy button. */
.page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 48px 64px;
}

.footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 48px 32px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: #a3a39a;
  font-size: 14px;
}

.footer-sep { color: var(--line); }

.footer-version { font-family: var(--mono); font-size: 13px; }

/* --- type ---------------------------------------------------------------- */

.brand {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 84px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-sm {
  font-size: 34px;
  line-height: 1.2;
}

.tagline {
  font-size: 24px;
  color: var(--muted);
  margin: 14px 0 40px;
  white-space: nowrap;
}

.poll-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
}

/* The title doubles as the heading and its own input: borderless until hovered or focused, so it
   reads as a heading but invites editing. */
.title-edit {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 28px;
}

.poll-title-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
}

.poll-title-input::placeholder { color: #bdbdb4; }

.poll-title-input:hover { border-color: var(--line); }

.poll-title-input:focus {
  outline: none;
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.14);
}

.title-status {
  flex: 0 0 auto;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

.title-status.is-error { color: #c62828; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 16px;
}

.hint, .link-desc, .note, .empty, .field-hint {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.note { margin: 16px 0 0; }
.note-top { margin: 0 0 18px; }
.empty { margin: 0; }

.hero {
  padding: 120px 0 0;
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.topbar-split { justify-content: space-between; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  background: var(--yellow);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 13px 26px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled) {
  background: var(--orange);
  color: #fff;
}

.btn:active:not(:disabled) {
  background: var(--orange);
  color: #fff;
  transform: translateY(1px);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

a.btn { text-decoration: none; display: inline-block; }

.btn-lg { padding: 20px 56px; font-size: 26px; }

.btn-copy { padding: 11px 20px; font-size: 17px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.btn-ghost:hover, .btn-ghost:focus-visible {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

/* --- inputs -------------------------------------------------------------- */

.input {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--text);
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.14);
}

.input-question { font-size: 22px; padding: 18px 20px; }

.input-comment {
  margin-top: 10px;
  font-size: 17px;
  color: var(--muted);
}

.input-comment:focus { color: var(--ink); }

.field {
  display: block;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}

.field-hint { display: block; margin-top: 8px; }

.setup-form { margin: 0; }

/* --- share links --------------------------------------------------------- */

.links {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 44px;
}

/* Deliberately one line per link: the label, the tag, the URL and Copy stay side by side rather
   than wrapping. The URL field takes whatever width is left. */
.link-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
}

.link-row + .link-row { margin-top: 16px; }

.link-meta {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 190px;
}

.link-label { font-weight: 700; font-size: 17px; white-space: nowrap; }
.link-desc { white-space: nowrap; }

.link-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--mono);
  color: var(--muted);
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-overflow: ellipsis;
}

.link-input:focus { outline: none; border-color: var(--orange); color: var(--ink); }

.tag {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* The tags sit inside the label column rather than the row: "Keep secret, save for later!" is wide
   enough that, on the row, it took the width the URL field needs to show a full link. */
.link-meta .tag {
  align-self: flex-start;
  margin-top: 6px;
}

.tag-secret { background: #fdecec; color: #b3261e; }
.tag-share { background: #eaf5ec; color: #1e7b34; }

.warn {
  margin: 18px 0 0;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  color: #6d3b00;
  background: var(--tint);
  border: 1px solid #ffd9a8;
  border-radius: var(--radius);
}

.warn strong { color: #b3261e; }

/* --- composer ------------------------------------------------------------ */

.composer { margin-bottom: 52px; }

.kind-toggle {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.kind {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 17px;
  white-space: nowrap;
  cursor: pointer;
}

.kind:has(input:checked) {
  border-color: var(--orange);
  background: var(--tint);
  font-weight: 600;
}

.kind input { accent-color: var(--orange); margin: 0; width: 18px; height: 18px; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.option-row .input { padding: 13px 16px; font-size: 17px; }

.remove-option {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 8px;
}

.remove-option:hover { color: var(--orange); }

.composer-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
}

.error {
  color: #c62828;
  font-size: 16px;
  margin: 14px 0 0;
}

/* --- question list ------------------------------------------------------- */

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.question-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  background: #fff;
}

.question-item.dragging { opacity: 0.4; }
.question-item.drop-target { border-color: var(--orange); }

.drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  color: #b8b8ae;
  font-size: 20px;
  line-height: 1.3;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.question-body { flex: 1 1 auto; min-width: 0; }

.question-text { font-weight: 600; font-size: 20px; }

/* The creator's note on a question, in both the editor list and the answer form. Set apart with a
   rule rather than italics so it does not compete with the question itself. */
.question-comment,
.answer-question-comment {
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.answer-question-comment { margin: 10px 0 0; font-size: 17px; }

.badge {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
  background: #f4f4ef;
  border-radius: 999px;
  padding: 4px 11px;
  margin: 8px 0 4px;
  white-space: nowrap;
}

.option-list {
  list-style: disc;
  margin: 8px 0 0;
  padding-left: 24px;
  color: var(--muted);
  font-size: 17px;
}

.question-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.edit-question,
.delete-question {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.edit-question:hover,
.delete-question:hover { color: var(--orange); }

.question-item.is-editing {
  border-color: var(--orange);
  background: #fffdf8;
}

.question-item.is-editing .input-question { font-size: 20px; }

/* --- answering ----------------------------------------------------------- */

.answer-question {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 18px;
}

.answer-question-text {
  font-weight: 600;
  font-size: 22px;
  padding: 0 6px;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  font-size: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.answer-option:hover { border-color: var(--orange); }

.answer-option:has(input:checked) {
  border-color: var(--orange);
  background: var(--tint);
}

.answer-option input {
  accent-color: var(--orange);
  margin: 0;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* --- results ------------------------------------------------------------- */

.response {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.response-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.response-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
}

.response-time {
  color: var(--muted);
  font-size: 14px;
  font-family: var(--mono);
  white-space: nowrap;
}

.response-answers { margin: 0; }

.response-answers dt {
  color: var(--muted);
  font-size: 16px;
  margin-top: 12px;
}

.response-answers dt:first-child { margin-top: 0; }

.response-answers dd {
  margin: 3px 0 0;
  font-weight: 600;
  font-size: 19px;
}

/* --- narrow screens ------------------------------------------------------ */

/* Laptop widths: claw back horizontal padding and label width so the full poll link still fits on
   its single line instead of scrolling inside the field. */
@media (max-width: 1400px) {
  .page { padding: 40px 28px 64px; }
  .footer { padding: 22px 28px 32px; }
  .link-meta { min-width: 170px; }
  .links { padding: 20px; }
}

/* The no-wrap link rows only hold up while there is width for them. Below this they stack, which
   beats a URL field squeezed to nothing. */
@media (max-width: 780px) {
  html, body { font-size: 17px; }
  .page { padding: 28px 20px 48px; }
  .footer { padding: 20px 20px 28px; }
  .brand { font-size: 56px; white-space: normal; }
  .brand-sm { font-size: 28px; }
  .tagline { font-size: 20px; white-space: normal; }
  .poll-title { font-size: 34px; }
  .btn-lg { padding: 16px 36px; font-size: 22px; }
  .hero { padding: 64px 0 0; }
  .link-row { flex-wrap: wrap; }
  .link-meta { min-width: 0; }
  .link-input { flex: 1 1 100%; }
}

/* --- footer link + prose pages ------------------------------------------- */

.footer-link {
  color: #a3a39a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover { color: var(--orange); }

.prose {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.65;
}

.prose .lede {
  font-size: 21px;
  line-height: 1.5;
  padding: 16px 18px;
  background: var(--tint);
  border: 1px solid #ffd9a8;
  border-radius: var(--radius);
  color: #6d3b00;
  margin: 0 0 28px;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  margin: 32px 0 10px;
}

.prose p { margin: 0 0 14px; }

.prose ul { margin: 0 0 14px; padding-left: 24px; }

.prose li { margin-bottom: 8px; }

/* --- landing page --------------------------------------------------------
   The front page has to sell the thing, so it gets a narrower measure than the app pages: a full
   1320px line of body copy is unreadable however well it suits a poll editor. */

.hero-sell { padding: 96px 0 0; }

.hero-question {
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 900px;
  margin: 20px auto 0;
}

.hero-lede {
  font-size: 21px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 700px;
  margin: 20px auto 36px;
}

.hero-note {
  font-size: 16px;
  color: var(--muted);
  margin: 22px 0 0;
}

.hero-note a { color: var(--muted); }
.hero-note a:hover, .hero-note a:focus-visible { color: var(--orange); }

.pitch { margin-top: 104px; }

.pitch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pitch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  font-size: 17px;
  line-height: 1.6;
  /* Column, so the closing line can be pushed to the bottom and the three of them line up across
     cards of unequal length. Otherwise the shortest ends halfway up and looks unfinished. */
  display: flex;
  flex-direction: column;
}

.pitch-card p { margin: 0 0 14px; }
.pitch-card p:last-child { margin-bottom: 0; }

.pitch-question {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.2;
  margin: 0 0 16px;
}

/* The one line in each card worth carrying away from it. Specific enough to beat `.pitch-card p`
   above, which zeroes margin-top and would leave the auto margin doing nothing. */
.pitch-card .pitch-punch {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.steps { margin-top: 104px; }

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-list li { display: flex; gap: 18px; align-items: flex-start; }

.step-num {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--yellow);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  margin: 6px 0 8px;
}

.step-list p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.cta-band {
  margin-top: 104px;
  padding: 56px 40px;
  border-radius: var(--radius);
  background: var(--tint);
  border: 1px solid #ffd9a8;
  text-align: center;
}

.cta-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 760px;
  margin: 0 auto 16px;
}

.cta-note {
  font-size: 17px;
  line-height: 1.6;
  color: #6d3b00;
  max-width: 680px;
  margin: 0 auto 30px;
}

.cta-note a { color: #6d3b00; }

@media (max-width: 1100px) {
  .pitch-grid, .step-list { grid-template-columns: 1fr; }
  .pitch, .steps, .cta-band { margin-top: 72px; }
}

@media (max-width: 780px) {
  .hero-sell { padding: 56px 0 0; }
  .hero-question { font-size: 30px; }
  .hero-lede { font-size: 19px; }
  .pitch-question { font-size: 24px; }
  .cta-title { font-size: 27px; }
  .cta-band { padding: 40px 24px; }
}


/* ===========================================================================
   Vår gate. Everything above is the shared base the other Brightness apps use.

   This one is played on a tablet lying flat on a table, so the rules that
   matter are different from a page you read: nothing depends on hover, every
   target is at least 44px, and the board is a square that fits the shorter
   side of the screen whichever way the tablet is turned.
   =========================================================================== */

.table-top {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  /* Kills the 300ms tap delay and stops a double tap zooming the board mid-game. */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 20px;
  padding: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  align-items: start;
}

/* --- the board ------------------------------------------------------------ */

.board-wrap { display: flex; justify-content: center; }

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 3px;
  width: min(100%, calc(100dvh - 40px));
  aspect-ratio: 1;
  background: var(--line);
  border: 3px solid var(--ink);
  border-radius: 6px;
  padding: 3px;
}

.sq {
  position: relative;
  background: var(--bg);
  border-radius: 3px;
  /* Bottom padding leaves the lane the tokens are drawn in. */
  padding: 4px 3px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  overflow: hidden;
  min-width: 0;
}

/* Grid placement. Computed in board.py and emitted as classes, because a style attribute is
   dropped under style-src 'self' and every square would pile into the first cell. */
.r1 { grid-row: 1; } .r2 { grid-row: 2; } .r3 { grid-row: 3; }
.r4 { grid-row: 4; } .r5 { grid-row: 5; } .r6 { grid-row: 6; }
.r7 { grid-row: 7; } .r8 { grid-row: 8; } .r9 { grid-row: 9; }
.c1 { grid-column: 1; } .c2 { grid-column: 2; } .c3 { grid-column: 3; }
.c4 { grid-column: 4; } .c5 { grid-column: 5; } .c6 { grid-column: 6; }
.c7 { grid-column: 7; } .c8 { grid-column: 8; } .c9 { grid-column: 9; }

.sq-name {
  font-size: clamp(7px, 1vw, 13px);
  line-height: 1.12;
  text-align: center;
  font-weight: 600;
  /* Norwegian road names are long compounds. `anywhere` broke them mid-syllable, so Kleppevegen
     came out as "Kleppevege / n". Hyphenation first, and a break only where nothing else fits. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  /* A flex item defaults to min-width:auto, which lets a long compound push past its square and get
     clipped by the overflow:hidden instead of wrapping inside it. */
  min-width: 0;
  max-width: 100%;
}

.sq-price {
  font-family: var(--mono);
  font-size: clamp(7px, 0.85vw, 11px);
  color: var(--muted);
}

.sq-band {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 2px 2px 0 0;
  margin: -4px -3px 2px;
  width: calc(100% + 6px);
  flex: 0 0 auto;
}

.band-myr    { background: #8a6f3d; }
.band-dal    { background: #5b93c4; }
.band-heim   { background: #c96a9b; }
.band-kleiva { background: #e08a2e; }
.band-florvg { background: #c0392b; }
.band-strand { background: #2f7d4f; }

.sq-corner, .sq-start, .sq-queue, .sq-parking, .sq-to_queue { background: var(--tint); }
.sq-card { background: #fffdf4; }
.sq-tax { background: #fdf0ef; }

.sq.is-mortgaged { opacity: 0.55; }
.sq.is-mortgaged .sq-name { text-decoration: line-through; }

.sq-owner {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.sq-houses {
  font-size: 11px;
  letter-spacing: 1px;
  color: #2f7d4f;
  line-height: 1;
}

/* Tokens sit over the square rather than in its flow. In flow they competed with the name for
   height, and a square with two players on it pushed its own name out of sight. */
.sq-tokens {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  pointer-events: none;
}

.tok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.tok-ferje, .sq-owner.tok-ferje { background: #1f6fb2; }
.tok-bru,   .sq-owner.tok-bru   { background: #c0392b; }
.tok-laks,  .sq-owner.tok-laks  { background: #e08a2e; }
.tok-maake, .sq-owner.tok-maake { background: #2f7d4f; }

.tok-edge-ferje { border-left: 5px solid #1f6fb2; }
.tok-edge-bru   { border-left: 5px solid #c0392b; }
.tok-edge-laks  { border-left: 5px solid #e08a2e; }
.tok-edge-maake { border-left: 5px solid #2f7d4f; }

.board-middle {
  grid-row: 2 / 9;
  grid-column: 2 / 9;
  background: var(--tint);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.board-title {
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(24px, 4vw, 52px);
  line-height: 1;
}

.board-sub {
  font-size: clamp(10px, 1.3vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.dice { display: flex; gap: 10px; margin-top: 8px; }

.die {
  width: clamp(34px, 5vw, 56px);
  height: clamp(34px, 5vw, 56px);
  border-radius: 8px;
  background: #fff;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 30px);
}

.board-note { margin: 6px 0 0; font-weight: 700; }

/* --- the panel ------------------------------------------------------------ */

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.whose {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--tint);
  border-radius: var(--radius);
}

.whose-turn { font-family: var(--display); font-weight: 700; font-size: 22px; }
.whose-cash { font-family: var(--mono); font-weight: 700; }

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* The step the table is actually on. Everything else stays quiet so there is one obvious thing to
   press from across the table. */
.step.is-now { border-color: var(--orange); background: #fffdf7; }

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.step-no {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: 0 0 auto;
}

.step.is-now .step-no { background: var(--orange); color: #fff; }

.step-done, .step-waiting { margin: 0; color: var(--muted); font-size: 15px; }

.btn-wide { width: 100%; }
.btn-tap { min-height: 44px; padding: 10px 14px; font-size: 16px; }

/* Every control is at least a fingertip. */
.btn { min-height: 48px; }
.btn-lg { min-height: 60px; }

.row-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.row-buttons form { flex: 1 1 10rem; }
.row-buttons .btn { width: 100%; }

.offer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--tint);
  border-radius: var(--radius);
}

.offer-name { font-family: var(--display); font-weight: 700; font-size: 20px; }
.offer-group { font-size: 14px; color: var(--muted); }

.drawer { border-top: 1px solid var(--line); padding-top: 10px; }
.drawer summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
.drawer[open] summary { margin-bottom: 8px; }
.drawer-quiet summary { color: var(--muted); font-weight: 400; }

.deed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.deed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.deed-name { font-size: 15px; }
.deed-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.trade-form { display: flex; flex-direction: column; gap: 10px; }

.trade-side {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.trade-side legend { font-size: 13px; font-weight: 700; text-transform: uppercase;
                     letter-spacing: 0.07em; color: var(--muted); padding: 0 4px; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; flex: 0 0 auto; }
.check em { color: var(--muted); font-style: normal; font-size: 13px; }

.trade-line { margin: 0; font-size: 16px; line-height: 1.5; }

.standings { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
             display: flex; flex-direction: column; gap: 10px; }

.stand-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.stand {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 4px 10px;
  font-size: 15px;
}

.stand-cash { font-family: var(--mono); font-weight: 700; }
.stand-worth { grid-column: 2 / -1; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.stand.is-out { opacity: 0.45; }
.stand.is-turn .stand-name { font-weight: 700; }

.log { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted);
       display: flex; flex-direction: column; gap: 5px; }

.flash-warn { background: var(--tint); color: #6d3b00; border: 1px solid #ffd9a8; }

/* --- setup ---------------------------------------------------------------- */

.seat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.seat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 6px 10px;
  align-items: center;
}

.seat-token { width: 20px; height: 20px; border-radius: 50%; }
.seat-token[data-colour="ferje"] { background: #1f6fb2; }
.seat-token[data-colour="bru"]   { background: #c0392b; }
.seat-token[data-colour="laks"]  { background: #e08a2e; }
.seat-token[data-colour="maake"] { background: #2f7d4f; }

.seat-label { font-size: 13px; font-weight: 700; text-transform: uppercase;
              letter-spacing: 0.07em; color: var(--muted); }
.seat .input { grid-column: 1 / -1; }
.seat-name { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

/* --- turning the tablet --------------------------------------------------- */

/* Portrait, or anything narrow: the board goes on top and the controls under it, both full width. */
@media (max-aspect-ratio: 1/1), (max-width: 900px) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .board { width: min(100%, 92dvh); }
}

/* Below this, nine squares across cannot hold a name like Klampavikvegen at any readable size, so
   the board keeps a legible minimum and the narrow screen pans across it instead of shrinking the
   text to nothing. The tablet this is built for never hits this. */
@media (max-width: 560px) {
  .board-wrap { overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
  .board { width: 580px; min-width: 580px; gap: 2px; padding: 2px; }
  .sq { padding: 3px 2px 18px; }
  .tok { width: 17px; height: 17px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
