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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 12px;
    font-size: 2em;
}

.home-tagline {
    text-align: center;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.45;
    margin-bottom: 28px;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* Invite link: full-screen join gate (same flow as home page join form, no prompt/confirm) */
.join-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.97) 0%, rgba(118, 75, 162, 0.97) 100%);
}

.join-gate-overlay.hidden {
    display: none;
}

.join-gate-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.join-gate-card h2 {
    margin-bottom: 8px;
    text-align: center;
}

.join-gate-lead {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.join-gate-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.join-gate-card input[type="text"] {
    width: 100%;
}

.join-gate-card button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
}

.join-gate-error {
    color: #c62828;
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
}

.join-gate-error.hidden {
    display: none;
}

.join-gate-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.9rem;
}

.join-gate-footer a {
    color: #667eea;
    font-weight: 600;
}

h2 {
    color: #764ba2;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.game-setup {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 2px solid #fcc;
}

#gameInfo {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    border: 2px solid #4caf50;
}

#gameInfo strong {
    font-size: 1.5em;
    color: #667eea;
    font-family: monospace;
}

/* Game Screen Styles */
.screen {
    animation: fadeIn 0.3s;
}

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

.game-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.game-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.timer {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    max-width: 100%;
}

.timer .phase-wall-clock {
    font-size: 0.68em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    max-width: 52%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.timer-countdown-wrap {
    white-space: nowrap;
}

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

.good-player-banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    border: 2px solid #81c784;
}

.good-player-banner-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
    color: #2e7d32;
    text-align: center;
}

.good-player-banner--under-role {
    margin-top: 14px;
}

.role-display {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 3px solid #667eea;
}

.role-display h3 {
    margin: 0;
}

#yourRole {
    font-size: 1.25em;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 8px;
    display: inline-block;
    margin-left: 10px;
}

#yourRole.good {
    background: #4caf50;
    color: white;
}

#yourRole.bad {
    background: #f44336;
    color: white;
}

.role-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95em;
}

.players-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.players-list ul {
    list-style: none;
    padding: 0;
}

.players-list li {
    padding: 12px;
    margin: 8px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.players-list li:hover {
    transform: translateX(5px);
}

.players-list li.eliminated {
    opacity: 0.5;
    text-decoration: line-through;
    border-left-color: #999;
}

#votingSection {
    background: #fff3cd;
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #ffc107;
    margin-top: 20px;
}

#votingStatus {
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 600;
    color: #856404;
}

.vote-buttons {
    display: grid;
    gap: 12px;
}

.vote-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.vote-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Touch-friendly voting cards */
.vote-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.vote-card {
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vote-card:active {
    transform: scale(0.95);
    background: #667eea;
    color: white;
}

.vote-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    border-color: #764ba2;
}

.vote-card-number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.vote-card:hover .vote-card-number {
    color: white;
}

.vote-card-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.vote-card:hover .vote-card-name {
    color: white;
}

.vote-card-tap-hint {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.vote-card:hover .vote-card-tap-hint {
    color: rgba(255, 255, 255, 0.9);
}

/* Voted state styling */
.vote-card.voted {
    background: #d4edda;
    border: 3px solid #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.vote-card.voted .vote-card-number {
    color: #28a745;
}

.vote-card.voted .vote-card-name {
    color: #155724;
    font-weight: bold;
}

.vote-card.voted:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
    border-color: #28a745;
}

#voteResult {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    font-weight: 600;
}

/* Full-screen game over (sibling of #gameScreen, not nested) */
.game-over-screen {
    text-align: center;
    padding: 8px 0 24px;
}

.game-over-panel {
    border-radius: 20px;
    padding: 28px 22px 32px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.game-over-screen--won .game-over-panel {
    background: linear-gradient(165deg, #e8f5e9 0%, #c8e6c9 45%, #a5d6a7 100%);
    border-color: #81c784;
}

.game-over-screen--lost .game-over-panel {
    background: linear-gradient(165deg, #fce4ec 0%, #f8bbd9 40%, #f48fb1 100%);
    border-color: #f06292;
}

.game-over-screen:not(.game-over-screen--won):not(.game-over-screen--lost) .game-over-panel {
    background: linear-gradient(165deg, #f5f5f5 0%, #eeeeee 100%);
    border-color: #e0e0e0;
}

.game-over-emoji {
    font-size: 3.25rem;
    line-height: 1.2;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.game-over-personal {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1a237e;
}

.game-over-screen--lost .game-over-personal {
    color: #880e4f;
}

.game-over-headline {
    font-size: 1.75rem;
    margin: 0 0 10px;
    color: #311b92;
    line-height: 1.25;
}

.game-over-screen--lost .game-over-headline {
    color: #4a148c;
}

.game-over-sub {
    font-size: 1rem;
    color: #424242;
    margin: 0 0 16px;
    line-height: 1.45;
}

.game-over-alt {
    margin-top: 14px;
    font-size: 0.95rem;
}

.game-over-alt a {
    color: #5c6bc0;
    font-weight: 600;
}

.game-over-alt-hint {
    color: #757575;
    font-weight: 400;
    font-size: 0.88rem;
}

.game-over-roles {
    text-align: left;
    margin-top: 8px;
}

.game-over-roles h3 {
    text-align: center;
    font-size: 1.15rem;
    color: #424242;
    margin-bottom: 14px;
}

.game-over-role-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-over-role-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.game-over-role-name {
    font-weight: 600;
    font-size: 1.05rem;
    text-align: left;
}

.game-over-you {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
}

.game-over-actions {
    margin-top: 28px;
}

button.btn-game-over-primary {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-game-over-primary {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-game-over-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.role-badge-good {
    background: #4caf50;
    color: white;
}

.role-badge-bad {
    background: #f44336;
    color: white;
}

.evil-role-banner {
    flex: 1;
    min-width: 0;
    background: #f0f4ff;
    padding: 16px 18px;
    border-radius: 15px;
    border: 3px solid #667eea;
    text-align: center;
}

.evil-role-banner-title {
    margin: 0;
    font-size: 1.08rem;
    color: #424242;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.evil-role-banner-label {
    font-weight: 800;
    color: #333;
}

.evil-round-line {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: #666;
    font-weight: 600;
}

.game-over-evil-recap.game-over-role-list {
    gap: 16px;
}

.game-over-spy-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-over-spy-header {
    margin-bottom: 0;
}

.evil-recap-missions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 4px 0;
}

.evil-recap-mission-card {
    text-align: left;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.evil-recap-mission-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.evil-recap-round {
    font-size: 0.85rem;
    font-weight: 700;
    color: #5c6bc0;
}

.evil-recap-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.evil-recap-status--done {
    background: #e8f5e9;
    color: #2e7d32;
}

.evil-recap-status--miss {
    background: #fff3e0;
    color: #e65100;
}

.evil-recap-task-text {
    margin: 0 0 10px;
    font-size: 0.98rem;
    line-height: 1.45;
    color: #333;
}

.evil-recap-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

button.mission-thumb {
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    padding: 8px 12px;
    font-size: 0.98rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

button.mission-thumb:hover:not(:disabled) {
    border-color: #bdbdbd;
}

button.mission-thumb:disabled {
    opacity: 0.55;
}

button.mission-thumb--active {
    border-color: #7e57c2;
    background: #ede7f6;
}

.evil-recap-empty {
    text-align: center;
    padding: 8px;
    font-size: 0.92rem;
    color: #666;
}

.evil-recap-empty--inline {
    text-align: left;
    padding: 8px 2px;
    font-style: italic;
}

.evil-recap-footnote {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #616161;
    line-height: 1.35;
    text-align: center;
}

#playerList ul {
    list-style: none;
    padding: 0;
}

#playerList li {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.network-info {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.network-info h4 {
    margin-bottom: 10px;
    color: #555;
}

.network-info code {
    display: block;
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    word-break: break-all;
    border: 1px solid #ddd;
}

.network-info button {
    margin-top: 10px;
    width: auto;
    padding: 8px 20px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .game-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .game-over-headline {
        font-size: 1.45rem;
    }

    .game-over-emoji {
        font-size: 2.75rem;
    }
    
    .vote-cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .vote-card {
        min-height: 100px;
        padding: 15px;
    }
    
    .vote-card-number {
        font-size: 1.5em;
    }
    
    .vote-card-name {
        font-size: 1em;
    }
}

/* Lobby */
.lobby-code-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 16px 18px;
    background: #f0f4ff;
    border-radius: 15px;
    border: 3px solid #667eea;
}

.lobby-code-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.lobby-code-value {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 800;
    color: #667eea;
    letter-spacing: 0.06em;
}

button.btn-copy-invite {
    margin-left: auto;
    width: auto !important;
    padding: 10px 18px;
    font-size: 0.95rem;
    margin-top: 0;
    flex-shrink: 0;
}

/* Round layout (same palette as role / voting cards — not role-specific) */
.evil-playing-view {
    margin-top: 8px;
}

.evil-top-bar {
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.phase-end-clock {
    font-weight: 600;
    font-size: 0.88em;
    margin-left: 4px;
    color: #37474f;
}

.evil-card {
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 16px;
    background: #f0f4ff;
    border: 3px solid #667eea;
}

.evil-label {
    font-size: 1rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 12px;
}

.evil-task-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    line-height: 1.35;
    margin-bottom: 8px;
}

.evil-mission-note {
    margin-bottom: 12px;
}

.evil-note-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
}

.evil-task-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.evil-task-recorded {
    margin: 4px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1b5e20;
    background: #e8f5e9;
    border: 2px solid #81c784;
    text-align: center;
}

.evil-btn-mission {
    width: 100%;
    margin-top: 4px;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.evil-btn-mission:disabled,
.evil-btn-mission.evil-btn-mission-done {
    background: #4caf50;
    cursor: default;
}

.evil-task-status {
    font-size: 0.85rem;
    min-height: 1.2em;
    color: #666;
}

.evil-task-status-done {
    color: #2e7d32;
    font-weight: 600;
}

.evil-card-team-head,
.evil-card-vote-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.evil-card-team-head .evil-label,
.evil-card-vote-head .evil-label {
    margin-bottom: 0;
}

.evil-team-pill {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: #e8eaf6;
    border: 2px solid #667eea;
    color: #667eea;
    white-space: nowrap;
}

.evil-team-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.evil-team-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff;
    border: 2px solid #e9ecef;
}

.evil-team-you {
    border-color: #667eea;
    background: #fff;
}

.evil-team-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.evil-team-meta {
    flex: 1;
    min-width: 0;
}

.evil-team-name {
    display: block;
    font-weight: 700;
    color: #333;
}

.evil-team-sub {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.evil-team-check {
    font-size: 1.2rem;
    color: #ccc;
}

.evil-team-check.is-done {
    color: #4caf50;
}

.evil-lock-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    white-space: nowrap;
    max-width: 100%;
    text-align: right;
}

.evil-vote-intro {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.35;
}

.evil-vote-intro-block {
    margin-bottom: 12px;
}

.evil-vote-rules {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.evil-vote-status-line {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.evil-vote-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.evil-vote-card {
    position: relative;
    border-radius: 12px;
    padding: 14px 12px 12px;
    text-align: left;
    background: #fff;
    border: 3px solid #667eea;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 100px;
}

.evil-vote-card:hover:not(.evil-vote-card-blocked):not([data-disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.evil-vote-card-blocked,
.evil-vote-card[data-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.evil-vote-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.evil-vote-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.25;
}

.evil-vote-count {
    flex-shrink: 0;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    background: #667eea;
    color: #fff;
}

.evil-tied-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #c62828;
}

.evil-voter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    min-height: 1.25rem;
}

.evil-voter-chip {
    font-size: 1rem;
    line-height: 1;
}

.evil-no-votes {
    font-size: 0.78rem;
    color: #999;
}

.evil-vote-empty {
    font-size: 0.9rem;
    color: #666;
}

.evil-footer-preview {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #555;
}

.evil-footer-kicker {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.evil-footer-body {
    display: block;
}

/* Phase deadline (local wall-clock end time) */
.phase-deadline-hint,
.evil-phase-deadline-hint {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.game-header .phase-deadline-hint {
    color: #4a3f9e;
}

.evil-playing-view .evil-phase-deadline-hint {
    color: #5c4ba3;
}

/* Eliminated — haunt experience */
.haunt-screen {
    margin: -30px;
    padding: 28px 22px 36px;
    border-radius: 20px;
    background: linear-gradient(165deg, #2d1b4e 0%, #1a0d2e 55%, #120820 100%);
    color: #ede7ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.haunt-header {
    margin-bottom: 18px;
}

.haunt-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.haunt-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 6px;
}

.haunt-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 16px rgba(118, 75, 162, 0.55);
}

.haunt-timer-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 215, 79, 0.35);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #ffe082;
    flex-wrap: wrap;
    max-width: min(100%, 340px);
    justify-content: flex-end;
}

.haunt-wall-clock {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 224, 130, 0.95);
    line-height: 1.25;
    max-width: 140px;
    text-align: right;
}

.haunt-timer-pill.haunt-timer-warn {
    border-color: rgba(255, 152, 0, 0.65);
    color: #ffcc80;
}

.haunt-timer-pill.haunt-timer-critical {
    border-color: rgba(244, 67, 54, 0.85);
    color: #ffcdd2;
    animation: pulse 1s infinite;
}

.haunt-deadline {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 224, 130, 0.95);
}

.haunt-stepper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.haunt-step {
    border-radius: 14px;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);
}

.haunt-step-active {
    border-color: #ffd54f;
    color: #fff;
    background: rgba(255, 213, 79, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.25);
}

.haunt-step-icon {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.haunt-step-hint {
    margin-top: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.haunt-context {
    margin-bottom: 16px;
}

.haunt-phase-label {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.haunt-elim-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.haunt-strip-chip {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(233, 30, 99, 0.2);
    border: 1px solid rgba(233, 30, 99, 0.45);
    color: #fce4ec;
}

.haunt-strip-muted {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
}

.haunt-notifications {
    margin-bottom: 16px;
}

.haunt-notif {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    text-align: center;
}

.haunt-notif p {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.haunt-notif-flash {
    background: rgba(244, 67, 54, 0.18);
    border: 1px solid rgba(244, 67, 54, 0.45);
    color: #ffcdd2;
}

.haunt-notif-muted {
    background: rgba(255, 213, 79, 0.1);
    border: 1px solid rgba(255, 213, 79, 0.28);
    color: rgba(255, 255, 255, 0.85);
}

.haunt-card {
    border-radius: 18px;
    padding: 18px 16px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.haunt-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.haunt-gold {
    color: #ffd54f;
}

.haunt-pink {
    color: #f48fb1;
}

.haunt-card-lead {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 12px;
    line-height: 1.45;
}

.haunt-pitch-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.haunt-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid rgba(255, 213, 79, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.95rem;
}

.haunt-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.haunt-btn-submit {
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 800;
    background: linear-gradient(135deg, #c62828 0%, #8e24aa 100%);
    color: #fff;
}

.haunt-meta {
    margin-top: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.haunt-status {
    margin-top: 8px;
    font-size: 0.88rem;
}

.haunt-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.haunt-votes-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.haunt-votes-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
    line-height: 1.4;
}

.haunt-vote-pill {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(233, 30, 99, 0.25);
    border: 1px solid rgba(233, 30, 99, 0.5);
    color: #fce4ec;
}

.haunt-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.haunt-vote-card {
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.haunt-vote-card:hover {
    border-color: rgba(244, 143, 177, 0.55);
}

.haunt-vote-card-on {
    border-color: #f48fb1;
    background: rgba(233, 30, 99, 0.18);
}

.haunt-vote-text {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    flex: 1;
}

.haunt-vote-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

.haunt-vote-avatar {
    font-size: 1.1rem;
}

.haunt-vote-by strong {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
}

.haunt-you-tag {
    font-weight: 600;
    color: #ffd54f;
}

.haunt-heart-btn {
    align-self: flex-end;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(233, 30, 99, 0.35);
    color: #fce4ec;
}

.haunt-list-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
    line-height: 1.4;
}

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

.haunt-submission-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.haunt-submission-row--readonly {
    opacity: 0.92;
}

.haunt-submission-text {
    font-size: 0.88rem;
    color: #fff;
    line-height: 1.35;
}

.haunt-submission-by {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

.haunt-empty {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

