@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    color-scheme: dark;
    --ink: #f5f1ff;
    --muted: #b8b1ce;
    --pink: #f69acb;
    --panel: rgba(23, 18, 48, 0.68);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    background: #090817;
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
}

.login-body {
    overflow: hidden;
}

.login-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    overflow: hidden;
    padding: 32px 20px;
    grid-template-columns: repeat(2, minmax(0, 490px));
    align-content: center;
    justify-content: center;
    gap: 24px;
    background:
        radial-gradient(circle at 50% 40%, rgba(114, 82, 183, 0.23), transparent 31%),
        radial-gradient(circle at 12% 92%, rgba(52, 155, 177, 0.15), transparent 30%),
        linear-gradient(135deg, #090817 0%, #15102b 52%, #0c1726 100%);
}

.login-page::before,
.login-page::after {
    position: absolute;
    content: '';
    width: 42vw;
    height: 42vw;
    max-width: 520px;
    max-height: 520px;
    border: 1px solid rgba(216, 198, 255, 0.12);
    border-radius: 50%;
    transform: rotate(-18deg) scaleY(0.35);
}

.login-page::before {
    top: -17vw;
    right: -10vw;
    box-shadow: 0 0 70px rgba(169, 140, 255, 0.13), inset 0 0 40px rgba(246, 154, 203, 0.08);
}

.login-page::after { bottom: -22vw; left: -8vw; }

.stars {
    position: absolute;
    inset: 0;
    opacity: 0.65;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px);
    background-position: 0 0;
    background-size: 83px 71px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 490px);
    padding: clamp(42px, 8vw, 78px) clamp(26px, 8vw, 72px);
    border: 1px solid rgba(225, 213, 255, 0.2);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35), 0 0 80px rgba(136, 103, 219, 0.12);
    backdrop-filter: blur(18px);
    text-align: center;
    animation: arrive 800ms ease-out both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--pink);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6bf0c0;
    box-shadow: 0 0 12px #6bf0c0;
}

h1 {
    margin: 19px 0 13px;
    color: #fffaff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.8rem, 10vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.intro {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 58px;
    margin-top: 32px;
    padding: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: linear-gradient(100deg, #8c73ed, #bd86d8);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(116, 84, 206, 0.34);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-button:hover,
.login-button:focus-visible {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(116, 84, 206, 0.48);
}

.login-button:focus-visible {
    outline: 3px solid rgba(246, 154, 203, 0.55);
    outline-offset: 4px;
}

.login-button > i:first-child { font-size: 1.35rem; }
.button-arrow { margin-left: auto; font-size: 0.8rem; opacity: 0.7; }

.fine-print {
    margin: 19px 0 0;
    color: #8982a5;
    font-size: 0.75rem;
}

.public-leaderboard {
    position: relative;
    z-index: 1;
    width: min(100%, 490px);
    margin-top: 0;
    padding: 24px 28px;
    border: 1px solid rgba(225, 213, 255, 0.16);
    border-radius: 18px;
    background: rgba(23, 18, 48, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px);
}

.leaderboard-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.leaderboard-heading .eyebrow { font-size: 0.62rem; }
.leaderboard-heading h2 { margin: 10px 0 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.55rem; }
.leaderboard-heading > i { color: #f6c47b; font-size: 1.5rem; }
.leaderboard-list { display: grid; gap: 7px; margin: 22px 0 0; padding: 0; list-style: none; }
.leaderboard-row { display: grid; grid-template-columns: 28px 32px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 9px; background: rgba(9, 8, 23, 0.35); }
.leaderboard-rank { color: #8982a5; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.leaderboard-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.leaderboard-avatar-fallback { display: grid; place-items: center; background: rgba(246, 154, 203, 0.16); color: var(--pink); font-size: 0.75rem; }
.leaderboard-user { display: grid; gap: 2px; min-width: 0; color: inherit; text-align: left; text-decoration: none; }
.leaderboard-user:hover strong { color: var(--pink); }
.leaderboard-user strong { overflow: hidden; color: #f5f1ff; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-user small { overflow: hidden; color: #8982a5; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-points { color: #f69acb; }
.leaderboard-empty { padding: 16px 0 4px; color: #8982a5; font-size: 0.85rem; text-align: center; }
.page-leaderboard { width: 100%; max-width: none; margin-top: 34px; }
.leaderboard-avatar + .leaderboard-avatar-fallback { display: none; }

@keyframes arrive {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell { animation: none; }
    .login-button { transition: none; }
}

.dashboard-page,
.admin-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 86% 8%, rgba(246, 154, 203, 0.12), transparent 27%),
        radial-gradient(circle at 10% 55%, rgba(75, 164, 182, 0.12), transparent 30%),
        linear-gradient(135deg, #090817 0%, #15102b 52%, #0c1726 100%);
}

.dashboard-header,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 48px, 1180px);
    margin: 0 auto;
    padding: 28px 0;
}

.brand-mark {
    color: #fffaff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark::before {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 10px 2px 0;
    border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 12px var(--pink);
    content: '';
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.85rem;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    object-fit: cover;
}

.logout-link,
.admin-link,
.profile-link,
.profile-name-link {
    color: #928ba9;
    font-size: 0.78rem;
    text-decoration: none;
}

.logout-link { margin-left: 10px; }
.admin-header-links { display: flex; align-items: center; gap: 16px; }
.profile-name-link { color: var(--muted); text-decoration: none; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.78rem; text-decoration: none; }
.logout-link:hover, .admin-link:hover, .profile-link:hover, .profile-name-link:hover, .back-link:hover { color: #fff; }
.patch-notes-link { display: inline-flex; align-items: center; color: #c8b6ff; font-size: 0.78rem; text-decoration: none; }
.patch-notes-link:hover { color: #fff; }
.viewer-page { min-height: 100vh; overflow: hidden; background: #090817; }
.viewer-stream { position: fixed; z-index: 0; inset: 0; width: 100vw; height: 100vh; border: 0; }
.viewer-stream-shade { position: fixed; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(9, 8, 23, 0.74), rgba(9, 8, 23, 0.18) 70%), linear-gradient(0deg, rgba(9, 8, 23, 0.8), transparent 40%); }
.viewer-content { position: relative; z-index: 2; display: grid; min-height: 100vh; width: min(100% - 32px, 720px); margin: 0 auto; place-items: center; }
.viewer-card { width: 100%; padding: clamp(28px, 6vw, 54px); border: 1px solid rgba(225, 213, 255, 0.22); border-radius: 20px; background: rgba(23, 18, 48, 0.84); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42); backdrop-filter: blur(18px); }
.viewer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.viewer-heading h1 { margin: 5px 0 0; font-size: clamp(2.2rem, 7vw, 4rem); }
.viewer-heading > i { color: #ad86ff; font-size: 2rem; }
.viewer-status { margin: 18px 0 0; color: var(--muted); font-size: 1.05rem; }
.viewer-login p { color: var(--muted); }
.viewer-login .submit-button { margin-top: 8px; text-decoration: none; }
.vote-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
.vote-choice { min-height: 150px; border: 2px solid transparent; border-radius: 14px; color: #fff; cursor: pointer; font: inherit; transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease; }
.vote-choice:hover, .vote-choice:focus-visible { filter: brightness(1.1); transform: translateY(-3px); }
.vote-choice:disabled { cursor: default; opacity: 0.65; transform: none; }
.vote-choice strong, .vote-choice span { display: block; }
.vote-choice strong { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; }
.vote-choice span { margin-top: 10px; font-size: 0.82rem; opacity: 0.85; }
.vote-choice-purple { background: #806dde; }
.vote-choice-green { background: #3eb88a; }
.vote-total { min-height: 20px; margin: 18px 0 0; color: var(--muted); text-align: center; }
.viewer-patch-link { display: block; margin-top: 26px; color: #c8b6ff; font-size: 0.8rem; text-align: center; text-decoration: none; }
.crowd-control-setting { justify-self: start; }
.crowd-choice-buttons { display: flex; gap: 8px; }
.crowd-choice { min-width: 68px; padding: 9px 12px; border: 2px solid transparent; border-radius: 8px; color: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.crowd-choice-purple { background: #806dde; }
.crowd-choice-green { background: #3eb88a; }
.crowd-choice.is-selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2); }
.crowd-choice:disabled { cursor: default; opacity: 0.7; }
.crowd-vote-status { color: var(--muted); font-size: 0.78rem; }


.profile-page { min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 86% 8%, rgba(246, 154, 203, 0.12), transparent 27%), radial-gradient(circle at 10% 55%, rgba(75, 164, 182, 0.12), transparent 30%), linear-gradient(135deg, #090817 0%, #15102b 52%, #0c1726 100%); }
.patch-notes-page { min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 86% 8%, rgba(246, 154, 203, 0.12), transparent 27%), radial-gradient(circle at 10% 55%, rgba(75, 164, 182, 0.12), transparent 30%), linear-gradient(135deg, #090817 0%, #15102b 52%, #0c1726 100%); }
.player-page { min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 86% 8%, rgba(246, 154, 203, 0.12), transparent 27%), radial-gradient(circle at 10% 55%, rgba(75, 164, 182, 0.12), transparent 30%), linear-gradient(135deg, #090817 0%, #15102b 52%, #0c1726 100%); }
.player-content { display: grid; width: min(100% - 48px, 760px); min-height: 100vh; margin: 0 auto; place-items: center; padding: 32px 0; }
.player-card { padding: clamp(28px, 6vw, 52px); border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 20px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); backdrop-filter: blur(18px); }
.player-card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.player-card-toolbar .section-kicker { margin: 0; }
.player-theme-setting { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); cursor: pointer; font-size: 0.78rem; white-space: nowrap; }
.player-theme-setting > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.player-theme-setting input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.player-theme-setting input:focus-visible + .theme-slider { outline: 2px solid var(--pink); outline-offset: 3px; }
.player-card-identity { display: flex; align-items: center; gap: 20px; }
.player-avatar { width: 92px; height: 92px; border: 2px solid rgba(246, 154, 203, 0.55); border-radius: 50%; object-fit: cover; }
.player-avatar-fallback { display: grid; place-items: center; background: rgba(246, 154, 203, 0.16); color: var(--pink); font-size: 1.6rem; }
.player-avatar + .player-avatar-fallback { display: none; }
.player-card h1 { margin: 4px 0 0; font-size: clamp(2rem, 6vw, 3.4rem); }
.player-card-identity p:not(.section-kicker) { margin: 6px 0 0; color: var(--muted); }
.player-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 34px 0 0; }
.player-card-stats div { padding: 18px; border: 1px solid rgba(225, 213, 255, 0.1); border-radius: 10px; background: rgba(9, 8, 23, 0.34); }
.player-card-stats dt { color: var(--muted); font-size: 0.78rem; }
.player-card-stats dd { margin: 8px 0 0; color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; font-weight: 700; }
.player-card-history { margin-top: 34px; }
.player-card-history h2 { margin: 0 0 14px; font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; }
.player-card-history ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.player-card-history li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 9px; background: rgba(9, 8, 23, 0.34); }
.player-card-history small { color: var(--muted); }
.patch-notes-content { width: min(100% - 48px, 860px); margin: 0 auto; padding: 64px 0 90px; }
.patch-notes-list { display: grid; gap: 18px; margin-top: 40px; }
.patch-note { padding: 28px 32px; border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); backdrop-filter: blur(18px); }
.patch-note-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--pink); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.patch-note-meta time { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.patch-note h2 { margin: 12px 0 14px; color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-size: 1.45rem; }
.patch-note ul { display: grid; gap: 9px; margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.55; }
.profile-content { width: min(100% - 48px, 980px); margin: 0 auto; padding: 64px 0 90px; }
.profile-heading { max-width: 650px; }
.profile-heading h1 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); }
.profile-grid { display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.2fr; gap: 20px; margin-top: 42px; }
.profile-card, .profile-stat-panel { border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); backdrop-filter: blur(18px); }
.profile-card { padding: 34px; text-align: center; }
.profile-card .profile-avatar-large { width: 112px; height: 112px; margin: 0 auto 20px; border: 2px solid rgba(246, 154, 203, 0.55); border-radius: 50%; object-fit: cover; }
.profile-card h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; }
.profile-card p { margin: 8px 0 0; color: var(--muted); }
.profile-stat-panel { padding: 28px; }
.profile-stat-panel h2 { margin: 0 0 20px; font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.profile-stat { padding: 18px; border: 1px solid rgba(225, 213, 255, 0.1); border-radius: 10px; background: rgba(9, 8, 23, 0.34); }
.profile-stat dt { color: var(--muted); font-size: 0.78rem; }
.profile-stat dd { margin: 8px 0 0; color: #fffaff; font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700; }
.profile-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 30px; color: #c8b6ff; font-size: 0.85rem; text-decoration: none; }
.profile-back:hover { color: #fff; }
.profile-settings { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 28px 34px; border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); backdrop-filter: blur(18px); }
.profile-settings h2 { margin: 4px 0 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; }
.profile-settings p:not(.section-kicker) { margin: 6px 0 0; color: var(--muted); }
.theme-setting { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); cursor: pointer; white-space: nowrap; }
.theme-setting > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.theme-setting input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-slider { position: relative; display: inline-block; width: 48px; height: 26px; border: 1px solid rgba(225, 213, 255, 0.24); border-radius: 999px; background: rgba(9, 8, 23, 0.7); }
.theme-slider::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #f6c47b; content: ''; transition: transform 180ms ease; }
.theme-setting input:checked + .theme-slider::after { transform: translateX(22px); }
.theme-setting input:focus-visible + .theme-slider { outline: 2px solid var(--pink); outline-offset: 3px; }
.theme-setting-label { display: none; }

body[data-theme="light"] { --ink: #201b2d; --muted: #655d76; --panel: rgba(255, 255, 255, 0.76); color-scheme: light; background: #f3eff8; }
body[data-theme="light"] .profile-page,
body[data-theme="light"] .dashboard-page,
body[data-theme="light"] .admin-page,
body[data-theme="light"] .patch-notes-page { background: linear-gradient(135deg, #f8f5fb 0%, #e9f2f3 100%); }
body[data-theme="light"] .profile-card,
body[data-theme="light"] .profile-stat-panel,
body[data-theme="light"] .profile-settings,
body[data-theme="light"] .submission-panel,
body[data-theme="light"] .info-panel,
body[data-theme="light"] .admin-list-panel,
body[data-theme="light"] .wheel-panel,
body[data-theme="light"] .battle-control-panel,
body[data-theme="light"] .public-leaderboard { border-color: rgba(77, 61, 99, 0.16); background: #fff; box-shadow: 0 18px 45px rgba(74, 60, 94, 0.12); }
body[data-theme="light"] .profile-stat,
body[data-theme="light"] .leaderboard-row { border-color: rgba(77, 61, 99, 0.1); background: rgba(245, 241, 249, 0.8); }
body[data-theme="light"] .dashboard-patch-notes { border-color: rgba(77, 61, 99, 0.16); background: #fff; box-shadow: 0 18px 45px rgba(74, 60, 94, 0.12); }
body[data-theme="light"] .dashboard-patch-note { border-color: rgba(77, 61, 99, 0.1); background: rgba(245, 241, 249, 0.8); }
body[data-theme="light"] .player-page { background: linear-gradient(135deg, #f8f5fb 0%, #e9f2f3 100%); }
body[data-theme="light"] .player-card { border-color: rgba(77, 61, 99, 0.16); background: #fff; box-shadow: 0 18px 45px rgba(74, 60, 94, 0.12); }
body[data-theme="light"] .player-card-stats div,
body[data-theme="light"] .player-card-history li { border: 1px solid rgba(77, 61, 99, 0.1); background: rgba(245, 241, 249, 0.8); }
body[data-theme="light"] .viewer-page { background: linear-gradient(135deg, #f8f5fb 0%, #e9f2f3 100%); }
body[data-theme="light"] .viewer-stream-shade { background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2) 70%), linear-gradient(0deg, rgba(255, 255, 255, 0.82), transparent 40%); }
body[data-theme="light"] .viewer-card { border-color: rgba(77, 61, 99, 0.2); background: rgba(255, 255, 255, 0.92); box-shadow: 0 18px 45px rgba(74, 60, 94, 0.2); }
body[data-theme="light"] .viewer-heading h1,
body[data-theme="light"] .viewer-card .viewer-status,
body[data-theme="light"] .viewer-card .viewer-login p { color: #201b2d; }
body[data-theme="light"] .viewer-total { color: #655d76; }
body[data-theme="light"] .crowd-choice.is-selected { border-color: #302944; box-shadow: 0 0 0 2px rgba(48, 41, 68, 0.18); }
body[data-theme="light"] .player-card h1,
body[data-theme="light"] .player-card-history h2 { color: #201b2d; }
body[data-theme="light"] .player-theme-setting { color: #655d76; }
body[data-theme="light"] .player-card-identity p:not(.section-kicker),
body[data-theme="light"] .player-card-history li { color: #655d76; }
body[data-theme="light"] .profile-stat dd,
body[data-theme="light"] .leaderboard-user strong,
body[data-theme="light"] .brand-mark { color: #201b2d; }
body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select { border-color: rgba(77, 61, 99, 0.2); background: #fff; color: #201b2d; }
body[data-theme="light"] label { color: #403752; }
body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder { color: #817895; }
body[data-theme="light"] input:focus,
body[data-theme="light"] textarea:focus,
body[data-theme="light"] select:focus { border-color: #c66c9f; box-shadow: 0 0 0 3px rgba(198, 108, 159, 0.14); }
body[data-theme="light"] .theme-slider { background: #d9d0e5; }
body[data-theme="light"] .theme-slider::after { background: #6d5b9b; }
body[data-theme="light"] .login-page { background: linear-gradient(135deg, #f8f5fb 0%, #e8f3f2 100%); }
body[data-theme="light"] .patch-notes-link { color: #6654a0; }
body[data-theme="light"] .patch-notes-link:hover { color: #403752; }
body[data-theme="light"] .patch-note { border-color: rgba(77, 61, 99, 0.16); background: #fff; box-shadow: 0 18px 45px rgba(74, 60, 94, 0.12); }
body[data-theme="light"] .login-shell { border-color: rgba(77, 61, 99, 0.16); background: rgba(255, 255, 255, 0.76); box-shadow: 0 24px 70px rgba(74, 60, 94, 0.12); }
body[data-theme="light"] .login-shell h1,
body[data-theme="light"] .dashboard-intro h1,
body[data-theme="light"] .admin-content h1,
body[data-theme="light"] .profile-heading h1,
body[data-theme="light"] .profile-settings h2,
body[data-theme="light"] .info-panel h2,
body[data-theme="light"] .admin-list-heading h2,
body[data-theme="light"] .profile-card h2,
body[data-theme="light"] .profile-stat-panel h2 { color: #201b2d; }
body[data-theme="light"] .logout-link,
body[data-theme="light"] .profile-name-link,
body[data-theme="light"] .back-link,
body[data-theme="light"] .clear-button,
body[data-theme="light"] .profile-card p,
body[data-theme="light"] .info-panel p,
body[data-theme="light"] .submission-item p,
body[data-theme="light"] .battle-control-panel p:not(.section-kicker) { color: #655d76; }
body[data-theme="light"] .leaderboard-user small,
body[data-theme="light"] .leaderboard-rank,
body[data-theme="light"] .submission-date,
body[data-theme="light"] .empty-state,
body[data-theme="light"] .leaderboard-empty { color: #756b89; }
body[data-theme="light"] .submission-item { border-color: rgba(77, 61, 99, 0.1); }
body[data-theme="light"] .submission-item a,
body[data-theme="light"] .winner-link { color: #6654a0; }
body[data-theme="light"] .mode-switch { color: #655d76; }
body[data-theme="light"] .host-battle-modal,
body[data-theme="light"] .winner-modal { border-color: rgba(77, 61, 99, 0.16); background: #fff; box-shadow: 0 24px 70px rgba(74, 60, 94, 0.2); }
body[data-theme="light"] .winner-panel > p:not(.section-kicker),
body[data-theme="light"] .host-battle-modal > p:not(.section-kicker):not(.form-status) { color: #655d76; }
body[data-theme="light"] .close-winner { border-color: rgba(77, 61, 99, 0.18); color: #655d76; }
body[data-theme="light"] .close-winner:hover,
body[data-theme="light"] .close-winner:focus-visible { background: rgba(77, 61, 99, 0.08); color: #201b2d; }
body[data-theme="light"] .resolution-button { border-color: rgba(77, 61, 99, 0.16); }
body[data-theme="light"] .resolution-button-muted { background: #ece8f1; color: #403752; }
body[data-theme="light"] .resolution-button-pink { background: #e78fbd; color: #21152f; }
body[data-theme="light"] .resolution-button-purple { background: #9585e6; color: #21152f; }
body[data-theme="light"] .resolution-button-green { background: #58cfa6; color: #12352b; }
body[data-theme="light"] .battle-control-actions .clear-button { border-color: rgba(77, 61, 99, 0.16); background: #f2eef6; color: #403752; }
body[data-theme="light"] .battle-section-heading h2 { color: #201b2d; }
body[data-theme="light"] .wheel-container { border-color: rgba(48, 41, 68, 0.22); background: #fffaff; box-shadow: 0 0 0 4px rgba(77, 61, 99, 0.12), 0 15px 35px rgba(74, 60, 94, 0.16); }
body[data-theme="light"] .wheel-pointer { border-top-color: #302944; }

.dashboard-content,
.admin-content {
    width: min(100% - 48px, 1180px);
    margin: 0 auto;
    padding: 64px 0 90px;
}

.admin-content { padding-top: 20px; }

.dashboard-intro { max-width: 650px; }
.section-kicker {
    margin: 0 0 12px;
    color: var(--pink);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dashboard-intro h1,
.admin-content h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    line-height: 1;
}
.current-version { margin: 10px 0 0; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; }
.dashboard-patch-notes { width: 100%; margin-top: 34px; padding: 24px 28px; border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); backdrop-filter: blur(18px); }
.dashboard-patch-notes-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dashboard-patch-notes-heading h2 { margin: 10px 0 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.55rem; }
.dashboard-patch-notes-list { margin-top: 20px; }
.dashboard-patch-note { padding: 18px; border: 1px solid rgba(225, 213, 255, 0.1); border-radius: 10px; background: rgba(9, 8, 23, 0.34); }
.dashboard-patch-note > div { display: flex; justify-content: space-between; gap: 16px; color: var(--ink); }
.dashboard-patch-note small { color: var(--muted); }
.dashboard-patch-note ul { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

.dashboard-intro > p:last-child,
.admin-intro p {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 24px;
    margin-top: 48px;
}

.submission-panel,
.info-panel,
.admin-list-panel {
    border: 1px solid rgba(225, 213, 255, 0.16);
    border-radius: 18px;
    background: rgba(23, 18, 48, 0.66);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px);
}

.submission-panel { padding: clamp(24px, 5vw, 44px); }
.info-panel { align-self: start; padding: 34px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-heading h2, .info-panel h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.65rem; }
.panel-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: rgba(169, 140, 255, 0.17);
    color: #c8b6ff;
}
.panel-icon-soft { margin-bottom: 25px; color: var(--pink); background: rgba(246, 154, 203, 0.12); }

form { margin-top: 30px; }
label { display: block; margin: 19px 0 8px; color: #e5def6; font-size: 0.85rem; font-weight: 700; }
label span { color: #8982a5; font-weight: 400; }
input, textarea {
    width: 100%;
    border: 1px solid rgba(225, 213, 255, 0.17);
    border-radius: 9px;
    outline: none;
    background: rgba(9, 8, 23, 0.55);
    color: var(--ink);
    font: inherit;
    padding: 13px 14px;
    resize: vertical;
}
select { width: 100%; border: 1px solid rgba(225, 213, 255, 0.17); border-radius: 9px; background: rgba(9, 8, 23, 0.55); color: var(--ink); font: inherit; padding: 13px 14px; }
input:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(246, 154, 203, 0.12); }
input::placeholder, textarea::placeholder { color: #716a88; }

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 49px;
    margin-top: 27px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: #e78fbd;
    color: #21152f;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 180ms ease, filter 180ms ease;
}
.submit-button:hover, .submit-button:focus-visible { filter: brightness(1.1); transform: translateY(-2px); }
.form-status { min-height: 20px; margin: 14px 0 0; color: #6bf0c0; font-size: 0.82rem; }
.info-panel p { color: var(--muted); line-height: 1.65; }
.sound-line { display: flex; align-items: center; gap: 5px; height: 42px; margin-top: 30px; }
.sound-line span { width: 4px; height: 18px; border-radius: 4px; background: var(--pink); }
.sound-line span:nth-child(2), .sound-line span:nth-child(6) { height: 31px; }
.sound-line span:nth-child(3), .sound-line span:nth-child(5) { height: 24px; }
.sound-line span:nth-child(4) { height: 40px; background: #9c8aff; }
.admin-link { display: none; margin-top: 30px; color: #afa0e8; }
.admin-link.is-visible { display: inline-flex; align-items: center; gap: 8px; }

.admin-intro { max-width: 680px; }
.admin-list-panel { margin-top: 42px; overflow: hidden; }
.admin-list-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid rgba(225, 213, 255, 0.12); }
.admin-list-heading h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; }
.clear-button { border: 0; background: transparent; color: #f69acb; cursor: pointer; font: inherit; font-size: 0.78rem; }
.submission-list { margin: 0; padding: 0; list-style: none; }
.submission-item { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 23px 28px; border-bottom: 1px solid rgba(225, 213, 255, 0.08); }
.submission-item:last-child { border-bottom: 0; }
.submission-item h3 { margin: 0 0 7px; font-size: 1rem; }
.submission-item p { margin: 5px 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.submission-item a { color: #c8b6ff; word-break: break-all; }
.submission-date { color: #8982a5; font-size: 0.75rem; white-space: nowrap; }
.empty-state { padding: 40px 28px; color: var(--muted); text-align: center; }
.wheel-panel { display: grid; grid-template-columns: 1fr; gap: clamp(16px, 3vh, 30px); align-items: center; min-height: clamp(390px, calc(100svh - 365px), 680px); margin-top: 0; padding: clamp(24px, 5vw, 70px); border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); text-align: center; }
.wheel-copy { display: flex; flex-direction: column; align-items: center; }
.wheel-copy h2, .winner-panel h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.65rem; }
.wheel-copy p:last-of-type { margin: 10px 0 0; color: var(--muted); }
.wheel-copy .submit-button { margin-top: 24px; }
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #b8b1ce;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
}

.mode-switch input {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(225, 213, 255, 0.24);
  border-radius: 999px;
  outline: none;
  background: rgba(9, 8, 23, 0.7);
  box-sizing: border-box;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.mode-switch input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8982a5;
  content: "";
  transform: translateX(0);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.mode-switch input:hover {
  border-color: rgba(200, 182, 255, 0.5);
}

.mode-switch input:focus-visible {
  box-shadow: 0 0 0 3px rgba(156, 138, 255, 0.2);
}

.mode-switch input:checked {
  border-color: #9c8aff;
  background: rgba(156, 138, 255, 0.3);
}

.mode-switch input:checked::after {
  background: #c8b6ff;
  transform: translateX(16px);
  box-shadow: 0 0 8px rgba(200, 182, 255, 0.35);
}

.mode-switch:has(input:checked) {
  color: #d8ceff;
}
.submit-button:disabled { cursor: default; opacity: 0.55; }
.battle-control-panel { display: grid; grid-template-columns: 1fr; gap: 22px; min-width: 0; margin-top: 32px; padding: 24px 28px; overflow: hidden; border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 18px; background: rgba(23, 18, 48, 0.66); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); }
.battle-control-panel h1 { margin: 4px 0 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.45rem; }
.battle-section-heading h2 { margin: 4px 0 0; color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; }
.battle-section-heading p:not(.section-kicker) { margin: 7px 0 0; color: var(--muted); }
.battle-control-panel p:not(.section-kicker) { margin: 6px 0 0; color: var(--muted); }
.battle-control-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 10px; min-width: 0; }
.battle-control-actions select,
.battle-control-actions input { width: 100%; min-width: 0; }
.battle-control-actions .submit-button { margin-top: 0; }
.battle-control-actions .clear-button { min-width: 0; padding: 12px; border: 1px solid rgba(225, 213, 255, 0.16); border-radius: 9px; background: rgba(255, 255, 255, 0.06); white-space: nowrap; }
.battle-start-actions { grid-template-columns: minmax(0, 1fr) auto; }
.battle-management-actions { grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(0, auto)); }
.host-battle-panel[hidden] { display: none; }
.host-battle-panel { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5, 4, 16, 0.8); backdrop-filter: blur(12px); }
.host-battle-modal { width: min(100%, 500px); padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(246, 154, 203, 0.34); border-radius: 18px; background: #171230; box-shadow: 0 28px 100px rgba(0, 0, 0, 0.55), 0 0 70px rgba(231, 143, 189, 0.16); }
.host-battle-modal h2 { margin: 4px 0 8px; font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; }
.host-battle-modal > p:not(.section-kicker):not(.form-status) { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.host-battle-modal label { margin-top: 0; }
.host-battle-modal .submit-button { margin-top: 20px; }
.wheel-container { position: relative; width: min(72vw, 52vh, 560px); height: min(72vw, 52vh, 560px); min-width: 0; min-height: 0; place-self: center; justify-self: center; flex: 0 0 auto; border: clamp(8px, 1.2vw, 14px) solid rgba(255, 255, 255, 0.14); border-radius: 50%; background: #171230; box-shadow: 0 0 0 4px rgba(9, 8, 23, 0.8), 0 15px 35px rgba(0, 0, 0, 0.35); }
.wheel-container canvas { display: block; width: 100% !important; height: 100% !important; aspect-ratio: 1 / 1; border-radius: 50%; }
.wheel-pointer { position: absolute; z-index: 2; top: -18px; left: 50%; width: 0; height: 0; border-right: 11px solid transparent; border-left: 11px solid transparent; border-top: 24px solid #fff; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); transform: translateX(-50%); }
#wheel-label { position: absolute; top: 50%; left: 50%; z-index: 2; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 0.72rem; font-weight: 700; pointer-events: none; transform: translate(-50%, -50%); }
.winner-panel[hidden] { display: none; }
.winner-panel { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5, 4, 16, 0.78); backdrop-filter: blur(12px); }
.winner-modal { position: relative; width: min(100%, 680px); max-height: min(92vh, 720px); overflow-y: auto; padding: clamp(28px, 5vw, 52px); border: 1px solid rgba(246, 154, 203, 0.34); border-radius: 20px; background: #171230; box-shadow: 0 28px 100px rgba(0, 0, 0, 0.55), 0 0 70px rgba(231, 143, 189, 0.16); }
.close-winner { position: absolute; top: 18px; right: 18px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(225, 213, 255, 0.18); border-radius: 50%; background: transparent; color: #b8b1ce; cursor: pointer; }
.close-winner:hover, .close-winner:focus-visible { background: rgba(255, 255, 255, 0.1); color: #fff; }
.winner-panel h2 { margin-top: 4px; }
.winner-panel > p:not(.section-kicker) { color: var(--muted); line-height: 1.5; }
.winner-user { color: #e78fbd !important; font-size: 0.88rem; font-weight: 700; }
.winner-panel iframe { display: block; width: 100%; height: 166px; margin: 22px 0 16px; border: 0; border-radius: 10px; }
.winner-link { color: #c8b6ff; font-size: 0.85rem; text-decoration: none; }
.winner-link:hover { color: #fff; }
.resolution-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.resolution-actions[hidden] { display: none; }
.resolution-button { flex: 1 1 120px; min-height: 44px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 9px; color: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.resolution-button span { display: block; margin-top: 2px; font-size: 0.68rem; font-weight: 400; opacity: 0.75; }
.resolution-button-muted { background: rgba(137, 130, 165, 0.25); }
.resolution-button-pink { background: rgba(231, 143, 189, 0.72); color: #21152f; }
.resolution-button-purple { background: #9c8aff; color: #21152f; }
.resolution-button-green { background: #6bf0c0; color: #12352b; }
.resolution-button:hover, .resolution-button:focus-visible { filter: brightness(1.12); }
.submission-user { color: #e78fbd !important; font-weight: 700; }
.submission-user span { margin-left: 6px; color: #8982a5; font-weight: 400; }
.version-label { display: inline-block; margin-left: 8px; color: var(--pink); font-size: 0.35em; font-weight: 700; letter-spacing: 0.08em; vertical-align: middle; }

@media (max-width: 700px) {
    .login-page { grid-template-columns: 1fr; align-content: center; }
    .dashboard-header, .admin-header, .dashboard-content, .admin-content { width: min(100% - 32px, 1180px); }
    .dashboard-header, .admin-header { padding: 20px 0; }
    .profile-chip > span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dashboard-content, .admin-content { padding-top: 46px; }
    .admin-content { padding-top: 20px; }
    .dashboard-grid { grid-template-columns: 1fr; margin-top: 34px; }
    .info-panel { order: -1; }
    .submission-item { grid-template-columns: 1fr; gap: 8px; }
    .submission-date { white-space: normal; }
    .wheel-panel { min-height: clamp(390px, calc(100svh - 330px), 620px); padding: 24px 20px; }
    .wheel-container { width: min(82vw, 42vh, 430px); }
    .public-leaderboard { margin-top: 0; }
    .battle-control-panel { grid-template-columns: 1fr; align-items: stretch; }
    .battle-control-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .battle-start-actions, .battle-management-actions { grid-template-columns: 1fr; }
    .battle-control-actions input, .battle-control-actions select { width: 100%; }
    .profile-content { width: min(100% - 32px, 980px); padding-top: 46px; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-card { padding: 28px 20px; }
    .profile-settings { align-items: stretch; flex-direction: column; padding: 24px 20px; }
    .player-content { width: min(100% - 32px, 760px); min-height: 100vh; padding: 20px 0; }
    .player-card-identity { align-items: flex-start; flex-direction: column; }
    .player-card-stats { grid-template-columns: repeat(2, 1fr); }
    .vote-panel { grid-template-columns: 1fr; }
    .patch-notes-content { width: min(100% - 32px, 860px); padding-top: 46px; }
    .patch-note { padding: 24px 20px; }
}

@media (max-width: 460px) {
    .battle-control-actions { grid-template-columns: 1fr; }
}
