* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-surface: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --text: #eee;
    --text-muted: #aaa;
    --success: #4ecdc4;
    --warning: #f39c12;
    --night-bg: #0d1b2a;
    --day-bg: #2c3e50;
    --wolf-red: #e74c3c;
    --village-blue: #3498db;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

#app {
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    inset: 0;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.5rem;
    text-align: center;
}

/* Welcome Screen */
.logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--bg-surface);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: #1a4a7a;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Rejoin Banner */
.rejoin-banner {
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeSlideIn 0.3s ease;
}

.rejoin-banner p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.rejoin-banner strong {
    color: var(--accent);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.rejoin-banner .btn {
    margin: 0.25rem;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* "New version available" banner */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    animation: fadeSlideIn 0.3s ease;
}

.btn-update {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    border-radius: 999px;
    padding: 0.3rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-update:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Name entry screen */
.name-prompt {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.recent-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    animation: fadeSlideIn 0.3s ease;
}

.name-chip {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: 999px;
    overflow: hidden;
}

.name-chip-label {
    padding: 0.45rem 0.5rem 0.45rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.name-chip-x {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.3rem 0.6rem 0.4rem;
    cursor: pointer;
}

.name-chip-x:hover {
    color: var(--wolf-red);
}

#home-greeting {
    margin-bottom: 1.25rem;
}

/* Inline join (code + button) on the home screen */
.join-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.join-box input {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.join-box .btn {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
}

/* "Your rooms" list */
.my-rooms {
    margin-bottom: 1rem;
    text-align: left;
    animation: fadeSlideIn 0.3s ease;
}

.my-rooms h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.my-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 0.6rem 0.75rem 0.6rem 1rem;
    margin-bottom: 0.5rem;
}

.my-room-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.my-room-code {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--accent);
}

.my-room-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.my-room-item .btn {
    margin: 0;
    width: auto;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Lobby */
.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 60px;
}

.player-chip {
    background: var(--bg-surface);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.player-chip.host::before {
    content: '👑';
    font-size: 0.8rem;
}

.player-chip.you {
    border: 1px solid var(--accent);
}

/* Room Settings */
.room-settings {
    text-align: left;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

.room-settings h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    cursor: pointer;
    font-size: 0.95rem;
}

.toggle-row input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-surface);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s;
}

.toggle-row input:checked + .toggle-switch {
    background: var(--accent);
}

.toggle-row input:checked + .toggle-switch::after {
    left: 23px;
    background: white;
}

/* Nomination badges */
.target-btn .nom-count {
    margin-left: auto;
    background: var(--accent);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-btn.nominated {
    border-color: var(--warning);
    background: rgba(243, 156, 18, 0.1);
}

.target-btn.my-nomination {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.15);
}

/* Shank (trial) screen */
.shank-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: monospace;
    transition: color 0.3s;
}

.shank-timer.urgent {
    color: var(--wolf-red);
}

.shank-accused {
    margin-bottom: 2rem;
}

.shank-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.shank-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.shank-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.shank-vote-btn {
    width: 80px;
    height: 80px;
    font-size: 2.2rem;
    border-radius: 50%;
}

.shank-vote-btn.active {
    transform: scale(1.1);
}

/* Vote result thumbs */
.vote-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--bg-surface);
    border-radius: 10px;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:active {
    transform: scale(0.9);
}

.vote-btn.vote-up.active {
    border-color: var(--success);
    background: rgba(78, 205, 196, 0.15);
}

.vote-btn.vote-down.active {
    border-color: var(--wolf-red);
    background: rgba(231, 76, 60, 0.15);
}

.player-count {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.status-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* Role Card */
.role-card {
    width: 220px;
    height: 300px;
    margin: 0 auto 1.5rem;
    perspective: 1000px;
    cursor: pointer;
}

.role-card.flipped .role-card-inner {
    transform: rotateY(180deg);
}

.role-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.role-card-front,
.role-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.role-card-front {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
    border: 2px solid #fff;
}

.role-card-front p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.role-card-back {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
    border: 3px solid #fff;
    transform: rotateY(180deg);
}

.role-card-back.team-wolf {
    border-color: var(--wolf-red);
}

.role-card-back.team-village {
    border-color: var(--village-blue);
}

.role-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.role-card-back h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.role-card-back p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.peek-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.peek-card {
    width: 220px;
    height: 300px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
    border: 3px solid #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.peek-card.team-wolf {
    border-color: var(--wolf-red);
}

.peek-card.team-village {
    border-color: var(--village-blue);
}

.peek-card .role-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.peek-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.peek-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Night & Day Screens */
.screen-night {
    background: var(--night-bg);
}

.screen-day {
    background: var(--day-bg);
    transition: box-shadow 0.5s ease;
}

.screen-day.accused-danger {
    box-shadow: inset 0 0 80px rgba(231, 76, 60, 0.3);
}

.phase-header {
    margin-bottom: 1.5rem;
}

.phase-icon {
    font-size: 2.5rem;
}

.phase-header h2 {
    margin-bottom: 0.25rem;
}

.phase-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.instruction {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.target-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.target-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--bg-surface);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.target-btn:hover {
    border-color: var(--accent);
}

.target-btn.selected {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.15);
}

.target-btn .player-status {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Waiting */
.waiting-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

.waiting-message p {
    color: var(--text-muted);
}

/* Night Resolve */
.resolve-results {
    text-align: left;
    margin-bottom: 2rem;
}

.resolve-item {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resolve-item .resolve-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.resolve-item .resolve-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.resolve-item.reveal-wolf {
    border-left: 3px solid var(--wolf-red);
}

.resolve-item.reveal-village {
    border-left: 3px solid var(--village-blue);
}

.resolve-item.reveal-neutral {
    border-left: 3px solid var(--text-muted);
}

/* Announcements */
.announcement {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.announcement p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.announcement p:last-child {
    margin-bottom: 0;
}

.announcement .death {
    color: var(--wolf-red);
    font-weight: 600;
}

.announcement .saved {
    color: var(--success);
}

/* Vote Tally */
.vote-tally {
    margin-top: 1.5rem;
    text-align: left;
}

.vote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}

.vote-row .name {
    font-weight: 500;
}

.vote-row .vote-icon {
    font-size: 1.3rem;
}

.vote-row.vote-kill {
    border-left: 3px solid var(--wolf-red);
}

.vote-row.vote-spare {
    border-left: 3px solid var(--success);
}

.vote-summary {
    margin-top: 1rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem;
    background: var(--bg-surface);
    border-radius: 8px;
}

/* Game Over */
#gameover-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#gameover-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.role-reveal-list {
    text-align: left;
    margin-bottom: 2rem;
}

.role-reveal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.role-reveal-item .player-name {
    font-weight: 500;
}

.role-reveal-item .player-role {
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

.role-reveal-item .player-role.wolf {
    background: rgba(231, 76, 60, 0.2);
    color: var(--wolf-red);
}

.role-reveal-item .player-role.village {
    background: rgba(52, 152, 219, 0.2);
    color: var(--village-blue);
}

.role-reveal-item.dead .player-name {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Dead Screen */
.dead-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.ghost-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
    font-style: italic;
}

/* Timer */
.timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Debug badge */
.room-badge {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    z-index: 9999;
    letter-spacing: 1px;
    font-family: monospace;
}

.destroy-room-btn {
    position: fixed;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.2s;
}

.destroy-room-btn.confirm {
    background: var(--wolf-red);
    color: #fff;
    border-color: var(--wolf-red);
}

.debug-badge {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--warning);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 9999;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.peek-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    z-index: 9998;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Screen transitions */
.screen {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Scrollbar */
.screen::-webkit-scrollbar {
    width: 4px;
}

.screen::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 4px;
}

/* ─── Card Selection Screen ─── */
.screen-cards.active {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}
.screen-cards .container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 0;
}
.deck-bar-spacer {
    height: 3.5rem;
}
.deck-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 0.7rem 1rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    z-index: 10;
    border-top: 1px solid var(--bg-surface);
}

.team-section { margin-bottom: 1.5rem; }
.team-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
}
.team-section h3.wolf { color: var(--wolf-red); }
.team-section h3.village { color: var(--village-blue); }
.team-section h3.neutral { color: #a855f7; }

.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.role-select-card {
    background: var(--bg-card);
    border: 2px solid var(--bg-surface);
    border-radius: 12px;
    padding: 0.6rem;
    text-align: center;
    transition: border-color 0.2s;
    position: relative;
}
.role-select-card.active.team-wolf { border-color: var(--wolf-red); }
.role-select-card.active.team-village { border-color: var(--village-blue); }
.role-select-card.active.team-neutral { border-color: #a855f7; }

.role-select-info {
    display: flex; align-items: center; gap: 0.3rem;
    justify-content: center; flex-wrap: wrap; margin-bottom: 0.15rem;
}
.role-select-icon { font-size: 1.8rem; }
.role-select-name { font-weight: 600; font-size: 0.8rem; }
.role-select-desc { font-size: 0.6rem; color: var(--text-muted); margin-bottom: 0.4rem; line-height: 1.3; }

.role-select-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}
.role-select-controls button {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--bg-surface); background: var(--bg-dark);
    color: var(--text); font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.role-select-controls .role-count {
    font-size: 1.1rem; font-weight: 700; min-width: 1.5rem; text-align: center;
}

/* 3-state toggle: Exclude / Include / Vote */
.role-state-toggle {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bg-surface);
    margin-top: 0.35rem;
}
.role-state-toggle .state-opt {
    flex: 1;
    padding: 0.3rem 0;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.role-state-toggle .state-opt + .state-opt {
    border-left: 1px solid var(--bg-surface);
}

/* Active state highlights — team coloured */
.role-state-toggle[data-state="exclude"] .state-opt[data-val="exclude"] {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}
.role-state-toggle.team-wolf[data-state="include"] .state-opt[data-val="include"] {
    background: var(--wolf-red);
    color: #fff;
}
.role-state-toggle.team-village[data-state="include"] .state-opt[data-val="include"] {
    background: var(--village-blue);
    color: #fff;
}
.role-state-toggle.team-neutral[data-state="include"] .state-opt[data-val="include"] {
    background: #a855f7;
    color: #fff;
}
.role-state-toggle.team-wolf[data-state="vote"] .state-opt[data-val="vote"] {
    background: rgba(231, 76, 60, 0.25);
    color: var(--wolf-red);
}
.role-state-toggle.team-village[data-state="vote"] .state-opt[data-val="vote"] {
    background: rgba(52, 152, 219, 0.25);
    color: var(--village-blue);
}
.role-state-toggle.team-neutral[data-state="vote"] .state-opt[data-val="vote"] {
    background: rgba(168, 85, 247, 0.25);
    color: #a855f7;
}

/* ─── Lobby Voting ─── */
.voteable-roles { margin-bottom: 1rem; }
.voteable-roles h3 { text-align: center; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }

.voteable-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-surface);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.voteable-card .v-icon { font-size: 1.3rem; flex-shrink: 0; }
.voteable-card .v-info { flex: 1; text-align: left; }
.voteable-card .v-name { font-weight: 600; font-size: 0.85rem; }
.voteable-card .v-tally { font-size: 0.7rem; color: var(--text-muted); }
.v-net { font-weight: 600; }
.v-net.pos { color: var(--success); }
.v-net.neg { color: var(--accent); }
.voteable-card .v-btns { display: flex; gap: 0.3rem; }
.voteable-card .v-btns button {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid var(--bg-surface); background: var(--bg-dark);
    font-size: 1rem; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.voteable-card .v-btns button.vote-yes.active {
    border-color: var(--success); background: rgba(78, 205, 196, 0.25);
}
.voteable-card .v-btns button.vote-no.active {
    border-color: var(--wolf-red); background: rgba(231, 76, 60, 0.25);
}

.deck-summary {
    text-align: center; padding: 0.5rem; font-size: 0.85rem;
    color: var(--text-muted); margin-bottom: 0.5rem;
}
.deck-summary .match { color: var(--success); }
.deck-summary .mismatch { color: var(--wolf-red); }
.deck-summary .deck-range { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.deck-summary .deck-cards {
    display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center;
    margin-bottom: 0.4rem;
}
.deck-summary .deck-chip {
    font-size: 0.7rem; padding: 0.2rem 0.5rem;
    border-radius: 10px; background: var(--bg-surface); color: var(--text);
}
.deck-summary .deck-chip.locked {
    border: 1px solid rgba(78, 205, 196, 0.4);
}
.deck-summary .deck-chip.vote {
    border: 1px solid rgba(168, 85, 247, 0.4);
}

/* ─── Neutral team colours ─── */
.role-reveal-item .player-role.neutral {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}
.role-card-back.team-neutral,
.peek-card.team-neutral {
    border-color: #a855f7;
}

/* Role info overlay (lobby "Vote on Roles" tap-to-view) team label */
.role-info-team {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}
.role-info-team.wolf {
    background: rgba(231, 76, 60, 0.2);
    color: var(--wolf-red);
}
.role-info-team.village {
    background: rgba(52, 152, 219, 0.2);
    color: var(--village-blue);
}
.role-info-team.neutral {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* ─── Alpha convert toggle ─── */
.alpha-convert-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 1rem; margin-bottom: 0.5rem;
    background: rgba(231,76,60,0.1); border: 1px solid var(--wolf-red);
    border-radius: 12px; font-size: 0.9rem;
}
