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

:root {
  --bg: #0a0a0f;
  --card: #12121a;
  --accent: #ff4d4d;
  --accent2: #ff8c42;
  --text: #f0f0f0;
  --muted: #666;
  --border: #1e1e2e;
}

html {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  background: var(--bg);
  scroll-behavior: smooth;
}
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); }

/* ── Header ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 20px;
  height: 52px;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.tagline {
  font-size: 0.72rem;
  color: var(--muted);
  display: none;
}

@media (min-width: 500px) { .tagline { display: block; } }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: #aaa; }

/* ── Game Slides ── */
#feed { display: flex; flex-direction: column; }

.game-slide {
  scroll-snap-align: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 58px 16px 8px;
  gap: 5px;
  position: relative;
  background: var(--bg);
  overflow: hidden;
  box-sizing: border-box;
}

/* Subtle gradient separator between slides */
.game-slide::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.game-header {
  text-align: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.game-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}

.game-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
}

canvas {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d0d14;
  display: block;
  touch-action: none;
  box-shadow: 0 0 30px rgba(255,77,77,0.06);
  /* size set by fixCanvasSizes() in JS */
}

canvas:focus-visible { outline: 2px solid var(--accent); }

.game-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  flex-shrink: 0;
}

.highscore {
  font-size: 0.78rem;
  color: #ffd700;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 12px rgba(255,77,77,0.3);
  animation: pulse-btn 2.5s infinite;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); animation: none; }
.btn:active { transform: translateY(0); }

/* Pulse animation to invite click */
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 2px 12px rgba(255,77,77,0.3); }
  50% { box-shadow: 0 2px 22px rgba(255,77,77,0.55); }
}

/* After start: no pulse */
.btn.started { animation: none; }

/* ── Scroll Hint ── */
#scroll-hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s;
}

#scroll-hint span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.chevron {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  animation: chevron-bounce 1.5s infinite;
}

@keyframes chevron-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(4px); opacity: 1; }
}

/* ── Ad Slide ── */
.ad-slide {
  scroll-snap-align: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #0c0c12;
}

.ad-slide::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.ad-label {
  font-size: 0.65rem;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.ad-box {
  width: 320px;
  height: 250px;
  background: #111118;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2a3a;
  border-radius: 10px;
  font-size: 0.78rem;
}

.ad-continue {
  font-size: 0.7rem;
  color: #2a2a3a;
  letter-spacing: 0.5px;
}

/* ── Cookie Banner ── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(12,12,18,0.98);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  backdrop-filter: blur(10px);
}

#cookie-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #666;
}

#cookie-inner a { color: var(--accent); text-decoration: none; }
#cookie-btns { display: flex; gap: 8px; margin-left: auto; }

#cookie-deny {
  background: transparent;
  border: 1px solid #2a2a3a;
  color: #555;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
#cookie-deny:hover { border-color: #444; color: #888; }

#cookie-accept {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Controls are now inside canvas preview — no external element needed */
.game-controls { display: none; }

/* Countdown state on button */
.btn:disabled {
  animation: none;
  background: linear-gradient(135deg, #333, #444);
  box-shadow: none;
  cursor: default;
  font-size: 1.1rem;
  font-weight: 900;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .game-title { font-size: 1.1rem; }
  .btn { padding: 7px 18px; font-size: 0.82rem; }
}
