:root {
    --color-bg: #fffbeb;
    --color-surface: #ffffff;
    --color-surface-alt: #fef9c3;
    --color-primary: #f59e0b;
    --color-primary-dark: #d97706;
    --color-primary-light: #fbbf24;
    --color-accent: #f97316;
    --color-text: #422006;
    --color-text-muted: #78716c;
    --color-text-secondary: #a8a29e;
    --color-border: #fde68a;
    --color-shadow: rgba(245, 158, 11, 0.12);
    --color-shadow-hover: rgba(245, 158, 11, 0.24);
    --gradient-header: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
    --gradient-btn: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

body {
    background-color: var(--color-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
}

.site-header {
    background: var(--gradient-header);
    box-shadow: 0 4px 16px var(--color-shadow);
    padding: 16px 0;
    margin-bottom: 24px;
}

.site-header .site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-header .site-title:hover {
    color: #fef3c7;
}

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

.main {
    margin-bottom: 48px;
}

.box {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 48px 32px 56px;
    box-shadow: 0 4px 20px var(--color-shadow);
    border: 1px solid var(--color-border);
}

.item {
    display: flex;
    flex-direction: column;
    background: var(--color-surface-alt);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

a:hover .item {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--color-shadow-hover);
    border-color: var(--color-primary-light);
}

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

.item .logo {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.item .logo img {
    margin-bottom: 10px;
}

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

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

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

#game-list > [class*="col-"],
.more-games > [class*="col-"] {
    min-width: 0;
}

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 8px 28px var(--color-shadow-hover);
    margin-bottom: 20px;
}

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

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

.btn-start-game {
    padding: 12px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    background: var(--gradient-btn);
    border: none;
    box-shadow: 0 4px 14px var(--color-shadow-hover);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start-game:hover,
.btn-start-game:focus {
    background: linear-gradient(135deg, #d97706 0%, #c2410c 100%);
    box-shadow: 0 6px 20px var(--color-shadow-hover);
    transform: translateY(-1px);
}

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

.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: #fff;
    background: rgba(217, 119, 6, 0.8);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.game-frame-wrap .btn-fullscreen:hover {
    background: rgba(217, 119, 6, 0.95);
}

.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: 2px solid var(--color-border);
}

.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(--color-text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

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

.ad-banner {
    display: none;
    margin: 28px auto 40px;
    box-sizing: border-box;
}
.ad-banner.is-visible {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}
.ad-banner__frame {
    width: 300px;
    max-width: 300px;
    margin: 0 auto;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 0;
}
.ad-banner .ad-slot {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px;
    margin: 0 auto !important;
    overflow: hidden !important;
    text-align: center;
    line-height: 0;
}
.ad-banner .ad-slot > div,
.ad-banner .ad-slot iframe {
    max-width: 300px !important;
}
.ad-banner .ad-slot iframe {
    width: 300px !important;
}
@media (max-width: 768px) {
    .box {
        padding: 32px 16px 40px;
    }

    .item {
        padding: 6px;
    }

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

    .item .game-name,
    .item .logo {
        font-size: 0.8rem;
    }

    .item .game-name {
        margin-top: 8px;
    }

    .item .logo img {
        margin-bottom: 8px;
    }

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

    .game-frame-wrap iframe {
        height: 400px;
    }
    .ad-banner > div {
        max-width: 300px;
        width: 100%;
    }
}
