:root {
    --color-bg: #fff3ec;
    --color-surface: #fffaf6;
    --color-surface-alt: #ffe8db;
    --color-primary: #ff7043;
    --color-primary-hover: #f4511e;
    --color-secondary: #26a69a;
    --color-secondary-hover: #00897b;
    --color-text: #5d4037;
    --color-heading: #bf360c;
    --color-muted: #8d6e63;
    --color-border: #ffccbc;
    --color-header-from: #ff8a65;
    --color-header-to: #ffab91;
    --shadow-sm: 0 2px 10px rgba(255, 112, 67, 0.15);
    --shadow-md: 0 6px 20px rgba(255, 112, 67, 0.18);
    --shadow-hover: 0 10px 28px rgba(255, 112, 67, 0.28);
    --radius: 14px;
}

body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 171, 145, 0.45) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(128, 203, 196, 0.35) 0%, transparent 40%);
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
}

.site-header {
    background: linear-gradient(135deg, var(--color-header-from), var(--color-header-to));
    box-shadow: var(--shadow-md);
    padding: 18px 0;
    margin-bottom: 28px;
}

.site-header .site-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(191, 54, 12, 0.25);
}

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

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 32px;
    color: var(--color-heading);
    padding-left: 14px;
    border-left: 5px solid var(--color-primary);
}

.main {
    margin-bottom: 48px;
}

.box {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 48px 32px 56px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--color-border);
}

.item {
    background: var(--color-surface-alt);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    height: 100%;
}

a:hover .item {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
    background: #ffd9c8;
}

.item .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-heading);
    margin-bottom: 8px;
    word-break: break-word;
    text-align: center;
}

.item .logo img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(255, 112, 67, 0.2);
}

.item .desc {
    display: none;
    font-size: 0.8rem;
    color: var(--color-muted);
}

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

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

.game-detail .game-icon {
    width: 160px;
    height: 160px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    border: 4px solid var(--color-primary);
}

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

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

.btn-start-game {
    padding: 12px 48px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--color-primary), #ff9e80);
    border: none;
    box-shadow: 0 4px 14px rgba(255, 112, 67, 0.4);
}

.btn-start-game:hover,
.btn-start-game:focus {
    background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary));
    border: none;
    box-shadow: 0 6px 18px rgba(244, 81, 30, 0.45);
}

.game-frame-wrap {
    display: none;
    margin-top: 32px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #37474f;
    border: 2px solid var(--color-border);
}

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

.game-frame-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--color-surface-alt);
    border-bottom: 2px solid var(--color-border);
}

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

.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen,
.game-frame-wrap:-moz-full-screen {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.game-frame-wrap:fullscreen .game-frame-toolbar,
.game-frame-wrap:-webkit-full-screen .game-frame-toolbar,
.game-frame-wrap:-moz-full-screen .game-frame-toolbar {
    flex-shrink: 0;
}

.game-frame-wrap:fullscreen iframe,
.game-frame-wrap:-webkit-full-screen iframe,
.game-frame-wrap:-moz-full-screen iframe {
    flex: 1;
    height: auto;
    min-height: 0;
}

.more-games {
    margin-top: 64px;
    padding: 48px 0 56px;
    border-top: 2px dashed 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;
}

#game-list {
    justify-content: center;
}

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

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

.btn-outline-secondary {
    color: var(--color-heading);
    border-color: var(--color-primary);
    background: #fff;
}

.btn-outline-secondary:hover {
    background-color: var(--color-surface-alt);
    border-color: var(--color-primary-hover);
    color: var(--color-primary-hover);
}
/* ========== 广告通用 ========== */
.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: 10px 8px;
        text-align: center;
    }

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

    .item .logo {
        margin-bottom: 0;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .item .logo img {
        max-width: 100%;
    }

    .game-frame-wrap iframe {
        height: 400px;
    }
    /* ========== 首页广告 H5 ========== */
    .ad-banner--home .ad-banner__frame,
    .ad-banner--home .ad-slot {
        width: 300px !important;
        max-width: 300px !important;
        min-width: 300px !important;
    }
    .ad-banner--home .ad-slot iframe {
        width: 300px !important;
        max-width: 300px !important;
    }
}
