:root {
    --bg-body: #0f1219;
    --bg-header: #161b26;
    --bg-card: #1a2030;
    --bg-item: #222a3c;
    --bg-item-hover: #2a3348;
    --bg-toolbar: #1e2536;
    --text-primary: #eef0f4;
    --text-secondary: #9aa3b5;
    --text-muted: #6e7a90;
    --accent: #ff5722;
    --accent-hover: #ff7043;
    --accent-glow: rgba(255, 87, 34, 0.3);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.35);
}

body {
    background-color: var(--bg-body);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(255, 87, 34, 0.08) 0%, transparent 60%);
    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: 1px solid var(--border);
    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);
}

.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-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px 32px 56px;
    box-shadow: 0 8px 32px var(--shadow);
}

.item {
    background: var(--bg-item);
    border: 1px solid var(--border);
    border-radius: 10px;
    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(-3px);
    background: var(--bg-item-hover);
    border-color: rgba(255, 87, 34, 0.35);
    box-shadow: 0 8px 24px var(--accent-glow);
}

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

.item .logo img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

/* Bootstrap overrides */
.btn-primary {
    background: linear-gradient(135deg, #ff5722, #e64a19);
    border: none;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #ff7043, #ff5722);
    border: none;
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
    background: transparent;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--text-primary);
    background: var(--bg-item);
    border-color: rgba(255, 87, 34, 0.4);
}

/* 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 rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 87, 34, 0.2);
    margin-bottom: 16px;
}

.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;
}

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

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

.game-frame-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--bg-toolbar);
    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);
}

@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 {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
        font-size: 0.8rem;
        line-height: 1.3;
    }

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

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