
:root {
  --bg: #0c0715;
  --panel: rgba(255,255,255,.07);
  --text: #fff;
  --muted: rgba(255,255,255,.68);
  --purple: #9b5cff;
  --gold: #d9b56d;
  --radius: clamp(14px, 2vw, 24px);
  --app-pad: clamp(10px, 1.8vw, 20px);
  --gap: clamp(8px, 1.4vw, 16px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(126,62,207,.26), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(64,19,111,.35), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.app {
  width: min(100%, 1100px);
  height: 100vh;
  height: 100dvh;
  margin: auto;
  padding:
    max(var(--app-pad), env(safe-area-inset-top))
    var(--app-pad)
    max(var(--app-pad), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  margin-bottom: var(--gap);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.brand {
  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.04em;
}

.powered {
  margin-top: 1px;
  color: var(--muted);
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.text-button,
.icon-button {
  border: 1px solid rgba(255,255,255,.14);
  background: var(--panel);
  color: #fff;
  cursor: pointer;
}

.text-button {
  padding: clamp(7px, 1vw, 10px) clamp(9px, 1.3vw, 13px);
  border-radius: 999px;
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 700;
}

.icon-button {
  width: clamp(36px, 4vw, 44px);
  height: clamp(36px, 4vw, 44px);
  border-radius: 50%;
  font-size: clamp(19px, 2.2vw, 23px);
}

.hidden { display: none !important; }

/* Setup */
.setup-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.setup-card {
  width: min(100%, 620px);
  max-height: 100%;
  overflow: auto;
  padding: clamp(16px, 2.4vw, 24px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: clamp(18px, 2.6vw, 26px);
  background: rgba(255,255,255,.065);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 6px;
  color: #c9a8ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
}

.setup-card h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
}

.setup-copy {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: clamp(12px, 1.5vw, 15px);
}

.add-player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.add-player-row input {
  width: 100%;
  min-width: 0;
  padding: clamp(11px, 1.4vw, 14px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  outline: none;
  background: rgba(0,0,0,.22);
  color: #fff;
}

.add-player-row input:focus { border-color: var(--purple); }

.add-player-row button {
  padding: 0 clamp(14px, 2vw, 18px);
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #1a1028;
  font-weight: 800;
  cursor: pointer;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  max-height: 84px;
  overflow: auto;
  margin: 10px 0 12px;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 12px;
}

.player-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
}

.order-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.order-options legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-weight: 800;
  font-size: 13px;
}

.order-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(0,0,0,.14);
  cursor: pointer;
}

.order-options input {
  margin-top: 3px;
  accent-color: var(--purple);
}

.order-options span {
  display: grid;
  gap: 1px;
}

.order-options strong {
  font-size: 12px;
}

.order-options small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.error-text {
  min-height: 16px;
  margin: 7px 0 0;
  color: #ffb3bd;
  text-align: center;
  font-size: 12px;
}

/* Game */
.game-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  gap: clamp(6px, 1vh, 12px);
  overflow: hidden;
}

.turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: clamp(8px, 1.2vh, 12px) 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
}

.turn-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
}

.turn-banner strong {
  font-family: Georgia, serif;
  font-size: clamp(18px, 3vw, 25px);
}

.order-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(155,92,255,.18);
  color: #d9c4ff;
  font-size: 10px;
  font-weight: 800;
}

.instructions {
  text-align: center;
}

.instructions h1 {
  margin: 0 0 2px;
  font-size: clamp(20px, 3.5vw, 34px);
}

.instructions p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(11px, 1.4vw, 14px);
}

.stage {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 16px);
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.result-card {
  width: auto;
  height: min(100%, 38vh);
  max-height: 360px;
  aspect-ratio: 2 / 3;
  padding: clamp(12px, 2vw, 22px);
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,.22);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  transform-origin: center;
  animation: flipIn .55s cubic-bezier(.2,.8,.2,1);
}

.result-card--white {
  color: #17120e;
  background:
    radial-gradient(circle at 40% 20%, #fff, transparent 45%),
    linear-gradient(145deg, #fffdf8, #eee2cb);
  border-color: rgba(217,181,109,.75);
}

.result-card.red { background: linear-gradient(145deg, #9b1223, #38030a); }
.result-card.blue { background: linear-gradient(145deg, #104ca3, #051632); }
.result-card.green { background: linear-gradient(145deg, #14743a, #032212); }

.result-card.black {
  background:
    radial-gradient(circle at 50% 35%, rgba(151,82,255,.24), transparent 35%),
    linear-gradient(145deg, #24202b, #050506);
}

.result-label {
  margin-bottom: clamp(10px, 1.8vh, 18px);
  font-size: clamp(8px, 1vw, 11px);
  font-weight: 800;
  letter-spacing: .24em;
  opacity: .72;
}

.result-text {
  font-family: Georgia, serif;
  font-size: clamp(22px, 4vw, 46px);
  line-height: 1.05;
}

.decks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 10px);
  padding: 2px 0;
  overflow: hidden;
}

.deck {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease, border-color .2s ease;
}

.deck:hover { transform: translateY(-3px); }
.deck:active { transform: scale(.97); }

.deck.selected {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.deck img,
.black-art {
  width: 100%;
  max-height: 17vh;
  aspect-ratio: 2 / 3;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
}

.deck span {
  display: block;
  margin-top: 4px;
  font-size: clamp(9px, 1.3vw, 12px);
  font-weight: 700;
}

.deck.locked {
  opacity: .37;
  filter: grayscale(.25);
  pointer-events: none;
}

.deck.used {
  opacity: .32;
  pointer-events: none;
}

.black-art {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background:
    radial-gradient(circle, rgba(151,82,255,.38), transparent 35%),
    linear-gradient(145deg, #1f1728, #030304);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.black-art strong {
  position: relative;
  z-index: 2;
  font-family: Georgia, serif;
  font-size: clamp(15px, 2vw, 23px);
}

.black-art small {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  font-size: clamp(5px, .7vw, 7px);
  letter-spacing: .18em;
  opacity: .7;
}

.black-ring {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(217,181,109,.55);
  border-radius: 50%;
}

.actions {
  display: flex;
  justify-content: center;
}

.primary-button {
  width: min(100%, 360px);
  padding: clamp(11px, 1.5vh, 15px) 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #a46aff, #7040d5);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

footer {
  color: var(--muted);
  text-align: center;
  font-size: clamp(9px, 1vw, 12px);
  line-height: 1.3;
}

.slide-away {
  animation: slideAway .42s ease forwards;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 20px);
  background: rgba(0,0,0,.72);
}

.modal-card {
  position: relative;
  width: min(100%, 720px);
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: clamp(16px, 2.5vw, 26px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: #1a1028;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.guide-header {
  padding-right: 34px;
}

.guide-header h2 {
  margin: 0 0 5px;
  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 30px);
}

.guide-header > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.guide-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
}

.guide-step > div:last-child {
  grid-column: 1 / -1;
}

.guide-step strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.step-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #a46aff, #7040d5);
  font-size: 12px;
  font-weight: 900;
}

.guide-visual {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.players-visual {
  gap: 5px;
  flex-wrap: wrap;
}

.players-visual span {
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 800;
}

.order-visual {
  gap: 6px;
}

.order-visual span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(155,92,255,.18);
  border: 1px solid rgba(155,92,255,.42);
  font-size: 11px;
  font-weight: 900;
}

.order-visual i {
  color: var(--muted);
  font-style: normal;
}

.card-pair-visual {
  gap: 8px;
}

.mini-card {
  width: 58px;
  aspect-ratio: 2 / 3;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(255,255,255,.22);
}

.mini-card small {
  margin-bottom: 6px;
  font-size: 6px;
  letter-spacing: .13em;
  opacity: .75;
}

.mini-card b {
  font-family: Georgia, serif;
  font-size: 11px;
}

.mini-card-white {
  color: #211810;
  background: linear-gradient(145deg, #fffdf8, #eadcbc);
  border-color: rgba(217,181,109,.8);
}

.mini-card-red {
  color: #fff;
  background: linear-gradient(145deg, #a31528, #40050d);
}

.plus {
  font-size: 20px;
  font-weight: 900;
  color: var(--gold);
}

.example-bubble {
  padding: 9px;
  border-radius: 11px;
  background: rgba(155,92,255,.14);
  border: 1px solid rgba(155,92,255,.34);
  color: #efe6ff;
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.35;
}

.guide-tip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(217,181,109,.1);
  border: 1px solid rgba(217,181,109,.26);
  color: #f2dfb7;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.guide-button {
  display: block;
  margin: 12px auto 0;
}

@keyframes flipIn {
  0% { opacity: 0; transform: perspective(700px) rotateY(90deg) scale(.9); }
  100% { opacity: 1; transform: perspective(700px) rotateY(0) scale(1); }
}

@keyframes slideAway {
  to { opacity: 0; transform: translateY(-35px) scale(.92); }
}

/* Phones */
@media (max-width: 640px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    margin-bottom: 8px;
  }

  .game-screen {
    gap: 6px;
  }

  .turn-banner {
    padding: 7px 10px;
  }

  .instructions h1 {
    font-size: 21px;
  }

  .instructions p {
    font-size: 10px;
  }

  .stage {
    gap: 7px;
  }

  .result-card {
    height: min(100%, 32vh);
    max-height: 250px;
    padding: 10px;
  }

  .result-text {
    font-size: clamp(20px, 7vw, 31px);
  }

  .decks {
    gap: 5px;
  }

  .deck img,
  .black-art {
    max-height: 14vh;
    border-radius: 9px;
  }

  .deck span {
    font-size: 9px;
  }

  footer {
    display: none;
  }

  .order-options {
    grid-template-columns: 1fr;
  }

  .guide-steps {
    grid-template-columns: 1fr;
  }
}

/* Very short screens */
@media (max-height: 700px) {
  .topbar {
    min-height: 36px;
    margin-bottom: 6px;
  }

  .brand {
    font-size: 25px;
  }

  .game-screen {
    gap: 5px;
  }

  .turn-banner {
    padding: 6px 10px;
  }

  .instructions h1 {
    font-size: 19px;
  }

  .instructions p {
    font-size: 10px;
  }

  .result-card {
    height: min(100%, 31vh);
    max-height: 230px;
  }

  .deck img,
  .black-art {
    max-height: 13vh;
  }

  .primary-button {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  footer {
    display: none;
  }
}

/* Tablets and landscape phones */
@media (min-width: 641px) and (max-width: 900px) {
  .result-card {
    height: min(100%, 36vh);
  }

  .deck img,
  .black-art {
    max-height: 15vh;
  }
}

/* Landscape phone optimization */
@media (orientation: landscape) and (max-height: 560px) {
  .app {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .topbar {
    margin-bottom: 4px;
  }

  .game-screen {
    grid-template-columns: 1fr 1.7fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 10px;
  }

  .turn-banner,
  .instructions,
  .actions,
  footer {
    grid-column: 1;
  }

  .stage {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .decks {
    grid-column: 1 / -1;
  }

  .result-card {
    height: min(100%, 56vh);
    max-height: 250px;
  }

  .deck img,
  .black-art {
    max-height: 17vh;
  }

  footer {
    display: none;
  }
}


/* V5: deck/action swap */
.deck-action-area {
  min-height: 0;
}

.next-round-area {
  min-height: clamp(90px, 17vh, 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 360px);
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(217,181,109,.32);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 30%, rgba(155,92,255,.18), transparent 40%),
    rgba(255,255,255,.055);
}

.round-summary {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.round-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.round-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-size: clamp(20px, 3vw, 34px);
}

.next-round-button {
  width: 100%;
}

#historyCount {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(155,92,255,.28);
  font-size: 10px;
}

/* History */
.history-modal-card {
  width: min(100%, 620px);
}

.history-list {
  display: grid;
  gap: 9px;
  max-height: min(58vh, 520px);
  overflow: auto;
  margin-top: 16px;
}

.history-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.history-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(155,92,255,.2);
  font-size: 11px;
  font-weight: 900;
}

.history-combo {
  min-width: 0;
}

.history-combo strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-size: 15px;
}

.history-combo small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.history-color {
  width: 11px;
  height: 38px;
  border-radius: 999px;
}

.history-color.red { background: #9b1223; }
.history-color.blue { background: #104ca3; }
.history-color.green { background: #14743a; }
.history-color.black { background: #29242f; }

.empty-history {
  margin-top: 16px;
  padding: 28px 16px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

/* QR in guide */
.guide-qr {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.guide-qr img {
  width: 86px;
  height: 86px;
  padding: 5px;
  border-radius: 9px;
  background: #fff;
}

.guide-qr strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.guide-qr p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.guide-qr span {
  color: #e7d9ff;
  font-weight: 800;
}

@media (max-width: 640px) {
  .next-round-area {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .round-summary {
    text-align: center;
  }

  .round-summary strong {
    white-space: normal;
    font-size: 21px;
  }

  .guide-qr {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .guide-qr img {
    width: 72px;
    height: 72px;
  }

  .history-item {
    grid-template-columns: 30px minmax(0, 1fr) 9px;
  }
}

.guide-qr img{
 width:140px!important;
 height:140px!important;
 cursor:pointer;
 transition:.2s;
}
.guide-qr img:hover{transform:scale(1.05)}
@media(max-width:640px){
 .guide-qr{grid-template-columns:1fr;text-align:center}
 .guide-qr img{
   width:170px!important;
   height:170px!important;
   justify-self:center;
 }
}


/* V7 — two modes */
.mode-start-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-start-button {
  min-height: 100px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, opacity .2s ease;
}

.mode-start-button:hover:not(:disabled) {
  transform: translateY(-3px);
}

.mode-start-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.mode-start-button--ice {
  background:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.14), transparent 34%),
    linear-gradient(145deg, #242128, #09090b);
}

.mode-start-button--deep {
  background:
    radial-gradient(circle at 88% 12%, rgba(207,151,255,.22), transparent 35%),
    linear-gradient(145deg, #5d28a2, #21102f);
}

.mode-start-title,
.mode-start-copy {
  display: block;
}

.mode-start-title {
  margin-bottom: 5px;
  font-family: Georgia, serif;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 700;
}

.mode-start-copy {
  color: rgba(255,255,255,.7);
  font-size: 11px;
  line-height: 1.4;
}

.mode-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(217,181,109,.15);
  color: #f0d8a7;
  font-size: 10px;
  font-weight: 800;
}

.mode-hidden {
  display: none !important;
}

.decks.ice-layout {
  grid-template-columns: repeat(2, minmax(0, 170px));
  justify-content: center;
}

.round-action-buttons {
  display: grid;
  grid-template-columns: minmax(130px, .72fr) minmax(170px, 1fr);
  gap: 9px;
}

.redraw-button {
  width: 100%;
  margin-top: 0;
  border-color: rgba(217,181,109,.32);
  color: #f4ddb0;
}

body.ice-mode {
  --purple: #f0f0f0;
  --gold: #ffffff;
}

body.ice-mode .order-badge,
body.ice-mode .mode-badge {
  background: rgba(255,255,255,.12);
  color: #fff;
}

body.ice-mode .primary-button {
  background: linear-gradient(135deg, #ffffff, #d8d8d8);
  color: #111;
}

body.ice-mode .result-card.black {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.12), transparent 36%),
    linear-gradient(145deg, #252525, #030303);
}

@media (max-width: 640px) {
  .mode-start-buttons {
    grid-template-columns: 1fr;
  }

  .mode-start-button {
    min-height: 82px;
  }

  .round-action-buttons {
    grid-template-columns: 1fr 1.25fr;
  }
}

@media (max-width: 390px) {
  .round-action-buttons {
    grid-template-columns: 1fr;
  }
}

/* V8 — robust hosted button rendering */
button.mode-start-button {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  font-family: inherit;
  box-shadow: none;
}

button.mode-start-button:disabled {
  opacity: .52;
  color: #fff;
  -webkit-text-fill-color: #fff;
}

button.mode-start-button:disabled .mode-start-copy {
  color: rgba(255,255,255,.66);
  -webkit-text-fill-color: rgba(255,255,255,.66);
}
