/* ============================================================
   TWEESIEE NET — shared styles
   SYNTHWAVE / OUTRUN aesthetic:
   neon sunset, perspective grid floor, pink + cyan glow
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Orbitron:wght@600;800&display=swap');

:root {
  --bg:        #0d0221;
  --bg-2:      #1a0b2e;
  --pink:      #ff3caf;
  --hot:       #ff2975;
  --cyan:      #00eaff;
  --purple:    #b14aed;
  --amber:     #ffd319;
  --orange:    #ff901f;
  --text:      #f3e6ff;
  --muted:     #9a86c9;

  --pixel:  'Press Start 2P', monospace;
  --display:'Orbitron', sans-serif;
  --term:   'VT323', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  min-height: 100vh;
  font-family: var(--term);
  color: var(--text);
  background:
    radial-gradient(130% 85% at 50% 60%, rgba(255,41,117,0.22), transparent 55%),
    radial-gradient(90% 60% at 50% 60%, rgba(177,74,237,0.18), transparent 60%),
    linear-gradient(to bottom, #0d0221 0%, #1a0b2e 45%, #2a0e44 58%, #150626 70%, #0d0221 100%);
  overflow-x: hidden;
  position: relative;
}

/* ---------- scrolling perspective grid floor ---------- */
.synthgrid {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 42vh;
  z-index: 0;
  perspective: 260px;
  overflow: hidden;
  pointer-events: none;
}
.synthgrid::before {
  content: "";
  position: absolute;
  bottom: 0; top: -40%;
  left: -60%; width: 220%;
  background-image:
    linear-gradient(to right,  rgba(0,234,255,0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,60,175,0.55) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: rotateX(72deg);
  transform-origin: bottom center;
  animation: gridmove 1.6s linear infinite;
}
.synthgrid::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, transparent 0%, rgba(13,2,33,0.2) 55%, var(--bg) 92%);
}
@keyframes gridmove {
  from { background-position: 0 0; }
  to   { background-position: 0 44px; }
}

/* subtle scanlines + vignette */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.12) 3px 4px);
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.5) 100%);
}

/* ---------- layout ---------- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
}

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.25rem;
  position: relative; z-index: 2;
}
.brand {
  font-family: var(--pixel);
  font-size: 0.85rem; letter-spacing: 1px;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan), 0 0 16px rgba(0,234,255,0.6);
  text-decoration: none;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  font-family: var(--term); font-size: 1.5rem;
  color: var(--muted); text-decoration: none;
  transition: color .15s, text-shadow .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--pink);
  text-shadow: 0 0 8px var(--pink);
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 2.5rem 0 2.5rem; position: relative; z-index: 1; }

/* the neon sun */
.sun {
  width: 200px; height: 200px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  position: relative;
  background: linear-gradient(to bottom, var(--amber) 0%, var(--orange) 42%, var(--hot) 100%);
  box-shadow: 0 0 50px rgba(255,41,117,0.65), 0 0 110px rgba(255,144,31,0.45);
}
.sun::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-linear-gradient(to bottom,
    transparent 0 13px, var(--bg) 13px 18px);
  -webkit-mask: linear-gradient(to bottom, transparent 48%, #000 48%);
          mask: linear-gradient(to bottom, transparent 48%, #000 48%);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 4.2rem);
  letter-spacing: 2px;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #ffd6f5 38%, var(--pink) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255,60,175,0.7)) drop-shadow(0 2px 2px rgba(0,234,255,0.4));
  animation: flicker 5s infinite;
}
.hero .tagline {
  font-size: 1.7rem; color: var(--muted);
  margin-top: 1.25rem; letter-spacing: 2px;
}
.coin {
  display: inline-block; margin-top: 2rem;
  font-family: var(--pixel); font-size: 0.8rem;
  color: var(--cyan); text-shadow: 0 0 10px var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes flicker {
  0%,100%,92%,94%,97% { opacity: 1; }
  93% { opacity: 0.55; }
  96% { opacity: 0.8; }
}

/* ---------- game grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.card {
  position: relative;
  border: 2px solid rgba(0,234,255,0.4);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(177,74,237,0.14), rgba(0,234,255,0.06));
  backdrop-filter: blur(2px);
  padding: 1.75rem 1.5rem;
  text-decoration: none; color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--pink);
  box-shadow: 0 0 22px rgba(255,60,175,0.45), inset 0 0 22px rgba(255,60,175,0.1);
}
.card.soon { border-color: rgba(154,134,201,0.35); cursor: default; }
.card.soon:hover { transform: none; box-shadow: none; border-color: rgba(154,134,201,0.35); }
.card .icon { font-size: 3rem; line-height: 1; filter: drop-shadow(0 0 8px rgba(0,234,255,0.5)); }
.card h3 {
  font-family: var(--pixel); font-size: 0.85rem;
  margin: 1rem 0 0.6rem; color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,234,255,0.5);
}
.card p { font-size: 1.3rem; color: var(--muted); }
.badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-family: var(--pixel); font-size: 0.5rem;
  padding: 0.35rem 0.55rem; color: var(--bg);
  background: var(--pink); border-radius: 3px;
  box-shadow: 0 0 12px rgba(255,60,175,0.7);
}
.badge.gray { background: var(--muted); box-shadow: none; }

/* ---------- section heading ---------- */
.sec-title {
  font-family: var(--pixel); font-size: 1rem;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255,60,175,0.7);
  margin-bottom: 0.5rem;
}

/* ---------- footer ---------- */
.foot {
  text-align: center; font-size: 1.3rem;
  color: var(--muted); padding: 2rem 1rem;
  position: relative; z-index: 1;
}

/* ============================================================
   GAME PAGE
   ============================================================ */
.game-stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.5rem; margin-top: 1rem;
}
.scoreboard {
  display: flex; gap: 3rem;
  font-family: var(--pixel); font-size: 0.85rem;
}
.scoreboard .label { color: var(--muted); font-size: 0.6rem; display: block; margin-bottom: 0.5rem; }
.scoreboard .val-score { color: var(--cyan);  text-shadow: 0 0 8px var(--cyan); }
.scoreboard .val-best  { color: var(--amber); text-shadow: 0 0 8px var(--amber); }

.board-frame {
  position: relative; padding: 14px;
  border: 3px solid var(--pink);
  border-radius: 6px;
  box-shadow: 0 0 26px rgba(255,60,175,0.45), inset 0 0 26px rgba(255,60,175,0.1);
  background: #0a0418;
}
canvas { display: block; image-rendering: pixelated; background: #0a0418; border-radius: 2px; }

.overlay {
  position: absolute; inset: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 1rem;
  background: rgba(10,4,24,0.88); backdrop-filter: blur(3px);
}
.overlay.hidden { display: none; }
.overlay h2 {
  font-family: var(--pixel); font-size: 1.4rem;
  color: var(--pink); text-shadow: 0 0 14px var(--pink);
}
.overlay p { font-size: 1.5rem; color: var(--text); }

.btn {
  font-family: var(--pixel); font-size: 0.8rem;
  color: var(--bg);
  background: linear-gradient(180deg, var(--cyan), #00b4d8);
  border: none; border-radius: 4px;
  padding: 0.9rem 1.4rem; cursor: pointer;
  transition: transform .1s, box-shadow .15s;
}
.btn:hover { box-shadow: 0 0 18px var(--cyan); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.controls-hint {
  font-size: 1.3rem; color: var(--muted);
  text-align: center; max-width: 440px;
}
.controls-hint kbd {
  font-family: var(--term); font-size: 1.15rem;
  color: var(--cyan); border: 1px solid var(--muted);
  border-radius: 3px; padding: 1px 7px; margin: 0 2px;
}

/* touch d-pad */
.dpad {
  display: none;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 6px; margin-top: 0.5rem;
}
.dpad button {
  font-size: 1.6rem; font-family: var(--term);
  color: var(--cyan);
  background: rgba(0,234,255,0.08);
  border: 2px solid rgba(0,234,255,0.4);
  border-radius: 4px; cursor: pointer;
}
.dpad button:active { background: rgba(0,234,255,0.28); }
.dpad .up { grid-area: 1/2; } .dpad .left { grid-area: 2/1; }
.dpad .right { grid-area: 2/3; } .dpad .down { grid-area: 3/2; }
.dpad .fire {
  grid-area: 3/2; color: var(--pink);
  border-color: rgba(255,60,175,0.5);
  background: rgba(255,60,175,0.1);
}
.dpad .fire:active { background: rgba(255,60,175,0.3); }

@media (hover: none) and (pointer: coarse) {
  .dpad { display: grid; }
  .controls-hint .keys { display: none; }
}
