:root {
  color-scheme: dark;
  --ink: #100806;
  --wood: #2b110c;
  --wood-light: #54261a;
  --cream: #f4ead1;
  --paper: #d8c8a6;
  --brass: #efbd5e;
  --brass-hot: #ffe49a;
  --felt: #075143;
  --felt-deep: #032b26;
  --pink: #ff5f91;
  --red: #dc4b43;
  --cyan: #6ee7d2;
  --shadow: rgba(0, 0, 0, 0.55);
  --display: "Bodoni 72 Smallcaps", "Didot", "Iowan Old Style", serif;
  --body: "Avenir Next Condensed", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--cream);
  font-family: var(--body);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(155, 54, 31, 0.38), transparent 46%),
    repeating-linear-gradient(90deg, transparent 0 80px, rgba(255, 219, 148, 0.018) 81px 82px),
    linear-gradient(145deg, #180906, #080504 62%, #130805);
}

button {
  font: inherit;
}

.room-glow {
  position: fixed;
  inset: -25svh -10vw auto;
  height: 68svh;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(255, 91, 63, 0.13), transparent 67%);
  filter: blur(30px);
}

.grain {
  position: fixed;
  z-index: 50;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.cabinet {
  position: relative;
  z-index: 1;
  width: min(1700px, calc(100vw - 30px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px 0 12px;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 84px;
}

.brand-lockup {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.brand-lockup h1 {
  margin: -2px 0 0;
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #6a271c, 0 5px 24px rgba(255, 92, 62, 0.26);
}

.brand-crown {
  position: relative;
  color: var(--brass);
  font-size: 13px;
}

.brand-crown::before,
.brand-crown::after {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--brass));
}

.brand-crown::before {
  right: 18px;
}

.brand-crown::after {
  left: 18px;
  transform: rotate(180deg);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brass);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.header-actions {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.sound-button {
  height: 38px;
  border: 1px solid rgba(239, 189, 94, 0.36);
  color: var(--paper);
  background: rgba(36, 15, 11, 0.78);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover,
.sound-button:hover {
  border-color: var(--brass);
  color: var(--brass-hot);
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 18px;
}

.sound-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sound-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.sound-bars i {
  width: 2px;
  height: 45%;
  background: var(--cyan);
  animation: sound-wave 0.8s ease-in-out infinite alternate;
}

.sound-bars i:nth-child(2) {
  height: 100%;
  animation-delay: -0.45s;
}

.sound-bars i:nth-child(3) {
  height: 70%;
  animation-delay: -0.2s;
}

.sound-button[aria-pressed="false"] .sound-bars i {
  height: 2px;
  animation: none;
  background: #9a806e;
}

@keyframes sound-wave {
  to { transform: scaleY(0.35); }
}

.run-board {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(340px, 1.8fr) minmax(180px, 1fr);
  align-items: stretch;
  min-height: 76px;
  margin: 8px 0 12px;
  border: 1px solid rgba(239, 189, 94, 0.44);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.035)),
    #1e0d09;
  box-shadow: 0 8px 30px var(--shadow), inset 0 0 0 3px #0c0705, inset 0 0 0 4px rgba(239, 189, 94, 0.18);
}

.blind-plaque,
.shots-plaque {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 22px;
}

.blind-plaque {
  border-right: 1px solid rgba(239, 189, 94, 0.2);
}

.blind-plaque span,
.shots-plaque > span,
.score-readout span,
.target-readout span {
  color: var(--brass);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.blind-plaque strong {
  margin: 3px 0 1px;
  font-family: var(--display);
  font-size: clamp(15px, 1.6vw, 22px);
  letter-spacing: 0.01em;
}

.blind-plaque small {
  overflow: hidden;
  color: #a79178;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cluster {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  padding: 9px 50px 16px;
  text-align: center;
}

.score-cluster::before {
  width: 1px;
  height: 38px;
  content: "";
  background: rgba(239, 189, 94, 0.25);
}

.score-readout {
  grid-column: 1;
  grid-row: 1;
}

.target-readout {
  grid-column: 3;
  grid-row: 1;
}

.score-readout strong,
.target-readout strong {
  display: block;
  margin-top: -1px;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-readout strong {
  color: var(--brass-hot);
  text-shadow: 0 0 18px rgba(255, 210, 100, 0.3);
}

.progress-track {
  position: absolute;
  right: 42px;
  bottom: 10px;
  left: 42px;
  height: 4px;
  border-radius: 5px;
  background: #090504;
  box-shadow: 0 0 0 1px rgba(239, 189, 94, 0.25);
}

.progress-track > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cd493f, var(--brass-hot));
  box-shadow: 0 0 14px rgba(255, 202, 95, 0.6);
  transition: width 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-track i {
  position: absolute;
  top: -3px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  background: white;
  box-shadow: 0 0 12px 4px var(--brass);
  transition: left 650ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms;
}

.shots-plaque {
  align-items: flex-end;
  border-left: 1px solid rgba(239, 189, 94, 0.2);
}

.shot-pips {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}

/* Above five pips the single row crowds the count, so split into two
   balanced rows (columns set from JS) centered inside the plaque. */
.shot-pips.is-stacked {
  display: grid;
  grid-template-columns: repeat(var(--pip-columns, 5), max-content);
  align-content: center;
  row-gap: 4px;
}

.shot-pips i {
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #0c0705;
  border-radius: 50%;
  background: var(--brass-hot);
  box-shadow: 0 0 0 1px #a86432, 0 0 9px rgba(255, 201, 91, 0.35);
  transition: 300ms ease;
}

.shot-pips i.is-spent {
  opacity: 0.28;
  background: #4c2b21;
  box-shadow: 0 0 0 1px #7b4938;
  transform: scale(0.78);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(145px, 0.22fr) minmax(620px, 1fr) minmax(145px, 0.22fr);
  gap: 12px;
  align-items: stretch;
}

.side-panel {
  position: relative;
  min-width: 0;
  padding: 18px 15px;
  border: 1px solid rgba(239, 189, 94, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 40%),
    rgba(18, 9, 7, 0.87);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.3);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--brass);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.panel-heading i {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(239, 189, 94, 0.4), transparent);
}

.shot-card {
  position: relative;
  overflow: hidden;
  min-height: 212px;
  padding: 18px 14px;
  border: 1px solid rgba(226, 191, 123, 0.32);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 198, 93, 0.12), transparent 55%),
    #28130d;
  text-align: center;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.32), inset 0 0 28px rgba(0, 0, 0, 0.28);
}

.shot-card::before {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(239, 189, 94, 0.17);
  content: "";
  pointer-events: none;
}

.shot-card.is-hot {
  animation: card-hit 600ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes card-hit {
  0% { transform: scale(0.92) rotate(-1deg); filter: brightness(1.6); }
  55% { transform: scale(1.03) rotate(0.4deg); }
  100% { transform: scale(1); }
}

.shot-card__overline {
  position: relative;
  display: block;
  color: #9d8269;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shot-card > strong {
  position: relative;
  display: block;
  min-height: 52px;
  margin: 18px 0 14px;
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(18px, 1.65vw, 25px);
  line-height: 1.02;
}

.score-equation {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #b9a487;
  font-size: 9px;
  text-transform: uppercase;
}

.score-equation span b {
  display: block;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 20px;
}

.score-equation span:last-child b {
  color: var(--pink);
}

.score-equation em {
  color: var(--brass);
  font-family: var(--display);
  font-size: 16px;
}

.shot-total {
  position: relative;
  margin-top: 12px;
  color: var(--brass-hot);
  font-family: var(--display);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.run-meter {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  align-items: center;
  column-gap: 10px;
  margin-top: 16px;
  padding: 9px 12px 8px;
  overflow: hidden;
  border: 1px solid rgba(239, 189, 94, 0.24);
  border-radius: 6px;
  color: #826d5d;
  font-size: 10px;
  line-height: 1.25;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.run-meter__label {
  color: #c4a675;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.run-meter strong {
  grid-column: 2;
  grid-row: 1 / span 3;
  color: var(--brass-hot);
  font-family: var(--display);
  font-size: 42px;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.run-meter em {
  font-style: normal;
  font-weight: 700;
}

.run-meter small {
  font-size: 9px;
  opacity: 0.75;
}

.run-meter.is-live {
  border-color: rgba(239, 189, 94, 0.5);
}

.run-meter[data-tier="hot"] {
  border-color: rgba(255, 140, 80, 0.55);
}

.run-meter[data-tier="hot"] strong {
  color: #ffa45c;
  text-shadow: 0 0 12px rgba(255, 140, 60, 0.45);
}

.run-meter[data-tier="blazing"] {
  border-color: #ff5e45;
  box-shadow:
    0 0 18px rgba(255, 94, 69, 0.3),
    inset 0 0 16px rgba(255, 94, 69, 0.14);
  animation: run-meter-smolder 1.6s ease-in-out infinite;
}

.run-meter[data-tier="blazing"] strong {
  color: #ffd044;
  text-shadow:
    0 0 7px rgba(255, 130, 40, 0.85),
    0 0 20px rgba(255, 90, 40, 0.5);
}

.run-meter.is-hot strong {
  animation: run-meter-pop 0.45s ease;
}

.run-meter.is-broken {
  animation: run-meter-break 0.5s ease;
}

@keyframes run-meter-smolder {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(255, 94, 69, 0.22),
      inset 0 0 12px rgba(255, 94, 69, 0.1);
  }
  50% {
    box-shadow:
      0 0 24px rgba(255, 94, 69, 0.42),
      inset 0 0 20px rgba(255, 94, 69, 0.2);
  }
}

@keyframes run-meter-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes run-meter-break {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

.table-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #84442a;
  border-radius: 7px;
  background: #180b07;
  box-shadow:
    0 25px 55px rgba(0, 0, 0, 0.52),
    0 0 0 3px #0d0705,
    0 0 0 4px rgba(239, 189, 94, 0.3),
    inset 0 0 40px black;
  isolation: isolate;
}

.table-stage::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, #532419, #180a07 45%, #4d2116);
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 650;
  touch-action: none;
  cursor: crosshair;
}

.marquee-lights {
  position: absolute;
  z-index: 2;
  inset: 5px;
  border: 1px solid rgba(255, 217, 131, 0.12);
  border-radius: 3px;
  pointer-events: none;
}

.aim-hint {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 231, 178, 0.2);
  border-radius: 99px;
  color: #e7d4b3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(3, 25, 22, 0.82);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  transform: translateX(-50%);
  transition: 300ms ease;
}

.aim-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.mouse-glyph {
  position: relative;
  width: 12px;
  height: 17px;
  border: 1px solid var(--brass);
  border-radius: 7px;
}

.mouse-glyph::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 1px;
  height: 4px;
  content: "";
  background: var(--brass);
  animation: mouse-pull 1.5s ease-in-out infinite;
}

@keyframes mouse-pull {
  50% { transform: translateY(5px); opacity: 0.25; }
}

.power-rack {
  position: absolute;
  z-index: 3;
  right: 30px;
  bottom: 18px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  color: rgba(244, 234, 209, 0.65);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
  transition: 150ms;
}

.power-rack.is-visible {
  opacity: 1;
}

.power-rack > div {
  height: 7px;
  flex: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 237, 190, 0.25);
  border-radius: 8px;
  background: rgba(3, 18, 15, 0.72);
}

.power-rack i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--brass-hot) 65%, var(--red));
  box-shadow: 0 0 12px currentColor;
}

.callout {
  position: absolute;
  z-index: 5;
  top: 47%;
  left: 50%;
  color: var(--brass-hot);
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 72px);
  font-weight: 900;
  letter-spacing: -0.05em;
  text-align: center;
  text-shadow: 0 4px 0 #7f2920, 0 0 30px rgba(255, 182, 74, 0.55);
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.65) rotate(-3deg);
}

.callout.is-live {
  animation: callout-pop 1.25s cubic-bezier(0.15, 0.9, 0.2, 1) forwards;
}

@keyframes callout-pop {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(0.45) rotate(-5deg); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(1deg); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-1deg); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.05); }
}

.chalk-case {
  display: grid;
  gap: 10px;
}

.empty-chalk {
  display: grid;
  place-items: center;
  min-height: 178px;
  padding: 18px;
  border: 1px dashed rgba(239, 189, 94, 0.3);
  color: #806a59;
  text-align: center;
}

.empty-chalk > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(239, 189, 94, 0.26);
  border-radius: 50%;
  color: #ad8960;
  font-family: var(--display);
  font-size: 24px;
}

.empty-chalk p {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.chalk-mini {
  position: relative;
  overflow: hidden;
  min-height: 70px;
  padding: 10px 10px 10px 47px;
  border: 1px solid color-mix(in srgb, var(--chalk-accent) 45%, #382015);
  background: linear-gradient(130deg, color-mix(in srgb, var(--chalk-accent) 9%, #24110c), #180c09);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.24);
}

.chalk-mini__icon {
  position: absolute;
  top: 10px;
  left: 9px;
  display: grid;
  width: 30px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--chalk-accent);
  color: var(--chalk-accent);
  font-family: var(--display);
  font-size: 15px;
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--chalk-accent) 12%, transparent);
}

.chalk-mini strong,
.chalk-mini span {
  display: block;
}

.chalk-mini strong {
  margin-top: 2px;
  font-family: var(--display);
  font-size: 14px;
}

.chalk-mini span {
  margin-top: 5px;
  color: var(--chalk-accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-stat {
  position: absolute;
  right: 15px;
  bottom: 15px;
  left: 15px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(239, 189, 94, 0.18);
  color: #806b5b;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.run-stat strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.footer-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 6px 0;
  color: #756051;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-line i {
  margin: 0 6px;
  color: var(--brass);
}

.modal-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  background: rgba(7, 3, 2, 0.78);
  backdrop-filter: blur(13px) saturate(0.8);
  transition: visibility 0s 300ms, opacity 300ms ease;
}

.modal-backdrop.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.modal-card {
  position: relative;
  width: min(920px, 100%);
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(239, 189, 94, 0.55);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.035), transparent 35%),
    #1c0c08;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.72), inset 0 0 0 5px #0d0705, inset 0 0 0 6px rgba(239, 189, 94, 0.2);
  text-align: center;
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  transition: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.is-open .modal-card {
  opacity: 1;
  transform: none;
}

.intro-card {
  max-width: 760px;
}

.intro-card::before,
.intro-card::after,
.reward-card::before,
.reward-card::after {
  position: absolute;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(239, 189, 94, 0.22);
  content: "";
  transform: rotate(45deg);
}

.intro-card::before,
.reward-card::before {
  top: -120px;
  left: -90px;
}

.intro-card::after,
.reward-card::after {
  right: -90px;
  bottom: -120px;
}

.intro-sun {
  position: absolute;
  z-index: -1;
  top: 22%;
  left: 50%;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 95, 80, 0.17);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 23px, rgba(255, 95, 80, 0.045) 24px 25px);
  transform: translate(-50%, -50%);
}

.modal-card h2 {
  position: relative;
  margin: 8px 0 18px;
  color: var(--cream);
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.modal-card h2 em {
  color: var(--brass);
  font-weight: inherit;
}

.modal-card > p:not(.eyebrow) {
  max-width: 500px;
  margin: 0 auto 25px;
  color: #bca88c;
  font-size: 14px;
  line-height: 1.45;
}

.intro-rules {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 30px 0;
}

.intro-rules span {
  color: #d1bfa1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-rules b {
  margin-right: 7px;
  color: var(--pink);
  font-family: var(--display);
  font-size: 14px;
}

.hero-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 58px;
  padding: 0 10px 0 24px;
  overflow: hidden;
  border: 1px solid #ffd889;
  color: #1c0d08;
  background: linear-gradient(135deg, #ffe9a9, #eaaa47);
  box-shadow: 0 8px 28px rgba(223, 137, 47, 0.25), inset 0 1px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: 180ms ease;
}

.hero-button:hover {
  box-shadow: 0 12px 38px rgba(223, 137, 47, 0.38), inset 0 1px rgba(255, 255, 255, 0.55);
  transform: translateY(-2px) scale(1.015);
}

.hero-button i {
  display: grid;
  width: 42px;
  height: 42px;
  margin-left: auto;
  place-items: center;
  border-left: 1px solid rgba(58, 28, 12, 0.22);
  font-size: 20px;
}

.intro-card > small {
  display: block;
  margin-top: 14px;
  color: #7d6957;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-card {
  width: min(1040px, 100%);
}

.reward-card h2,
.howto-card h2 {
  font-size: clamp(38px, 5vw, 62px);
}

.reward-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}

/* Drafts smaller than three cards keep the three-card track width but center
   the row instead of leaving trailing columns empty; a four-card draft stays
   on one row. Desktop only — phone tiers relayout these below 781px. */
@media (min-width: 781px) {
  .reward-choices[data-choice-count="1"],
  .reward-choices[data-choice-count="2"] {
    justify-content: center;
  }

  .reward-choices[data-choice-count="1"] {
    grid-template-columns: calc((100% - 2 * 18px) / 3);
  }

  .reward-choices[data-choice-count="2"] {
    grid-template-columns: repeat(2, calc((100% - 2 * 18px) / 3));
  }

  .reward-choices[data-choice-count="4"] {
    grid-template-columns: repeat(4, 1fr);
  }
}

.reward-choice {
  position: relative;
  min-height: 265px;
  padding: 28px 18px 20px;
  border: 1px solid color-mix(in srgb, var(--chalk-accent) 55%, #4d3020);
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--chalk-accent) 13%, transparent), transparent 44%),
    #20100c;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3), inset 0 0 0 4px #120907;
  cursor: pointer;
  transition: 210ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reward-choice:hover,
.reward-choice:focus-visible {
  border-color: var(--chalk-accent);
  box-shadow: 0 19px 36px rgba(0, 0, 0, 0.42), 0 0 28px color-mix(in srgb, var(--chalk-accent) 18%, transparent), inset 0 0 0 4px #120907;
  outline: none;
  transform: translateY(-10px) rotate(-0.5deg);
}

.reward-choice:nth-child(2):hover {
  transform: translateY(-10px) rotate(0.6deg);
}

.reward-choice__icon {
  display: grid;
  width: 72px;
  height: 92px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid var(--chalk-accent);
  color: var(--chalk-accent);
  font-family: var(--display);
  font-size: 30px;
  box-shadow: inset 0 0 25px color-mix(in srgb, var(--chalk-accent) 12%, transparent);
}

.reward-choice strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
}

.reward-choice b {
  display: block;
  margin: 9px 0;
  color: var(--chalk-accent);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reward-choice p {
  margin: 0;
  color: #a9947c;
  font-size: 11px;
  line-height: 1.4;
}

.gameover-card {
  max-width: 620px;
}

.final-score {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin: 6px 0 30px;
  padding: 12px 20px;
  border-top: 1px solid rgba(239, 189, 94, 0.24);
  border-bottom: 1px solid rgba(239, 189, 94, 0.24);
  color: #997e65;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.final-score strong {
  color: var(--brass-hot);
  font-family: var(--display);
  font-size: 28px;
}

.howto-card {
  max-width: 720px;
  text-align: left;
}

.howto-card ol {
  display: grid;
  gap: 16px;
  padding: 0;
  counter-reset: rules;
  list-style: none;
}

.howto-card li {
  position: relative;
  padding: 16px 18px 16px 64px;
  border: 1px solid rgba(239, 189, 94, 0.2);
  background: rgba(255, 255, 255, 0.018);
  counter-increment: rules;
}

.howto-card li::before {
  position: absolute;
  top: 50%;
  left: 18px;
  color: var(--pink);
  content: "0" counter(rules);
  font-family: var(--display);
  font-size: 22px;
  transform: translateY(-50%);
}

.howto-card li b,
.howto-card li span {
  display: block;
}

.howto-card li b {
  margin-bottom: 3px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 17px;
}

.howto-card li span {
  color: #9d8973;
  font-size: 11px;
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(239, 189, 94, 0.25);
  border-radius: 50%;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-size: 21px;
}

/* Modal responsiveness only — the cabinet itself is a fixed shape that the
   fit script scales, so it never needs media queries. Modals live outside
   the scaled shell and stay fluid. */
@media (max-width: 780px) {
  .intro-rules {
    flex-direction: column;
    gap: 9px;
  }

  .reward-choices {
    grid-template-columns: 1fr;
    max-height: 58svh;
    overflow-y: auto;
  }

  .reward-choice {
    min-height: 150px;
    padding: 18px 18px 18px 108px;
    text-align: left;
  }

  .reward-choice__icon {
    position: absolute;
    top: 25px;
    left: 20px;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    padding: 34px 22px;
  }

  .modal-card h2 {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
