/* Prefixed (--ysd-*) for the same reason as games/lawn-man/styles.css:
   these can't collide with the main WordPress theme's own :root custom
   properties if this stylesheet is ever loaded alongside it. Values are
   pulled from the site's real Neon Frost V3 tokens (frost-cyan/script-red/
   star-gold) rather than an arbitrary one-off palette, since this game is
   thematically about ice/snow and the real tokens fit directly. The
   tropical-island *game* art (sky/sand/ocean themes, flavor colors) is
   drawn on canvas in src/render/ and is untouched by any of this — this
   file is chrome only: HUD, buttons, overlays, fonts. */
:root {
  --ysd-black: #05070d;
  --ysd-black-soft: #0b0f1a;
  --ysd-ice-white: #eaf7ff;
  --ysd-frost-cyan: #5ad8ff;
  --ysd-frost-cyan-deep: #1a8fc9;
  --ysd-script-red: #ff2d3d;
  --ysd-star-gold: #ffd84a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

.ysd-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--ysd-black);
  color: var(--ysd-ice-white);
  font-family: 'Nunito', sans-serif;
}

/* Retro arcade-cabinet frame, matching Lawn Man's cabinet chrome so both
   arcade games feel like the same machine. */
.ysd-cabinet {
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: linear-gradient(180deg, #0d1420, #05070d);
  border: 3px solid var(--ysd-frost-cyan);
  border-radius: 16px;
  padding: 20px clamp(14px, 3vw, 28px) 24px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ysd-frost-cyan) 25%, transparent),
    0 0 28px color-mix(in srgb, var(--ysd-frost-cyan) 22%, transparent),
    0 0 20px color-mix(in srgb, var(--ysd-star-gold) 12%, transparent),
    inset 0 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ysd-bolt {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f2f2f2, #8a8a8a 55%, #333 100%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}
.ysd-bolt--tl { top: 10px; left: 10px; }
.ysd-bolt--tr { top: 10px; right: 10px; }
.ysd-bolt--bl { bottom: 10px; left: 10px; }
.ysd-bolt--br { bottom: 10px; right: 10px; }

.ysd-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.75rem, 2.3vw, 1.05rem);
  color: var(--ysd-frost-cyan);
  text-align: center;
  margin: 0;
  text-shadow: 0 0 10px rgba(90, 216, 255, 0.5);
}

/* Fixed 960x600 logical canvas, uniformly scaled + letterboxed via CSS
   aspect-ratio (same technique as Lawn Man's #lm-stage). Input.js reads
   getBoundingClientRect() to map pointer coords back into that logical
   space, so this can be sized however CSS likes. */
.ysd-stage {
  position: relative;
  width: min(100%, 960px);
  max-height: 78vh;
  aspect-ratio: 960 / 600;
  margin: 0 auto;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.ysd-instructions {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  color: rgba(234, 247, 255, 0.6);
  text-align: center;
  max-width: 520px;
}

/* ---------- HUD ---------- */
.ysd-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 5;
}

.ysd-hud-box {
  background: rgba(5, 10, 20, 0.72);
  border: 2px solid var(--ysd-frost-cyan);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--ysd-ice-white);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  line-height: 1.9;
  box-shadow: 0 0 12px rgba(90, 216, 255, 0.3);
  pointer-events: auto;
}
.ysd-hud-box b { color: var(--ysd-star-gold); }
/* Right-margin reserves room for the mute button (top-right, appended by
   Audio.js), which would otherwise sit on top of "Pause". */
.ysd-hud-box--right { text-align: right; margin-right: 42px; }
.ysd-hud-sub { opacity: 0.7; font-size: 8px; }

.ysd-hud-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--ysd-ice-white);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.ysd-hud-link:hover { color: var(--ysd-star-gold); }

.ysd-combo-text {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: 'Bangers', cursive;
  font-size: 34px;
  letter-spacing: 0.02em;
  color: var(--ysd-star-gold);
  text-shadow: 0 0 12px var(--ysd-script-red), 0 0 4px #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
}

/* Power-up / boss banners — new chrome the prototype didn't have. Stacked
   just under the HUD, centered, only one is ever visible at a time in
   practice but both can coexist without overlapping the HUD boxes. */
.ysd-banner {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(60%, 360px);
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 5;
}
.ysd-banner--visible { opacity: 1; }
.ysd-banner--power {
  top: 52px;
  background: rgba(5, 10, 20, 0.8);
  border: 2px solid var(--ysd-star-gold);
  color: var(--ysd-star-gold);
  box-shadow: 0 0 12px rgba(255, 216, 74, 0.35);
}
.ysd-banner--boss {
  top: 86px;
  background: rgba(20, 5, 8, 0.82);
  border: 2px solid var(--ysd-script-red);
  color: var(--ysd-ice-white);
  box-shadow: 0 0 12px rgba(255, 45, 61, 0.4);
}

.ysd-next-preview {
  position: absolute;
  bottom: 12px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 10, 20, 0.72);
  border: 2px solid var(--ysd-frost-cyan);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ysd-ice-white);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  z-index: 5;
}

.ysd-swap-btn {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 5;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--ysd-ice-white);
  background: rgba(5, 10, 20, 0.8);
  border: 2px solid var(--ysd-frost-cyan);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.ysd-swap-btn:hover { border-color: var(--ysd-star-gold); color: var(--ysd-star-gold); }

.ysd-mute-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid var(--ysd-frost-cyan);
  border-radius: 6px;
  color: var(--ysd-ice-white);
  cursor: pointer;
  padding: 0;
}
.ysd-mute-btn:hover { border-color: var(--ysd-star-gold); }

/* ---------- Overlays ---------- */
/* position: fixed (not absolute), same reasoning as Lawn Man's overlays:
   .ysd-stage is aspect-ratio-clamped and overflow:hidden, so on a short
   mobile viewport an absolutely-positioned overlay confined to it would
   get its content clipped. Fixed escapes that without affecting the
   stage's own layout size. */
.ysd-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 13, 0.86);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.hidden { display: none !important; }

.ysd-overlay--start {
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0.72) 55%, rgba(5, 7, 13, 0.92) 100%),
    url('assets/start-hero-bg.jpeg') center/cover no-repeat;
}

.ysd-overlay-card {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ysd-start-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: 0.03em;
  color: var(--ysd-frost-cyan);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(90, 216, 255, 0.5);
  margin: 0 0 16px;
  line-height: 1.15;
}

.ysd-overlay-heading {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  color: var(--ysd-script-red);
  text-shadow: 0 0 12px rgba(255, 45, 61, 0.5);
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}
.ysd-overlay-heading--win { color: var(--ysd-star-gold); text-shadow: 0 0 12px rgba(255, 216, 74, 0.5); }

.ysd-body {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--ysd-ice-white);
  line-height: 1.55;
  margin: 0 0 18px;
}

.ysd-stats {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--ysd-frost-cyan);
  line-height: 1.8;
  margin: 0 0 20px;
}

.ysd-ad-logo {
  max-width: min(78vw, 380px);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(90, 216, 255, 0.45));
  margin-bottom: 10px;
}

.ysd-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.ysd-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.6rem, 1.7vw, 0.75rem);
  color: var(--ysd-black);
  border: none;
  border-radius: 8px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 0.05s ease-out, filter 0.1s ease-out;
}
.ysd-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ysd-btn:active { transform: translateY(1px); }

.ysd-btn--primary {
  background: var(--ysd-frost-cyan);
  box-shadow: 0 4px 0 var(--ysd-frost-cyan-deep), 0 0 16px rgba(90, 216, 255, 0.5);
}
.ysd-btn--secondary {
  color: var(--ysd-ice-white);
  background: var(--ysd-script-red);
  box-shadow: 0 4px 0 #a3151f, 0 0 16px rgba(255, 45, 61, 0.4);
}
