.ski-main {
  max-width: 760px;
}

/* ---------- HUD ---------- */

.ski-hud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.9rem;
}

.ski-hud .stat {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.ski-hud .stat b {
  font-variant-numeric: tabular-nums;
}

.ski-hud .stat.best {
  border-color: var(--pick-border);
  background: var(--pick-bg);
}

/* "Flow" combo chip — warm gold, shown only while a combo is active */
.ski-hud .stat.combo {
  border-color: #ffcf66;
  background: linear-gradient(180deg, #fff7e6, #ffeec2);
}
/* Deeper amber than the old #d98a1f, which only hit 2.6:1 on the cream chip;
   the label likewise needs its own warm brown — the default var(--muted)
   lavender only manages 3.9:1 against cream. */
.ski-hud .stat.combo b { color: #9a5c00; }
.ski-hud .stat.combo .stat-label { color: #7d5f22; }
.ski-hud .stat.combo.hidden { display: none; }

/* The chip's cream is a fixed colour, so in dark mode it kept the inherited
   near-white var(--ink) text — 1.1:1, i.e. blank. Give it a dark-gold face
   instead of a glowing cream one. */
html.dark .ski-hud .stat.combo {
  border-color: #c9963d;
  background: linear-gradient(180deg, #4a3410, #3a2809);
}
html.dark .ski-hud .stat.combo b { color: #ffd27a; }
html.dark .ski-hud .stat.combo .stat-label { color: #e8c98a; }

/* collection strip — the icons you've gathered this run, kept at the bottom */
.ski-collection {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 7px;
  max-width: 720px;
  margin: 0.7rem auto 0;
  min-height: 1.7rem;
  font-size: 1.15rem;
  line-height: 1;
}
.ski-collection span { animation: collGet 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.28); }
@keyframes collGet {
  0%   { transform: scale(0.2); opacity: 0; }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}

#sound-pill {
  margin-left: auto;
}

#sound-pill input {
  display: none;
}

/* ---------- Slope ---------- */

.ski-wrap {
  position: relative;
}

#slope {
  display: block;
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fafcff;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: crosshair;
}

.ski-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(3px);
  border-radius: 20px;
  transition: opacity 0.2s ease;
}

/* The panel is white in both themes but its text is var(--ink)/var(--muted),
   which go pale in dark — the title was rendering at 1.2:1, i.e. invisible. The
   panel has to darken along with them. */
html.dark .ski-overlay {
  background: rgba(48, 22, 44, 0.9);
}

.ski-overlay.hidden,
.yeti-warning.hidden,
.ski-toast.hidden {
  display: none;
}

.ski-overlay h2 {
  margin: 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink);
}

.ski-overlay p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  max-width: 32ch;
}

.ski-overlay button {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.6rem 1.6rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}

.ski-overlay button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.yeti-warning {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--card);
  border: 2px solid #e74e4e;
  color: #c43c3c;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  animation: yeti-pulse 0.7s ease-in-out infinite;
  pointer-events: none;
}

/* var(--card) goes dark eggplant in dark mode, leaving the dark red at 2.7:1 —
   bad for anything, worse for the one element that's meant to alarm you. */
html.dark .yeti-warning {
  border-color: #ff6b6b;
  color: #ff8a8a;
}

@keyframes yeti-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.ski-toast {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Touch controls ---------- */

.touch-controls {
  display: none;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
}

.touch-btn {
  width: 64px;
  height: 56px;
  font-size: 1.3rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--btn);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.touch-btn:active {
  background: var(--pick-bg);
  border-color: var(--pick-border);
}

.touch-btn.boost {
  border-color: var(--accent);
}

/* ---------- How to play ---------- */

.how-to {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem 1.4rem 1.1rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}

.how-to h2 {
  margin: 0 0 0.6rem;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.how-to ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.how-to li {
  margin-bottom: 0.35rem;
}

.how-to b {
  color: var(--ink);
}
