/* ===== 全域重置與基底 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #0a0a1a;
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== 主容器 ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 標題區 ===== */
.header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.logo-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa 0%, #6366f1 40%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    animation: titleFloat 3s ease-in-out infinite;
}

.title-icon {
    -webkit-text-fill-color: initial;
    font-size: 2.4rem;
    margin-right: 8px;
    display: inline-block;
    animation: iconBounce 2s ease-in-out infinite;
}

.subtitle {
    font-size: 1.15rem;
    color: #94a3b8;
    font-weight: 400;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-5deg); }
    75% { transform: translateY(1px) rotate(3deg); }
}

/* ===== 遊戲卡片網格 ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    flex: 1;
}

/* ===== 單張遊戲卡片 ===== */
.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.15);
    text-decoration: none;
    color: inherit;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardAppear 0.5s ease-out both;
    backdrop-filter: blur(12px);
}

.game-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--card-color, #6366f1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 30px color-mix(in srgb, var(--card-color, #6366f1) 25%, transparent);
}

.game-card.coming-soon {
    opacity: 0.6;
    cursor: default;
}

.game-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(99, 102, 241, 0.15);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 卡片背景（Emoji 區域）===== */
.card-bg {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--card-color, #6366f1) 15%, #0a0a1a) 0%,
        color-mix(in srgb, var(--card-color, #6366f1) 5%, #0a0a1a) 100%
    );
    overflow: hidden;
}

.card-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, color-mix(in srgb, var(--card-color, #6366f1) 10%, transparent) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, color-mix(in srgb, var(--card-color, #6366f1) 8%, transparent) 0%, transparent 40%);
}

.card-emoji {
    font-size: 5rem;
    z-index: 1;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover .card-emoji {
    transform: scale(1.15) rotate(-5deg);
}

/* ===== 卡片內容 ===== */
.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.card-status {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    flex: 1;
}

/* ===== 標籤 ===== */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ===== 遊玩按鈕 ===== */
.card-play {
    margin-top: 8px;
    padding: 12px 0;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--card-color, #6366f1);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.game-card:hover .card-play:not(.disabled) {
    color: #fff;
    text-shadow: 0 0 20px var(--card-color, #6366f1);
}

.card-play.disabled {
    color: #475569;
    cursor: default;
}

/* ===== 底部 ===== */
.footer {
    text-align: center;
    padding: 40px 0 0;
    color: #475569;
    font-size: 0.85rem;
}

/* ===== 響應式 ===== */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px 40px;
    }

    .title {
        font-size: 2rem;
    }

    .title-icon {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header {
        margin-bottom: 36px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-bg {
        height: 140px;
    }

    .card-emoji {
        font-size: 3.5rem;
    }
}

@media (max-width: 400px) {
    .title {
        font-size: 1.6rem;
    }

    .card-content {
        padding: 18px;
    }
}
