@font-face {
  font-family: "Plumbers Display";
  src: url("../../assets/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Plumbers Slab";
  src: url("../../assets/fonts/RobotoSlab-Variable.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Plumbers Work";
  src: url("../../assets/fonts/BarlowSemiCondensed-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: "Plumbers Work";
  src: url("../../assets/fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype");
  font-display: swap;
  font-weight: 600;
}

@font-face {
  font-family: "Plumbers Work";
  src: url("../../assets/fonts/BarlowSemiCondensed-Black.ttf") format("truetype");
  font-display: swap;
  font-weight: 900;
}

:root {
  --paper: #f1e5ce;
  --paper-deep: #ddc9a3;
  --card: #fffaf0;
  --ink: #13253a;
  --ink-soft: #586575;
  --casino: #07131d;
  --casino-soft: #10283b;
  --navy: #0c2944;
  --brass: #d9a83f;
  --brass-pale: #ffe79a;
  --copper: #b96135;
  --copper-dark: #6f3017;
  --red: #a92f2c;
  --green: #2f9d72;
  --line: #c9b895;
  --shell: 1180px;
  --shadow: 0 22px 55px rgb(12 31 49 / 16%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgb(255 255 255 / 68%), transparent 29%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgb(64 43 23 / 2%) 6px),
    var(--paper);
  font-family: "Plumbers Work", "Arial Narrow", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(19 37 58 / 8%) 0.7px, transparent 0.7px);
  background-size: 7px 7px;
  content: "";
  pointer-events: none;
}
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--brass-pale);
  outline-offset: 3px;
}
.shell, .site-header { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 13px;
  color: white;
  background: var(--casino);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  min-height: 86px;
}
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--brass);
  place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: "Plumbers Display", sans-serif; font-size: 18px; }
.brand-copy small {
  margin-top: 4px;
  color: var(--copper-dark);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.global-nav { display: flex; gap: 18px; justify-content: center; }
.global-nav a {
  padding: 7px 2px;
  border-bottom: 2px solid transparent;
  color: #405064;
  font-weight: 600;
  text-decoration: none;
}
.global-nav a:hover, .global-nav a.active { border-color: var(--copper); color: var(--ink); }
.wallet-button, .text-button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}
.wallet-button { min-width: 132px; padding: 10px 17px; }
.wallet-button:hover, .text-button:hover { color: white; background: var(--ink); }

.game-hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  color: white;
  background: #06101a;
}
.game-hero__art, .game-hero__shade { position: absolute; inset: 0; }
.game-hero__art {
  background-image: url("../assets/turn-the-valve-v1.webp");
  background-position: 50% 52%;
  background-size: cover;
  filter: saturate(0.92) contrast(1.05);
  transform: scale(1.015);
}
.game-hero__shade {
  background:
    linear-gradient(90deg, rgb(4 10 15 / 95%) 0, rgb(5 13 20 / 82%) 34%, rgb(5 13 20 / 22%) 65%, rgb(5 13 20 / 52%) 100%),
    linear-gradient(0deg, rgb(4 10 15 / 78%), transparent 55%);
}
.game-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: end;
  min-height: 430px;
  padding-block: 70px 58px;
}
.eyebrow {
  margin: 0 0 9px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.game-hero .eyebrow { color: var(--brass-pale); }
.game-hero h1, .section-heading h2, .rules h2 {
  margin: 0;
  font-family: "Plumbers Slab", serif;
  line-height: 0.91;
}
.game-hero h1 {
  max-width: 650px;
  font-size: clamp(66px, 9vw, 118px);
  letter-spacing: -0.055em;
  text-shadow: 0 7px 35px rgb(0 0 0 / 65%);
}
.game-hero__lede {
  max-width: 600px;
  margin: 24px 0 0;
  color: #d5e2e8;
  font-size: 20px;
}
.hero-rule-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  min-width: 330px;
  overflow: hidden;
  border: 1px solid rgb(255 231 154 / 42%);
  border-radius: 9px;
  background: rgb(4 13 20 / 78%);
  box-shadow: 0 18px 45px rgb(0 0 0 / 36%), inset 0 1px rgb(255 255 255 / 8%);
  backdrop-filter: blur(10px);
}
.hero-rule-card span {
  padding: 15px 12px;
  border-right: 1px solid rgb(255 255 255 / 10%);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  color: var(--brass-pale);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
.hero-rule-card span:nth-child(2n) { border-right: 0; }
.hero-rule-card span:nth-last-child(-n + 2) { border-bottom: 0; }

.deployment-notice {
  padding: 12px 20px;
  border-block: 1px solid #8a5a20;
  color: #ffe7a0;
  background: #3b2915;
  font-weight: 700;
  text-align: center;
}
.game, .history, .rules { padding-block: 72px; }
.section-heading {
  display: flex;
  gap: 25px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
}
.section-heading h2 { font-size: clamp(42px, 5.5vw, 66px); letter-spacing: -0.04em; }
.section-heading--compact h2 { font-size: clamp(36px, 4.6vw, 52px); }
.round-chip {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid #b9a476;
  border-radius: 999px;
  background: rgb(255 250 240 / 65%);
  box-shadow: inset 0 1px white;
}
.round-chip > span {
  position: relative;
  padding-left: 15px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.round-chip > span::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
  content: "";
  transform: translateY(-50%);
}

.game-board {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(325px, 0.78fr);
  overflow: hidden;
  border: 1px solid #172d3f;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.valve-panel {
  min-width: 0;
  padding: 18px;
  color: white;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgb(255 255 255 / 1.5%) 9px),
    var(--casino);
}
.valve-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #3b5060;
  border-radius: 9px;
  background: #03090e;
  box-shadow: inset 0 0 45px rgb(0 0 0 / 76%);
  isolation: isolate;
}
.valve-scene__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 29% 52%, transparent 0 25%, rgb(2 7 11 / 12%) 43%, transparent 56%),
    linear-gradient(90deg, transparent 36%, rgb(3 9 14 / 25%) 57%, rgb(3 9 14 / 72%) 100%),
    linear-gradient(0deg, rgb(2 7 11 / 65%), transparent 32%);
  pointer-events: none;
}
.wheel-recess {
  position: absolute;
  top: 52.5%;
  left: 29.4%;
  z-index: 3;
  display: block;
  width: 47.5%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgb(231 176 69 / 38%);
  border-radius: 50%;
  box-shadow: 0 13px 36px rgb(0 0 0 / 58%), 0 0 24px rgb(174 61 39 / 14%);
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
}
.wheel-recess img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: valve-idle 4.8s ease-in-out infinite;
}
.steam {
  position: absolute;
  z-index: 4;
  width: 12%;
  height: 31%;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 75%, rgb(240 247 245 / 63%), transparent 48%),
    radial-gradient(ellipse at 30% 40%, rgb(216 230 229 / 38%), transparent 53%);
  filter: blur(8px);
  pointer-events: none;
  animation: steam-rise 5.4s ease-out infinite;
}
.steam--one { bottom: 5%; left: 7%; animation-delay: -1.2s; }
.steam--two { bottom: 1%; left: 49%; width: 9%; animation-delay: -3.8s; }
.steam--three { top: 9%; left: 12%; width: 8%; height: 26%; animation-delay: -2.3s; }
.valve-scene.is-turning .steam { animation: steam-burst 1.2s ease-out both; }
.valve-scene.is-turning .steam--two { animation-delay: 80ms; }
.valve-scene.is-turning .steam--three { animation-delay: 160ms; }

.scene-round, .scene-clock {
  position: absolute;
  z-index: 5;
  right: 4%;
  display: grid;
  width: 39%;
  padding: 13px 16px;
  border: 1px solid rgb(255 231 154 / 30%);
  border-radius: 7px;
  color: white;
  background: rgb(3 11 17 / 75%);
  box-shadow: 0 12px 30px rgb(0 0 0 / 35%), inset 0 1px rgb(255 255 255 / 7%);
  backdrop-filter: blur(8px);
}
.scene-round { top: 8%; }
.scene-clock { bottom: 8%; }
.scene-round span, .scene-clock span {
  color: #a9bbc5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.scene-round strong {
  overflow: hidden;
  color: var(--brass-pale);
  font-family: "Plumbers Slab", serif;
  font-size: clamp(23px, 3.2vw, 40px);
  line-height: 1.1;
  text-overflow: ellipsis;
}
.scene-clock strong {
  color: #fff5d1;
  font-family: "Plumbers Display", sans-serif;
  font-size: clamp(24px, 3.4vw, 43px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}
.scene-round small, .scene-clock small { color: #a9bbc5; }
.live-strip {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #2f4555;
  border-radius: 7px;
  background: #0c2131;
}
.live-strip div { display: grid; padding: 11px 13px; border-right: 1px solid #2f4555; }
.live-strip div:last-child { border-right: 0; }
.live-strip span { color: #8fa9b8; font-size: 12px; }
.live-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.turn-panel {
  padding: 26px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 72%), transparent 34%),
    var(--card);
}
.turn-panel__heading { display: flex; gap: 14px; align-items: start; justify-content: space-between; }
.turn-panel h3 { margin: 0; font-family: "Plumbers Slab", serif; font-size: 34px; line-height: 1; }
.turn-panel__heading > span {
  padding: 5px 8px;
  border: 1px solid #c6ae7b;
  border-radius: 999px;
  color: var(--copper-dark);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.turn-receipt { margin: 24px 0 0; border-top: 1px solid var(--line); }
.turn-receipt div {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #e4d9c3;
}
.turn-receipt dt { color: var(--ink-soft); }
.turn-receipt dd { margin: 0; font-weight: 900; text-align: right; }
.turn-receipt__total dt, .turn-receipt__total dd { color: var(--ink); font-size: 18px; }
.split-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}
.split-dot--burn { background: var(--red); }
.split-dot--draw { background: var(--brass); }
.split-dot--pot { background: var(--green); }
.ticket-meter { margin: 18px 0; padding: 13px; border: 1px solid #d5c39e; border-radius: 7px; background: #f8edd7; }
.ticket-meter__topline { display: flex; gap: 10px; justify-content: space-between; font-size: 14px; }
.ticket-meter__topline strong { color: var(--copper-dark); }
.ticket-meter__track { display: block; height: 9px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #cfc0a5; }
.ticket-meter__track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #b86a35, #e8b540); transition: width 350ms ease; }
.ticket-meter p { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; }
.wallet-balance { display: flex; gap: 12px; justify-content: space-between; margin: 18px 0 10px; color: var(--ink-soft); }
.wallet-balance strong { color: var(--ink); text-align: right; }
.button {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.035em;
}
.button:disabled { cursor: not-allowed; filter: grayscale(0.35); opacity: 0.54; }
.button--turn {
  min-height: 58px;
  border: 1px solid #66251e;
  color: #fff8e8;
  background: linear-gradient(180deg, #c94b3b, #7f251f);
  box-shadow: inset 0 1px rgb(255 255 255 / 27%), 0 9px 21px rgb(128 35 29 / 22%);
  font-size: 18px;
  text-shadow: 0 1px rgb(0 0 0 / 32%);
}
.button--turn:not(:disabled):hover { filter: brightness(1.12); transform: translateY(-1px); }
.button--turn:not(:disabled):active { transform: translateY(1px); }
.button--lifecycle { margin-top: 14px; color: #122232; background: linear-gradient(180deg, #ffe891, #ca9131); }
.button--lifecycle:not(:disabled):hover { background: linear-gradient(180deg, #fff0ac, #dda840); }
.button--claim { min-height: 42px; margin-top: 9px; color: white; background: var(--green); }
.micro-status, .action-status { min-height: 20px; margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }
.valve-panel .micro-status { color: #9eb5c5; }
.micro-status.error, .action-status.error { color: #c73734; }
.micro-status.success, .action-status.success { color: var(--green); }
.winner-vault { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.winner-vault > div { display: flex; gap: 12px; justify-content: space-between; }
.winner-vault span { color: var(--ink-soft); }
.winner-vault strong { text-align: right; }

.history { padding-top: 22px; border-top: 1px solid rgb(126 93 55 / 24%); }
.text-button { padding: 8px 14px; }
.history-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.history-card, .empty-state {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 250 240 / 72%);
}
.empty-state { grid-column: 1 / -1; color: var(--ink-soft); text-align: center; }
.history-card { display: grid; gap: 9px; }
.history-card header { display: flex; align-items: center; justify-content: space-between; }
.history-card h3 { margin: 0; font-family: "Plumbers Slab", serif; font-size: 21px; }
.state-badge { padding: 4px 7px; border-radius: 999px; color: white; background: var(--green); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.state-badge.skipped { color: var(--ink); background: var(--brass-pale); }
.history-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; }
.history-card dt { color: var(--ink-soft); }
.history-card dd { margin: 0; overflow: hidden; font-weight: 900; text-align: right; text-overflow: ellipsis; }

.rules {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 45px;
  border-top: 1px solid rgb(126 93 55 / 24%);
}
.rules h2 { font-size: clamp(38px, 5vw, 58px); }
.rules > div > p:not(.eyebrow) { color: var(--ink-soft); font-size: 18px; }
.rules ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: rules; }
.rules li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(255 250 240 / 56%);
  counter-increment: rules;
}
.rules li::before { grid-row: 1 / 3; color: var(--copper); content: counter(rules, decimal-leading-zero); font-family: "Plumbers Display", sans-serif; font-size: 28px; }
.rules li span { color: var(--ink-soft); }
.funding-rule, .ordering-rule { grid-column: 1 / -1; padding: 18px 20px; border-left: 5px solid var(--brass); background: #fff4cc; }
.ordering-rule { border-left-color: var(--red); background: #f5ddd2; }
.funding-rule p, .ordering-rule p { margin: 4px 0 0; color: var(--ink-soft); }

.site-footer { display: flex; justify-content: space-between; padding-block: 28px 45px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.site-footer a { color: var(--ink); font-weight: 900; }

body[data-preview-state="live"] .deployment-notice { display: block; }

@keyframes valve-idle {
  0%, 100% { filter: brightness(0.94) saturate(0.95); transform: rotate(-1deg) scale(1.002); }
  50% { filter: brightness(1.07) saturate(1.05); transform: rotate(1deg) scale(1.008); }
}
@keyframes steam-rise {
  0% { opacity: 0; transform: translate3d(0, 20%, 0) scale(0.65); }
  28% { opacity: 0.38; }
  100% { opacity: 0; transform: translate3d(14%, -85%, 0) scale(1.3); }
}
@keyframes steam-burst {
  0% { opacity: 0; transform: translate3d(0, 15%, 0) scale(0.75); }
  25% { opacity: 0.82; }
  100% { opacity: 0; transform: translate3d(22%, -110%, 0) scale(1.55); }
}

@media (max-width: 940px) {
  .site-header { grid-template-columns: 1fr auto; }
  .global-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; padding-bottom: 15px; overflow-x: auto; }
  .game-hero__inner { grid-template-columns: 1fr; }
  .game-board, .rules { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: repeat(2, 1fr); }
  .funding-rule, .ordering-rule { grid-column: auto; }
}

@media (max-width: 620px) {
  .shell, .site-header { width: min(calc(100% - 24px), var(--shell)); }
  .site-header { gap: 12px; min-height: 72px; }
  .brand-copy small { display: none; }
  .wallet-button { min-width: 0; padding-inline: 12px; }
  .global-nav { gap: 13px; font-size: 14px; }
  .game-hero { min-height: 390px; }
  .game-hero__art { background-position: 37% center; opacity: 0.74; }
  .game-hero__shade { background: linear-gradient(90deg, rgb(3 9 14 / 91%), rgb(3 9 14 / 45%)), linear-gradient(0deg, rgb(3 9 14 / 82%), transparent 58%); }
  .game-hero__inner { min-height: 390px; padding-block: 50px 38px; }
  .game-hero h1 { font-size: clamp(58px, 19vw, 76px); }
  .game-hero__lede { font-size: 18px; }
  .hero-rule-card { min-width: 0; }
  .game, .history, .rules { padding-block: 46px; }
  .section-heading { display: grid; align-items: start; }
  .round-chip { justify-self: start; }
  .valve-panel, .turn-panel { padding: 13px; }
  .valve-scene { aspect-ratio: 4 / 5; }
  .valve-scene__backdrop { object-position: 27% center; }
  .wheel-recess { top: 46%; left: 42%; width: 69%; }
  .scene-vignette { background: linear-gradient(0deg, rgb(2 7 11 / 84%), transparent 50%); }
  .scene-round, .scene-clock { right: 4%; left: 4%; width: auto; padding: 9px 11px; }
  .scene-round { top: 4%; }
  .scene-clock { bottom: 4%; }
  .scene-round strong, .scene-clock strong { font-size: 24px; }
  .scene-round small, .scene-clock small { font-size: 11px; }
  .live-strip { grid-template-columns: 1fr 1fr; }
  .live-strip div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #2f4555; }
  .turn-panel__heading > span { display: none; }
  .history-grid { grid-template-columns: 1fr; }
  .site-footer { display: grid; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
