/* GameMax.io — dark arcade UI */
:root {
  --bg: #08080d;
  --bg-2: #0c0c14;
  --surface: #12121c;
  --surface-2: #191926;
  --surface-3: #21212f;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5fa;
  --muted: #9b9bb2;
  --muted-2: #6e6e85;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff4d6d;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1220px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
::selection { background: var(--accent); color: #fff; }

.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.section { padding: 84px 0; }
.section-sm { padding: 56px 0; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 8, 13, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 72px; display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.04em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #4b32c4);
  box-shadow: 0 6px 22px rgba(124, 92, 255, 0.42); font-size: 17px;
}
.brand span em { font-style: normal; color: var(--accent-2); }
.main-nav { display: flex; align-items: center; gap: 26px; margin-left: 12px; }
.main-nav a {
  color: var(--muted); font-size: 14px; font-weight: 600; transition: color .18s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; height: 40px; width: 218px;
}
.header-search svg { flex: none; color: var(--muted-2); }
.header-search input {
  background: none; border: 0; outline: none; color: var(--text); width: 100%; font-size: 13px;
}
.header-search input::placeholder { color: var(--muted-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: transform .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 26px rgba(124, 92, 255, 0.3); }
.btn-primary:hover { background: #8d71ff; }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }

.nav-toggle { display: none; }
#nav-check { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 92px 0 76px; }
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 780px;
  background:
    radial-gradient(600px 380px at 18% 18%, rgba(124, 92, 255, 0.24), transparent 70%),
    radial-gradient(520px 340px at 82% 12%, rgba(0, 212, 255, 0.14), transparent 70%),
    radial-gradient(420px 300px at 60% 70%, rgba(255, 77, 109, 0.1), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin-bottom: 22px;
  border: 1px solid rgba(124, 92, 255, 0.36); border-radius: 999px;
  background: rgba(124, 92, 255, 0.1); color: #c6b8ff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #b9a6ff; box-shadow: 0 0 0 4px rgba(124,92,255,.2); }
.hero h1 {
  margin: 0 0 20px; font-size: clamp(42px, 5.4vw, 72px); line-height: 1.04; letter-spacing: -0.055em; font-weight: 850;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #a992ff 5%, #6fe6ff 55%, #ff8aa8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 0 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 38px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.04em; line-height: 1.1; }
.stat span { color: var(--muted-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

.hero-visual { position: relative; }
.hero-card {
  position: relative; border-radius: 24px; border: 1px solid var(--border-strong); overflow: hidden;
  background: linear-gradient(160deg, #1c1830, #101018 62%); box-shadow: var(--shadow);
  transform: rotate(1.4deg);
}
.hero-card-top { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.03); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #3a3a4c; }
.hero-card-body { padding: 22px; }
.hero-game {
  aspect-ratio: 16 / 10; border-radius: 15px; display: grid; place-items: center; position: relative;
  background:
    radial-gradient(300px 200px at 30% 20%, rgba(124,92,255,.55), transparent 70%),
    radial-gradient(260px 200px at 78% 80%, rgba(0,212,255,.35), transparent 70%),
    #151523;
  border: 1px solid rgba(255,255,255,.08);
}
.hero-game-icon { font-size: 96px; filter: drop-shadow(0 14px 30px rgba(0,0,0,.5)); }
.hero-play {
  position: absolute; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px);
}
.hero-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.hero-meta h3 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.hero-meta p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.float-chip {
  position: absolute; z-index: 2; background: rgba(20, 20, 31, 0.92); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; backdrop-filter: blur(10px);
}
.float-chip.one { top: 40px; left: -34px; }
.float-chip.two { right: -22px; bottom: 58px; }
.float-chip .ico { font-size: 18px; }

/* ---------- section heading ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -0.045em; line-height: 1.15; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 620px; }
.text-link { color: #b9a6ff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.text-link:hover { color: #d5caff; }

/* ---------- categories ---------- */
.bg-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  position: relative; padding: 24px; min-height: 172px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .2s, border-color .2s, background .2s;
}
.cat-card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.cat-card::after {
  content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -55px; bottom: -75px;
  background: var(--cat-color); opacity: .13; filter: blur(26px);
}
.cat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 23px; background: color-mix(in srgb, var(--cat-color) 18%, transparent); border: 1px solid color-mix(in srgb, var(--cat-color) 34%, transparent); }
.cat-card h3 { margin: 18px 0 5px; font-size: 17px; letter-spacing: -0.02em; }
.cat-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; position: relative; z-index: 1; }
.cat-count { position: absolute; top: 22px; right: 22px; color: var(--muted-2); font-size: 12px; font-weight: 700; }

/* ---------- game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.game-card {
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; transition: transform .22s, border-color .22s, box-shadow .22s;
  display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--card-accent) 45%, transparent); box-shadow: 0 20px 45px rgba(0,0,0,.35); }
.card-thumb {
  aspect-ratio: 16 / 10; position: relative; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(190px 130px at 24% 18%, color-mix(in srgb, var(--card-accent) 55%, transparent), transparent 72%),
    radial-gradient(180px 140px at 82% 82%, color-mix(in srgb, var(--card-accent) 24%, transparent), transparent 72%),
    #161622;
}
.card-thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 24px 24px;
}
.card-icon { font-size: 64px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.45)); transition: transform .25s; z-index: 1; }
.game-card:hover .card-icon { transform: scale(1.12) rotate(-4deg); }
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 4px 9px; border-radius: 7px;
  background: rgba(8,8,13,.72); border: 1px solid rgba(255,255,255,.14); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.card-rating {
  position: absolute; top: 12px; right: 12px; z-index: 2; padding: 4px 9px; border-radius: 7px;
  background: rgba(8,8,13,.72); border: 1px solid rgba(255,255,255,.14); font-size: 11px; font-weight: 800;
}
.card-body { padding: 16px 17px 18px; display: flex; flex-direction: column; flex: 1; }
.card-cat { color: var(--card-accent); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.card-body h3 { margin: 6px 0 6px; font-size: 16.5px; letter-spacing: -0.02em; }
.card-body p { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.55; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 13px; }
.card-plays { color: var(--muted-2); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.card-play {
  display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 12px; font-weight: 800;
  background: color-mix(in srgb, var(--card-accent) 22%, transparent); border: 1px solid color-mix(in srgb, var(--card-accent) 45%, transparent);
  padding: 6px 11px; border-radius: 8px; transition: background .18s;
}
.game-card:hover .card-play { background: var(--card-accent); }

/* filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 9px 17px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .18s;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-hint { margin-left: auto; align-self: center; color: var(--muted-2); font-size: 12.5px; }

/* ranking */
.rank-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rank-item {
  display: flex; align-items: center; gap: 15px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 13px; padding: 13px 16px; transition: background .18s, border-color .18s;
}
.rank-item:hover { background: var(--surface-2); border-color: var(--border-strong); }
.rank-num { font-size: 22px; font-weight: 850; letter-spacing: -0.05em; color: var(--muted-2); min-width: 34px; }
.rank-item:first-child .rank-num { color: var(--accent-2); }
.rank-ico { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; font-size: 25px; background: var(--surface-3); }
.rank-info { flex: 1; min-width: 0; }
.rank-info b { display: block; font-size: 14.5px; }
.rank-info span { color: var(--muted); font-size: 12px; }

/* ---------- why / feature strip ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 28px; }
.feature-ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(124,92,255,.14); border: 1px solid rgba(124,92,255,.3); display: grid; place-items: center; font-size: 21px; }
.feature h3 { margin: 18px 0 8px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- CTA ---------- */
.cta-panel {
  border-radius: 24px; padding: 54px; text-align: center; position: relative; overflow: hidden;
  border: 1px solid rgba(124,92,255,.3);
  background: radial-gradient(600px 300px at 50% 0%, rgba(124,92,255,.2), transparent 70%), var(--surface);
}
.cta-panel h2 { margin: 0 0 12px; font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -0.045em; }
.cta-panel p { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  padding: 20px 44px 20px 0; cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; color: var(--accent-2); font-size: 22px; font-weight: 400; top: 17px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 44px 22px 0; color: var(--muted); font-size: 14.5px; }

/* ---------- game detail ---------- */
.crumbs { padding: 26px 0 0; color: var(--muted-2); font-size: 12.5px; }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 8px; opacity: .5; }
.detail-hero { padding: 30px 0 48px; }
.detail-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 30px; align-items: start; }
.play-stage {
  border-radius: 20px; border: 1px solid var(--border-strong); overflow: hidden; background: #101019; box-shadow: var(--shadow);
}
.stage-bar { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.025); }
.stage-bar b { font-size: 13px; }
.stage-bar span { color: var(--muted); font-size: 12px; }
.stage-screen {
  aspect-ratio: 16 / 10; display: grid; place-items: center; text-align: center; position: relative;
  background: radial-gradient(340px 240px at 30% 25%, color-mix(in srgb, var(--card-accent) 42%, transparent), transparent 72%), radial-gradient(300px 220px at 78% 80%, rgba(0,212,255,.2), transparent 70%), #141420;
}
.stage-icon { font-size: 110px; filter: drop-shadow(0 16px 28px rgba(0,0,0,.5)); }
.stage-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,8,13,.55); backdrop-filter: blur(2px); }
.stage-overlay-inner { display: grid; place-items: center; gap: 14px; }
.detail-info h1 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.05em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag { padding: 5px 11px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.detail-desc { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.metric b { display: block; font-size: 18px; }
.metric span { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.how-box { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.how-box h2 { margin: 0 0 16px; font-size: 19px; }
.how-box ol { margin: 0; padding-left: 0; list-style: none; counter-reset: steps; }
.how-box li { counter-increment: steps; display: flex; gap: 12px; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.how-box li:last-child { margin-bottom: 0; }
.how-box li::before {
  content: counter(steps); flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(124,92,255,.16); border: 1px solid rgba(124,92,255,.32); color: #c6b8ff; font-size: 11px; font-weight: 800;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; margin-bottom: 48px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; max-width: 330px; margin: 16px 0 0; }
.footer-col h4 { margin: 0 0 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
.footer-col a { display: block; color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.footer-col a:hover { color: #c6b8ff; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted-2); font-size: 12.5px; }

/* ---------- legal / static pages ---------- */
.prose { max-width: 800px; }
.prose h1 { font-size: clamp(34px, 4vw, 48px); letter-spacing: -0.045em; margin: 0 0 12px; }
.prose h2 { font-size: 23px; margin: 36px 0 12px; letter-spacing: -0.03em; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--muted); font-size: 14.5px; }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0; }
.prose li { margin-bottom: 8px; }
.updated { color: var(--muted-2); font-size: 12.5px; margin-bottom: 28px; }

/* ---------- quick play modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 4, 8, .78); backdrop-filter: blur(8px);
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  width: min(100%, 620px); border-radius: 20px; border: 1px solid var(--border-strong);
  background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.modal-metrics { display: flex; gap: 18px; padding: 14px 20px; color: var(--muted); font-size: 13px; }
.modal-metrics b { color: var(--text); }
.qp-stage { position: relative; height: 300px; margin: 0 20px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; background: radial-gradient(300px 200px at 50% 50%, rgba(124,92,255,.18), transparent 70%), #0e0e17; }
.qp-idle { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.qp-target {
  position: absolute; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #a992ff, #6d4aff); box-shadow: 0 0 0 8px rgba(124,92,255,.16), 0 12px 30px rgba(124,92,255,.45);
  animation: qp-pop .18s ease-out;
}
@keyframes qp-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-foot { padding: 16px 20px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.modal-foot small { color: var(--muted-2); font-size: 11.5px; max-width: 330px; }

/* ---------- playable game area ---------- */
.play-full { border: 1px solid var(--border-strong); border-radius: 18px; overflow: hidden; background: #101019; box-shadow: var(--shadow); }
.play-full-head { display: flex; justify-content: space-between; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.03); font-size: 13px; }
.play-full-head span { color: var(--muted); font-size: 11.5px; }
.play-full-body { min-height: 420px; padding: 20px; background: radial-gradient(500px 300px at 50% 0%, rgba(124,92,255,.1), transparent 70%), #101019; }
.play-full-body .gm-area { min-height: 350px; }
.play-full-body .gm-canvas { max-width: 100%; }
.gm-stage { display: block; overflow: auto; }
.gm-idle { height: 100%; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.gm-wrap { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.gm-hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid var(--border); font-size: 12px; }
.gm-hud b { letter-spacing: -.01em; }
.gm-score { color: var(--accent-2); font-weight: 800; }
.gm-tip { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.gm-area { position: relative; flex: 1; min-height: 260px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.gm-grid { display: grid; gap: 4px; width: 100%; }
.gm-cell { min-height: 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .12s; }
.gm-cell:hover { background: var(--surface-3); }
.gm-cell.blank { background: transparent; border-color: transparent; }
.gm-cell.filled, .gm-cell.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.gm-cell.wall { background: #08080d; border-color: #08080d; }
.gm-cell.target { box-shadow: inset 0 0 0 2px #00d4ff; }
.gm-cell.box, .gm-cell.player { font-size: 15px; }
.gm-cell.floor { background: var(--surface-2); }
.gm-cell.exit { background: rgba(61,220,151,.28); border-color: #3ddc97; }
.gm-cell.hit { background: #ff4d6d; }
.gm-cell.miss::after { content: "×"; color: var(--muted); }
.gm-grid.gm-tight .gm-cell { min-height: 34px; }
.gm-grid.g2048 .gm-cell { min-height: 48px; font-size: 18px; background: var(--surface-2); border-color: var(--border); }
.gm-grid.g2048 .v2{background:#2c2c3a}.gm-grid.g2048 .v4{background:#3a3a50}.gm-grid.g2048 .v8{background:#7c5cff;color:#fff}.gm-grid.g2048 .v16{background:#00a8cc;color:#fff}.gm-grid.g2048 .v32{background:#3ddc97;color:#08110d}.gm-grid.g2048 .v64{background:#ffb020;color:#1a1200}.gm-grid.g2048 .v128,.gm-grid.g2048 .v256,.gm-grid.g2048 .v512{background:#ff4d6d;color:#fff;font-size:14px}
.gm-grid.gm-sudoku .gm-cell { min-height: 30px; font-size: 13px; }
.gm-grid.gm-sudoku .given { color: var(--muted); background: var(--surface); }
.gm-grid.gm-sudoku .sel { box-shadow: inset 0 0 0 2px var(--accent); }
.gm-grid.gm-snake .gm-cell { min-height: 15px; border-radius: 2px; background: #11111b; }
.gm-grid.gm-snake .body { background: #7c5cff; }
.gm-grid.gm-snake .head { background: #b9a6ff; }
.gm-grid.gm-snake .food { background: #ff4d6d; }
.gm-grid.gm-maze .gm-cell { min-height: 22px; border-radius: 2px; }
.gm-grid.gm-connect .gm-cell { min-height: 34px; border-radius: 50%; background: #101019; }
.gm-grid.gm-connect .p1 { background: #ff4d6d; }
.gm-grid.gm-connect .p2 { background: #ffb020; }
.gm-grid.gm-reversi .gm-cell, .gm-grid.gm-gomoku .gm-cell { min-height: 32px; border-radius: 50%; background: #171725; }
.gm-grid .p1 { background: #1b1b28; box-shadow: inset 0 0 0 2px #f5f5fa; }
.gm-grid .p2 { background: #f5f5fa; }
.gm-grid.gm-bubbles .gm-cell { min-height: 32px; border-radius: 50%; border-width: 2px; }
.gm-btn { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 8px 13px; font-size: 12px; font-weight: 700; cursor: pointer; }
.gm-btn:hover { background: var(--accent); border-color: var(--accent); }
.gm-btn:disabled { opacity: .4; cursor: default; }
.gm-pad { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gm-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.gm-swatch.sel { border-color: #fff; }
.gm-over { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(8,8,13,.82); border-radius: 12px; text-align: center; }
.gm-over h3 { margin: 0 0 14px; font-size: 18px; }
.gm-canvas { width: 100%; max-width: 640px; height: auto; background: #101019; border: 1px solid var(--border); border-radius: 10px; }
.gm-bigcard { font-size: 34px; text-align: center; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.gm-message { color: var(--muted); font-size: 13px; text-align: center; line-height: 1.8; }
.gm-word { font-size: 26px; letter-spacing: .18em; text-align: center; font-weight: 800; }
.gm-letter { min-width: 30px; }
.gm-input { width: 100%; max-width: 320px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); outline: none; }
.gm-passage { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 440px; margin: 0 auto; }
.gm-wordrow { display: flex; gap: 5px; justify-content: center; margin-bottom: 5px; }
.gm-letterbox { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--border-strong); font-weight: 800; }
.gm-letterbox.ok { background: #3ddc97; color: #08110d; }
.gm-letterbox.near { background: #ffb020; color: #1a1200; }
.gm-react { width: 100%; max-width: 420px; min-height: 130px; border: 1px solid var(--border-strong); border-radius: 14px; font-size: 20px; font-weight: 800; cursor: pointer; }
.gm-react.wait { background: #ff4d6d; color: #fff; }
.gm-react.go { background: #3ddc97; color: #08110d; }
.gm-react.idle { background: var(--surface-2); }
.gm-piece { font-size: 24px; min-height: 48px !important; }
.gm-hanoi { display: flex; gap: 12px; justify-content: center; align-items: flex-end; }
.gm-peg { flex: 1; max-width: 130px; min-height: 190px; display: flex; flex-direction: column-reverse; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 12px 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.gm-peg.sel { border-color: var(--accent); }
.gm-disks { display: flex; flex-direction: column-reverse; align-items: center; gap: 3px; }
.gm-disks i { display: block; height: 20px; border-radius: 5px; background: #7c5cff; }
.gm-disks .d1{background:#3ddc97}.gm-disks .d2{background:#00d4ff}.gm-disks .d3{background:#ff4d6d}
.gm-track { display: flex; gap: 3px; flex-wrap: wrap; }
.gm-trackcell { flex: 1; min-width: 22px; min-height: 26px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; font-size: 9px; color: var(--muted-2); }
.gm-trackcell.me { background: var(--accent); color: #fff; }
.gm-trackcell.rival { background: #ff4d6d; color: #fff; }
.gm-pot { position: relative; height: 60px; font-size: 34px; text-align: center; transition: left .05s; }
.gm-jegi { position: absolute; font-size: 34px; background: none; border: 0; cursor: pointer; }
.gm-pit { min-height: 46px !important; font-size: 18px; }
.gm-codes, .gm-words { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gm-coderow { display: flex; gap: 5px; align-items: center; }
.gm-codepeg { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); }
.gm-codepeg.pick { cursor: pointer; }
.gm-feedback { color: var(--muted); font-size: 11px; margin-left: 8px; }
.gm-lane { position: relative; height: 90px; border-bottom: 2px solid var(--border-strong); }
.gm-jack, .gm-boule { position: absolute; bottom: 4px; font-size: 26px; transform: translateX(-50%); }
.gm-jack { left: 50%; }
.gm-carrom { position: relative; height: 200px; border: 2px solid var(--border-strong); border-radius: 12px; background: #101019; }
.gm-carromdisc, .gm-striker { position: absolute; font-size: 20px; transform: translate(-50%,-50%); }

/* ---------- library / discover / embedded play ---------- */
.lib-hero { padding: 54px 0 40px; border-bottom: 1px solid var(--border); background: radial-gradient(700px 320px at 80% -10%, rgba(0,212,255,.12), transparent 65%), radial-gradient(600px 300px at 10% 0%, rgba(124,92,255,.14), transparent 65%); }
.lib-hero h1 { font-size: clamp(34px, 4.6vw, 58px); letter-spacing: -.05em; margin: 12px 0 14px; }
.lib-hero p { color: var(--muted); font-size: 17px; max-width: 720px; line-height: 1.6; }
.lib-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 26px; }
.lib-stats div { display: flex; flex-direction: column; }
.lib-stats b { font-size: 26px; letter-spacing: -.03em; }
.lib-stats span { font-size: 12px; color: var(--muted); }

.lib-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.lib-search { flex: 1 1 300px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.lib-search svg { flex: none; color: var(--muted); }
.lib-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.lib-select { padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 14px; outline: 0; }
.lib-count { color: var(--muted); font-size: 13px; white-space: nowrap; }

.lib-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.lib-card { display: block; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); transition: transform .2s, border-color .2s, box-shadow .2s; }
.lib-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.lib-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #1a1a26, #101018); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.lib-card:hover .lib-thumb img { transform: scale(1.06); }
.lib-thumb .lib-badge { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(8,8,13,.82); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .03em; backdrop-filter: blur(6px); }
.lib-thumb .lib-rate { position: absolute; right: 8px; top: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(8,8,13,.82); color: #ffd166; font-size: 10px; font-weight: 700; }
.lib-body { padding: 12px 13px 14px; }
.lib-body h3 { font-size: 13.5px; line-height: 1.35; margin: 0 0 6px; min-height: 37px; }
.lib-body .lib-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.lib-body .lib-play { color: var(--accent, #00d4ff); font-weight: 700; }

.lib-more { display: flex; justify-content: center; margin-top: 34px; }
.lib-empty { text-align: center; color: var(--muted); padding: 60px 0; }

.discover-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.discover-tile { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); transition: transform .2s, border-color .2s; }
.discover-tile:hover { transform: translateY(-4px); border-color: var(--cat-color); }
.discover-tile .d-ico { font-size: 34px; }
.discover-tile h3 { margin: 0 0 3px; font-size: 17px; }
.discover-tile span { color: var(--muted); font-size: 12px; }

.play-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0a0a10; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-strong); }
.play-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; }
.play-fallback .pf-ico { font-size: 60px; }
.play-fallback p { color: var(--muted); max-width: 420px; }
.play-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.attribution { margin-top: 16px; font-size: 12px; color: var(--muted-2); }
.attribution a { color: var(--muted); text-decoration: underline; }

@media (max-width: 1200px) { .lib-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .lib-grid { grid-template-columns: repeat(3, 1fr); } .discover-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } .discover-tiles { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .cat-grid, .game-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { gap: 34px; }
  .float-chip.one { left: -10px; }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-search { width: 180px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; margin-inline: auto; width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; order: -1;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 17px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s;
  }
  .nav-toggle span::before { transform: translateY(-5px); }
  .nav-toggle span::after { transform: translateY(3px); }
  #nav-check { display: none; }
  #nav-check:checked ~ .header-inner .main-nav {
    display: flex; position: absolute; top: 72px; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
  }
  #nav-check:checked ~ .header-inner .main-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .container { width: min(100% - 32px, var(--max)); }
  .section { padding: 60px 0; }
  .cat-grid, .game-grid, .feature-grid, .rank-list { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 60px 0 52px; }
  .hero-lead { font-size: 16px; }
  .hero-stats { gap: 24px; }
  .stat b { font-size: 22px; }
  .header-search { display: none; }
  .cta-panel { padding: 38px 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .float-chip.one { left: -6px; top: 24px; }
  .float-chip.two { right: -6px; bottom: 32px; }
  .card-icon { font-size: 52px; }
  .filter-hint { display: none; }
}
@media (max-width: 480px) {
  .cat-grid, .game-grid, .feature-grid, .rank-list { grid-template-columns: 1fr; }
  .cat-card { min-height: 140px; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .hero-cta .btn { flex: 1; }
  .card-icon { font-size: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
