@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito+Sans:wght@400;600;700&display=swap');

:root {
  --bg: #0d0f1a;
  --bg2: #141728;
  --card: #1a1e30;
  --card-h: #222740;
  --brd: #2a2f48;
  --neon1: #00f5d4;
  --neon2: #7b61ff;
  --neon3: #fee440;
  --pink: #f15bb5;
  --tx: #eef0ff;
  --tx2: #8b90b0;
  --tx3: #555a78;
  --r: 14px;
  --ff: 'Nunito Sans', sans-serif;
  --fd: 'Baloo 2', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--ff); background: var(--bg); color: var(--tx); line-height: 1.65; }
a { color: var(--neon1); text-decoration: none; }
a:hover { color: #66fce5; }

/* === HEADER === */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(13,15,26,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--brd); padding: 0 20px; }
.hdr-in { max-width: 1060px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { font-family: var(--fd); font-size: 1.35rem; font-weight: 800; background: linear-gradient(135deg, var(--neon1), var(--neon2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-decoration: none; }
.logo span { -webkit-text-fill-color: var(--tx3); color: var(--tx3); font-size: .75rem; font-family: var(--ff); font-weight: 400; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { font-size: .78rem; font-weight: 600; color: var(--tx2); padding: 5px 12px; border-radius: 8px; text-decoration: none; transition: .2s; }
.nav a:hover { color: var(--tx); background: rgba(0,245,212,.06); }
.ham { display: none; background: 0; border: 0; color: var(--tx); font-size: 1.3rem; cursor: pointer; }

/* === HERO === */
.hero { padding: 56px 20px 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(123,97,255,.12) 0%, transparent 70%); pointer-events: none; }
.hero h1 { font-family: var(--fd); font-size: clamp(1.8rem,5vw,3rem); font-weight: 800; line-height: 1.15; margin-bottom: 12px; position: relative; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--neon1), var(--neon3)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: .95rem; color: var(--tx2); max-width: 520px; margin: 0 auto; position: relative; }

/* === CONTAINER === */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.sec { padding: 28px 0 44px; }
.sec-h { font-family: var(--fd); font-size: 1.3rem; font-weight: 700; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.sec-h .bar { width: 4px; height: 22px; border-radius: 2px; background: linear-gradient(180deg, var(--neon1), var(--neon2)); }

/* === GAME GRID === */
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.gcard { background: var(--card); border: 1px solid var(--brd); border-radius: var(--r); overflow: hidden; transition: .25s; text-decoration: none; color: inherit; display: block; position: relative; }
.gcard:hover { border-color: rgba(0,245,212,.3); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,245,212,.08); }
.gcard-preview { height: 200px; background: var(--bg2); display: flex; align-items: center; justify-content: center; font-size: 4rem; overflow: hidden; position: relative; }
.gcard-preview img { width: 100%; height: 100%; object-fit: cover; }
.gcard-bd { padding: 16px; }
.gcard-bd h3 { font-family: var(--fd); font-size: 1.05rem; font-weight: 700; margin-bottom: 3px; }
.gcard-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.gcard-tags span { font-size: .6rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .3px; }
.t-arcade { background: rgba(0,245,212,.1); color: var(--neon1); }
.t-puzzle { background: rgba(123,97,255,.1); color: var(--neon2); }
.t-casual { background: rgba(254,228,64,.1); color: var(--neon3); }
.t-match { background: rgba(241,91,181,.1); color: var(--pink); }
.gcard-bd p { font-size: .82rem; color: var(--tx2); line-height: 1.5; }
.play-badge { position: absolute; top: 12px; right: 12px; background: var(--neon1); color: var(--bg); font-family: var(--fd); font-size: .7rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }

/* === GAME PAGE === */
.game-wrap { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.game-header { padding: 32px 0 16px; }
.game-header .back { font-size: .8rem; color: var(--neon1); text-decoration: none; margin-bottom: 14px; display: inline-block; }
.game-header h1 { font-family: var(--fd); font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.game-header p { color: var(--tx2); font-size: .88rem; margin-bottom: 12px; }
.game-tags-big { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.game-container { background: var(--card); border: 1px solid var(--brd); border-radius: var(--r); overflow: hidden; margin-bottom: 24px; }
.game-canvas { width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: #0a0c18; position: relative; }
.game-canvas canvas { max-width: 100%; max-height: 100%; }
.game-controls { padding: 12px 16px; border-top: 1px solid var(--brd); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctrl-btn { font-family: var(--fd); font-weight: 700; font-size: .78rem; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--brd); background: var(--bg2); color: var(--tx); cursor: pointer; transition: .2s; }
.ctrl-btn:hover { border-color: var(--neon1); color: var(--neon1); }
.ctrl-btn.primary { background: var(--neon1); color: var(--bg); border-color: var(--neon1); }
.ctrl-btn.primary:hover { background: #66fce5; }
.game-score { font-family: var(--fd); font-size: 1rem; font-weight: 700; color: var(--neon3); margin-left: auto; }

.game-desc { padding: 20px 0 40px; }
.game-desc h2 { font-family: var(--fd); font-size: 1.1rem; font-weight: 700; margin: 20px 0 8px; padding-left: 10px; border-left: 3px solid var(--neon1); }
.game-desc p { font-size: .88rem; color: var(--tx2); line-height: 1.7; margin-bottom: 12px; }
.game-desc ul { padding-left: 18px; margin-bottom: 12px; }
.game-desc li { font-size: .86rem; color: var(--tx2); margin-bottom: 4px; }

/* === FOOTER === */
.ft { border-top: 1px solid var(--brd); padding: 28px 20px; text-align: center; }
.ft-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.ft-links a { color: var(--tx3); font-size: .74rem; font-weight: 500; text-decoration: none; }
.ft-links a:hover { color: var(--tx2); }
.ft-copy { color: var(--tx3); font-size: .66rem; }

/* === LEGAL === */
.legal { max-width: 660px; margin: 0 auto; padding: 40px 20px 60px; }
.legal h1 { font-family: var(--fd); font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.legal .dt { color: var(--tx3); font-size: .78rem; margin-bottom: 22px; }
.legal h2 { font-size: .95rem; font-weight: 700; margin: 20px 0 6px; color: var(--tx); }
.legal p, .legal li { font-size: .84rem; color: var(--tx2); line-height: 1.7; margin-bottom: 8px; }
.legal ul { padding-left: 16px; margin-bottom: 12px; }
.legal a { color: var(--neon1); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: rgba(13,15,26,.97); padding: 12px 20px; border-bottom: 1px solid var(--brd); }
  .ham { display: block; }
  .ggrid { grid-template-columns: 1fr; }
}
