/* The start, tutorial and final share the table. The playing field keeps its v30 dimensions. */
.game:focus { outline: 0; }
.journey-dialog, .score-page, .receipt-dialog, .campaign-doc {
  --ink: #2e241f;
  --accent: #b62d2c;
  --cream: #fff9eb;
  --line: #c6baa3;
  color: var(--ink);
  font: 400 16px/1.42 var(--font-body);
}
.journey-dialog {
  max-width: calc(100% - 32px);
  max-height: min(90vh, 880px);
  max-height: min(92dvh, 880px);
  padding: 0;
  border: 0;
  margin: auto;
  box-shadow: 0 16px 64px #20120c3b;
  overscroll-behavior: contain;
}
.journey-dialog::backdrop { background: #231715a6; }
.journey-dialog {
  width: 480px;
  background: var(--cream);
  padding: clamp(24px, 4vw, 42px);
  border-top: 6px solid var(--accent);
}
.journey-dialog h1, .receipt-dialog h1, .score-page h2, .campaign-doc h1 {
  margin: 8px 0 14px;
  font-size: clamp(31px, 4.4vw, 42px);
  line-height: .99;
  letter-spacing: -.055em;
}
.journey-dialog p, .score-page p { margin: 0 0 14px; }
.journey-dialog a, .score-page a, .campaign-doc a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .15em;
}
:is(.journey-dialog, .score-page, .campaign-doc) :focus-visible {
  outline: 3px solid #126db5;
  outline-offset: 2px;
}
:is(.journey-dialog, .receipt-dialog) h1:focus { outline: none; }
.journey-dialog .paper-kicker, .score-page .paper-kicker, .campaign-doc .paper-kicker {
  margin: 0;
  font: 600 11px/1.3 var(--font-body);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
}
.paper-close {
  position: absolute;
  top: 5px; right: 6px;
  width: 42px; height: 42px;
  border: none; padding: 0;
  color: var(--ink); font: 400 28px/1 var(--font-body); background: transparent; cursor: pointer;
}
.paper-primary, .paper-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 45px; padding: 10px 18px; border-radius: 2px;
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 650; line-height: 1.15; cursor: pointer;
  touch-action: manipulation;
}
.paper-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.paper-primary:disabled { opacity: .6; cursor: progress; }
@media (hover: hover) {
  .paper-primary:hover { background: #962323; }
  .paper-secondary:hover { background: #e9dfcb; }
}
.order-legend {
  display: grid; gap: 8px;
  padding-block: 12px; margin-block: 16px;
  border-block: 1px dashed var(--line);
  font-size: 15px;
}
.order-legend div { display: flex; align-items: center; gap: 10px; }
.order-legend b { width: 40px; flex: none; text-align: center; color: var(--accent); }
.field-label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 5px; }
.paper-input {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #9c8d78;
  border-radius: 2px; font: inherit; font-size: 16px; color: var(--ink);
  background: #fffef9;
}
.tutorial-actions, .receipt-actions { display: flex; gap: 10px; }
.tutorial-actions { margin-top: 16px; }
.tutorial-actions .paper-primary { flex: 1; }
.journey-dialog .field-hint { margin: 7px 0 0; font-size: 13px; color: #65584a; }
.score-page { background: #ece4d4; padding: clamp(20px, 4vw, 54px) max(16px, env(safe-area-inset-right)) 42px; }
.score-page.after-shift { min-height: 100vh; min-height: 100svh; padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.score-layout { max-width: 720px; margin-inline: auto; }
.after-shift .score-layout { max-width: 1020px; display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(18px, 3vw, 40px); align-items: start; }
.receipt-dialog { position: static; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; }
.cash-receipt {
  position: relative; margin: 0; padding: 22px 20px 27px;
  background: var(--cream);
  font: 400 14px/1.4 var(--font-body);
}
.cash-receipt::after {
  content: ""; position: absolute; bottom: -6px; left: 0; right: 0; height: 7px;
  background: linear-gradient(135deg,var(--cream) 25%,transparent 26%) 0 0 / 12px 12px,
    linear-gradient(225deg,var(--cream) 25%,transparent 26%) 0 0 / 12px 12px;
}
.cash-receipt h1 { font: 700 clamp(29px,3.5vw,37px)/1 var(--font-body); letter-spacing: -.075em; }
.receipt-lines { margin: 19px 0 7px; padding-block: 11px; border-block: 1px dashed var(--line); }
.receipt-lines > div, .receipt-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.receipt-lines > div + div { margin-top: 5px; }
.receipt-lines dd { margin: 0; text-align: end; font-weight: 700; overflow-wrap: anywhere; }
.receipt-lines dt { flex-shrink: 0; }
.cash-receipt .receipt-note { margin: 0 0 16px; color: #6d6255; font-size: 11px; }
.receipt-total { font-size: 19px; font-weight: 650; }
.receipt-total strong { color: var(--accent); font-size: 28px; line-height: 1; }
.cash-receipt .receipt-phrase { margin: 13px 0; padding-top: 13px; border-top: 1px dashed var(--line); }
.prize-panel { padding: 32px 8px 12px; }
.prize-panel h2 { font-size: 30px; }
.prize-panel .contest-rule { font-size: 14px; color: #5f5145; }
.consent-check { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; font-size: 13px; cursor: pointer; }
.consent-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
#claim-form .paper-primary { width: 100%; }
.receipt-actions {
  position: fixed; inset: auto 0 0; z-index: 2; justify-content: center; align-items: center;
  padding: 10px 16px max(10px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #ece4d4;
}
.public-board { padding: clamp(18px,3vw,32px); background: var(--cream); scroll-margin-block: 12px; }
.public-board:focus { outline: none; }
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-board h2 { font-size: clamp(25px,4vw,36px); margin: 0; }
.after-shift #play-from-board { display: none; }
.public-board .board-personal, .public-board .board-status:not(:empty) { margin: 12px 0 0; font-size: 14px; }
.public-board .board-status:empty { margin: 0; }
.paper-link { color: var(--accent); cursor: pointer; padding: 5px 0; font: inherit; background: none; border: none; text-decoration: underline; }
.after-shift .board-rows { max-height: min(62vh, 560px); overflow-y: auto; scroll-padding-block: 44px 10px; }
.after-shift .ranking-table th { position: sticky; top: 0; background: var(--cream); }
.ranking-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-variant-numeric: tabular-nums; }
.ranking-table th, .ranking-table td { text-align: start; vertical-align: baseline; padding: 9px 6px; }
.ranking-table th { border-block: 1px solid var(--line); font-size: 13px; color: #65584a; }
.ranking-table td { border-bottom: 1px dashed var(--line); }
.ranking-table td:first-child { width: 4ch; }
.ranking-table td:nth-child(2) { overflow-wrap: anywhere; }
.ranking-table :is(td,th):last-child { text-align: end; }
.ranking-table tr[data-me] { background: #f7e4d1; color: #922322; font-weight: 700; scroll-margin-block: 12px 80px; }
.prize-panel .claim-status { margin: 8px 0 0; font-size: 13px; scroll-margin-bottom: 80px; }
.claim-status[data-error] { color: #842222; }
.campaign-doc { max-width: 620px; margin: min(10vw,90px) auto; padding: 24px; background: var(--cream); }
.campaign-doc h1 { margin-block: 16px 24px; }
.campaign-doc h2 { margin: 22px 0 5px; font-size: 20px; }
.campaign-doc p { margin: 0 0 12px; }
@media (max-width: 700px) {
  .after-shift .score-layout { display: flex; flex-direction: column; align-items: stretch; gap: 23px; }
  .personal-result { display: contents; }
  .prize-panel { order: 1; padding: 4px; }
  .cash-receipt { padding: 20px 16px 22px; }
  .receipt-actions > button { flex: 1; max-width: 220px; }
}
@media (max-width: 340px) {
  .journey-dialog { max-width: calc(100% - 16px); }
  .receipt-lines dt { flex-shrink: 1; }
}

.prize-panel .claim-status:focus { outline: 0; }

.training-repeat {
  --ink: #2e241f;
  --line: #c6baa3;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 10;
  min-height: 44px;
  padding: 9px 14px;
  background: #fff9eb;
  color: #2e241f;
  font: 600 14px/1.3 var(--font-body);
  box-shadow: 0 2px 12px #20120c1f;
}
.training-repeat[hidden] { display: none; }
.training-repeat-slot { max-width: 1020px; margin: 24px auto 0; }
.training-repeat-slot:empty { display: none; }
.training-repeat-slot .training-repeat {
  position: static;
  background: transparent;
  box-shadow: none;
}
.training-skip { margin-top: 18px; width: 100%; }
.rejected-dialog {
  --ink: #2e241f;
  --accent: #b62d2c;
  --line: #c6baa3;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  box-sizing: border-box;
  padding: 28px;
  border: 0;
  border-top: 6px solid #b62d2c;
  color: #2e241f;
  background: #fff9eb;
  text-align: center;
  font: 400 16px/1.4 var(--font-body);
}
.rejected-dialog::backdrop { background: #231715c9; }
.rejected-dialog h1 { font-size: clamp(28px, 7vw, 38px); line-height: 1.05; margin: 16px 0; }
.rejected-dialog h1:focus { outline: none; }
.rejected-dino { display: block; width: 180px; height: 180px; object-fit: contain; margin: 0 auto; }
.rejected-dialog[open] .rejected-dino { animation: rejected-chomp 600ms ease-out both; }
@keyframes rejected-chomp {
  0% { transform: translateY(-30px) scale(.7) rotate(-12deg); }
  55% { transform: translateY(8px) scale(1.15) rotate(7deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .rejected-dialog[open] .rejected-dino { animation: none; }
}

/* Keep the landing above the live, idle kitchen until the table folds into place. */
#scene-root.seating { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
#scene-root.seating .ss-table { transform-origin: 0 0; }
#scene-root.seating .ss-table > :is(.ss-header, .ss-title, .ss-seat, .ss-hit) {
  animation: clear-table-labels 180ms ease-out both;
}
#scene-root.seating .ss-table::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: #d1b297; animation: uncover-worktop 850ms ease-in-out both;
}
@keyframes clear-table-labels { to { opacity: 0; } }
@keyframes uncover-worktop { 0%, 18% { opacity: 0; } 80%, 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #scene-root.seating { visibility: hidden; }
}
