:root {
    --bg-body: #12151a;
    --bg-surface: #1a1f27;
    --bg-card: #232a34;
    --bg-card-hover: #2c3440;
    --bg-header: #0c0f14;
    --text-primary: #eef1f5;
    --text-secondary: #a8b0bc;
    --text-muted: #6e7888;
    --accent: #ff3d2e;
    --accent-hover: #ff5c50;
    --accent-secondary: #ffb020;
    --border: rgba(255, 255, 255, 0.07);
    --shadow: rgba(0, 0, 0, 0.45);
    --shadow-accent: rgba(255, 61, 46, 0.3);
}

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

.site-header {
    background: var(--bg-header);
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 4px 20px var(--shadow);
    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;
}

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

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

.main {
    margin-bottom: 48px;
}

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

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

a:hover .item {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
    border-color: rgba(255, 61, 46, 0.35);
    box-shadow: 0 8px 24px var(--shadow-accent);
}

.item .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0;
    word-break: break-word;
    text-align: center;
    line-height: 1.3;
}

.item .logo img {
    width: 110px;
    height: 110px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.item .desc {
    display: none;
}

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

/* Bootstrap overrides */
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: #e03528;
    --bs-btn-active-border-color: #e03528;
    --bs-btn-focus-shadow-rgb: 255, 61, 46;
}

.btn-outline-secondary {
    --bs-btn-color: var(--text-secondary);
    --bs-btn-border-color: var(--border);
    --bs-btn-hover-bg: var(--bg-card-hover);
    --bs-btn-hover-border-color: var(--accent-secondary);
    --bs-btn-hover-color: var(--accent-secondary);
}

/* 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: 0 8px 32px var(--shadow-accent);
    margin-bottom: 16px;
    border: 2px solid rgba(255, 61, 46, 0.3);
}

.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-start-game {
    padding: 12px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 20px var(--shadow-accent);
}

.game-frame-wrap {
    display: none;
    margin-top: 32px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    background: #000;
    border: 1px solid var(--border);
}

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

.game-frame-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

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

.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: 1px solid var(--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(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

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

    .item {
        padding: 10px 8px;
    }

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

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

    .item .logo img {
        width: 88px;
        height: 88px;
    }

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