/* Prefixed (--lm-*) so these can never collide with the main WordPress
   theme's own :root custom properties if this stylesheet is ever loaded
   alongside it (e.g. by a CSS-combining cache/optimization plugin). Without
   the prefix, --black and --ice-white here had the same names as — but
   different values than — the main theme's own --black/--ice-white, which
   is exactly the kind of silent, selector-free leak that's hard to spot. */
:root {
  --lm-black: #050508;
  --lm-ice-white: #e8f8ff;
  --lm-neon-cyan: #00d4e0;
  --lm-neon-pink: #e0009e;
  --lm-neon-yellow: #e8d800;
}

* {
  box-sizing: border-box;
}

/* Deliberately just a layout reset (no color/font here) — html/body is the
   one selector every page on the site shares, so anything themed belongs on
   .lm-page below instead, scoped to this game's own markup. */
html, body {
  margin: 0;
  height: 100%;
}

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

/* Retro arcade-cabinet frame around the whole game. Tinted per season via
   --cabinet-accent/--cabinet-accent-2 (set in main.js from
   season.palette.cabinetGlow/cabinetGlowSecondary once a season is picked)
   — defaults to the original cyan here, so Summer's look is untouched
   until/unless a season explicitly overrides it. */
.lm-cabinet {
  --cabinet-accent: var(--lm-neon-cyan);
  --cabinet-accent-2: var(--lm-neon-cyan);
  position: relative;
  width: 100%;
  max-width: 1000px;
  background: linear-gradient(180deg, #0d0d1a, #050508);
  border: 3px solid var(--cabinet-accent);
  border-radius: 16px;
  padding: 20px clamp(14px, 3vw, 28px) 24px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cabinet-accent) 25%, transparent),
    0 0 28px color-mix(in srgb, var(--cabinet-accent) 22%, transparent),
    0 0 20px color-mix(in srgb, var(--cabinet-accent-2) 18%, transparent),
    inset 0 0 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lm-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);
}

.lm-bolt--tl { top: 10px; left: 10px; }
.lm-bolt--tr { top: 10px; right: 10px; }
.lm-bolt--bl { bottom: 10px; left: 10px; }
.lm-bolt--br { bottom: 10px; right: 10px; }

.lm-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.8rem, 2.5vw, 1.1rem);
  color: var(--lm-neon-cyan);
  text-align: center;
  margin: 0;
  text-shadow: 0 0 10px rgba(0, 212, 224, 0.5);
}

/* The stage is what Game.js measures/fits the canvas into. Its own
   background is what shows as the letterbox bars when the world aspect
   ratio doesn't exactly match the viewport. */
.lm-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;
}

#lm-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.lm-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(--lm-neon-cyan);
  border-radius: 6px;
  color: var(--lm-ice-white);
  cursor: pointer;
  padding: 0;
}

.lm-mute-btn:hover {
  border-color: var(--lm-neon-yellow);
}

.lm-joystick-base {
  position: absolute;
  width: 110px;
  height: 110px;
  margin-left: -55px;
  margin-top: -55px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 224, 0.16), rgba(0, 212, 224, 0.04) 70%);
  border: 2px solid rgba(0, 212, 224, 0.55);
  box-shadow: 0 0 14px rgba(0, 212, 224, 0.3);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.lm-joystick-base--active {
  opacity: 1;
}

.lm-joystick-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top: -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85), rgba(0, 212, 224, 0.55) 75%);
  border: 2px solid var(--lm-neon-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 224, 0.5);
}

/* Applied only on release, so the "spring back to center" eases — dragging
   itself stays instant/1:1 with the finger (see Input.js). */
.lm-joystick-thumb--release {
  transition: transform 0.18s ease-out;
}

.lm-instructions {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  color: rgba(232, 248, 255, 0.6);
  text-align: center;
  max-width: 500px;
}

/* position: fixed (not absolute) is deliberate: this overlay is appended
   into #lm-stage (see SeasonSelect.js), but .lm-stage is capped at
   max-height:78vh with aspect-ratio 960/600 and overflow:hidden for canvas
   letterboxing — on a narrow phone that box is only ~240px tall, and an
   absolutely-positioned overlay confined to it gets its centered content
   clipped top and bottom. Fixed positioning escapes that ancestor's
   overflow:hidden and sizes against the real viewport instead, without
   touching .lm-stage's own box (Game.js measures that box for the canvas,
   and fixed children never affect a parent's layout size). */
.lm-season-select {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: calc(6% + env(safe-area-inset-top)) 6% calc(6% + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--lm-black);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lm-season-select-heading {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  color: var(--lm-neon-yellow);
  letter-spacing: 0.03em;
  margin: 0;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.lm-season-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.lm-season-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.5rem, 1.6vw, 0.65rem);
  line-height: 1.4;
  color: var(--lm-ice-white);
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--lm-neon-cyan);
  border-radius: 10px;
  padding: 18px 10px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 212, 224, 0.25);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, border-color 0.08s ease-out;
}

.lm-season-btn-icon {
  font-size: 2rem;
  line-height: 1;
}

.lm-season-btn:hover {
  border-color: var(--lm-neon-yellow);
  box-shadow: 0 0 16px rgba(232, 216, 0, 0.4);
  transform: translateY(-2px);
}

.lm-season-btn:active {
  transform: translateY(1px);
}

/* position: fixed for the same reason as .lm-season-select above — this
   overlay is appended into the aspect-ratio-clipped #lm-stage, and fixed
   positioning is what lets it cover the real viewport instead. */
.lm-start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(6% + env(safe-area-inset-top)) 6% calc(3% + env(safe-area-inset-bottom));
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lm-start-logo {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 8vw, 3.6rem);
  letter-spacing: 0.04em;
  margin: 0;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.lm-start-logo-a { color: var(--lm-neon-pink); }
.lm-start-logo-b { color: var(--lm-neon-yellow); }

.lm-start-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.5rem, 1.6vw, 0.65rem);
  color: var(--lm-neon-cyan);
  letter-spacing: 0.15em;
  margin: 10px 0 0;
}

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

.lm-start-highlight {
  color: var(--lm-neon-yellow);
  font-weight: 700;
}

.lm-start-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  color: #ffffff;
  background: var(--lm-neon-pink);
  border: none;
  border-radius: 8px;
  padding: 16px 26px;
  margin-top: 22px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 0 16px rgba(224, 0, 158, 0.5);
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
}

.lm-start-btn:hover {
  filter: brightness(1.1);
}

.lm-start-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 0 16px rgba(224, 0, 158, 0.5);
}

.lm-start-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  color: rgba(232, 248, 255, 0.45);
  margin-top: auto;
  margin-bottom: 2px;
}

/* position: fixed for the same reason as the other overlays above. */
.lm-win-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 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;
}

.lm-win-card {
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  background: var(--lm-black);
  border: 2px solid var(--lm-neon-cyan);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(0, 212, 224, 0.3);
  padding: 28px 24px;
}

.lm-win-heading {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--lm-neon-yellow);
  letter-spacing: 0.03em;
  margin: 0 0 14px;
}

.lm-win-stats {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--lm-neon-cyan);
  line-height: 1.8;
  margin: 0 0 16px;
}

.lm-win-ad-body {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--lm-ice-white);
  line-height: 1.5;
  margin: 0 0 10px;
}

.lm-win-address {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--lm-neon-pink);
  margin: 0 0 22px;
}

.lm-play-again-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--lm-black);
  background: var(--lm-neon-cyan);
  border: none;
  border-radius: 6px;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 212, 224, 0.45);
}

.lm-play-again-btn:hover {
  background: var(--lm-neon-yellow);
}
