/* Wavelength – mörk partyspel-design */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(160deg, #0a0a12 0%, #111827 50%, #0f172a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        max(12px, env(safe-area-inset-top))
        max(10px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(10px, env(safe-area-inset-left));
    color: #e5e7eb;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.game-container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.game-container .card {
    padding: 14px 10px;
}

.game-container .dial-wrap {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

h1 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f472b6, #818cf8, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2, h3 {
    color: #f3f4f6;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.subtitle {
    text-align: center;
    color: #9ca3af;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.card {
    background: rgba(17, 17, 25, 0.92);
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card.compact { padding: 16px; }

.center { text-align: center; }

.emoji-lg { font-size: 2.5rem; margin-bottom: 12px; }

.loading { color: #9ca3af; text-align: center; padding: 12px; }

.input, .textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(129, 140, 248, 0.3);
    background: rgba(0, 0, 0, 0.35);
    color: #f9fafb;
    font-size: 1rem;
    margin-bottom: 10px;
}

.textarea { resize: vertical; min-height: 60px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, opacity 0.12s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-full { width: 100%; }
.btn-lg { padding: 16px; font-size: 1.05rem; min-height: 48px; }
.btn-small { padding: 8px 12px; font-size: 0.8rem; min-height: 36px; }

.btn-primary {
    background: linear-gradient(135deg, #818cf8, #a855f7);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.link-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
}

.footer-actions { text-align: center; margin-top: 24px; }

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.player-btn {
    padding: 14px 10px;
    border-radius: 14px;
    border: 2px solid rgba(129, 140, 248, 0.25);
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.player-btn:hover {
    border-color: rgba(244, 114, 182, 0.6);
    background: rgba(244, 114, 182, 0.12);
}

.player-btn.loading { opacity: 0.5; pointer-events: none; }

.error-msg {
    color: #f87171;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.info-msg {
    color: #9ca3af;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 0.9rem;
}

.games-list { display: flex; flex-direction: column; gap: 10px; }

.game-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 14px;
}

.game-card.clickable {
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.game-card-title { font-weight: 600; color: #f3f4f6; }
.game-card-meta { font-size: 0.8rem; color: #9ca3af; margin-top: 4px; }

.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 6px;
    background: rgba(129, 140, 248, 0.15);
    color: #a5b4fc;
}

.lobby-hint {
    margin-bottom: 8px !important;
    font-size: 0.85rem;
}

.card h3 {
    margin-bottom: 8px;
}

.turn-order-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.turn-order-item {
    display: grid;
    grid-template-columns: 28px 1fr 68px;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    min-height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.turn-order-item-readonly {
    grid-template-columns: 28px 1fr;
}

.turn-order-item.next-psychic {
    border-color: rgba(244, 114, 182, 0.45);
    background: rgba(244, 114, 182, 0.08);
}

.turn-order-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.2);
    color: #c7d2fe;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.turn-order-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.turn-order-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    width: 68px;
    flex-shrink: 0;
}

.turn-order-actions .btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-item {
    display: grid;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.player-item-simple {
    grid-template-columns: 1fr;
    padding: 4px 10px;
    min-height: 0;
}

.player-item-gm {
    grid-template-columns: 1fr 32px;
    gap: 8px;
    padding: 5px 8px;
    min-height: 38px;
}

.player-item-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 1.35;
}

.player-item-simple .player-item-name {
    font-size: 0.84rem;
    font-weight: 500;
}

.player-item-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1;
}

.btn-icon-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-icon-danger:active {
    background: rgba(239, 68, 68, 0.28);
}

.player-item.offline { opacity: 0.45; }

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.score-table th, .score-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.score-table th { color: #9ca3af; font-weight: 500; text-align: left; }
.score-table .right { text-align: right; }

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* Spelskärm */
.round-badge {
    text-align: center;
    font-size: 0.8rem;
    color: #818cf8;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.role-banner {
    text-align: center;
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.role-banner.psychic {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(244, 114, 182, 0.2));
    border: 1px solid rgba(244, 114, 182, 0.5);
    color: #f9a8d4;
    animation: pulse 2s ease-in-out infinite;
}

.role-banner.waiting {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(244, 114, 182, 0.15); }
}

.spectrum-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 0;
    background: linear-gradient(135deg, rgba(42,157,143,0.15), rgba(231,111,81,0.12));
    border-radius: 16px;
    border: 3px solid #152238;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
}

.spectrum-scale-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

.spectrum-category-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(21, 34, 56, 0.45);
    border-bottom: 1px solid rgba(21, 34, 56, 0.7);
}

.spectrum-category-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
}

.spectrum-category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c7d2fe;
    letter-spacing: 0.02em;
}

.spectrum-left, .spectrum-right {
    flex: 1;
    font-weight: 800;
    font-size: 1rem;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.02em;
}

.spectrum-left { text-align: right; color: #2a9d8f; }
.spectrum-right { text-align: left; color: #e76f51; }

.spectrum-line {
    width: 36px;
    height: 4px;
    background: linear-gradient(90deg, #2a9d8f, #f9c74f, #e76f51);
    border-radius: 2px;
    flex-shrink: 0;
}

.clue-display {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fef3c7;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(250, 204, 21, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.psychic-name {
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.target-hint {
    text-align: center;
    color: #22c55e;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.dial-wrap {
    width: 100%;
    margin: 4px 0 12px;
    touch-action: pan-y;
}

.dial-wrap-reveal {
    margin-bottom: 8px;
    touch-action: pan-y;
}

.dial-wrap-reveal .wl-dial-stage,
.dial-wrap-reveal .wl-dial-canvas {
    touch-action: pan-y;
}

.wl-dial-root {
    width: 100%;
}

.wl-dial-stage {
    position: relative;
    width: 100%;
    border-radius: 16px 16px 10px 10px;
    overflow: hidden;
    background: #fff;
    padding: 2px 2px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 0 0 3px #152238;
}

.wl-dial-canvas {
    display: block;
    width: 100%;
}

.wl-dial-slider {
    display: block;
    width: 100%;
    margin: 16px 0 4px;
    height: 48px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: none;
}

.wl-dial-slider::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2a9d8f, #f9c74f, #e76f51);
    border: 2px solid #152238;
}

.wl-dial-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    margin-top: -12px;
    border-radius: 50%;
    background: #d62839;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #152238, 0 3px 8px rgba(0,0,0,0.35);
}

.wl-dial-slider::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2a9d8f, #f9c74f, #e76f51);
    border: 2px solid #152238;
}

.wl-dial-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #d62839;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #152238, 0 3px 8px rgba(0,0,0,0.35);
}

.wl-dial-canvas {
    display: block;
    width: 100%;
    position: relative;
    z-index: 1;
}

.guess-status {
    text-align: center;
    color: #2a9d8f;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.guess-status-list {
    display: grid;
    gap: 8px;
    margin: 14px 0 8px;
}

.guess-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(129, 140, 248, 0.25);
}

.guess-status-name {
    font-weight: 600;
    color: #e5e7eb;
}

.guess-status-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.guess-status-label.submitted {
    color: #10b981;
}

.guess-status-label.waiting {
    color: #9ca3af;
}

.wl-hold-reveal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 72px;
    margin-top: 12px;
    padding: 14px 20px;
    border-radius: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    border: 3px solid rgba(129, 140, 248, 0.5);
    box-shadow: 0 0 24px rgba(129, 140, 248, 0.35);
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wl-hold-reveal-btn.wl-hold-reveal-pressed {
    transform: scale(0.97);
    box-shadow: 0 0 36px rgba(129, 140, 248, 0.55);
}

.wl-hold-reveal-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.wl-hold-reveal-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.wl-hold-reveal-title {
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.wl-hold-reveal-hint {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 600;
}

.scoreboard {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
}

.score-row-reveal span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.score-round {
    font-weight: 800;
    font-size: 0.85rem;
    color: #6b7280;
}

.score-round-scored {
    color: #2a9d8f;
}

.scoreboard-reveal .score-row-reveal strong {
    min-width: 2ch;
    text-align: right;
}

.results-list { margin-top: 16px; }

.result-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.pts-win { color: #22c55e; }
.pts-zero { color: #6b7280; }

.reveal-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 16px;
    padding: 14px;
    background: #f4efe4;
    border-radius: 14px;
    border: 3px solid #152238;
    touch-action: pan-y;
}

.reveal-legend-item {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 0.92rem;
    color: #1e293b;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(21,34,56,0.12);
}

.reveal-legend-item:last-child {
    border-bottom: none;
}

.reveal-legend-psychic {
    background: rgba(82, 183, 136, 0.14);
    border-radius: 10px;
    padding: 10px 8px;
    border-bottom: none;
    margin-bottom: 2px;
}

.reveal-legend-divider {
    height: 1px;
    background: rgba(21, 34, 56, 0.12);
    margin: 10px 0;
}

.reveal-role-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c3aed;
}

.reveal-legend-target {
    background: rgba(82,183,136,0.12);
    border-radius: 8px;
    padding: 8px 6px;
    border-bottom: none;
    margin-bottom: 4px;
}

.reveal-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #152238;
}

.reveal-swatch-target,
.reveal-swatch-psychic {
    background: #52b788;
}

.reveal-legend-meta {
    color: #64748b;
    font-size: 0.78rem;
    white-space: nowrap;
    font-weight: 600;
}

.reveal-points {
    font-weight: 800;
    font-size: 0.95rem;
    color: #64748b;
}

.reveal-points-scored {
    color: #0d9488;
}

.reveal-zones-block {
    padding: 2px 0 4px;
}

.reveal-zones-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 6px;
}

.reveal-zones-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.88rem;
    color: #1e293b;
}

.reveal-zones-pts {
    flex-shrink: 0;
    min-width: 36px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
}

.reveal-zone-5 .reveal-zones-pts { background: rgba(82, 183, 136, 0.4); color: #166534; }
.reveal-zone-3 .reveal-zones-pts { background: rgba(231, 111, 81, 0.3); color: #c2410c; }
.reveal-zone-1 .reveal-zones-pts { background: rgba(249, 199, 79, 0.45); color: #a16207; }

.reveal-zones-range {
    font-weight: 600;
    color: #334155;
}

.reveal-zones-foot {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* —— GM poängzoner —— */
.zone-setting {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.zone-setting-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.zone-setting-badge {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.zone-badge-5 { background: rgba(82,183,136,0.25); color: #86efac; }
.zone-badge-3 { background: rgba(231,111,81,0.2); color: #fdba74; }
.zone-badge-1 { background: rgba(249,199,79,0.25); color: #fcd34d; }

.zone-setting-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e5e7eb;
}

.zone-slider {
    width: 100%;
    accent-color: #818cf8;
}

.zone-setting-hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #9ca3af;
}

@media (max-width: 520px) {
    body { padding:
        max(8px, env(safe-area-inset-top))
        max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom))
        max(8px, env(safe-area-inset-left));
    }

    .container,
    .game-container {
        max-width: 100%;
    }

    h1 { font-size: 1.55rem; }
    h2, h3 { font-size: 1rem; }

    .card {
        padding: 14px 12px;
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .subtitle {
        font-size: 0.88rem;
        margin-bottom: 14px;
    }

    .header-row {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .header-row h2 {
        font-size: 1.15rem;
        margin-bottom: 0;
    }

    .banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        text-align: center;
    }

    .banner .btn {
        width: 100%;
    }

    .player-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .player-btn {
        padding: 16px 8px;
        font-size: 0.92rem;
        min-height: 52px;
    }

    .game-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .game-card .btn {
        width: 100%;
    }

    .turn-order-item {
        grid-template-columns: 26px 1fr 64px;
        padding: 5px 6px;
        min-height: 36px;
    }

    .turn-order-item-readonly {
        grid-template-columns: 26px 1fr;
    }

    .turn-order-actions {
        width: 64px;
    }

    .player-item-gm {
        grid-template-columns: 1fr 32px;
        padding: 5px 6px;
        min-height: 36px;
    }

    .player-item-simple {
        padding: 4px 8px;
    }

    .score-table {
        font-size: 0.85rem;
    }

    .score-table th,
    .score-table td {
        padding: 8px 4px;
    }

    .role-banner {
        font-size: 0.92rem;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .spectrum-bar {
        margin-bottom: 12px;
    }

    .spectrum-scale-row {
        padding: 10px 10px;
        gap: 6px;
    }

    .spectrum-category-strip {
        padding: 6px 10px;
    }

    .spectrum-left,
    .spectrum-right {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .spectrum-line {
        width: 28px;
    }

    .wl-dial-slider {
        margin: 12px 0 2px;
        height: 44px;
    }

    .wl-dial-slider::-webkit-slider-thumb {
        width: 36px;
        height: 36px;
    }

    .wl-dial-slider::-moz-range-thumb {
        width: 36px;
        height: 36px;
    }

    .wl-hold-reveal-btn {
        min-height: 68px;
        padding: 12px 16px;
    }

    .guess-status-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .guess-status-name {
        font-size: 0.9rem;
    }

    .guess-status-label {
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .reveal-legend {
        padding: 10px;
    }

    .reveal-legend-item {
        grid-template-columns: 14px 1fr;
        grid-template-rows: auto auto;
        gap: 4px 8px;
        font-size: 0.85rem;
    }

    .reveal-legend-meta {
        grid-column: 2;
        white-space: normal;
    }

    .info-msg {
        font-size: 0.85rem;
        padding: 10px;
    }

    .input, .textarea {
        font-size: 16px;
        padding: 14px 12px;
    }

    .footer-actions {
        margin-top: 16px;
    }
}

@media (max-width: 360px) {
    h1 { font-size: 1.4rem; }
    .player-grid { grid-template-columns: 1fr 1fr; }
    .spectrum-left, .spectrum-right { font-size: 0.75rem; }
}

.category-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* —— Admin kategorier (accordion) —— */
.container-narrow {
    max-width: 520px;
}

.card-compact {
    padding: 12px 14px;
}

.input-compact {
    padding: 8px 10px;
    font-size: 0.9rem;
}

.cat-add-row,
.cat-quick-add {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cat-add-row .input,
.cat-quick-add .input {
    flex: 1;
    min-width: 0;
}

.cat-bulk-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.cat-bulk-hint {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.4;
}

.cat-bulk-hint code {
    font-size: 0.76rem;
    color: #c7d2fe;
    background: rgba(99,102,241,0.12);
    padding: 1px 4px;
    border-radius: 4px;
}

.cat-bulk-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.45;
}

.cat-bulk-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cat-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-item {
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}

.cat-item-open {
    border-color: rgba(99,102,241,0.35);
    background: rgba(99,102,241,0.06);
}

.cat-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cat-chevron {
    color: #9ca3af;
    font-size: 0.7rem;
    width: 12px;
    flex-shrink: 0;
}

.cat-item-name {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
}

.cat-item-count {
    color: #9ca3af;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 999px;
}

.cat-panel {
    padding: 0 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cat-panel-head {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0 8px;
}

.cat-name-edit {
    flex: 1;
    font-weight: 600;
}

.cat-scales {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.cat-scale-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.cat-scale-side {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

.cat-scale-sep {
    color: #6b7280;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.cat-empty {
    color: #6b7280;
    font-size: 0.82rem;
    padding: 4px 0 8px;
}

.cat-quick-add {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,0.08);
}

/* —— Admin spelarlista —— */
.admin-player-add {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-player-add .input {
    flex: 1;
    min-width: 0;
}

.admin-players-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-player-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    min-height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.admin-player-row-edit {
    grid-template-columns: 1fr auto auto;
    padding: 5px 6px;
}

.admin-player-offline {
    opacity: 0.5;
}

.admin-player-dot {
    font-size: 0.55rem;
    line-height: 1;
    text-align: center;
}

.admin-player-name {
    font-size: 0.84rem;
    font-weight: 500;
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.admin-player-gm {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(129,140,248,0.2);
    color: #a5b4fc;
    vertical-align: middle;
}

.admin-player-meta {
    margin-left: 6px;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 400;
}

.admin-player-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.admin-player-actions .btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.85rem;
    touch-action: manipulation;
    position: relative;
    z-index: 1;
}

.admin-player-edit-name {
    min-width: 0;
}

.admin-player-gm-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-player-gm-label input {
    width: 14px;
    height: 14px;
}

.admin-player-edit-error {
    margin: -2px 0 4px;
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* —— Lobby kategorier —— */
.lobby-cat-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.lobby-cat-header h3 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
}

.lobby-cat-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.lobby-cat-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lobby-cat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 10px;
    min-height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #9ca3af;
    font: inherit;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lobby-cat-chip:disabled {
    opacity: 0.7;
    cursor: wait;
}

.lobby-cat-chip-on {
    background: rgba(99,102,241,0.18);
    border-color: rgba(99,102,241,0.45);
    color: #e5e7eb;
}

.lobby-cat-check {
    width: 12px;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #818cf8;
    text-align: center;
}

.lobby-cat-chip:not(.lobby-cat-chip-on) .lobby-cat-check {
    color: transparent;
}

.lobby-cat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-cat-count {
    font-size: 0.72rem;
    color: #6b7280;
    flex-shrink: 0;
}

.lobby-cat-chip-on .lobby-cat-count {
    color: #a5b4fc;
}

.lobby-cat-readonly {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 10px;
    min-height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.82rem;
    color: #6b7280;
}

.lobby-cat-readonly-on {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #d1d5db;
}

.lobby-cat-readonly .lobby-cat-check {
    color: transparent;
}

.lobby-cat-readonly-on .lobby-cat-check {
    color: #818cf8;
}

.game-cat-panel {
    margin: 10px 0 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.game-cat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 6px;
}

.game-cat-col {
    gap: 3px;
}

.category-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
}

.category-toggle input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.category-toggle-on {
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.12);
}

.category-toggle-name {
    flex: 1;
    font-size: 0.95rem;
}

.category-toggle-meta {
    color: #9ca3af;
    font-size: 0.8rem;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    margin: 0 6px 6px 0;
    border-radius: 999px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    font-size: 0.85rem;
}

.category-chip-meta {
    color: #9ca3af;
}

.spectrum-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spectrum-card-row,
.spectrum-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.spectrum-card-input {
    flex: 1;
    min-width: 100px;
}

.spectrum-card-arrow {
    color: #9ca3af;
    flex-shrink: 0;
}

.category-card + .category-card {
    margin-top: 12px;
}

/* —— Historik / statistik —— */
.stats-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stats-summary {
    flex: 1;
    font-size: 0.8rem;
    color: #9ca3af;
    min-width: 120px;
}

.stats-row,
.stats-pair-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-row {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}

.stats-row-name,
.stats-pair-names {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 0;
}

.stats-row-meta,
.stats-pair-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.stats-row-points {
    color: #a5b4fc;
    font-size: 0.9rem;
    white-space: nowrap;
}

.stats-pair-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
}

.stats-pair {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.stats-pair-often-zero {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.stats-pair-arrow {
    color: #6b7280;
    font-weight: 400;
}

.stats-pair-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.stats-pt {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.stats-pt-0 { background: rgba(107,114,128,0.25); color: #9ca3af; }
.stats-pt-1 { background: rgba(249,199,79,0.2); color: #fcd34d; }
.stats-pt-3 { background: rgba(231,111,81,0.2); color: #fdba74; }
.stats-pt-5 { background: rgba(82,183,136,0.25); color: #86efac; }

.stats-recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.stats-recent {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.stats-recent-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.stats-recent-sub {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

/* —— Lobby historik —— */
.lobby-history-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lobby-round-badge {
    color: #a855f7;
    font-size: 0.8rem;
    background: rgba(168,85,247,0.12);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 10px;
    padding: 2px 10px;
}

.btn-history {
    font-size: 0.8rem;
    padding: 2px 10px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 10px;
    color: #818cf8;
    cursor: pointer;
}

.history-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.history-modal-inner {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.history-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.history-pause-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
}

.history-pause-line {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.07);
}

.history-pause-chip {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.75rem;
    color: #f59e0b;
    white-space: nowrap;
}
