:root {
  --bg: #083728;
  --bg-deep: #031b16;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --ink: #092233;
  --muted: #567064;
  --line: rgba(8, 55, 40, 0.22);
  --green: #61b823;
  --green-dark: #1d6b2c;
  --gold: #ffc928;
  --gold-deep: #c97b00;
  --red: #d24b25;
  --navy: #08293b;
  --shadow: rgba(0, 0, 0, 0.24);
  --soft-shadow: rgba(12, 46, 32, 0.16);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 226, 111, 0.14), transparent 24rem),
    linear-gradient(145deg, #0f5b39 0%, var(--bg) 44%, var(--bg-deep) 100%);
}

button {
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: clamp(12px, 2.2vw, 28px);
}

.game-frame {
  width: min(1480px, 100%);
  display: grid;
  gap: clamp(10px, 1.4vw, 16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, #b8f55a 0 20%, #61b823 21% 38%, transparent 39%),
    conic-gradient(from 20deg, #0f5b39, #93d94a, #0f5b39, #ffc928, #0f5b39);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24), inset 0 0 0 5px rgba(8, 41, 59, 0.45);
}

h1,
h2,
p,
dl,
dt,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6.8vw, 5.3rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.brand p {
  max-width: 34rem;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.86rem, 1.6vw, 1.05rem);
  font-weight: 700;
}

.course-badge {
  min-width: min(360px, 40vw);
  padding: 13px 18px;
  color: white;
  text-align: center;
  background: linear-gradient(180deg, #0c3d3b, #061f2b);
  border: 2px solid rgba(255, 220, 88, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.course-badge span,
.course-badge strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-badge span {
  font-size: clamp(0.88rem, 1.4vw, 1.3rem);
  font-weight: 900;
}

.course-badge strong {
  margin-top: 2px;
  color: var(--gold);
  font-size: clamp(0.82rem, 1.2vw, 1.02rem);
}

.hud {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) repeat(3, minmax(120px, 0.7fr)) minmax(120px, 0.75fr);
  gap: clamp(8px, 1vw, 12px);
}

.stat {
  min-width: 0;
  padding: clamp(10px, 1.3vw, 16px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px var(--soft-shadow), inset 0 -3px 0 rgba(8, 55, 40, 0.08);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: clamp(0.72rem, 1vw, 0.86rem);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--navy);
  font-size: clamp(1.42rem, 3.4vw, 3.2rem);
  font-weight: 950;
  line-height: 0.95;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat--timer strong {
  color: var(--red);
}

.stat--score strong {
  color: #06263a;
}

.course-wrap {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

.course {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: #78b82f url("assets/plug-rush/course-bg.png") center / cover no-repeat;
  touch-action: manipulation;
  user-select: none;
}

.course-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(1, 20, 14, 0.18), transparent 24%, transparent 78%, rgba(1, 20, 14, 0.2)),
    radial-gradient(circle at 50% 45%, transparent 45%, rgba(2, 25, 16, 0.16));
}

.field-layer,
.float-layer {
  position: absolute;
  inset: 0;
}

.field-layer {
  z-index: 2;
}

.float-layer {
  z-index: 7;
  pointer-events: none;
}

.hole {
  --hole-size: clamp(54px, 5.8vw, 84px);
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--hole-size) * var(--scale, 1));
  height: calc(var(--hole-size) * var(--scale, 1));
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.hole::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(255, 255, 255, 0);
  border-radius: 50%;
  transform: scale(0.82);
  transition: border-color 120ms ease, transform 120ms ease;
}

.hole img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.25));
}

.hole:not(.is-filled):hover,
.hole:not(.is-filled):focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
  filter: saturate(1.08);
}

.hole:not(.is-filled):hover::after,
.hole:not(.is-filled):focus-visible::after {
  border-color: rgba(255, 241, 143, 0.86);
  transform: scale(1);
}

.hole.is-filled {
  pointer-events: none;
  animation: repaired 360ms cubic-bezier(0.22, 1.35, 0.48, 1) both;
}

.hole.is-filled.is-raised {
  z-index: 6;
  pointer-events: auto;
  animation: highPlug 880ms ease-in-out infinite;
}

.hole.is-filled.is-raised::before {
  content: "TAMP";
  position: absolute;
  left: 50%;
  top: -12%;
  z-index: 2;
  padding: 3px 7px;
  color: #102923;
  background: linear-gradient(180deg, #ffe874, var(--gold));
  border: 1px solid rgba(75, 55, 0, 0.34);
  border-radius: 99px;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.18);
  font-size: clamp(0.54rem, 0.9vw, 0.7rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.hole.is-filled.is-raised img {
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.32)) saturate(1.16);
}

.hole.is-filled.is-raised::after {
  border-color: rgba(255, 220, 46, 0.95);
  transform: scale(1.05);
}

.hole.is-filled.is-low {
  z-index: 6;
  pointer-events: auto;
  animation: lowPlug 900ms ease-in-out infinite;
}

.hole.is-filled.is-low::before {
  content: "LIFT";
  position: absolute;
  left: 50%;
  top: 69%;
  z-index: 2;
  padding: 3px 7px;
  color: white;
  background: linear-gradient(180deg, #3bb8ff, #17639a);
  border: 1px solid rgba(6, 42, 73, 0.34);
  border-radius: 99px;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.18);
  font-size: clamp(0.54rem, 0.9vw, 0.7rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.hole.is-filled.is-low img {
  filter: brightness(0.72) saturate(0.84) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
}

.hole.is-filled.is-low::after {
  border-color: rgba(77, 202, 255, 0.94);
  transform: scale(0.78);
}

.hole.is-filled.is-scalp-warning::before {
  color: white;
  background: linear-gradient(180deg, #ff7f35, var(--red));
}

.hole.is-filled.is-scalp-warning::after {
  border-color: rgba(255, 94, 37, 0.98);
}

.hole.is-filled.is-trip-warning::before {
  color: white;
  background: linear-gradient(180deg, #ff7f35, var(--red));
}

.hole.is-filled.is-trip-warning::after {
  border-color: rgba(255, 94, 37, 0.98);
  transform: scale(0.96);
}

.hole.is-filled.is-scalped img {
  filter: sepia(0.75) saturate(0.72) brightness(0.72) drop-shadow(0 8px 7px rgba(0, 0, 0, 0.28));
}

.hole.is-filled.is-scalped::before {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  top: 47%;
  height: 9%;
  background: rgba(92, 42, 19, 0.78);
  border-radius: 99px;
  transform: rotate(-12deg);
}

.hole.is-filled.is-tripped img {
  filter: sepia(0.55) saturate(0.62) brightness(0.64) drop-shadow(0 7px 6px rgba(0, 0, 0, 0.28));
}

.hole.is-filled.is-tripped::before {
  content: "";
  position: absolute;
  left: 21%;
  right: 14%;
  top: 56%;
  height: 10%;
  background: rgba(8, 35, 43, 0.76);
  border-radius: 99px;
  transform: rotate(16deg);
}

.hole.is-danger:not(.is-filled) {
  animation: dangerPulse 900ms ease-in-out infinite;
}

.golfer {
  --gx: 48%;
  --gy: 52%;
  position: absolute;
  left: var(--gx);
  top: var(--gy);
  z-index: 5;
  width: clamp(86px, 10vw, 142px);
  transform: translate(-50%, -82%);
  transition: left 280ms cubic-bezier(0.2, 0.9, 0.32, 1), top 280ms cubic-bezier(0.2, 0.9, 0.32, 1);
  pointer-events: none;
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.27));
}

.golfer.is-planting {
  animation: plantPlug 320ms ease;
}

.mower-front {
  position: absolute;
  left: var(--mower-x, -12%);
  top: 0;
  bottom: 0;
  z-index: 4;
  width: clamp(16px, 2vw, 24px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent, rgba(255, 230, 79, 0.48), transparent),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  border-left: 2px dashed rgba(255, 241, 117, 0.9);
  transition: opacity 160ms ease;
}

.mower {
  position: absolute;
  left: var(--mower-x, -12%);
  top: var(--mower-y, 72%);
  z-index: 6;
  width: clamp(78px, 7vw, 112px);
  height: clamp(62px, 5.5vw, 86px);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -54%);
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.28));
  transition: opacity 160ms ease;
}

body.has-mower .mower,
body.has-mower .mower-front {
  opacity: 1;
}

.mower-person {
  position: absolute;
  left: 18%;
  top: 3%;
  width: 30%;
  height: 64%;
  background:
    radial-gradient(circle at 50% 13%, #f4cda3 0 17%, transparent 18%),
    linear-gradient(180deg, transparent 0 24%, #f4c928 25% 56%, #124e2d 57% 100%);
  border-radius: 42% 42% 30% 30%;
  transform-origin: 50% 100%;
  animation: mowerWalk 520ms ease-in-out infinite;
}

.mower-handle {
  position: absolute;
  left: 40%;
  top: 37%;
  width: 33%;
  height: 6%;
  background: #102923;
  border-radius: 99px;
  transform: rotate(13deg);
}

.mower-deck {
  position: absolute;
  left: 55%;
  top: 45%;
  width: 42%;
  height: 34%;
  background:
    radial-gradient(circle at 22% 86%, #08171b 0 10%, transparent 11%),
    radial-gradient(circle at 78% 86%, #08171b 0 10%, transparent 11%),
    linear-gradient(180deg, #e3332f 0%, #a91e23 62%, #67181b 100%);
  border: 2px solid rgba(69, 10, 10, 0.55);
  border-radius: 8px 16px 12px 12px;
}

.plug-drop {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 6;
  width: clamp(54px, 5vw, 72px);
  transform: translate(-50%, -78%) scale(0.9);
  pointer-events: none;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.25));
  animation: plugDrop 430ms cubic-bezier(0.2, 0.9, 0.36, 1) forwards;
}

.score-pop {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 8;
  min-width: 64px;
  padding: 4px 8px;
  color: white;
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 950;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: scoreRise 760ms ease-out forwards;
}

.score-pop em {
  display: block;
  color: var(--gold);
  font-size: 0.54em;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-pop--loss {
  color: #ffefe7;
  text-shadow: 0 3px 0 rgba(86, 12, 0, 0.42);
}

.score-pop--loss em {
  color: #ff9d5c;
}

.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 7;
  width: clamp(72px, 7vw, 106px);
  height: clamp(72px, 7vw, 106px);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 245, 136, 0.95) 0 8%, transparent 9%),
    conic-gradient(from 0deg, transparent, rgba(255, 213, 41, 0.9), transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: translate(-50%, -50%) scale(0.35);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: sparkle 520ms ease-out forwards;
}

.rush-meter {
  position: absolute;
  left: clamp(10px, 1.6vw, 22px);
  bottom: clamp(10px, 1.6vw, 22px);
  z-index: 9;
  width: min(260px, 44vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: white;
  background: rgba(5, 31, 43, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.rush-meter span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rush-meter div {
  height: 12px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.rush-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fea35, var(--gold), #ff8b2e);
  transition: width 130ms ease;
}

.intro-panel,
.win-panel {
  position: absolute;
  z-index: 20;
  right: clamp(14px, 3vw, 44px);
  top: 50%;
  width: min(430px, calc(100% - 28px));
  padding: clamp(18px, 2.5vw, 30px);
  color: white;
  background: linear-gradient(180deg, rgba(9, 49, 34, 0.96), rgba(4, 32, 44, 0.97));
  border: 2px solid rgba(255, 213, 61, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.intro-panel h2,
.win-panel h2 {
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-panel p {
  margin: 14px 0 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  font-weight: 700;
}

.intro-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.win-panel {
  text-align: center;
}

.win-kicker {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 20px;
}

.stars span {
  width: clamp(46px, 6vw, 76px);
  aspect-ratio: 1;
  clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 68% 55%, 79% 88%, 50% 68%, 21% 88%, 32% 55%, 5% 35%, 39% 35%);
  background: linear-gradient(145deg, #fff3a0, var(--gold) 55%, var(--gold-deep));
  filter: drop-shadow(0 8px 2px rgba(0, 0, 0, 0.22));
  opacity: 0.28;
  transform: scale(0.86);
}

.stars[data-rating="1"] span:nth-child(-n + 1),
.stars[data-rating="2"] span:nth-child(-n + 2),
.stars[data-rating="3"] span:nth-child(-n + 3) {
  opacity: 1;
  transform: scale(1);
}

.win-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.win-stats div {
  min-width: 0;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.win-stats dt {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.win-stats dd {
  margin-top: 3px;
  overflow: hidden;
  color: var(--gold);
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: white;
}

.status {
  min-height: 42px;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  background: rgba(2, 22, 20, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  min-height: 44px;
  padding: 0 17px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16), inset 0 -3px 0 rgba(0, 0, 0, 0.09);
  font-size: 0.9rem;
  font-weight: 950;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: default;
  opacity: 0.68;
}

.button:disabled:hover {
  filter: none;
  transform: none;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  color: white;
  background: linear-gradient(180deg, #79cd2d, #328c21);
  border-color: rgba(255, 255, 255, 0.44);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

.button--ghost {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.is-overtime .stat--timer strong {
  color: var(--gold);
}

body.is-running .intro-panel {
  display: none;
}

@keyframes repaired {
  0% { transform: translate(-50%, -50%) scale(0.84); }
  65% { transform: translate(-50%, -50%) scale(1.12); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes highPlug {
  0%, 100% {
    transform: translate(-50%, -55%) scale(1.03);
  }
  50% {
    transform: translate(-50%, -64%) scale(1.08);
  }
}

@keyframes lowPlug {
  0%, 100% {
    transform: translate(-50%, -45%) scale(0.98);
  }
  50% {
    transform: translate(-50%, -39%) scale(0.94);
  }
}

@keyframes dangerPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 201, 40, 0)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 201, 40, 0.9)); }
}

@keyframes mowerWalk {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(5deg) translateY(2%); }
}

@keyframes plantPlug {
  0%, 100% { transform: translate(-50%, -82%) rotate(0deg); }
  46% { transform: translate(-50%, -77%) rotate(-3deg); }
}

@keyframes plugDrop {
  0% { opacity: 0; transform: translate(-50%, -140%) scale(0.76); }
  42% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.42); }
}

@keyframes scoreRise {
  0% { opacity: 0; transform: translate(-50%, -18%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -138%) scale(1); }
}

@keyframes sparkle {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35) rotate(80deg); }
}

@media (max-width: 900px) {
  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .course-badge {
    width: 100%;
    min-width: 0;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat--score {
    grid-column: span 2;
  }

  .course {
    min-height: 520px;
    aspect-ratio: auto;
    background-position: center;
  }

  .intro-panel,
  .win-panel {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 16px;
    transform: translateX(-50%);
  }

  .control-buttons {
    justify-content: stretch;
  }

  .control-buttons .button {
    flex: 1 1 138px;
  }
}

@media (max-width: 560px) {
  .game-shell {
    padding: 10px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand p {
    display: none;
  }

  .hud {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
  }

  .stat {
    padding: 7px 2px;
    text-align: center;
  }

  .stat--score {
    grid-column: auto;
  }

  .stat span {
    font-size: 0.48rem;
    letter-spacing: 0.04em;
  }

  .stat strong {
    font-size: clamp(0.66rem, 2.85vw, 0.92rem);
    line-height: 1.05;
  }

  .course {
    min-height: min(68vh, 560px);
  }

  .win-stats {
    grid-template-columns: 1fr;
  }

  .intro-actions {
    grid-template-columns: 1fr;
  }

  .win-actions {
    grid-template-columns: 1fr;
  }

  .status {
    white-space: normal;
  }

  .button {
    min-height: 42px;
    padding-inline: 13px;
    font-size: 0.84rem;
  }
}

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