:root {
    --bg: #10151d;
    --panel: #1b2838;
    --panel-2: #16202d;
    --line: #2b3a4a;
    --text: #e8eef4;
    --muted: #93a5b5;
    --accent: #66c0f4;
    --accent-dark: #2a7fbf;
    --warm: #f2a007;
    --danger: #e35d6a;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 20px 48px; }

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 0 6px;
}
.brand { color: var(--text); text-decoration: none; font-size: 1.25rem; letter-spacing: .2px; }
.brand strong { color: var(--accent); }
.brand-mark { color: var(--warm); margin-right: 6px; }
.topbar-note { color: var(--muted); font-size: .9rem; }

.footer { margin-top: 40px; color: var(--muted); font-size: .85rem; text-align: center; }

.hero { text-align: center; padding: 34px 10px 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 10px; letter-spacing: -.5px; }
.hero .accent { color: var(--warm); }
.lede { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin: 0 auto; line-height: 1.55; }
.lede em { color: var(--text); font-style: normal; font-weight: 600; }

.steps {
    display: flex; gap: 8px; justify-content: center;
    list-style: none; padding: 0; margin: 26px 0 18px;
}
.steps li {
    display: flex; align-items: center; gap: 8px;
    color: var(--muted); padding: 6px 14px 6px 8px;
    border: 1px solid var(--line); border-radius: 999px; font-size: .95rem;
}
.steps li span {
    display: grid; place-items: center; width: 24px; height: 24px;
    border-radius: 50%; background: var(--panel); color: var(--muted); font-weight: 700;
}
.steps li.on { color: var(--text); border-color: var(--accent-dark); }
.steps li.on span { background: var(--accent-dark); color: #fff; }

.panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 26px; margin-top: 14px;
}
.panel h2 { margin: 0 0 8px; font-size: 1.45rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--muted); line-height: 1.55; }
.center { text-align: center; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.subhead { margin: 26px 0 10px; font-size: 1.05rem; color: var(--text); }

.player-row { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.player-row label { width: 84px; flex: none; color: var(--muted); font-weight: 600; }
input {
    flex: 1; min-width: 0;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
    color: var(--text); padding: 11px 13px; font-size: 1rem;
}
input:focus { outline: 2px solid var(--accent-dark); border-color: var(--accent-dark); }
input::placeholder { color: #5f7285; }

button {
    font: inherit; cursor: pointer; border-radius: 10px;
    border: 1px solid transparent; padding: 10px 18px; font-weight: 600;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent-dark); color: #fff; }
.primary:hover:not(:disabled) { background: #3590d4; }
.primary.big { font-size: 1.08rem; padding: 13px 22px; }
.secondary { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.ghost.small { padding: 5px 10px; font-size: .85rem; }
.link-btn { text-decoration: none; display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600; }

.row-actions { margin: 4px 0 10px 94px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.cta-row.center { justify-content: center; }

.banner { border-radius: var(--radius); padding: 14px 18px; margin-top: 14px; line-height: 1.5; }
.banner.error { background: #3a1d22; border: 1px solid var(--danger); color: #ffd7db; }
.banner.notice { background: #22303f; border: 1px solid var(--accent-dark); color: #d6ecfd; }
.key-note {
    margin-top: 18px; background: var(--panel-2); border: 1px solid var(--warm);
    border-radius: var(--radius); padding: 14px 18px; line-height: 1.55; color: #f5e3bb;
}

.grid {
    display: grid; gap: 16px; margin-top: 16px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
    background: var(--panel-2); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
}
.card img { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; background: #0b0f14; }
.img-fallback {
    aspect-ratio: 460 / 215; display: grid; place-items: center;
    font-size: 2.4rem; font-weight: 800; color: var(--accent); background: #0b0f14;
}
.card-body { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; }
.card-body h3 { margin: 0; font-size: .98rem; line-height: 1.3; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: 999px; padding: 7px 14px; font-weight: 500;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.alt { color: var(--muted); }

.manual-row { display: flex; gap: 10px; flex-wrap: wrap; }
.manual-row input { flex: 1 1 220px; }

.wheel-panel { text-align: left; }
.wheel-wrap {
    position: relative; width: min(520px, 92vw); aspect-ratio: 1;
    margin: 26px auto 8px;
}
.pointer {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; z-index: 3;
    border-left: 16px solid transparent; border-right: 16px solid transparent;
    border-top: 26px solid var(--warm);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.wheel {
    width: 100%; height: 100%; display: block; border-radius: 50%;
    box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 6px #0b0f14, 0 0 0 8px var(--line);
    transition: transform 6.5s cubic-bezier(.12, .8, .08, 1);
    will-change: transform;
}
.wheel-label { fill: #fff; font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 3px; stroke-linejoin: round; letter-spacing: .2px; }
.hub {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 92px; height: 92px; border-radius: 50%; z-index: 2;
    background: var(--warm); color: #231600; font-weight: 800; letter-spacing: 1px;
    border: 4px solid #0b0f14; font-size: 1.05rem;
}
.hub:hover:not(:disabled) { background: #ffb62e; }
.hub:disabled { opacity: .8; }

.winner {
    margin: 26px auto 6px; max-width: 560px; text-align: center;
    background: var(--panel-2); border: 1px solid var(--warm); border-radius: var(--radius);
    padding: 22px;
    animation: pop .45s ease-out;
}
.winner-kicker { color: var(--warm); text-transform: uppercase; letter-spacing: 2px; font-size: .8rem; margin: 0 0 12px; font-weight: 700; }
.winner img { width: 100%; border-radius: 10px; display: block; }
.winner h3 { font-size: 1.7rem; margin: 14px 0 4px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.boot { text-align: center; padding: 80px 20px; color: var(--muted); }
.boot-wheel {
    width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%;
    border: 6px solid var(--line); border-top-color: var(--warm);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: #3a1d22; color: #ffd7db; padding: 12px 20px;
}
#blazor-error-ui .reload { color: #fff; margin-left: 10px; }
#blazor-error-ui .dismiss { position: absolute; right: 14px; cursor: pointer; }

@media (max-width: 640px) {
    .panel { padding: 18px; }
    .player-row label { width: 64px; }
    .row-actions { margin-left: 74px; }
    .topbar-note { display: none; }
}
