:root {
  --ink: #111111;
  --sky: #1fa8f4;
  --cloud: #fffaf0;
  --cream: #fff1bf;
  --yellow: #ffcc18;
  --gold: #ffb000;
  --green: #30ce53;
  --pink: #ff6fb1;
  --blue: #256dff;
  --danger: #f04f42;
  --shadow: 5px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: Chewy, system-ui, sans-serif;
  overflow: hidden;
  background:
    url("./assets/sky-clouds.png") center bottom / cover no-repeat,
    linear-gradient(180deg, #1fa8f4 0%, #7fe6ff 66%, #fff 66%, #fff 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px clamp(10px, 2vw, 24px);
}

.value-note {
  grid-column: 1 / -1;
  justify-self: center;
  margin: -3px 0 0;
  padding: 4px 10px 3px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cloud);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: clamp(0.9rem, 1.8vw, 1.08rem);
  line-height: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: clamp(52px, 8vw, 76px);
  height: clamp(52px, 8vw, 76px);
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 rgba(17, 17, 17, 0.38));
}

.brand span,
.status-strip,
.controls button,
.prompt,
.prize-board,
.your-bone,
.modal-card {
  border: 4px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand span {
  padding: 7px 12px 5px;
  background: var(--cream);
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-1.5deg);
}

.status-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: min(520px, 44vw);
  padding: 7px 10px 5px;
  background: var(--cloud);
  text-align: center;
  line-height: 1;
}

.status-strip span {
  min-width: 0;
  white-space: nowrap;
}

.status-strip span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
}

.controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-actions {
  display: none;
}

button {
  min-height: 42px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 7px 12px 5px;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 6px 6px 0 var(--ink);
  filter: saturate(1.08);
  outline: none;
}

button.secondary {
  background: var(--cloud);
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(190px, clamp(210px, 17vw, 270px)) minmax(0, 1fr) minmax(190px, clamp(210px, 17vw, 270px));
  gap: clamp(12px, 1.8vw, 24px);
  align-items: start;
  padding: clamp(118px, 16vh, 154px) clamp(10px, 2vw, 26px) 18px;
}

.gate {
  position: fixed;
  left: 50%;
  top: min(11vh, 96px);
  z-index: 0;
  width: clamp(210px, 30vw, 380px);
  transform: translateX(-50%);
  opacity: 0.42;
  filter: drop-shadow(5px 8px 0 rgba(17, 17, 17, 0.22));
  pointer-events: none;
}

.cloud-layer {
  position: fixed;
  inset: auto 0 0;
  z-index: 0;
  height: min(40vh, 330px);
  background: url("./assets/clouds-overlay.png") center bottom / cover no-repeat;
  pointer-events: none;
}

.playfield,
.prize-board {
  position: relative;
  z-index: 2;
}

.playfield {
  z-index: 14;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: center;
  gap: clamp(8px, 1.4vh, 14px);
  min-height: calc(100dvh - 130px);
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--cloud);
  text-shadow:
    0 5px 0 var(--ink),
    5px 5px 0 var(--ink),
    -3px 4px 0 var(--ink),
    0 0 18px rgba(17, 17, 17, 0.32);
  background: rgba(31, 168, 244, 0.16);
}

.start-screen.hide {
  display: none;
}

h1,
h2,
.prize-board h2 {
  margin: 0;
  font-family: Luckiest Guy, Chewy, sans-serif;
  letter-spacing: 0;
  line-height: 0.92;
}

h1 {
  max-width: 920px;
  font-size: clamp(3.4rem, 10vw, 8.8rem);
}

.start-screen p {
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  line-height: 1.08;
}

.start-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.start-actions button,
.modal-actions button {
  min-width: 134px;
  min-height: 54px;
  font-family: Luckiest Guy, Chewy, sans-serif;
  font-size: 1.12rem;
}

#god-mode {
  background: var(--pink);
}

.your-bone {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--cream);
  transform: rotate(-1deg);
}

.your-bone span {
  white-space: nowrap;
  font-size: 1.05rem;
}

.prompt {
  max-width: min(100%, 620px);
  padding: 7px 14px 5px;
  background: var(--cloud);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.1;
  text-align: center;
}

.bone-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(clamp(68px, 7vw, 108px), 1fr));
  gap: clamp(8px, 1.1vw, 14px);
  width: min(100%, 960px);
  min-height: 0;
  align-content: start;
}

.bone-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.38 / 1;
  min-width: 0;
  min-height: clamp(66px, 7.2vh, 92px);
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transform: rotate(var(--tilt, 0deg));
}

.bone-card:hover,
.bone-card:focus-visible {
  transform: translateY(-4px) rotate(var(--tilt, 0deg)) scale(1.03);
  box-shadow: none;
}

.bone-card:disabled {
  cursor: default;
}

.bone-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(4px 5px 0 rgba(17, 17, 17, 0.35));
}

.bone-card strong {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -45%);
  min-width: 42%;
  padding: 3px 6px 1px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cloud);
  font-family: "Space Mono", monospace;
  font-size: clamp(0.92rem, 1.8vw, 1.18rem);
  line-height: 1;
  text-align: center;
}

.bone-card.opened strong,
.bone-card.player.revealed strong {
  min-width: 58%;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: clamp(0.72rem, 1.55vw, 1rem);
  text-shadow: none;
  white-space: nowrap;
}

.bone-card.player {
  width: clamp(96px, 12vw, 146px);
}

.bone-card.player strong {
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
}

.bone-card.eliminated {
  opacity: 0.42;
  filter: grayscale(0.4);
}

.bone-card.kept {
  pointer-events: none;
}

.prize-board {
  align-self: stretch;
  max-height: calc(100dvh - 148px);
  overflow: hidden;
  padding: clamp(10px, 1.2vw, 14px);
  background: rgba(255, 250, 240, 0.9);
}

.prize-board h2,
.prize-board h3 {
  margin-bottom: clamp(8px, 1.1vh, 12px);
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  text-align: center;
}

.prize-board h3 {
  margin-top: 0;
  font-family: Luckiest Guy, Chewy, sans-serif;
  letter-spacing: 0;
  line-height: 0.92;
}

.prize-board ol {
  display: grid;
  gap: clamp(5px, 0.72vh, 8px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.prize-board li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(30px, 3.45vh, 42px);
  padding: 6px 10px 4px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: var(--yellow);
  font-family: "Space Mono", monospace;
  font-size: clamp(0.82rem, 1.14vw, 1.04rem);
  line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}

.prize-board.low li {
  background: #ff89c6;
}

.prize-board.low li.penny-prize {
  background: #ff4f6d;
}

.prize-board.high li {
  background: var(--yellow);
}

.prize-board.high li.jackpot-prize {
  background: #4cff7a;
  color: var(--ink);
}

.prize-board li.out {
  color: rgba(17, 17, 17, 0.38);
  background: #d8d8d8;
  text-decoration: line-through;
  transform: scale(0.98);
}

.modal {
  width: min(92vw, 620px);
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(17, 17, 17, 0.16);
  backdrop-filter: none;
}

#banker-dialog::backdrop {
  background: rgba(17, 17, 17, 0.04);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 28px);
  background: var(--cream);
  text-align: center;
}

.modal-card h2 {
  font-size: clamp(2.2rem, 7vw, 4.8rem);
}

.modal-card p {
  margin: 0;
  font-size: clamp(1.02rem, 2.3vw, 1.35rem);
  line-height: 1.18;
}

.leaderboard-note {
  width: fit-content;
  justify-self: center;
  padding: 5px 10px 3px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cloud);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.95rem !important;
  line-height: 1;
}

.eyebrow {
  width: fit-content;
  margin: 0 auto;
  padding: 5px 10px 3px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1rem !important;
  line-height: 1;
}

.banker-card {
  width: min(92vw, 520px);
  margin: 0 auto;
  background: #ffe08a;
}

.banker-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.banker-stats span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px 6px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--cloud);
  font-size: 0.92rem;
  line-height: 1;
}

.banker-stats strong {
  font-family: "Space Mono", monospace;
  font-size: 1rem;
}

.mini-values-button {
  display: none;
  justify-self: center;
  min-height: 42px;
  background: var(--cloud);
  font-family: Luckiest Guy, Chewy, sans-serif;
}

#offer-value,
.result-prize {
  font-family: Luckiest Guy, Chewy, sans-serif;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.94;
}

.result-prize {
  margin: 0;
  color: var(--blue);
  text-shadow: 3px 3px 0 var(--cloud), 6px 6px 0 var(--ink);
}

.code-card input {
  width: min(100%, 360px);
  justify-self: center;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--cloud);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 12px 8px;
  text-align: center;
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
}

.modal-note {
  min-height: 1.2em;
  color: var(--danger);
}

.help-card {
  text-align: left;
}

.help-card h2,
.help-card button {
  justify-self: center;
  text-align: center;
}

.help-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.16;
}

.score-submit {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.score-submit p,
.score-message,
.leaderboard-status {
  margin: 0;
  font-size: 1rem !important;
  line-height: 1.12;
}

.score-form {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: min(100%, 390px);
}

.score-form input {
  min-width: 0;
  flex: 1;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--cloud);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 8px 10px 6px;
  font-family: "Space Mono", monospace;
  font-size: 1rem;
}

.score-message {
  min-height: 1.1em;
}

.leaderboard-card {
  max-height: min(82dvh, 720px);
  overflow: auto;
}

.leaderboard-head,
.leaderboard-list li,
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 96px;
  gap: 8px;
  align-items: center;
  text-align: left;
}

.leaderboard-head {
  padding: 0 10px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  opacity: 0.72;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li,
.history-row {
  min-height: 38px;
  padding: 7px 10px 5px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--cloud);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: "Space Mono", monospace;
  font-size: 0.9rem;
}

.leaderboard-list .rank-name,
.history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-button {
  display: inline;
  min-height: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rank-button:hover,
.rank-button:focus-visible {
  transform: none;
  box-shadow: none;
  filter: none;
}

.pending-section,
.player-history {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 4px solid var(--ink);
}

.pending-section h3,
.player-history h3 {
  margin: 0;
  font-family: Luckiest Guy, Chewy, sans-serif;
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.pending-list li {
  background: #e4e1d8;
}

.player-history ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-row {
  grid-template-columns: 58px minmax(0, 1fr) 86px;
  background: #d9f8ff;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .status-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }

  .stage {
    position: relative;
    grid-template-columns: 1fr;
    padding-top: 12px;
    min-height: calc(100dvh - 130px);
  }

  .playfield {
    min-height: 0;
    order: 1;
  }

  .prize-board {
    max-height: none;
  }

  .prize-board.low {
    order: 2;
  }

  .prize-board.high {
    order: 3;
  }

  .prize-board ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bone-grid {
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    width: min(100%, 560px);
  }

  .start-screen {
    top: 116px;
    place-content: start center;
    min-height: calc(100dvh - 116px);
    padding-top: clamp(74px, 13vh, 118px);
    background:
      url("./assets/clouds-overlay.png") center bottom / cover no-repeat,
      rgba(31, 168, 244, 0.92);
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 7px 8px;
    gap: 7px;
  }

  .brand span {
    max-width: 48vw;
    white-space: normal;
  }

  .status-strip {
    flex-wrap: wrap;
    font-size: 0.95rem;
  }

  .value-note {
    max-width: 100%;
    text-align: center;
  }

  .controls button {
    min-width: 58px;
    padding-inline: 8px;
  }

  .stage {
    padding-inline: 8px;
  }

  .bone-grid {
    grid-template-columns: repeat(3, minmax(76px, 1fr));
  }

  .start-screen {
    top: 96px;
    min-height: calc(100dvh - 96px);
    padding: clamp(46px, 10vh, 84px) 12px 24px;
    gap: 10px;
  }

  h1 {
    font-size: clamp(2.9rem, 17vw, 4.4rem);
  }

  .start-screen p {
    max-width: 330px;
    font-size: clamp(1.05rem, 6vw, 1.34rem);
  }

  .start-actions button {
    min-width: 118px;
    min-height: 48px;
    font-size: 1rem;
  }

  .prize-board ol {
    grid-template-columns: 1fr;
  }

  .banker-stats {
    grid-template-columns: 1fr;
  }

  .score-form {
    flex-direction: column;
  }

  .leaderboard-head,
  .leaderboard-list li {
    grid-template-columns: minmax(0, 1fr) 54px 84px;
    gap: 5px;
    font-size: 0.78rem;
  }

.history-row {
  grid-template-columns: 44px minmax(0, 1fr) 70px;
  font-size: 0.72rem;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  body {
    background:
      url("./assets/sky-clouds.png") center bottom / cover no-repeat,
      linear-gradient(180deg, #1fa8f4 0%, #78dcff 67%, #fff 67%, #fff 100%);
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 42;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 8px;
    padding: max(7px, env(safe-area-inset-top)) 8px 6px;
    background: rgba(31, 168, 244, 0.9);
  }

  .brand {
    gap: 6px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand span {
    max-width: 36vw;
    padding: 5px 8px 3px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.98rem;
    white-space: normal;
  }

  .status-strip {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    gap: 5px;
    padding: 5px 7px 4px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.82rem;
    overflow: hidden;
  }

  .status-strip span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-strip span:not(:last-child)::after {
    width: 6px;
    height: 6px;
    margin-left: 5px;
    border-width: 1px;
  }

  .controls {
    display: none;
  }

  .value-note {
    grid-column: 1 / -1;
    max-width: min(100%, 340px);
    margin: 0;
    padding: 4px 8px 3px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.78rem;
  }

  .stage {
    position: fixed;
    inset: 88px 0 calc(70px + env(safe-area-inset-bottom)) 0;
    display: block;
    min-height: 0;
    padding: 6px 8px;
    overflow: hidden;
  }

  .stage > .prize-board {
    display: none;
  }

  .gate {
    top: 92px;
    width: min(58vw, 210px);
    opacity: 0.28;
  }

  .cloud-layer {
    height: 27vh;
  }

  .playfield {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    justify-items: center;
    gap: min(0.9dvh, 7px);
    height: 100%;
    min-height: 0;
  }

  body[data-phase="pick"] .playfield,
  body[data-phase="idle"] .playfield {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .your-bone {
    max-width: min(100%, 148px);
    gap: 3px;
    padding: 4px 8px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .your-bone span {
    font-size: 0.82rem;
    line-height: 1;
  }

  .bone-card.player {
    width: min(25vw, 86px);
    min-height: 0;
  }

  .prompt {
    width: min(100%, 390px);
    padding: 5px 9px 4px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: clamp(0.86rem, 4vw, 1.05rem);
  }

  .bone-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    width: min(100%, 420px);
    height: 100%;
    min-height: 0;
    gap: min(0.8dvh, 6px) min(1.7vw, 7px);
  }

  .bone-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .bone-card:hover,
  .bone-card:focus-visible {
    transform: rotate(var(--tilt, 0deg)) scale(1.02);
  }

  .bone-card img {
    filter: drop-shadow(2px 3px 0 rgba(17, 17, 17, 0.34));
  }

  .bone-card strong {
    min-width: 38%;
    padding: 2px 5px 1px;
    border-width: 2px;
    font-size: clamp(0.72rem, 3.6vw, 0.96rem);
  }

  .bone-card.opened strong,
  .bone-card.player.revealed strong {
    min-width: 60%;
    font-size: clamp(0.54rem, 2.7vw, 0.76rem);
  }

  .start-screen {
    inset: 0;
    min-height: 100dvh;
    place-content: center;
    padding: 104px 14px calc(82px + env(safe-area-inset-bottom));
    gap: 10px;
    background:
      url("./assets/clouds-overlay.png") center bottom / cover no-repeat,
      linear-gradient(180deg, #1fa8f4 0%, #27b5f7 67%, #ffffff 67%, #ffffff 100%);
  }

  h1 {
    font-size: clamp(2.55rem, 16vw, 4.2rem);
  }

  .start-screen p {
    max-width: 330px;
    font-size: clamp(0.98rem, 5.5vw, 1.28rem);
    line-height: 1.2;
    text-shadow:
      0 3px 0 var(--ink),
      3px 3px 0 var(--ink);
  }

  .start-actions {
    gap: 8px;
  }

  .start-actions button {
    min-width: 112px;
    min-height: 46px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.96rem;
  }

  .mobile-actions {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px 8px max(7px, env(safe-area-inset-bottom));
    background: rgba(255, 250, 240, 0.92);
    border-top: 4px solid var(--ink);
  }

  .mobile-actions button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 4px 5px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: clamp(0.72rem, 3.5vw, 0.92rem);
  }

  .modal {
    width: calc(100vw - 18px);
    max-width: 430px;
    max-height: calc(100dvh - 18px);
  }

  .modal-card {
    max-height: calc(100dvh - 18px);
    gap: 10px;
    padding: 14px;
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--ink);
    overflow: auto;
  }

  .modal-card h2 {
    font-size: clamp(1.7rem, 10vw, 3rem);
  }

  .modal-card p {
    font-size: clamp(0.92rem, 4.4vw, 1.12rem);
  }

  .banker-card {
    width: 100%;
  }

  #offer-value,
  .result-prize {
    font-size: clamp(2.8rem, 17vw, 5rem);
  }

  .banker-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .banker-stats span {
    padding: 6px 4px 5px;
    border-width: 2px;
    font-size: 0.7rem;
  }

  .banker-stats strong {
    font-size: 0.76rem;
  }

  .mini-values-button {
    display: inline-grid;
    place-items: center;
    min-height: 38px;
    padding: 6px 10px 4px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.9rem;
  }

  .values-card {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: start;
    height: calc(100dvh - 18px);
    overflow: hidden;
  }

  .values-card h2 {
    font-size: clamp(1.6rem, 8vw, 2.25rem);
    line-height: 1;
  }

  .values-card .leaderboard-note {
    max-width: 100%;
    padding: 4px 8px 3px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--ink);
    font-size: 0.72rem !important;
    line-height: 1;
    white-space: normal;
  }

  .mobile-prize-lists {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    overflow: hidden;
  }

  .mobile-prize-lists .prize-board {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-self: stretch;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .mobile-prize-lists .prize-board h3 {
    margin-bottom: 6px;
    font-size: clamp(0.94rem, 4.2vw, 1.24rem);
  }

  .mobile-prize-lists .prize-board ol {
    grid-template-columns: 1fr;
    gap: min(0.62dvh, 5px);
    min-height: 0;
  }

  .mobile-prize-lists .prize-board li {
    min-height: 0;
    padding: 4px 3px 3px;
    border-width: 2px;
    border-radius: 6px;
    box-shadow: 1px 1px 0 var(--ink);
    font-size: clamp(0.56rem, 3.1vw, 0.82rem);
  }

  .values-card > button {
    height: 46px;
    min-height: 44px;
    border-width: 3px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .score-form {
    flex-direction: column;
  }
}

@media (max-width: 370px) {
  .brand img {
    display: none;
  }

  .brand span {
    max-width: 33vw;
    font-size: 0.9rem;
  }

  .status-strip {
    font-size: 0.76rem;
  }

  .stage {
    inset: 84px 0 calc(70px + env(safe-area-inset-bottom)) 0;
  }

  .bone-grid {
    gap: 4px;
  }

  .mobile-actions {
    gap: 4px;
    padding-inline: 6px;
  }
}
