:root {
    --bg: #0b1020;
    --bg-soft: #121a30;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-hover: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.1);
    --text: #eef2fb;
    --muted: #9aa7c4;
    --accent: #5b8cff;
    --accent-rgb: 91, 140, 255;
    --accent-2: #7c5cff;
    --accent-2-rgb: 124, 92, 255;
    --danger: #ff6b6b;
    --radius: 16px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font: 16px/1.6 var(--font);
    background:
        radial-gradient(1100px 500px at 15% -10%, rgba(91, 140, 255, 0.2), transparent 60%),
        radial-gradient(900px 480px at 90% 0%, rgba(124, 92, 255, 0.18), transparent 60%),
        var(--bg);
    padding-bottom: 48px;
}

.shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

/* ---------- 顶栏 ---------- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand .logo {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #fff;
    font-weight: 900;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 18px rgba(91, 140, 255, 0.35);
}

.account-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

#account-name {
    color: var(--muted);
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-btn {
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font: 600 14px/1 inherit;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.account-btn:active {
    transform: translateY(1px);
}

#login-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(91, 140, 255, 0.3);
}

#login-btn:hover {
    background: linear-gradient(135deg, #6b98ff, #8c6fff);
    border-color: transparent;
}

/* ---------- Hero ---------- */
.hero {
    padding: 40px 0 8px;
    text-align: center;
}

.hero .eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: 0.01em;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 560px;
    margin: 14px auto 0;
    color: var(--muted);
}

.section-title {
    margin: 40px 0 16px;
    font-size: 20px;
    font-weight: 800;
}

/* ---------- 游戏卡片(街机柜样式) ---------- */
.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding-bottom: 24px;
    perspective: 1300px;
}

.game-card {
    --a-rgb: var(--accent-rgb);
    --a: rgb(var(--a-rgb));
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1 / 1;
    padding: 16px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: linear-gradient(158deg, #18213d, #10162b);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.25s, border-color 0.25s;
    animation: card-pop 0.5s both cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes card-pop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* 顶部霓虹条 */
.game-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3;
    background: var(--a);
    opacity: 0.55;
    box-shadow: 0 0 14px var(--a);
    transition: opacity 0.25s;
}

/* hover 扫光 */
.game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: linear-gradient(115deg, transparent 40%, rgba(var(--a-rgb), 0.22) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.game-card:hover {
    border-color: rgba(var(--a-rgb), 0.55);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 34px -10px var(--a);
    transform: translateY(-4px);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover::after {
    transform: translateX(120%);
}

.game-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* 全出血封面 */
.game-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(158deg, #18213d, #10162b);
}

.game-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: saturate(1.05) brightness(0.84) contrast(1.02);
    transition: transform 0.55s ease, filter 0.3s;
}

.game-card:hover .game-art img {
    transform: scale(1.07);
    filter: saturate(1.15) brightness(1.02) contrast(1.03);
}

/* 底部渐变压暗,保证文字可读 */
.game-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top,
        rgba(5, 6, 11, 0.97) 6%,
        rgba(5, 6, 11, 0.72) 32%,
        rgba(5, 6, 11, 0.18) 62%,
        rgba(5, 6, 11, 0) 100%);
}

/* 无封面:回退到首字大字 */
.game-glyph {
    display: none;
    position: absolute;
    right: -8px;
    bottom: -20px;
    z-index: 1;
    font-size: 8rem;
    line-height: 1;
    color: var(--a);
    opacity: 0.16;
    pointer-events: none;
    text-shadow: 0 0 34px var(--a);
    transition: opacity 0.3s, transform 0.4s ease;
}

.game-card.no-art .game-glyph {
    display: block;
}

.game-card.no-art .game-art img {
    display: none;
}

.game-card:hover .game-glyph {
    opacity: 0.32;
    transform: scale(1.09) rotate(-3deg);
}

.game-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--a);
    background: rgba(5, 6, 11, 0.55);
    padding: 4px 8px;
    border-radius: 6px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.game-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    font-size: 12px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 9px;
    background: rgba(5, 6, 11, 0.6);
}

.game-name {
    position: relative;
    z-index: 2;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 16px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-desc {
    position: relative;
    z-index: 2;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-tags {
    position: relative;
    z-index: 2;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.game-play {
    position: relative;
    z-index: 2;
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--a);
    opacity: 0;
    transform: translateY(7px);
    transition: 0.25s;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.game-card:hover .game-play {
    opacity: 1;
    transform: none;
}

.modal {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 6, 11, 0.88);
    overflow: hidden;
}

.hidden {
    display: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 6, 11, 0.72);
}

.auth-modal.hidden {
    display: none;
}

.auth-panel {
    width: min(400px, 100%);
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
}

#auth-close-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
}

#auth-close-btn:hover {
    color: #fff;
}

.auth-error {
    min-height: 20px;
    color: var(--danger);
    font-size: 14px;
}

.auth-providers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.provider-btn {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font: 600 14px/1 inherit;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.provider-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.provider-btn:active {
    transform: translateY(1px);
}

.provider-icon {
    font-weight: bold;
    font-size: 16px;
}

.provider-google {
    background: #fff;
    color: #1f2937;
    border-color: transparent;
}

.provider-google:hover {
    background: #f2f4f8;
}

.provider-google .provider-icon {
    color: #4285f4;
}

.provider-apple {
    background: #000;
    color: #fff;
    border-color: transparent;
}

.provider-apple:hover {
    background: #1c1c1e;
}

.provider-apple .provider-icon {
    color: #fff;
    font-size: 18px;
}

.modal-content {
    position: relative;
    width: 100vw;
    height: 100dvh;
    background: #05060b;
    overflow: hidden;
}

.modal-header {
	position: absolute;
    pointer-events: none;
	z-index: 999;
    top: 0;
    left: 0;
    right: 0;

    height: 60px;

    z-index: 999;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 20px;

    background:
        linear-gradient(
            rgba(0,0,0,0.1),
            rgba(0,0,0,0)
        );

    color: white;
}

#close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    pointer-events: auto;
}

#game-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #05060b;
}

#game-title {
    font-size: 16px;
    font-weight: 700;
}

#close-btn:hover {
    color: var(--accent);
}

@media (max-width: 560px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero {
        padding-top: 28px;
    }

    .game-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-card {
        padding: 12px;
        border-radius: 12px;
    }

    .game-name {
        font-size: 15px;
    }

    .game-desc {
        font-size: 12px;
        margin-top: 4px;
    }

    .game-rank {
        top: 8px;
        left: 8px;
        font-size: 10px;
        padding: 3px 6px;
    }

    .game-tag {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 2px 6px;
    }
}
