/* One winter landscape fills the viewport; the control sits at the end of the piste. */
body {
  --masthead-height: 64px;
  --intro-height: 96px;
  --action-height: 60px;
  background: #eaf2f7;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(#eff7ff22, #f3f8fc18 45%, #f4f8fb55), url("winter-idyll-v1.png") center center / cover no-repeat;
}
.masthead { height: var(--masthead-height); border-bottom-color: #ffffff70; }
.brand, .guest { color: #143c40; text-shadow: 0 1px 8px #ffffffa8; }
.intro { height: var(--intro-height); padding: 10px 0 16px; }
.intro .eyebrow { color: #2d5663; }
.intro h1 { margin: 5px 0; font-size: 36px; line-height: 1.15; text-shadow: 0 2px 16px #ffffffb0; }
.intro p { color: #2b5360; font-size: 12px; text-shadow: 0 1px 7px white; }
.game { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.scene {
  /* Keep the hut and racer clear above the control at the end of the piste. */
  height: clamp(300px, calc(73.5294svh - 294.118px), 610px);
  min-height: 0;
  background: transparent;
  border-radius: 24px;
}
.start-landscape {
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent), linear-gradient(to bottom, transparent, black 7%, black 85%, transparent);
  mask-composite: intersect;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent), linear-gradient(to bottom, transparent, black 7%, black 85%, transparent);
  -webkit-mask-composite: source-in;
}
.scene-top { top: 15px; }
.hut-branding { position: absolute; inset: 0; z-index: 2; pointer-events: none; user-select: none; }
.hut-branding img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; pointer-events: none; }
.signal-display { top: 65px; right: calc(50% - 190px); }
.scene-bottom { display: none; }
.race-controls {
  position: relative;
  inset: auto;
  height: var(--action-height);
  transform: none;
  margin: 0 auto;
  gap: 0;
}
.race-controls .action { height: var(--action-height); }
.game-controls {
  position: relative;
  margin: 8px 0 0;
  padding: 0 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
.control-hint { color: #365d63; text-shadow: 0 1px 4px #fff; }
.stats { padding: 18px 20px; margin-top: 12px; border: 1px solid #ffffff8c; border-radius: 18px; background: #f6fbfd9c; backdrop-filter: blur(3px); }
.stat-label { color: #456274; }
.stat small { color: #58717e; }
.community-counter { background: #eaf3f19c; border-color: #ffffff8c; backdrop-filter: blur(3px); }
.how-it-works { color: #254b5d; text-shadow: 0 1px 5px white; }
.how-it-works b, .how-it-works i { color: #446c7d; }
.site-footer { color: #36596a; border-color: #ffffff9c; text-shadow: 0 1px 5px white; }
.result-overlay { justify-content: flex-start; padding: 38px 14px 0; border-radius: 24px; background: #ecf5f7da; }
.result-number { line-height: 1.15; }
#result-value { font-size: 82px; }
.result-caption { font-size: 13px; }
.game:is([data-state="result"], [data-state="early"], [data-state="slow"], [data-state="paused"]) .race-controls__label { visibility: hidden; }
@media (max-width: 640px) {
  body { --masthead-height: 52px; --intro-height: 88px; --action-height: 54px; }
  .shell { padding: 0 12px; }
  .intro { padding: 10px 0 14px; }
  .intro h1 { font-size: 27px; margin: 5px 0; }
  .intro p { font-size: 10px; }
  .scene { height: clamp(250px, calc(83.3333svh - 293.333px), 610px); border-radius: 18px; }
  .scene-top { top: 12px; }
  .signal-display { top: 65px; right: 5px; }
  .stats { padding: 15px 14px; }
  .result-overlay { padding-top: 45px; border-radius: 18px; }
  #result-value { font-size: 70px; }
  .result-caption { font-size: 11px; }
}
@media (max-height: 800px) {
  body { --masthead-height: 42px; --intro-height: 48px; }
  .masthead .brand { font-size: 20px; }
  .masthead .brand-icon { width: 28px; height: 28px; border-radius: 9px; }
  .intro { padding: 1px 0 8px; }
  .intro .eyebrow { display: none; }
  .intro h1 { font-size: 25px; margin: 0 0 3px; line-height: 1.1; }
  .intro p { font-size: 9px; line-height: 12px; }
  .scene { height: clamp(260px, calc(73.5294svh - 191.176px), 480px); }
}
@media (max-height: 800px) and (max-width: 640px) {
  .scene { height: clamp(250px, calc(83.3333svh - 210px), 480px); }
}
@media (max-height: 660px) {
  body { --action-height: 48px; }
  .result-overlay { padding-top: 38px; }
  #result-value { font-size: 54px; letter-spacing: -3px; }
  .game[data-state=early] #result-value, .game[data-state=slow] #result-value, .game[data-state=paused] #result-value { font-size: 38px; }
  .result-caption { max-width: 92%; font-size: 10px; }
  .signal-display { top: 54px; }
}
@media (max-height: 520px) and (min-width: 641px) {
  .scene { height: 300px; }
}

/* Center every result within its own field, including the space above the start. */
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat, .stat:first-child { min-width: 0; padding: 0 8px; text-align: center; }
.stat-label { justify-content: center; min-height: 28px; height: auto; line-height: 1.4; }
.stat strong { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.stat small { margin-left: 0; }
.community-counter { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.community-counter > div { width: 100%; }
.community-counter strong { width: 100%; }
.result-overlay { padding: 0; }
.result-summary { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 28px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.result-summary .record-pill { margin-top: 8px; }

/* The additional sponsor stays beneath the game and other promotional panels. */
.sponsor-partner--spela { background: #fffaf4eb; border-color: #e3d6bb; }
@media (min-width: 1280px) {
  .sponsor-partner--spela { grid-row: 9; }
  .advertising--bottom { grid-row: 10; }
}
