* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, #1c2a5e 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #3a1650 0%, transparent 55%),
              linear-gradient(165deg, #0b0e1c 0%, #101632 60%, #0d1226 100%);
  min-height: 100vh; color: #e7eaf6;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-badge { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg,#22d3ee,#e879f9); display:flex; align-items:center; justify-content:center; font-size: 24px; box-shadow: 0 0 18px rgba(34,211,238,.45); }
.logo b { font-size: 22px; letter-spacing: .5px; background: linear-gradient(90deg,#22d3ee,#e879f9); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo small { display: block; color: #9aa3c0; font-size: 12px; }
.lang-switch { font-size: 14px; font-weight: 700; text-decoration: none; color: #c7cdf0; background: #171e3d; border: 1px solid #2c3763; padding: 8px 14px; border-radius: 999px; }
.lang-switch:hover { border-color: #22d3ee; color: #22d3ee; }
.hero { text-align: center; padding: 14px 0 26px; }
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p { color: #9aa3c0; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px; }
.chip { border: 1px solid #2c3763; background: #171e3d; color: #c7cdf0; font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; transition: border-color .12s ease, box-shadow .12s ease; }
.chip:hover { border-color: #22d3ee; }
.chip.active { background: #22d3ee; color: #06121a; border-color: #22d3ee; box-shadow: 0 0 14px rgba(34,211,238,.5); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: #131a35; border: 1px solid #232c52; border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.5), 0 0 16px rgba(34,211,238,.25); }
.card .thumb { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.card .body { padding: 14px 16px 18px; }
.card h2 { font-size: 19px; margin-bottom: 4px; }
.card p { font-size: 13.5px; color: #9aa3c0; line-height: 1.45; }
.card .tag { display: inline-block; margin-top: 10px; font-size: 11.5px; font-weight: 700; color: #22d3ee; background: rgba(34,211,238,.12); padding: 4px 10px; border-radius: 999px; }
.card.soon { opacity: .65; pointer-events: none; }
.card.soon .tag { color: #8a8494; background: rgba(255,255,255,.06); }
.t-purple { background: linear-gradient(135deg,#2e2170,#7c3aed); }
.t-orange { background: linear-gradient(135deg,#7a2e0e,#f97316); }
.t-teal   { background: linear-gradient(135deg,#0c4a42,#14b8a6); }
.t-pink   { background: linear-gradient(135deg,#6d1c48,#ec4899); }
.t-blue   { background: linear-gradient(135deg,#1b3a75,#3b82f6); }
.t-green  { background: linear-gradient(135deg,#1f4d22,#22c55e); }
footer { text-align: center; color: #7d87ad; font-size: 12.5px; margin-top: 40px; line-height: 1.6; }

/* game page */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 16px; flex-wrap: wrap; }
.back { text-decoration: none; color: #c7cdf0; font-weight: 700; font-size: 14.5px; background:#171e3d; border:1px solid #2c3763; padding:7px 13px; border-radius:999px; }
.back:hover { border-color: #22d3ee; color: #22d3ee; }
.game-title { font-size: 22px; }
.game-box { background: #131a35; border: 1px solid #232c52; border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.35); padding: 20px; }
.hint { color: #9aa3c0; font-size: 14px; text-align: center; margin-top: 14px; line-height: 1.5; }
.btn { display: inline-block; border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 16px; color: #06121a; background: linear-gradient(135deg,#22d3ee,#e879f9); padding: 12px 26px; border-radius: 999px; box-shadow: 0 4px 16px rgba(34,211,238,.35); }
.btn:hover { box-shadow: 0 4px 22px rgba(232,121,249,.45); }
.btn.ghost { background: #171e3d; color: #c7cdf0; border: 1px solid #2c3763; box-shadow: none; }
.stat-row { display: flex; gap: 14px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.stat { background: #1a2142; border: 1px solid #262f57; border-radius: 12px; padding: 8px 18px; font-weight: 700; font-size: 15px; color: #c7cdf0; }
.stat b { color: #22d3ee; }
.overlay { position: fixed; inset: 0; background: rgba(5,8,18,.72); display: none; align-items: center; justify-content: center; z-index: 30; padding: 20px; }
.overlay.show { display: flex; }
.overlay .panel { background: #161d3a; border: 1px solid #2c3763; border-radius: 20px; padding: 32px 28px; text-align: center; max-width: 340px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 24px rgba(34,211,238,.15); }
.overlay h2 { font-size: 26px; margin-bottom: 8px; }
.overlay p { color: #9aa3c0; margin-bottom: 20px; font-size: 15px; }

/* dense portal grid (friv/poki style) */
.slim-hero { text-align: center; padding: 4px 0 14px; }
.slim-hero p { color: #9aa3c0; font-size: 14.5px; }
.chips.compact { flex-wrap: wrap; justify-content: center; row-gap: 8px; margin-bottom: 14px; }
.chips.compact .chip { flex: 0 0 auto; }
.portal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 700px) { .portal-grid { grid-template-columns: repeat(8, 1fr); gap: 12px; } }
.tile { display: block; text-decoration: none; color: #e7eaf6; }
.tile .art { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 42px; box-shadow: 0 4px 12px rgba(0,0,0,.4); transition: transform .12s ease, box-shadow .12s ease; overflow: hidden; }
.tile .art.thumb { background-color: #171e3d; background-size: cover; background-position: center; }
@media (max-width: 639px) { .tile .art { font-size: 34px; border-radius: 10px; } }
.tile:hover .art { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 20px rgba(0,0,0,.55), 0 0 18px rgba(34,211,238,.35); }
.tile .cap { font-size: 11.5px; font-weight: 700; text-align: center; margin-top: 5px; line-height: 1.25; color: #c7cdf0; }
.tile.soon .art { filter: saturate(.4); opacity: .7; }
.tile .badge { position: absolute; top: 5px; inset-inline-start: 5px; font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: #22d3ee; color: #06202a; box-shadow: 0 0 10px rgba(34,211,238,.5); }
