:root {
    --bg-body: #0c0618;
    --bg-surface: #16102e;
    --bg-item: #1f1640;
    --text-primary: #f0eaff;
    --text-secondary: #a99bc9;
    --text-muted: #6e6094;
    --accent: #00e5ff;
    --accent-hover: #5ef0ff;
    --accent-warm: #ff3cac;
    --border-glow: rgba(0, 229, 255, 0.2);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 28px rgba(0, 229, 255, 0.18);
    --header-gradient: linear-gradient(135deg, #1a0d3a 0%, #2a1260 50%, #150a30 100%);
}

body {
    background-color: var(--bg-body);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(123, 47, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 229, 255, 0.08) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

.site-header {
    background: var(--header-gradient);
    border-bottom: 1px solid var(--border-glow);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    padding: 16px 0;
    margin-bottom: 24px;
}

.site-header .site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.site-header .site-title:hover {
    color: var(--accent);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 32px;
    color: var(--text-primary);
    position: relative;
    padding-left: 14px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-warm));
    box-shadow: 0 0 8px var(--accent);
}

.main {
    margin-bottom: 48px;
}

.box {
    background: var(--bg-surface);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 48px 32px 56px;
    box-shadow: var(--shadow-card);
}

.item {
    display: flex;
    flex-direction: column;
    background: var(--bg-item);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
}

a:hover .item {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
}

.item .game-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
}

.item .game-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
    margin-top: 10px;
    word-break: break-word;
    line-height: 1.3;
}

.item .desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

#game-list a,
.more-games a {
    display: block;
    height: 100%;
}

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

/* Detail page */
.game-detail {
    text-align: center;
    padding-bottom: 16px;
}

.game-detail .game-icon {
    width: 280px;
    height: 280px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 4px 32px rgba(0, 229, 255, 0.2);
    margin-bottom: 20px;
    border: 2px solid var(--border-glow);
}

.game-detail .game-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-detail .game-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #7b2ff7 100%);
    border: none;
    color: #0c0618;
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #9b5fff 100%);
    border: none;
    color: #0c0618;
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.4);
}

.btn-start-game {
    padding: 12px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
}

.game-frame-wrap {
    display: none;
    position: relative;
    margin-top: 32px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-glow);
}

.game-frame-wrap.active {
    display: block;
}

.game-frame-wrap .btn-fullscreen {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(22, 16, 46, 0.85);
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.game-frame-wrap .btn-fullscreen:hover {
    background: rgba(31, 22, 64, 0.95);
    border-color: var(--accent);
}

.game-frame-wrap iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen,
.game-frame-wrap.is-fullscreen {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    background: #000;
}

.game-frame-wrap:fullscreen iframe,
.game-frame-wrap:-webkit-full-screen iframe,
.game-frame-wrap.is-fullscreen iframe {
    width: 100%;
    height: 100%;
}

.more-games {
    margin-top: 64px;
    padding: 48px 0 56px;
    border-top: 1px solid var(--border-glow);
}

.more-games .section-title {
    margin-top: 0;
    margin-bottom: 32px;
}

.more-games .item {
    margin-bottom: 0;
}

.main .box .row.g-4 .item {
    margin-bottom: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .box {
        padding: 32px 16px 40px;
    }

    .item {
        padding: 6px;
    }

    .item .desc,
    .game-detail .game-desc {
        display: none;
    }

    .item .game-name {
        font-size: 0.8rem;
        margin-top: 8px;
    }

    .game-detail .game-icon {
        width: 220px;
        height: 220px;
    }

    .game-frame-wrap iframe {
        height: 400px;
    }
}
