/* ═══════════════════════════════════════════════════════════════════
   Number Merge Shooter — Game Page Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:     #05060f;
  --cyan:   #00d4ff;
  --border: rgba(255,255,255,0.08);
  --text:   #f0f4ff;
  --text-2: #6b7280;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* no page scroll — game is fullscreen */
}

/* ── Layout ─────────────────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
}

.game-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,6,15,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}


.game-title {
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text);
  flex: 1;
}

.header-right { margin-left: auto; }

.platform-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px; padding: 4px 10px;
}

.game-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Subtle radial glow behind canvas */
  background: radial-gradient(ellipse 600px 500px at 50% 50%, rgba(0,212,255,0.04), transparent 70%), var(--bg);
}

.canvas-wrapper {
  position: relative;
  line-height: 0; /* kill inline-block gap */
}

#gameCanvas {
  display: block;
  /* Internal resolution is 800×600; JS sets width/height attributes.
     CSS width/height control visual size (responsive scaling). */
  image-rendering: crisp-edges;
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 4px;
  box-shadow:
    0 0 0   1px rgba(0,212,255,0.06),
    0 0 40px    rgba(0,212,255,0.08),
    0 20px 60px rgba(0,0,0,0.6);
  /* Focus outline */
  outline: none;
  cursor: default;
}
#gameCanvas:focus-visible {
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.3), 0 20px 60px rgba(0,0,0,0.6);
}

.canvas-focus-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: opacity 0.3s;
  border-radius: 4px;
  user-select: none;
}

.game-footer {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  background: rgba(5,6,15,0.9);
}

.footer-controls {
  display: flex;
  gap: 24px;
  font-size: 0.75rem;
  color: var(--text-2);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  font-family: inherit;
  font-size: 0.75em;
  color: var(--text);
}

/* ── Embed mode (?embed=1) — hides chrome, game fills the frame ── */
.embed-mode body { overflow: hidden; background: #000; }
.embed-mode .game-header,
.embed-mode .game-footer { display: none; }
.embed-mode .game-main {
  height: 100vh;
  background: #000;
}
.embed-mode #gameCanvas {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── Mobile overrides ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .game-footer { display: none; } /* controls are on-canvas for touch */
  .game-title  { font-size: 0.78rem; }
}

@media (max-height: 500px) {
  .game-header { height: 44px; }
}
