/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - LIGHT DESIGN
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-dark: #f8fafc;        /* Clean slate background */
    --bg-card: #ffffff;        /* Pure white cards */
    --border-color: #e2e8f0;    /* Light grey border */
    
    --primary: #3b82f6;       /* Blue */
    --primary-glow: rgba(59, 130, 246, 0.1);
    --primary-hover: #1d4ed8;
    
    --secondary: #10b981;     /* Green */
    --secondary-glow: rgba(16, 185, 129, 0.1);
    --secondary-hover: #047857;
    
    --danger: #ff003c;        /* Vibrant Red from template */
    --danger-glow: rgba(255, 0, 60, 0.1);
    --danger-hover: #d00030;
    
    --warning: #f59e0b;       /* Amber */
    
    --text-main: #0f172a;     /* Dark navy */
    --text-muted: #64748b;    /* Muted grey */
    --text-dark: #0f172a;
    
    /* Shadows & Borders */
    --card-shadow: 0 4px 18px 0 rgba(15, 23, 42, 0.05), 0 1px 3px 0 rgba(15, 23, 42, 0.03);
    --border-radius: 16px;
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-speed: 0.25s;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px 0;
}

/* Ambient Background (Minimalist for Light Theme) */
.bg-glow {
    display: none; /* Removed for clean light theme */
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.app-container {
    width: 100%;
    max-width: 600px; /* Unified layout width to match clean app style */
    padding: 16px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: flex-start;
}

/* Wide layouts are now standardized to keep the elegant, compact vertical flow */
#screen-host-lobby.screen.active,
#screen-game.screen.active {
    max-width: 600px;
}

.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ==========================================================================
   SCREENS & ANIMATIONS
   ========================================================================== */
.screen {
    display: none;
    width: 100%;
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    width: 100%;
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 2px;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   INPUTS & FIELDS
   ========================================================================== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

input[type="text"], select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Code Input */
.code-input {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    letter-spacing: 6px;
    font-weight: 800;
}

/* Custom Switches */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.switch-label {
    display: flex;
    flex-direction: column;
}

.switch-label span:first-child {
    font-size: 0.9rem;
    font-weight: 600;
}

.switch-label .sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger-hover);
}

.btn-tertiary {
    background-color: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-tertiary:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #f1f5f9;
}

.choice-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   BADGES (Matches image specs)
   ========================================================================== */
.badge {
    background: #e2e8f0;
    color: var(--text-main);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-host {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: capitalize;
}

.badge-you {
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

/* ==========================================================================
   ROOM CODE DISPLAY
   ========================================================================== */
.room-code-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.room-code-display .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.code-box span {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary);
}

.code-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

/* ==========================================================================
   HOST LOBBY & PLAYER LISTS
   ========================================================================== */
.grid-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-player-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lobby-player-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.lobby-player-list li .player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-player-list li .player-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.lobby-player-list li .player-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 6px;
}

/* ==========================================================================
   GAMEPLAY SCREEN: TOP HEADER BAR
   ========================================================================== */
.game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    width: 100%;
}

/* Top bar texts */
.game-info-bar .info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.game-info-bar .info-label {
    display: none; /* Hide standard labels to fit clean layout */
}

.game-info-bar .info-value {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Timer Pill on the Right */
.timer-pill {
    background-color: var(--danger);
    color: #ffffff;
    border-radius: 99px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(255, 0, 60, 0.2);
}

.timer-pill .dot {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* ==========================================================================
   GAMEPLAY SCREEN: ROLE BANNER (Exactly matches template image)
   ========================================================================== */
.word-card-container {
    width: 100%;
    margin-bottom: 20px;
}

/* Make it look like the red imposter banner in the image */
.word-card {
    width: 100%;
    min-height: 100px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.card-front, .card-back {
    width: 100%;
    min-height: 100px;
    padding: 16px 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid var(--border-color);
}

.word-card .card-back {
    display: none !important;
}

.word-card.flipped .card-front {
    display: none !important;
}

.word-card.flipped .card-back {
    display: flex !important;
}

/* Front card (click to reveal) */
.card-front {
    background: #ffffff;
    justify-content: space-between;
    border: 2px dashed #cbd5e1;
}

.card-front h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.card-front p {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

.card-front .card-logo {
    font-size: 1.8rem;
}

/* Revealed banner */
.card-back {
    color: #ffffff !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

/* Role layout */
.card-back .banner-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.card-back .role-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.card-back .word-reveal-text {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.card-back .banner-icon {
    font-size: 2.2rem;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.95;
}

/* Imposter Red Banner Colors */
.card-back.imposter-banner {
    background: var(--danger);
    box-shadow: 0 4px 15px var(--danger-glow);
    border: none;
}

/* Citizen Blue Banner Colors */
.card-back.citizen-banner {
    background: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
    border: none;
}

/* Hints container inside banner card */
.hints-box {
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.hints-box h4 {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.hints-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hints-tags span {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 600;
}

/* ==========================================================================
   GAMEPLAY SCREEN: CLUES LIST CONTAINER (Matches template image)
   ========================================================================== */
.game-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.feed-card {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    margin-bottom: 20px;
}

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

.feed-header-row h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.feed-header-row .round-badge {
    background-color: #e2e8f0;
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
}

/* Unified list container */
.clues-container-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* Individual player rows */
.player-clue-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    transition: background-color var(--transition-speed);
}

.player-clue-row:last-child {
    border-bottom: none;
}

/* Highlighted Row for Active Turn (Matches image) */
.player-clue-row.active-turn {
    background-color: #f0f7ff; /* Light blue */
    border-top: 1px solid #3b82f6;
    border-bottom: 1px solid #3b82f6;
    margin-top: -1px; /* collapse border shift */
    position: relative;
    z-index: 2;
}

/* Right-side green checkmark for completed turn */
.player-clue-row .status-icon {
    font-size: 1.1rem;
    color: #10b981; /* Green checkmark */
    font-weight: bold;
}

.player-row-right-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-elim-small {
    background: var(--danger-glow);
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-elim-small:hover {
    background: var(--danger);
    color: #ffffff;
    transform: scale(1.05);
}

/* Left components */
.player-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Circular Avatar with Initial (Matches image) */
.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Avatar colors list */
.avatar-color-0 { background-color: #3b82f6; } /* Blue */
.avatar-color-1 { background-color: #f97316; } /* Orange */
.avatar-color-2 { background-color: #a855f7; } /* Purple */
.avatar-color-3 { background-color: #ec4899; } /* Pink */
.avatar-color-4 { background-color: #14b8a6; } /* Teal */
.avatar-color-5 { background-color: #ef4444; } /* Red */
.avatar-color-6 { background-color: #eab308; } /* Yellow */

.player-meta-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-row-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Clue Text & History display */
.player-clue-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.1px;
}

.player-clue-text.typing {
    color: #3b82f6;
    animation: typingPulse 1s infinite alternate;
}

.player-clue-text.waiting {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.player-clue-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.clue-tag {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.clue-tag.typing {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
    animation: typingPulse 1s infinite alternate;
}

.clue-tag.waiting {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: var(--text-muted);
}

.vote-player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vote-player-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-dark);
}

.vote-player-descs {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.player-clue-row.eliminated-row {
    opacity: 0.45;
}

.player-clue-row.eliminated-row .player-clue-text {
    text-decoration: line-through;
}

@keyframes typingPulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Feed action area */
.game-status-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
}

.input-action-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.typing-container {
    display: flex;
    gap: 8px;
}

.typing-container input {
    flex-grow: 1;
}

.imposter-guess-container {
    width: 100%;
}

.or-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    margin: 6px 0;
}

.or-separator::before, .or-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.or-separator span {
    padding: 0 8px;
}

/* Hide old bottom HUD entirely as it is now integrated */
.player-hud {
    display: none !important;
}

/* ==========================================================================
   VOTING UI
   ========================================================================== */
.voting-card {
    border: 1px solid var(--border-color);
}

.vote-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.vote-progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.vote-status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.voting-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-vote-target {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-vote-target:hover:not(:disabled) {
    background-color: #f0f7ff;
    border-color: var(--primary);
}

.btn-vote-target.selected {
    background: #dbeafe;
    border-color: var(--primary);
    color: #1e40af;
}

.btn-vote-target .vote-count-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* ==========================================================================
   MODAL WINDOWS (Elimination & Guess)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border-color);
}

.elimination-avatar {
    font-size: 3.5rem;
    margin: 8px 0;
}

.eliminated-role-reveal {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin: 12px 0;
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
}

.eliminated-role-reveal.imposter-role {
    color: #ffffff;
    background-color: var(--danger);
}

.eliminated-role-reveal.citizen-role {
    color: #ffffff;
    background-color: var(--primary);
}

/* ==========================================================================
   GAME OVER / FINAL SUMMARY SCREEN
   ========================================================================== */
.game-over-card {
    border: 1px solid var(--border-color);
}

.trophy-icon {
    font-size: 3.8rem;
    margin-bottom: 8px;
}

.word-reveal-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.word-card-summary {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

.word-card-summary .label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.word-card-summary .word {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
}

.citizen-summary {
    border-top: 4px solid var(--primary);
}

.imposter-summary {
    border-top: 4px solid var(--danger);
}

.final-scores-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.final-player-roles {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.final-player-roles li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.final-player-roles li.imposter-item {
    border-left: 4px solid var(--danger);
}

.final-player-roles li.citizen-item {
    border-left: 4px solid var(--primary);
}

.final-player-roles .role-label-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 6px;
}

.final-player-roles .role-label-badge.imposter-lbl {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.final-player-roles .role-label-badge.citizen-lbl {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* ==========================================================================
   TOAST NOTIFICATION & UTILITIES
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.25s;
    pointer-events: none;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
}

.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-sm { font-size: 0.82rem; }
.text-gray { color: var(--text-muted); }
.mt-4 { margin-top: 12px; }
.mt-6 { margin-top: 20px; }
.pulse-text {
    animation: textPulse 1.2s infinite ease-in-out;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Host toggles */
.host-only { display: none !important; }
body.is-host .host-only { display: block !important; }
body.is-host button.host-only { display: inline-flex !important; }

.client-only-text { display: none !important; }
body:not(.is-host) .client-only-text { display: block !important; }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 480px) {
    body {
        padding: 0;
        background-color: #ffffff;
    }
    
    .app-container {
        padding: 12px;
        min-height: 100vh;
    }
    
    .card {
        border-radius: 12px;
        padding: 16px;
        border: none;
        box-shadow: none;
        margin-bottom: 12px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   IMPOSTER GAME ENHANCEMENTS
   ========================================================================== */
.info-help-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 90;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

.info-help-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-glow);
    border-color: var(--primary);
}

.label-with-info {
    display: flex;
    align-items: center;
}

.info-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: help;
    margin-left: 6px;
    position: relative;
}

.info-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: normal;
    width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.info-tooltip-icon:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.text-left {
    text-align: left;
}

.imposter-guess-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    box-shadow: var(--card-shadow);
}

.imposter-guess-card .card-header {
    margin-bottom: 12px;
}

.imposter-guess-card .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.imposter-guess-card .card-header .sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.guess-input-group {
    display: flex;
    gap: 8px;
}

.guess-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: var(--bg-dark);
}

.guess-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.guess-status-text {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.guess-status-text.muted {
    color: var(--text-muted);
}

.guess-status-text.error {
    color: var(--danger);
}
