/* ==========================================================================
   VoltPlay — sidebar arcade theme
   Layout: fixed left rail (desktop) / top bar + drawer (mobile)
   Visual: flat dark surfaces, 16:9 cover cards, volt-lime accent
   ========================================================================== */

:root {
    --ink: #090c12;
    --ink-2: #0d121c;
    --panel: #121826;
    --panel-2: #172032;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .16);
    --text: #eaf0fa;
    --muted: #8792a6;
    --volt: #c6ff2e;
    --volt-dim: #a9e01f;
    --violet: #7b5cff;
    --cyan: #2ee6ff;
    --pink: #ff3d81;
    --volt-grad: linear-gradient(120deg, #c6ff2e 0%, #7b5cff 100%);
    --rail: 260px;
    --r: 16px;
    --r-sm: 12px;
    --gap: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    --glow: 0 14px 34px rgba(198, 255, 46, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--ink);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app {
    display: grid;
    grid-template-columns: var(--rail) 1fr;
    min-height: 100vh;
}

.content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ink-2);
    border-right: 1px solid var(--line);
}

.sb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sb-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    flex: 0 0 36px;
}

.sb-name {
    font-size: 1.12rem;
    font-weight: 900;
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--volt-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sb-close {
    display: none;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    border-radius: 9px;
    cursor: pointer;
}

.sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sb-link {
    position: relative;
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 700;
    color: var(--muted);
    transition: background .16s, color .16s;
}

.sb-link:hover {
    background: var(--panel);
    color: var(--text);
}

.sb-link.is-active {
    color: var(--volt);
    background: rgba(198, 255, 46, .09);
}

.sb-link.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 3px;
    background: var(--volt);
}

.sb-foot {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
}

.sb-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: .84rem;
}

.sb-foot-links a { color: var(--muted); }
.sb-foot-links a:hover { color: var(--volt); }

.sb-copy {
    margin: 10px 0 0;
    font-size: .74rem;
    color: #5b6577;
}

.sb-mask {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, .68);
    z-index: 999;
}

/* ==========================================================================
   Top bar (mobile only)
   ========================================================================== */

.topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(9, 12, 18, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 120;
}

.menu-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 11px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.menu-btn span {
    width: 19px;
    height: 2px;
    background: var(--volt);
    border-radius: 2px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.topbar-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
    flex: 0 0 30px;
}

.topbar-brand span {
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--volt-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Main / rows
   ========================================================================== */

.main {
    flex: 1;
    width: 100%;
    max-width: 1420px;
    margin: 0 auto;
    padding: 24px 26px 8px;
}

.row {
    margin-bottom: var(--gap);
}

.row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.row-title {
    margin: 0 0 14px;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: .2px;
}

.row-head .row-title { margin: 0; }

.row-title::after {
    content: "";
    display: block;
    width: 30px;
    height: 3px;
    margin-top: 8px;
    border-radius: 3px;
    background: var(--volt-grad);
}

.row-tag {
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.row-tag-new { background: var(--volt); color: var(--ink); }

.row-tag-hot { background: var(--pink); color: #fff; }

/* ==========================================================================
   Hero (featured)
   ========================================================================== */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 28px;
    margin-bottom: var(--gap);
    border-radius: var(--r);
    overflow: hidden;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(198, 255, 46, .22), transparent 55%),
        radial-gradient(120% 160% at 100% 0%, rgba(123, 92, 255, .28), transparent 55%),
        var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-thumb {
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
    border-radius: 22px;
    overflow: hidden;
    background: #05070c;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(198, 255, 46, .18);
}

.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }

.hero-body { min-width: 0; }

.hero-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--volt);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.hero-name {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.15;
}

.hero-desc {
    margin: 0 0 18px;
    max-width: 620px;
    color: var(--muted);
    font-size: .96rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--volt);
    color: var(--ink);
    font-weight: 900;
    padding: 12px 30px;
    border-radius: 999px;
    box-shadow: 0 10px 26px rgba(198, 255, 46, .3);
    transition: transform .15s, box-shadow .15s;
}

.hero-play:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(198, 255, 46, .44); }

/* ==========================================================================
   Category tiles
   ========================================================================== */

.cats {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    margin-bottom: var(--gap);
}

.cat-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--panel-2);
    border: 1px solid var(--line);
    transition: transform .16s, box-shadow .16s;
}

.cat-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .38));
}

.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--glow); }

.cat-tile-name {
    position: relative;
    z-index: 1;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}

.cat-tile:nth-child(6n+1) { background: linear-gradient(150deg, #7b5cff, #2b1c6e); }
.cat-tile:nth-child(6n+2) { background: linear-gradient(150deg, #2ee6ff, #0b5b6e); }
.cat-tile:nth-child(6n+3) { background: linear-gradient(150deg, #ff3d81, #6e1036); }
.cat-tile:nth-child(6n+4) { background: linear-gradient(150deg, #c6ff2e, #486b00); }
.cat-tile:nth-child(6n+5) { background: linear-gradient(150deg, #ffb02e, #6e4400); }
.cat-tile:nth-child(6n+6) { background: linear-gradient(150deg, #37e39b, #0a5a3c); }

/* ==========================================================================
   Game grid (16:9 covers)
   ========================================================================== */

.game-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(5, 1fr);
}

.game-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(198, 255, 46, .6);
    box-shadow: var(--glow);
}

.game-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #05070c;
    overflow: hidden;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.game-card:hover .game-thumb img { transform: scale(1.07); }

.play-dot {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--volt);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
}

.game-card:hover .play-dot { opacity: 1; transform: translateY(0); }

.game-name {
    padding: 9px 11px 10px;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Category list page banner
   ========================================================================== */

.cat-hero {
    margin-bottom: var(--gap);
    padding: 26px 28px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background:
        radial-gradient(120% 180% at 100% 0%, rgba(46, 230, 255, .18), transparent 55%),
        radial-gradient(120% 180% at 0% 0%, rgba(198, 255, 46, .16), transparent 55%),
        var(--panel);
    box-shadow: var(--shadow);
}

.crumb {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0 0 12px;
    font-size: .82rem;
    color: var(--muted);
}

.crumb li + li::before {
    content: "/";
    margin-right: 8px;
    color: var(--line-2);
}

.crumb a { color: var(--volt); font-weight: 700; }

.cat-hero-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.15;
}

.cat-hero-desc {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Detail page
   ========================================================================== */

.detail-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px;
    margin-bottom: var(--gap);
    border-radius: var(--r);
    border: 1px solid var(--line);
    background:
        radial-gradient(120% 180% at 0% 0%, rgba(123, 92, 255, .24), transparent 55%),
        var(--panel);
    box-shadow: var(--shadow);
}

.detail-cover {
    width: 190px;
    height: 190px;
    flex: 0 0 190px;
    border-radius: 24px;
    overflow: hidden;
    background: #05070c;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(198, 255, 46, .16);
}

.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { min-width: 0; }

.detail-name {
    margin: 0 0 14px;
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.15;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.chip {
    background: rgba(198, 255, 46, .1);
    border: 1px solid var(--line);
    color: var(--volt);
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 999px;
}

.detail-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--volt);
    color: var(--ink);
    font-weight: 900;
    padding: 12px 32px;
    border-radius: 999px;
    box-shadow: 0 10px 26px rgba(198, 255, 46, .3);
    transition: transform .15s, box-shadow .15s;
}

.detail-play:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(198, 255, 46, .44); }

.detail-desc { color: #c2ccdb; font-size: .96rem; }

/* ==========================================================================
   Static docs
   ========================================================================== */

.doc {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 28px 30px;
    box-shadow: var(--shadow);
}

.doc h1 { margin-top: 0; }

.doc h2 {
    font-size: 1.1rem;
    margin: 22px 0 8px;
    color: var(--volt);
}

.doc p { margin: 8px 0; color: #c2ccdb; }

/* ==========================================================================
   SEO block
   ========================================================================== */

.seo-block p {
    margin: 0;
    color: var(--muted);
    font-size: .94rem;
    max-width: 900px;
}

/* ==========================================================================
   Ad boxes
   ========================================================================== */

.adbox {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--gap);
    background: var(--panel);
    border: 1px dashed var(--line-2);
    border-radius: var(--r);
    overflow: hidden;
}

.adbox-sm { margin-top: 0; }
.adbox-slim { min-height: 64px; }

.game-ad.in-grid {
    grid-column: 1 / -1;
    min-height: 90px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border: 1px dashed var(--line-2);
    border-radius: var(--r-sm);
    overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    margin-top: auto;
    padding: 22px 26px;
    border-top: 1px solid var(--line);
}

.footer p {
    margin: 0;
    font-size: .8rem;
    color: #5b6577;
}

/* ==========================================================================
   Play page
   ========================================================================== */

.play-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.play-bar {
    position: sticky;
    top: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(9, 12, 18, .95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.play-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    font-size: .9rem;
    color: var(--text);
    padding: 8px 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    transition: border-color .16s, color .16s;
}

.play-home:hover { border-color: var(--volt); color: var(--volt); }

.play-bar-spacer { width: 96px; }

.play-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 900;
    min-width: 0;
}

.play-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
    flex: 0 0 30px;
}

.play-brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--volt-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.play-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 26px;
}

.stage {
    border-radius: var(--r);
    overflow: hidden;
    background: #05070c;
    border: 1px solid var(--line-2);
    box-shadow: 0 0 60px rgba(123, 92, 255, .18), 0 18px 40px rgba(0, 0, 0, .5);
    margin-bottom: var(--gap);
}

.stage-frame {
    width: 100%;
    height: 76vh;
    min-height: 420px;
    display: block;
    border: 0;
}

.play-seo {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 22px 24px;
}

.play-seo p { margin: 0; color: var(--muted); font-size: .94rem; }

/* ==========================================================================
   Back to top
   ========================================================================== */

.back-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--volt);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(198, 255, 46, .38);
    transition: transform .15s;
}

.back-top-btn:hover { transform: translateY(-2px); }

/* ==========================================================================
   Tablet (769px ~ 1024px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    :root { --rail: 218px; }
    .main { padding: 20px 18px 8px; }
    .game-grid { grid-template-columns: repeat(4, 1fr); }
    .cats { grid-template-columns: repeat(6, 1fr); }
    .hero-name { font-size: 1.7rem; }
    .stage-frame { height: 64vh; }
}

/* ==========================================================================
   Mobile (<=768px)
   ========================================================================== */

@media (max-width: 768px) {
    .app { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform .28s ease;
        z-index: 1000;
        box-shadow: 8px 0 30px rgba(0, 0, 0, .5);
        border-right: 0;
    }

    .sidebar.open { transform: translateX(0); }

    .sb-close { display: block; }

    .sb-mask { display: none; }
    .sb-mask.show { display: block; }

    .topbar { display: flex; }

    .main { padding: 16px 14px 6px; }

    .hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
    .hero-thumb { width: 128px; height: 128px; flex-basis: 128px; }
    .hero-name { font-size: 1.5rem; }
    .hero-play { width: 100%; justify-content: center; }

    .cats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cat-tile-name { font-size: .78rem; }

    .game-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .game-name { font-size: .76rem; padding: 8px 8px 9px; }

    .row-title { font-size: 1.06rem; }

    .cat-hero { padding: 20px; }
    .cat-hero-title { font-size: 1.5rem; }

    .detail-hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
    .detail-cover { width: 132px; height: 132px; flex-basis: 132px; }
    .detail-name { font-size: 1.45rem; }
    .detail-play { width: 100%; justify-content: center; }

    .doc { padding: 20px; }

    .adbox { min-height: 80px; }

    .play-bar { padding: 8px 12px; }
    .play-bar-spacer { width: 76px; }
    .play-home span { display: none; }
    .play-main { padding: 12px 12px 20px; }
    .stage-frame { height: 54vh; min-height: 340px; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}