:root {
  /* poolside: deep navy ink on a cool ground, teal button, hot pink pick */
  --ink: #14263d;
  --ground: #eef4f7;
  --muted: #6f8298;
  --blue: #1b998b;
  --blue-hi: #21b3a2;
  --yellow: #ffc93c;
  --coral: #ef476f;
  --kept: #dff0ec;
  --dial-0: #bfe0e6;
  --dial-1: #ffdfd0;
  --hover: #e4f2f0;
  --ease-out: cubic-bezier(.3, 1.4, .5, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body {
  font-family: 'Quicksand', ui-rounded, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-weight: 600;
}
a { color: var(--blue); }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.page {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px 18px 34px;
  display: flex; flex-direction: column; gap: 30px;
}

/* header */
.top { display: flex; align-items: center; gap: 10px; position: relative; }
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.chip-btn {
  width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--ink); background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 700; font-size: 12px; line-height: 1;
  transition: transform .08s, box-shadow .08s;
}
.chip-btn:active, .chip-btn.is-down { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.help {
  position: absolute; top: 38px; left: 0; z-index: 5; max-width: 360px;
  background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink); padding: 14px 16px;
  font-size: 14px; line-height: 1.5; text-wrap: pretty;
}

/* dials */
.dials { display: flex; flex-wrap: wrap; gap: 10px; }
.dial { flex: 1 1 200px; position: relative; }
.dial-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 13px 9px 15px;
  border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700; font-size: 14px; text-align: left;
  transition: transform .08s, box-shadow .08s;
}
.dial-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.dial-btn .lbl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dial-btn .lbl small { font-size: 10px; font-weight: 600; color: var(--muted); }
.dial-btn .lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial-btn .caret { font-size: 12px; flex: none; }
.dial-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 6; min-width: 100%;
  background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.dial-menu button {
  text-align: left; padding: 7px 11px; border-radius: 10px;
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.dial-menu button:hover { background: var(--hover); }

/* hero */
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spin-btn {
  width: 100%; max-width: 250px; aspect-ratio: 1;
  border: 2px solid var(--ink); border-radius: 50%;
  background: var(--blue); color: #fff;
  font-weight: 700; font-size: 37px; letter-spacing: -0.02em; padding: 0 22px; line-height: 1;
  box-shadow: 0 7px 0 var(--ink);
  transition: background .1s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  display: grid; place-items: center; text-wrap: balance;
}
.spin-btn:hover { background: var(--blue-hi); }
.spin-btn.is-down { transform: translateY(7px); box-shadow: 0 0 0 var(--ink); }
.spin-btn.is-rel-a { animation: relA .3s cubic-bezier(.3, 1.5, .5, 1); }
.spin-btn.is-rel-b { animation: relB .3s cubic-bezier(.3, 1.5, .5, 1); }
.hero-row { display: flex; gap: 9px; }
.pill {
  padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink); font-weight: 700; font-size: 14px;
  transition: transform .08s, box-shadow .08s;
}
.pill:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.pill-yellow { background: var(--yellow); }
.pill-small { margin-left: auto; padding: 6px 12px; font-size: 13px; box-shadow: 0 3px 0 var(--ink); }
.pill-small.is-off { background: var(--ground); color: var(--muted); }
.pill-white { background: #fff; }
.pill-blue { background: var(--blue); color: #fff; }

/* side column: dials + hero. Sticky on wide screens so the button never leaves view. */
.side { display: flex; flex-direction: column; gap: 28px; }

/* bottom dock: a compact spin button for narrow screens once the hero scrolls away */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; justify-content: center; padding: 10px 14px 14px;
  pointer-events: none;
}
.dock-btn { pointer-events: auto; font-size: 16px; padding: 11px 25px; box-shadow: 0 5px 0 var(--ink); }
.dock.is-out { animation: dockOut .2s ease-in forwards; }
.dock:not([hidden]) { animation: dockIn .28s var(--ease-out); }
@keyframes dockIn { from { transform: translateY(80px); } to { transform: translateY(0); } }
@keyframes dockOut { to { transform: translateY(80px); } }
body.has-dock .page { padding-bottom: 96px; }

/* reels */
.reels { display: flex; flex-direction: column; gap: 12px; }
.reels:empty { display: none; }
.card {
  border: 2px solid var(--ink); border-radius: 18px; background: #fff;
  padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.card.is-new { animation: cardIn .38s var(--ease-out); }
.card.is-locked { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); background: var(--kept); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-name { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.kept-badge { font-size: 10px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 6px; padding: 2px 7px; }
.card-ctl { display: flex; gap: 6px; }
.ctl {
  height: 27px; padding: 0 9px; border: 2px solid var(--ink); border-radius: 8px;
  background: #fff; box-shadow: 0 3px 0 var(--ink);
  font-weight: 700; font-size: 12px; line-height: 1; white-space: nowrap;
  transition: transform .08s, box-shadow .08s;
}
.ctl.reroll { min-width: 29px; padding: 0 7px; font-size: 14px; }
.ctl:active, .ctl.is-on { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.ctl.is-on { background: var(--ink); color: #fff; }
.ctl[disabled] { opacity: .45; cursor: default; }
.call-text { font-size: 21px; font-weight: 700; color: var(--muted); padding: 6px 2px 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; transition: transform .1s, opacity .1s; }
.chips.is-ticking { transform: translateY(-4px); opacity: .75; }
.chips.is-land-a { animation: landA .38s var(--ease-out); }
.chips.is-land-b { animation: landB .38s var(--ease-out); }
.chip {
  padding: 9px 14px; border: 2px solid var(--ink); border-radius: 13px;
  background: #fff; box-shadow: 0 4px 0 var(--ink);
  font-weight: 700; font-size: 18px; line-height: 1.15; text-align: left; text-wrap: pretty;
}
.chip:hover { filter: brightness(.97); }
.chip.is-pick { background: var(--coral); color: #fff; }
.card.is-locked .chip, .card.is-locked .chip:hover { cursor: default; filter: none; }

.credit { text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; }

@keyframes landA { 0% { transform: translateY(-10px); } 55% { transform: translateY(3px); } 100% { transform: translateY(0); } }
@keyframes landB { 0% { transform: translateY(-10px); } 55% { transform: translateY(3px); } 100% { transform: translateY(0); } }
@keyframes relA { 0% { transform: translateY(7px); } 55% { transform: translateY(-4px) scale(1.03); } 100% { transform: translateY(0); } }
@keyframes relB { 0% { transform: translateY(7px); } 55% { transform: translateY(-4px) scale(1.03); } 100% { transform: translateY(0); } }
@keyframes cardIn { 0% { transform: translateY(-14px); opacity: 0; } 60% { transform: translateY(4px); opacity: 1; } 100% { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 900px) {
  .page {
    max-width: 980px; padding: 24px 24px 34px;
    display: grid; grid-template-columns: 330px minmax(0, 1fr); column-gap: 30px; row-gap: 24px;
    align-items: start;
  }
  .top { grid-column: 1 / -1; }
  .side { position: sticky; top: 20px; }
  .dials { flex-direction: column; }
  .dial { flex: none; }
  .spin-btn { max-width: 268px; }
  .reels { grid-column: 2; }
  .reels:empty { display: none; }
  .credit { grid-column: 1 / -1; }
  .dock { display: none; }
}
@media (max-width: 480px) {
  .page { padding: 18px 13px 28px; gap: 24px; }
  .spin-btn { font-size: 31px; max-width: 200px; }
  .chip { font-size: 16px; }
}
