:root {
  --tax-red: #bb5033;
  --gold: #ffc644;
  --blue: #70b0cc;
  --paper: #fdf8ef;
  --surface: #faf6ed;
  --ink: #24334c;
  --success: #2f8f63;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.game-main { width: 100%; }
.hero-stage { aspect-ratio: 16 / 9; border-width: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.hero-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.intro-copy { text-align: center; }
.feature-preview { margin: 0 0 6px; color: #5a2530; font-size: .72rem; font-weight: 950; letter-spacing: .12em; }
.intro-copy h1 { margin: 5px 0 3px; font-size: clamp(2.05rem, 7vw, 4.4rem); }
.eyebrow { margin: 0; font-size: .78rem; }
.dek { margin: 12px auto; max-width: 760px; font-size: 1.08rem; font-weight: 900; }
#start { min-width: min(100%, 340px); margin-top: 6px; }

#play {
  width: min(430px, calc(100% - 12px));
  margin: 4px auto 16px;
  scroll-margin-top: 62px;
}
.play-panel {
  min-height: calc(var(--hg-visual-viewport-height, 100dvh) - var(--hg-game-header-block, 76px) - 6px);
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 38px 88px;
  gap: 4px;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.play-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 4px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 7px;
}
.hud-ticket { min-width: 0; display: grid; place-content: center; font-size: .64rem; font-weight: 800; line-height: 1.05; text-align: center; }
.hud-ticket b { display: block; font-size: .91rem; white-space: nowrap; }
.current-rate b { color: var(--gold); font-size: 1.08rem; }
.board-frame { min-height: 0; border-width: 3px !important; border-radius: 10px !important; box-shadow: 3px 3px 0 rgba(36,51,76,.2) !important; }
.board { position: relative; width: 100%; height: 100%; min-height: 365px; overflow: hidden; background: var(--paper); }
.board-art { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.coin {
  position: absolute;
  z-index: 5;
  left: var(--coin-x, 12%);
  top: var(--coin-y, 16%);
  width: clamp(28px, 8.3%, 36px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--coin-rot, 0rad));
  transition: left 260ms cubic-bezier(.16,.74,.28,1), top 260ms ease-in, transform 260ms ease-out, opacity 180ms;
  pointer-events: none;
  will-change: left, top, transform;
}
.coin svg { display: block; width: 100%; height: 100%; overflow: visible; }
.coin.rolling { filter: drop-shadow(0 3px 1px rgba(36,51,76,.25)); }
.coin.drop { transition: left 160ms, top 240ms ease-in, transform 240ms; }
.coin.rattle { animation: coin-rattle 170ms 3; }
.coin.out { opacity: 1; --coin-rot: 420deg; }
.coin.falling::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(50% - 2px);
  bottom: 74%;
  width: 4px;
  height: 52px;
  border-radius: 3px;
  background: repeating-linear-gradient(to bottom, var(--tax-red) 0 7px, transparent 7px 13px);
  opacity: .72;
}
.coin.success { animation: coin-success 260ms 2; }
.impact {
  position: absolute; z-index: 4; width: 56px; height: 56px; opacity: 0;
  background: url("/games/2026-07-30-food-tax-coin-drop/art/machine-parts.svg?v=10#impact") center/contain no-repeat;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.impact.show { animation: impact-show 300ms ease-out; }
.feedback-panel {
  min-height: 38px;
  display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 7px;
  padding: 6px 9px; color: var(--ink); background: rgba(255,255,255,.95);
  border-left: 6px solid var(--blue); border-radius: 6px;
  box-shadow: 0 2px 0 rgba(36,51,76,.12);
  font-size: .79rem; font-weight: 900; line-height: 1.15;
  pointer-events: none;
}
.feedback-panel[data-kind="success"] { border-left-color: var(--success); }
.feedback-panel[data-kind="near"] { border-left-color: var(--gold); }
.feedback-panel[data-kind="danger"] { border-left-color: var(--tax-red); }
#feedback-icon { width: 21px; height: 21px; display: grid; place-items: center; color: var(--paper); background: var(--blue); border-radius: 50%; font-size: .65rem; }
[data-kind="success"] #feedback-icon { background: var(--success); }
[data-kind="near"] #feedback-icon { color: var(--ink); background: var(--gold); }
[data-kind="danger"] #feedback-icon { background: var(--tax-red); }
.lever-controls { display: grid; grid-template-columns: 1fr; min-height: 88px; }
.spring-lever {
  position: relative;
  min-width: 0; min-height: 86px; padding: 0;
  color: var(--ink); background: var(--surface);
  border: 3px solid var(--ink); border-radius: 9px;
  box-shadow: 0 5px 0 var(--ink);
  font: inherit; font-size: .74rem; font-weight: 950;
  cursor: pointer; touch-action: none;
  transition: transform 80ms, box-shadow 80ms, filter 120ms, opacity 120ms;
  overflow: hidden;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.spring-lever .lever-base { display: none; }
.spring-lever .lever-handle {
  position: absolute; z-index: 4; left: 50%; top: 27px; width: 39px; height: 35px;
  transform: translateX(calc(-50% + var(--travel-x, 0px))) rotate(calc(90deg + var(--pull, 0deg)));
  transform-origin: 50% 50%;
}
.spring-lever::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 38px;
  width: var(--spring, 0px);
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: repeating-linear-gradient(to right, var(--blue) 0 5px, var(--paper) 5px 10px);
  transform: scaleX(var(--spring-direction, 1));
  transform-origin: left center;
}
.pull-hint {
  position: absolute; z-index: 5; right: 9px; top: 6px;
  padding: 3px 6px; color: var(--ink); background: var(--gold);
  border: 1px solid var(--ink); border-radius: 3px;
  font-size: .62rem; line-height: 1; font-weight: 950;
}
.strength-scale {
  position: absolute; z-index: 3; left: 96px; right: 12px; bottom: 8px; height: 16px;
  border-top: 2px solid var(--ink);
  background: repeating-linear-gradient(to right, var(--ink) 0 2px, transparent 2px 22px);
  background-position: left top;
  background-size: 100% 9px;
  background-repeat: repeat-x;
}
.strength-scale i {
  position: absolute; top: 5px; padding: 0 2px; background: var(--surface);
  font-size: .56rem; line-height: 1; font-style: normal; font-weight: 950;
  transform: translateX(-50%);
}
.strength-scale i:first-child { left: 0; transform: none; }
.strength-scale i:nth-child(2) { left: 50%; }
.strength-scale i:last-child { right: 0; left: auto; transform: none; }
.strength-readout {
  position: absolute; z-index: 6; left: 10px; bottom: 6px;
  min-width: 66px; padding: 2px 5px; color: var(--ink); background: rgba(255,255,255,.9);
  border-left: 4px solid var(--blue); text-align: left;
  font-size: .58rem; line-height: 1.1; font-weight: 850;
}
.strength-readout b { display: block; color: var(--tax-red); font-size: .76rem; }
.lever-name {
  display: none;
}
.launch-direction {
  position: absolute;
  z-index: 7;
  left: 9px;
  top: 5px;
  min-width: 118px;
  padding: 3px 7px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px;
  font-size: .62rem;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: .03em;
}
.spring-lever.active-side { background: #fff7d8; }
.spring-lever.active-side::after {
  content: ""; position: absolute; inset: 4px;
  border: 3px solid var(--gold); border-radius: 5px; pointer-events: none;
}
.spring-lever.pulling { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); filter: saturate(1.08); }
.spring-lever:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 2px 0 var(--ink); }
.spring-lever:focus-visible { outline: 4px solid #0086ff; outline-offset: 2px; }

#result { width: min(760px, calc(100% - 20px)); margin: 12px auto 28px; }
.result-card { padding: 18px; background: var(--paper); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 rgba(36,51,76,.18); text-align: center; }
.result-art { width: min(100%, 520px); margin: auto; }
.result-art img { display: block; width: 100%; height: auto; }
.result-progress { position: relative; aspect-ratio: 430 / 470; }
.result-progress > img { width: 100%; height: 100%; object-fit: fill; }
.result-progress-coin {
  position: absolute; left: var(--result-coin-x, 14.5%); top: var(--result-coin-y, 19.6%);
  width: 8.3%; aspect-ratio: 1; transform: translate(-50%,-50%);
}
.result-progress-coin svg { display: block; width: 100%; height: 100%; }
.result-rate-line { margin: 10px 0 0; font-size: .9rem; font-weight: 900; }
.result-rate-line strong { display: block; color: var(--tax-red); font-size: clamp(2.8rem, 11vw, 4.8rem); line-height: 1; }
.rank-line { margin: 4px 0 0; font-size: .82rem; font-weight: 900; }
.rank-line strong { margin-left: 7px; color: var(--success); font-size: 1.8rem; }
.final-score { margin: 0 0 8px; font-size: 1.7rem; font-weight: 950; }
.result-message { min-height: 1.7em; white-space: pre-line; font-weight: 900; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 14px 0; }
.result-stats div { padding: 8px; background: #fff; border-left: 4px solid var(--blue); text-align: left; }
.result-stats dt { font-size: .72rem; }
.result-stats dd { margin: 2px 0 0; font-size: 1rem; font-weight: 900; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.news-card { margin-top: 18px; padding: 14px 16px; background: #fff; border-left: 6px solid var(--tax-red); border-radius: 8px; text-align: left; }
.news-card h2 { margin: 0 0 4px; font-size: .9rem; }
.news-card p { margin: 0; font-size: .88rem; line-height: 1.7; }
