/* ── Wavelength Game Styles ─────────────────────────────── */

:root {
    --wv-primary: #ff9f43;
    --wv-accent: #ffc312;
    --wv-dark: #1a1a2e;
    --wv-surface: rgba(255, 255, 255, 0.07);
    --wv-border: rgba(255, 255, 255, 0.12);
    --wv-text: #f0f0f0;
    --wv-muted: rgba(255, 255, 255, 0.5);
}

/* Container */
.wv-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    color: var(--wv-text);
    font-family: 'Quicksand', sans-serif;
}

/* Loading / Error */
.wv-loading, .wv-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 1rem;
    text-align: center;
}

.wv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 159, 67, 0.3);
    border-top-color: var(--wv-primary);
    border-radius: 50%;
    animation: wv-spin 0.8s linear infinite;
}

@keyframes wv-spin { to { transform: rotate(360deg); } }

/* Phase header */
.wv-phase-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wv-phase-title {
    font-family: 'Cabin Sketch', cursive;
    font-size: 2rem;
    color: var(--wv-primary);
    margin: 0 0 0.3rem;
}

.wv-phase-desc {
    color: var(--wv-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* Round header */
.wv-round-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.wv-round-badge {
    background: rgba(255, 159, 67, 0.15);
    border: 1px solid rgba(255, 159, 67, 0.3);
    color: var(--wv-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.wv-psychic-badge {
    background: rgba(162, 93, 220, 0.15);
    border: 1px solid rgba(162, 93, 220, 0.3);
    color: #c77dff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Spectrum Component ─────────── */
.wv-spectrum {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.wv-concept {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
    line-height: 1.2;
}

.wv-concept-left { color: #ff6b6b; }
.wv-concept-right { color: #4ecdc4; }

.wv-bar-wrap {
    flex: 1;
    position: relative;
}

.wv-bar {
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(to right,
        #ff4e50, #fc913a, #f9d62e, #a8e063, #4ecdc4, #6a82fb);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Scoring zones */
.wv-zone {
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none;
}

.wv-zone-2pts { background: rgba(255, 255, 255, 0.12); }
.wv-zone-3pts { background: rgba(255, 220, 60, 0.20); }
.wv-zone-4pts { background: rgba(255, 220, 60, 0.45); }

/* Pins (pointers on spectrum) */
.wv-pin {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.wv-pin-line {
    flex: 1;
    width: 3px;
    border-radius: 2px;
}

.wv-pin-head {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: 4px;
    border: 3px solid rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.wv-pin-head-target {
    background: #ff4757;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.8);
}

.wv-pin-head-guess {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.wv-pin-target .wv-pin-line { background: rgba(255, 71, 87, 0.7); }
.wv-pin-guess .wv-pin-line { background: rgba(255, 255, 255, 0.7); }

/* ── Lobby ─────────────────────── */
.wv-lobby {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.wv-room-code-block {
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wv-room-label { color: var(--wv-muted); font-size: 0.85rem; }
.wv-room-code {
    font-family: 'Cabin Sketch', cursive;
    font-size: 2rem;
    color: var(--wv-accent);
    letter-spacing: 0.2em;
}

.wv-section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wv-muted);
    margin: 0 0 0.6rem;
}

.wv-player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wv-player-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--wv-surface);
    border-radius: 8px;
    border: 1px solid var(--wv-border);
}

.wv-player-name { flex: 1; }

.wv-btn-kick {
    background: none;
    border: 1px solid rgba(255, 100, 100, 0.35);
    color: rgba(255, 100, 100, 0.7);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.wv-btn-kick:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: #ff5050;
    color: #ff5050;
}

.wv-badge-host, .wv-badge-you {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
}

.wv-badge-host { background: rgba(255, 159, 67, 0.2); color: var(--wv-primary); }
.wv-badge-you { background: rgba(78, 205, 196, 0.2); color: #4ecdc4; }

.wv-rounds-info {
    text-align: center;
    color: var(--wv-muted);
    font-size: 0.85rem;
}

/* ── Clue View ─────────────────── */
.wv-clue-view { display: flex; flex-direction: column; gap: 1rem; }

.wv-clue-panel {
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wv-clue-instructions {
    margin: 0;
    color: var(--wv-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.wv-clue-input-row {
    display: flex;
    gap: 0.6rem;
}

.wv-clue-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--wv-border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    color: var(--wv-text);
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
}

.wv-clue-input:focus {
    outline: none;
    border-color: var(--wv-primary);
}

.wv-waiting-panel {
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.wv-pulse-icon {
    font-size: 2.5rem;
    animation: wv-pulse 1.5s ease-in-out infinite;
}

@keyframes wv-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

.wv-waiting-text { font-size: 1.05rem; margin: 0; }
.wv-waiting-sub { color: var(--wv-muted); font-size: 0.9rem; margin: 0; }
.wv-waiting-msg { text-align: center; color: var(--wv-muted); font-size: 0.9rem; }

/* ── Guess View ────────────────── */
.wv-guess-view { display: flex; flex-direction: column; gap: 1rem; }

.wv-clue-display {
    text-align: center;
    padding: 0.8rem;
    background: rgba(255, 159, 67, 0.08);
    border: 1px solid rgba(255, 159, 67, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.wv-clue-label { color: var(--wv-muted); font-size: 0.85rem; }

.wv-clue-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wv-accent);
    font-style: italic;
}

.wv-dial-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 12px;
    padding: 1.2rem;
}

.wv-dial-slider {
    width: 100%;
    accent-color: var(--wv-primary);
    cursor: pointer;
    height: 6px;
}

.wv-dial-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    font-size: 0.85rem;
}

.wv-concept-small { color: var(--wv-muted); font-size: 0.8rem; }
.wv-dial-pos { font-weight: 700; font-size: 1rem; color: var(--wv-accent); }

.wv-btn-lockin { margin-top: 0.4rem; }

.wv-psychic-watch {
    text-align: center;
    padding: 1.2rem;
    background: rgba(162, 93, 220, 0.08);
    border: 1px solid rgba(162, 93, 220, 0.2);
    border-radius: 12px;
    color: var(--wv-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wv-dial-pos-display { font-size: 1rem; color: var(--wv-text); }

.wv-player-list-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.wv-player-chip {
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 20px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
}

.wv-chip-psychic {
    border-color: rgba(162, 93, 220, 0.4);
    color: #c77dff;
}

.wv-chip-guessed {
    border-color: rgba(78, 205, 196, 0.4);
    color: #4ecdc4;
}

/* ── Reveal View ───────────────── */
.wv-reveal-view { display: flex; flex-direction: column; gap: 1rem; }

.wv-zone-legend {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.wv-legend-item {
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: 600;
}

.wv-legend-4 { background: rgba(255, 220, 60, 0.35); color: #ffd93d; }
.wv-legend-3 { background: rgba(255, 220, 60, 0.20); color: #ffc312; }
.wv-legend-2 { background: rgba(255, 255, 255, 0.12); color: var(--wv-muted); }
.wv-legend-0 { color: rgba(255,255,255,0.3); }

.wv-score-banner {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.wv-score-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Cabin Sketch', cursive;
}

.wv-score-label { font-size: 1.1rem; font-weight: 600; }

.wv-banner-4 { background: rgba(255, 215, 0, 0.2); border: 1px solid rgba(255, 215, 0, 0.4); color: #ffd700; }
.wv-banner-3 { background: rgba(255, 159, 67, 0.15); border: 1px solid rgba(255, 159, 67, 0.3); color: var(--wv-primary); }
.wv-banner-2 { background: rgba(78, 205, 196, 0.1); border: 1px solid rgba(78, 205, 196, 0.2); color: #4ecdc4; }
.wv-banner-0 { background: rgba(255,255,255,0.05); border: 1px solid var(--wv-border); color: var(--wv-muted); }

.wv-scores-table {
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 12px;
    padding: 1rem;
}

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

.wv-score-row:last-child { border-bottom: none; }
.wv-score-name { display: flex; align-items: center; gap: 0.4rem; }
.wv-score-pts { font-weight: 700; color: var(--wv-accent); }
.wv-round-delta { font-size: 0.75rem; color: #4ecdc4; font-weight: 600; opacity: 0.8; }

/* ── Game Over ─────────────────── */
.wv-gameover {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    text-align: center;
}

.wv-gameover-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.wv-gameover-icon { font-size: 3rem; }

.wv-gameover-title h2 {
    font-family: 'Cabin Sketch', cursive;
    font-size: 2.2rem;
    margin: 0;
    color: var(--wv-primary);
}

.wv-winner-msg { font-size: 1.05rem; }

.wv-final-scores {
    width: 100%;
    max-width: 380px;
    background: var(--wv-surface);
    border: 1px solid var(--wv-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wv-final-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
}

.wv-final-row-you { background: rgba(255, 159, 67, 0.1); }
.wv-final-medal { font-size: 1.2rem; min-width: 28px; }
.wv-final-name { flex: 1; text-align: left; }
.wv-final-pts { font-weight: 700; color: var(--wv-accent); }

.wv-gameover-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Buttons ───────────────────── */
.wv-btn-primary {
    background: linear-gradient(135deg, var(--wv-primary), var(--wv-accent));
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.wv-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.wv-btn-primary:active { transform: translateY(0); }
.wv-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.wv-btn-secondary {
    background: var(--wv-surface);
    color: var(--wv-text);
    border: 1px solid var(--wv-border);
    border-radius: 10px;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    display: inline-block;
}

.wv-btn-secondary:hover { background: rgba(255,255,255,0.12); }
