:root {
    --bg: #0b1225;
    --bg-strong: #091121;
    --panel: rgba(17, 27, 49, 0.85);
    --panel-strong: rgba(21, 33, 58, 0.95);
    --panel-soft: rgba(26, 38, 65, 0.75);
    --line: rgba(255, 255, 255, 0.08);
    --accent: #ff6adf;
    --accent-2: #6ddcff;
    --accent-warm: #ffb65c;
    --text: #e6eeff;
    --muted: #a8b7d8;
    --muted-dark: #7c8aad;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 20% 10%, rgba(255, 106, 223, 0.08), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(109, 220, 255, 0.12), transparent 35%),
        radial-gradient(circle at 20% 90%, rgba(255, 182, 92, 0.08), transparent 30%),
        #050b18;
    color: var(--text);
    min-height: 100vh;
    position: relative;
}

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

.plasma-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(800px circle at 20% 20%, rgba(255, 106, 223, 0.08), transparent 50%),
        radial-gradient(700px circle at 80% 0%, rgba(109, 220, 255, 0.08), transparent 50%),
        radial-gradient(600px circle at 30% 90%, rgba(255, 182, 92, 0.08), transparent 60%);
    filter: blur(50px);
    z-index: 0;
    pointer-events: none;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

.channel-panel {
    width: 240px;
    background: linear-gradient(180deg, rgba(17, 27, 49, 0.95), rgba(12, 18, 32, 0.9));
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
    padding: 1.2rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(12px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.6rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(109, 220, 255, 0.12), rgba(255, 106, 223, 0.14));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6ddcff, #ff6adf);
    color: #0a0f1c;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(109, 220, 255, 0.4);
}

.brand-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.brand-block h2 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.channel-section {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.channel-section__label {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.22em;
    margin: 0.5rem 0;
}

.channel-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    color: var(--muted);
    transition: all 0.18s ease;
}

.channel-link i {
    width: 20px;
    text-align: center;
    color: #9acbff;
}

.channel-link:hover,
.channel-link.active {
    background: linear-gradient(90deg, rgba(109, 220, 255, 0.18), rgba(255, 106, 223, 0.18));
    color: var(--text);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.channel-panel__footer {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.help-card {
    background: var(--panel-strong);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.9rem;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.help-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.help-copy {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.mini-link {
    font-weight: 700;
    color: var(--accent-2);
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(9, 15, 29, 0.4);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.6rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(109, 220, 255, 0.08), rgba(255, 106, 223, 0.06));
    backdrop-filter: blur(14px);
    gap: 1rem;
}

.channel-meta h1 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.channel-meta p {
    color: var(--muted);
    font-size: 0.96rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.6rem 0.9rem;
    min-width: 320px;
}

.hero-search {
    margin-top: 0.4rem;
    min-width: 420px;
    background: rgba(0, 0, 0, 0.25);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
}

.search-bar input:focus {
    outline: none;
}

.user-actions.top-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-weight: 700;
}

.coin-chip {
    background: linear-gradient(135deg, rgba(255, 182, 92, 0.24), rgba(255, 106, 223, 0.18));
    border-color: rgba(255, 182, 92, 0.35);
}

.lang-chip {
    background: linear-gradient(135deg, rgba(109, 220, 255, 0.2), rgba(109, 220, 255, 0.08));
}

.icon-pill {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pill-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    background: linear-gradient(135deg, #ff6adf, #ffb65c);
    color: #0a0f1c;
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-weight: 800;
}

.avatar-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6ddcff, #ff6adf);
    color: #0a0f1c;
    font-weight: 800;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.login-btn {
    border-radius: 14px;
    padding: 0.75rem 1.2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0a0f1c;
    text-align: center;
    font-weight: 800;
    border: none;
    box-shadow: 0 16px 30px rgba(255, 106, 223, 0.4);
    cursor: pointer;
}

.user-menu {
    position: absolute;
    bottom: 110%;
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.user-menu-item {
    padding: 0.85rem 1rem;
    display: flex;
    gap: 0.65rem;
    color: var(--text);
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.user-menu-divider {
    height: 1px;
    background: var(--line);
}

.scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.6rem 1.8rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
    align-items: stretch;
}

.hero-card {
    position: relative;
    background: radial-gradient(circle at 20% 20%, rgba(109, 220, 255, 0.08), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(255, 106, 223, 0.18), transparent 40%),
        linear-gradient(135deg, #0f1c3a, #0b142a);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1.6rem;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hero-card h2 {
    font-size: 2.2rem;
    margin: 0.8rem 0 0.4rem;
    letter-spacing: -0.01em;
}

.hero-card p {
    color: var(--muted);
    max-width: 520px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.4rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
    color: #0a0f1c;
    font-weight: 800;
    box-shadow: 0 18px 35px rgba(255, 106, 223, 0.4);
}

.hero-meta {
    color: var(--muted);
    font-weight: 700;
}

.fruit-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fruit-orbs span {
    position: absolute;
    font-size: 3.6rem;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.fruit-orbs span:nth-child(1) { top: 30%; left: 62%; transform: rotate(-10deg); }
.fruit-orbs span:nth-child(2) { top: 55%; left: 75%; transform: rotate(15deg); }
.fruit-orbs span:nth-child(3) { top: 18%; left: 78%; transform: rotate(-22deg); }

.side-stack {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.side-card,
.cta-card {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.side-card h3 {
    margin-bottom: 0.7rem;
    font-size: 1.1rem;
}

.side-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.side-row:last-child {
    border-bottom: none;
}

.side-label {
    font-weight: 700;
}

.side-sub {
    color: var(--muted);
    font-size: 0.92rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(109, 220, 255, 0.24), rgba(255, 106, 223, 0.18));
    color: #0a0f1c;
    font-weight: 800;
    border: none;
}

.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.pill-link {
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.cta-card.secondary {
    background: linear-gradient(135deg, rgba(109, 220, 255, 0.12), rgba(255, 106, 223, 0.08));
}

.btn-ghost {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.55rem 0.95rem;
    color: var(--text);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
}

.section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.25rem 1.4rem 1.35rem;
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.section-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.section-title {
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: var(--muted);
    margin-bottom: 1rem;
}

.section-link {
    color: var(--accent-2);
    font-weight: 700;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding: 0.6rem 0.2rem 0.2rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tags .tag {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.4rem 0.95rem;
    color: var(--muted);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}

.filter-tags .tag.active {
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
    color: #0a0f1c;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(255, 106, 223, 0.35);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.game-card {
    position: relative;
    border-radius: 18px;
    padding: 1.1rem;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.35);
}

.game-card__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(109, 220, 255, 0.12), transparent 50%),
        radial-gradient(circle at 80% 10%, rgba(255, 106, 223, 0.12), transparent 50%);
    opacity: 0.9;
    pointer-events: none;
}

.game-card__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    position: relative;
    z-index: 1;
}

.game-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--card-gradient, linear-gradient(135deg, #6ddcff, #ff6adf));
    color: #0a0f1c;
    font-size: 1.1rem;
}

.game-genre-chip {
    padding: 0.35rem 0.8rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
}

.game-status {
    margin-left: auto;
    padding: 0.32rem 0.7rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    color: #0a0f1c;
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
}

.game-status.admin { background: linear-gradient(135deg, #ffb65c, #ff6adf); }
.game-status.beta { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.game-status.live { background: linear-gradient(135deg, #6ddcff, #8df9c4); }

.game-title {
    font-size: 1.1rem;
    margin: 0.3rem 0 0.25rem;
    position: relative;
    z-index: 1;
}

.game-description,
.game-meta-text {
    color: var(--muted);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.game-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.8rem;
    position: relative;
    z-index: 1;
}

.play-button,
.play-button.disabled {
    border: none;
    border-radius: 12px;
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
    color: #0a0f1c;
    font-weight: 800;
    cursor: pointer;
}

.play-button.disabled {
    background: #3b425b;
    color: #d0d5e6;
    cursor: not-allowed;
}

.section-frame {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.ranking-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.rank-tabs,
.difficulty-tabs,
.game-tabs,
.hof-game-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rank-tab,
.difficulty-tab,
.game-tab,
.hof-game-tab {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    padding: 0.5rem 0.95rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.18s ease;
}

.rank-tab.active,
.difficulty-tab.active,
.game-tab.active,
.hof-game-tab.active {
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
    color: #0a0f1c;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(255, 106, 223, 0.3);
}

.ranking-board {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead {
    background: var(--panel-soft);
}

.ranking-table th,
.ranking-table td {
    padding: 0.85rem 0.95rem;
    text-align: left;
}

.ranking-table th { color: var(--muted); font-weight: 800; }

.ranking-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.ranking-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.hof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.8rem;
}

.hof-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.hof-card h3 { margin-bottom: 0.6rem; }

.footer {
    padding: 1.4rem 0.6rem 0.4rem;
    color: var(--muted);
    text-align: center;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 11, 24, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
}

.auth-modal[aria-hidden="false"] { display: flex; }

.auth-modal__panel {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.8rem;
    width: min(380px, 90%);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    position: relative;
}

.auth-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.auth-modal form { display: flex; flex-direction: column; gap: 0.8rem; }

.auth-modal input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(12, 18, 32, 0.9);
    color: var(--text);
}

.auth-modal button[type="submit"] {
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ff6adf, #6ddcff);
    color: #0a0f1c;
    font-weight: 800;
}

.auth-modal__switch { margin-top: 0.4rem; color: var(--muted); font-size: 0.92rem; }

.auth-modal__switch button { background: none; border: none; color: var(--accent-2); font-weight: 800; cursor: pointer; }

.auth-modal__message { min-height: 1.1rem; margin-top: 0.5rem; font-size: 0.9rem; }

@media (max-width: 1180px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-search { min-width: 280px; }
}

@media (max-width: 960px) {
    .app-shell { padding: 1rem; }
    .channel-panel { display: none; }
    .content-header { flex-direction: column; align-items: flex-start; }
    .user-actions.top-actions { width: 100%; justify-content: flex-start; }
    .scroll-body { padding: 1.2rem; }
}

@media (max-width: 640px) {
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .games-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .section { padding: 1rem; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0b1225; }
::-webkit-scrollbar-thumb { background: #3b425b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
