:root {
    --bg-color: #1a1b1e;
    --panel-color: #2b2d31;
    --neon-pink: #ff7eb9;
    --neon-blue: #70a1ff;
    --gold: #f6d365;
    --gold-deep: #b8860b;
    --gold-hot: #fff1b8;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg-color);
    color: #dbdee1;
    font-family: Impact, "Arial Black", sans-serif;
    overflow: hidden;
}

button, p, li, h2 { font-family: "Segoe UI", sans-serif; }

.app-container {
    position: fixed;
    inset: 0;
    display: flex;
    min-height: 0;
    justify-content: center;
    align-items: stretch;
}

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--panel-color);
    padding: 12px 14px 10px;
    border-right: 1px solid rgba(246, 211, 101, 0.18);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.modes button {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.72rem;
    letter-spacing: 0;
}

.modes button.active,
.modes button.active:hover {
    background: linear-gradient(#fff1b8, #e0aa3e);
    color: #1a1408;
    border-color: var(--gold);
}

.sidebar h2 {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-hot);
}

.left-count {
    margin: 4px 0 8px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
}

#listContainer {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: none;
}
#listContainer::-webkit-scrollbar { width: 0; height: 0; display: none; }
#listContainer.has-more {
    -webkit-mask-image: linear-gradient(#000 0, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(#000 0, #000 calc(100% - 16px), transparent);
}
#list { padding: 0; list-style: none; margin: 0; }

#list li {
    margin: 3px 0;
    padding: 5px 4px 5px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--sector) 55%, transparent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--sector) 22%, transparent), rgba(255, 255, 255, 0.03) 70%);
    font-weight: 700;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pip {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--sector);
    box-shadow: 0 0 8px var(--sector);
}

#list li span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.16);
    color: #c7c9ce;
    font-size: 0.85rem;
    line-height: 1;
}

.add-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.add-row input {
    flex: 1;
    min-width: 0;
    background: #1e1f22;
    border: 1px solid rgba(246, 211, 101, 0.35);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-family: "Segoe UI", sans-serif;
}

.add-row button {
    padding: 6px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.voice-btn,
.discord-status {
    font-family: "Segoe UI", sans-serif;
}

.voice-btn {
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.discord-status {
    min-height: 0;
    margin: 6px 0 0;
    color: #b5b8bd;
    font-size: 0.75rem;
    font-weight: 600;
}

.wheel-main {
    flex: 0 1 auto;
    width: min(680px, calc(100% - 250px));
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    padding: 8px 16px 10px;
    background:
        radial-gradient(circle at 50% 46%, rgba(246, 211, 101, 0.08), transparent 42%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45) 78%);
}

.hype {
    text-align: center;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    z-index: 4;
}

.hype-kicker {
    display: block;
    color: var(--gold);
    letter-spacing: 0.28em;
    font-size: 0.78rem;
    font-weight: 800;
}

.hype-line {
    display: block;
    margin-top: 4px;
    font-size: clamp(0.95rem, 1.5vw, 1.45rem);
    line-height: 1.05;
    color: var(--gold-hot);
    text-shadow: 0 0 18px rgba(246, 211, 101, 0.45);
    letter-spacing: 0.02em;
}

.wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

canvas#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: pointer;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 22px rgba(212, 160, 23, 0.28));
}

.pointer {
    position: absolute;
    top: 6px;
    left: 50%;
    z-index: 5;
    width: 30px;
    height: 58px;
    transform: translateX(-50%);
    background: linear-gradient(#fff6d4, #f6d365 35%, #c4891b);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(246, 211, 101, 0.85));
    pointer-events: none;
}

.pointer::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff8e4, #e0aa3e 60%, #7a5410);
    box-shadow: 0 0 12px rgba(246, 211, 101, 0.9);
}

#spinBtn {
    min-width: 280px;
    border-color: var(--gold);
    color: #1a1408;
    background: linear-gradient(#fff1b8, #e0aa3e);
    letter-spacing: 0.12em;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: 1.15rem;
}

#spinBtn:hover { filter: brightness(1.06); color: #1a1408; }
#spinBtn:disabled {
    opacity: 0.55;
    cursor: default;
    filter: none;
}

#togglePanel {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 30;
    padding: 10px 16px;
    border-color: rgba(246, 211, 101, 0.7);
    color: var(--gold-hot);
}

#fx {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1400;
}

#flash {
    position: fixed;
    inset: 0;
    background: #fff8e4;
    opacity: 0;
    pointer-events: none;
    z-index: 1350;
}

#flash.go { animation: flashHit 720ms ease-out; }

@keyframes flashHit {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1300;
}

.modal-content {
    background: #241c12;
    padding: 42px 48px;
    border-radius: 18px;
    border: 3px solid #ff5a5a;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 77, 77, 0.35);
    max-width: min(92vw, 760px);
}

.modal-content.is-win {
    border-color: var(--gold);
    box-shadow: 0 0 60px rgba(246, 211, 101, 0.55);
}

#modalTitle {
    margin: 0 0 8px;
    font-family: Impact, "Arial Black", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: 0.08em;
    color: #ff5a5a;
}

.modal-content.is-win #modalTitle { color: var(--gold-hot); }

.eliminated-name {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    color: #fff;
    margin: 8px 0 12px;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
    word-break: break-word;
}

#modalQuote {
    margin: 0 0 22px;
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 700;
}

button {
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 14px 36px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 999px;
}

button:hover { background: var(--neon-blue); color: white; }

body.tension .wheel-main {
    background:
        radial-gradient(circle at 50% 46%, rgba(246, 211, 101, 0.14), transparent 36%),
        radial-gradient(circle at 50% 50%, #14110e, #070605 76%);
}

body.top3 .hype-line,
body.duel .hype-line {
    animation: linePulse 0.9s ease-in-out infinite;
}

body.duel .wheel-main {
    background:
        radial-gradient(circle at 50% 42%, rgba(246, 211, 101, 0.22), transparent 32%),
        radial-gradient(circle at 50% 50%, #1a1208, #050403 74%);
}

body.is-crawling .pointer {
    animation: hotPointer 0.22s ease-in-out infinite;
}

body.is-crawling canvas#wheel {
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 34px rgba(246, 211, 101, 0.85));
}

body.panel-hidden .sidebar { display: none; }
body.panel-hidden .wheel-main { width: min(920px, 100%); }

@keyframes hotPointer {
    0%, 100% { filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 8px rgba(246, 211, 101, 0.8)); }
    50% { filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px #fff6d0) drop-shadow(0 0 28px #f6d365); }
}

@keyframes linePulse {
    50% { text-shadow: 0 0 22px rgba(255, 241, 184, 0.95); transform: scale(1.03); }
}

@keyframes screenShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(6px, -4px); }
    50% { transform: translate(-5px, 4px); }
    75% { transform: translate(4px, 3px); }
    100% { transform: translate(0, 0); }
}

.shake { animation: screenShake 0.08s linear 12; }

@keyframes winnerGlow {
    0% { text-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold-deep); transform: scale(1); }
    50% { text-shadow: 0 0 28px var(--gold-hot), 0 0 48px var(--gold); transform: scale(1.06); }
    100% { text-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold-deep); transform: scale(1); }
}

.winner-active { animation: winnerGlow 0.8s ease-in-out infinite; }
