/* ═══════════════════════════════════════════════════════════════════════════
   Ollin Smash — Styles v2.0
   Extracted from monolithic index.html as part of modularisation.
   All selectors are prefixed with #os-* or .os-* to avoid collisions
   with Love Arcade's global stylesheet.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Root ─────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --os-crimson: #DC2626;
  --os-violet:  #7C3AED;
  --os-gold:    #FACC15;
  --os-cyan:    #06B6D4;
  --os-dark:    #07000F;
  --os-darker:  #030007;
  --os-text:    #F0E8FF;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--os-darker);
  font-family: 'Exo 2', sans-serif;
  color: var(--os-text);
  touch-action: none;
}

/* Aztec grid overlay — purely decorative, pointer-events off */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(124,58,237,0.05) 0,
      rgba(124,58,237,0.05) 1px,
      transparent 1px,
      transparent 24px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(220,38,38,0.04) 0,
      rgba(220,38,38,0.04) 1px,
      transparent 1px,
      transparent 24px
    );
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

#os-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Canvas scales to fill the viewport while preserving 390:700 aspect ratio */
#os-canvas {
  display: block;
  max-height: 100vh;
  max-width: calc(100vh * 390 / 700);
  width: 100%;
  height: auto;
  position: relative;
  z-index: 2;
}

/* ── Back Button ──────────────────────────────────────────────────────────── */

#os-back {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 10px));
  left: max(12px, env(safe-area-inset-left, 12px));
  z-index: 30;
  background: transparent;
  border: 1px solid rgba(220,38,38,0.4);
  color: rgba(220,38,38,0.7);
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#os-back:hover {
  color: var(--os-crimson);
  border-color: var(--os-crimson);
  box-shadow: 0 0 10px rgba(220,38,38,0.3);
}

/* ── HUD ──────────────────────────────────────────────────────────────────── */

#os-hud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(390px, calc(100vh * 390 / 700));
  height: min(700px, 100vh);
  pointer-events: none;
  z-index: 5;
  display: none;
}
#os-hud.active { display: block; }

.os-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* top: 48px deja espacio al botón HUB (~28px alto + margen);
     lateral: 22px evita que los marcadores queden pegados al borde */
  padding: 48px 22px 0;
  font-family: 'Share Tech Mono', monospace;
}

.os-hud-col {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(240,232,255,0.45);
  line-height: 1.8;
}
.os-hud-col span {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--os-text);
}
.os-hud-col .gold { color: var(--os-gold); }

.os-lives-row {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
}
.os-life-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--os-crimson);
  box-shadow: 0 0 8px rgba(220,38,38,0.8);
}
.os-life-dot.empty {
  background: rgba(220,38,38,0.15);
  box-shadow: none;
}

#os-mult-badge {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--os-gold);
  text-shadow: 0 0 12px var(--os-gold);
  transition: opacity 0.3s;
}

/* ── Power-Up Pills ───────────────────────────────────────────────────────── */

#os-pu-bar {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}
#os-pu-bar.active { display: flex; }

.os-pu-pill {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(3,0,7,0.85);
  border: 1px solid rgba(250,204,21,0.35);
  padding: 3px 7px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  color: var(--os-gold);
  letter-spacing: 1px;
}
.os-pu-pill.on { display: flex; }
.os-pu-pill svg { flex-shrink: 0; }

/* ── Wave Label ───────────────────────────────────────────────────────────── */

#os-wave-lbl {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(124,58,237,0.45);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

/* ── Overlay Base ─────────────────────────────────────────────────────────── */

.os-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: rgba(3,0,7,0.92);
}
.os-overlay.hidden { display: none; }

/* ── Menu Screen ──────────────────────────────────────────────────────────── */

.os-logo-eye {
  font-size: 10px;
  letter-spacing: 5px;
  color: rgba(124,58,237,0.7);
  text-transform: uppercase;
}
.os-logo-main {
  font-size: 52px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 3px;
  text-align: center;
  background: linear-gradient(150deg, var(--os-crimson) 30%, var(--os-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.os-logo-tag {
  font-size: 10px;
  letter-spacing: 6px;
  color: var(--os-gold);
  text-transform: uppercase;
  margin-top: 6px;
}

.os-rule {
  width: 180px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--os-crimson),
    var(--os-violet),
    transparent
  );
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.os-btn {
  background: transparent;
  border: 1px solid var(--os-crimson);
  color: var(--os-crimson);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 12px 36px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.18s, box-shadow 0.18s;
}
.os-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--os-crimson);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s;
  z-index: -1;
}
.os-btn:hover,
.os-btn:active {
  color: #000;
  box-shadow: 0 0 24px rgba(220,38,38,0.5);
}
.os-btn:hover::before,
.os-btn:active::before {
  transform: scaleX(1);
}

.os-btn-sm {
  border-color: rgba(124,58,237,0.6);
  color: rgba(124,58,237,0.8);
  font-size: 10px;
  letter-spacing: 3px;
  padding: 8px 22px;
}
.os-btn-sm::before { background: var(--os-violet); }
.os-btn-sm:hover {
  color: #fff;
  box-shadow: 0 0 18px rgba(124,58,237,0.4);
}

.os-hs-line {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: rgba(240,232,255,0.3);
  letter-spacing: 2px;
}

.os-standalone-notice {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(124,58,237,0.6);
  text-align: center;
  border: 1px solid rgba(124,58,237,0.25);
  padding: 6px 14px;
  display: none;
}
.os-standalone-notice.visible { display: block; }

/* ── Pause Button (HUD) ───────────────────────────────────────────────────── */

#os-btn-pause {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 10px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 30;
  /* reset pointer-events blocked by #os-hud */
  pointer-events: auto;
  background: transparent;
  border: 1px solid rgba(124,58,237,0.45);
  color: rgba(124,58,237,0.75);
  width: 32px;
  height: 28px;
  display: none;           /* shown only when PLAYING or PAUSED */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
  padding: 0;
}
#os-btn-pause:hover,
#os-btn-pause:active {
  color: var(--os-violet);
  border-color: var(--os-violet);
  box-shadow: 0 0 10px rgba(124,58,237,0.4);
}
#os-btn-pause.visible { display: flex; }

/* When paused, show "play" triangle instead of pause bars */
#os-btn-pause.is-paused svg rect {
  display: none;
}
#os-btn-pause.is-paused::after {
  content: '▶';
  font-size: 11px;
  line-height: 1;
  color: currentColor;
}



#os-paused.os-overlay {
  background: rgba(3,0,7,0.75);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--os-violet);
  text-shadow: 0 0 30px rgba(124,58,237,0.6);
  gap: 16px;
}
#os-paused .os-pause-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(124,58,237,0.5);
}

/* ── Game Over Screen ─────────────────────────────────────────────────────── */

.os-go-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--os-crimson);
  text-shadow: 0 0 40px rgba(220,38,38,0.7);
}
.os-go-stats {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  text-align: center;
  line-height: 2.2;
  color: rgba(240,232,255,0.55);
  letter-spacing: 2px;
}
.os-go-stats strong {
  color: var(--os-gold);
  font-size: 18px;
  display: block;
  letter-spacing: 0;
}

/* ── Wave Transition Flash ────────────────────────────────────────────────── */

#os-wave-flash {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--os-gold);
  text-shadow: 0 0 30px var(--os-gold);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#os-wave-flash.show { opacity: 1; }
