/* ═══ Imposter Word Game ═══ */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Site Logo Link ─── */
.site-logo-link {
    position: fixed;
    top: 1.2rem;
    left: 1.5rem;
    z-index: 100;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.site-logo-link:hover {
    transform: translateY(-1px);
}

.site-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.site-logo-link:hover .site-logo-icon {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
    transform: rotate(5deg) scale(1.08);
}

body {
    background: #07070b;
    font-family: 'Inter', sans-serif;
    color: #e0e7ff;
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.04) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.03) 0%, transparent 50%);
}

.screen { display: none; min-height: 100vh; align-items: center; justify-content: center; padding: 2rem; }
.screen.active { display: flex; animation: fadeIn 0.4s ease; }

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

.container { width: 100%; max-width: 480px; text-align: center; }

/* ─── Typography ─── */
.back-link { display: inline-block; color: rgba(165,180,252,0.5); font-size: 0.85rem; text-decoration: none; margin-bottom: 1.5rem; transition: color 0.3s; }
.back-link:hover { color: #a5b4fc; }
.game-title { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.5rem; background: linear-gradient(135deg, #e0e7ff, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.game-subtitle { color: rgba(165,180,252,0.6); font-size: 0.95rem; margin-bottom: 2rem; }
.highlight { color: #818cf8; font-weight: 700; letter-spacing: 0.1em; text-shadow: 0 0 10px rgba(99,102,241,0.3); }

/* ─── Buttons ─── */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}
.btn:active::after { width: 200px; height: 200px; }
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
    background: transparent;
    color: #a5b4fc;
    border: 1px solid rgba(165,180,252,0.3);
}
.btn-secondary:hover { border-color: rgba(165,180,252,0.6); background: rgba(99,102,241,0.1); transform: translateY(-2px); }
.btn-small { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ─── Inputs ─── */
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; color: rgba(165,180,252,0.6); font-size: 0.8rem; margin-bottom: 0.4rem; text-align: left; }
.input-group input, .input-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    color: #e0e7ff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}
.input-group input:focus, .input-group select:focus { border-color: rgba(99,102,241,0.5); }
.input-group select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5b4fc' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.input-group select option { background: #1a1a2e; color: #e0e7ff; }
.checkbox-group label { display: flex; align-items: center; gap: 0.5rem; color: #a5b4fc; font-size: 0.9rem; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: auto; accent-color: #6366f1; }

/* ─── Menu ─── */
.mechanics { text-align: left; margin-bottom: 2rem; }
.mechanics details { background: rgba(99,102,241,0.05); border: 1px solid rgba(99,102,241,0.15); border-radius: 10px; padding: 1rem 1.2rem; }
.mechanics summary { color: #a5b4fc; font-weight: 600; cursor: pointer; font-size: 0.9rem; }
.mechanics-content { margin-top: 1rem; max-height: 350px; overflow-y: auto; padding-right: 0.5rem; }
.mechanics-content::-webkit-scrollbar { width: 4px; }
.mechanics-content::-webkit-scrollbar-track { background: transparent; }
.mechanics-content::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 4px; }
.mechanics-content::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }
.mechanic-step { display: flex; gap: 0.8rem; margin-bottom: 1rem; align-items: flex-start; }
.step-icon { font-size: 1.4rem; flex-shrink: 0; width: 2rem; text-align: center; }
.step-text { flex: 1; }
.step-text strong { color: #e0e7ff; font-size: 0.85rem; display: block; margin-bottom: 0.2rem; }
.step-text p { color: rgba(200,200,220,0.6); font-size: 0.8rem; line-height: 1.5; margin: 0; }
.mechanics-scoring-box { background: rgba(99,102,241,0.08); border-radius: 8px; padding: 0.8rem 1rem; margin: 1.2rem 0; }
.scoring-title { color: #a5b4fc; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; }
.scoring-row { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 0.8rem; }
.scoring-label { color: rgba(200,200,220,0.7); }
.scoring-value { color: #818cf8; font-weight: 500; }
.mechanics-example { background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.15); border-radius: 8px; padding: 0.8rem 1rem; margin: 1rem 0; }
.example-title { color: rgba(167,139,250,0.8); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; }
.example-text { color: rgba(200,200,220,0.6); font-size: 0.8rem; margin-bottom: 0.3rem; }
.example-clues { color: rgba(200,200,220,0.5); font-size: 0.78rem; }
.example-hint { color: rgba(165,180,252,0.5); font-style: italic; }
.mechanics-footer { color: rgba(165,180,252,0.4); font-size: 0.75rem; margin-top: 1rem; text-align: center; }
.mechanics-scoring { color: rgba(165,180,252,0.5); font-size: 0.8rem; margin-top: 0.8rem; }
.mechanics-list { color: rgba(200,200,220,0.7); font-size: 0.8rem; padding-left: 1.2rem; margin-top: 0.3rem; line-height: 1.7; }
.menu-buttons { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.5rem; }
.error-text { color: #f87171; font-size: 0.85rem; margin-top: 1rem; }
.section-actions { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1rem; }
.hidden { display: none !important; }

/* ─── Lobby ─── */
.lobby-category { color: rgba(165,180,252,0.5); font-size: 0.85rem; margin-bottom: 1.5rem; }
.player-list { margin-bottom: 2rem; }
.player-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.7rem 1rem;
    background: rgba(99,102,241,0.05);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.player-item .name { font-weight: 500; }
.player-item .badge { font-size: 0.7rem; color: #818cf8; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(99,102,241,0.15); padding: 0.2rem 0.5rem; border-radius: 4px; }
.lobby-hint { color: rgba(165,180,252,0.4); font-size: 0.8rem; margin-top: 1rem; }

/* ─── Game Header ─── */
.game-header { display: flex; justify-content: center; gap: 0.8rem; margin-bottom: 1.5rem; }
.round-badge { background: rgba(99,102,241,0.15); color: #a5b4fc; padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; border: 1px solid rgba(99,102,241,0.2); }
.category-badge { background: rgba(139,92,246,0.1); color: rgba(167,139,250,0.8); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; border: 1px solid rgba(139,92,246,0.2); }

/* ─── Word Card ─── */
.word-card {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.5s ease;
    animation: cardPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.word-card.collapsed { display: none; }
.word-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: #a5b4fc;
    animation: fadeIn 0.3s ease;
}
.word-pill:hover { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.15); transform: scale(1.05); }
.word-label { color: rgba(165,180,252,0.5); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.word-value { font-size: 1.8rem; font-weight: 700; color: #e0e7ff; }
.imposter-badge { color: #f87171; font-size: 0.9rem; font-weight: 700; margin-top: 0.8rem; animation: imposterPulse 1.5s ease-in-out infinite; letter-spacing: 0.1em; text-transform: uppercase; }
@keyframes imposterPulse { 0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(248,113,113,0.5); } 50% { opacity: 0.6; text-shadow: none; } }

/* ─── Phases ─── */
.phase { margin-top: 1rem; }
.phase-title { font-size: 1rem; font-weight: 600; color: #a5b4fc; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.turn-indicator { color: rgba(200,200,220,0.7); font-size: 0.9rem; margin-bottom: 1rem; }

#clue-input-area { display: flex; gap: 0.5rem; align-items: center; }
#clue-input-area input { flex: 1; }
#clue-input-area .btn { padding: 0.6rem 1.2rem; font-size: 0.85rem; }

/* ─── Clues ─── */
.game-layout { display: flex; gap: 1.5rem; text-align: left; }
.turn-sidebar { flex: 0 0 140px; }
.game-main { flex: 1; }
.sidebar-title { color: rgba(165,180,252,0.5); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.sidebar-timer { color: #fca5a5; font-size: 1.6rem; font-weight: 700; margin-bottom: 0.8rem; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(239,68,68,0.3); transition: color 0.3s; }
.turn-list { display: flex; flex-direction: column; gap: 0.4rem; }
.turn-item {
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(200,200,220,0.5);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: space-between;
}
.turn-item .turn-name { display: flex; align-items: center; gap: 0.4rem; }
.turn-item .turn-score { font-size: 0.7rem; color: rgba(165,180,252,0.4); }
.turn-item.active { color: #e0e7ff; border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.1); animation: pulseGlow 2s infinite; }
@keyframes pulseGlow { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 8px rgba(99,102,241,0.2); } }
.turn-item.done { color: rgba(165,180,252,0.4); }
.turn-item.done::before { content: '✓'; color: #4ade80; font-size: 0.7rem; }
.turn-item.active::before { content: '▶'; color: #818cf8; font-size: 0.6rem; }
.turn-item.waiting::before { content: '○'; color: rgba(165,180,252,0.3); font-size: 0.6rem; }
.turn-item.is-me { border-left: 2px solid #818cf8; }
.you-tag { color: #818cf8; font-size: 0.65rem; font-weight: 400; margin-left: 0.2rem; }
.clues-list { text-align: left; margin-top: 1rem; }
.clue-item { padding: 0.5rem 0; border-bottom: 1px solid rgba(99,102,241,0.08); display: flex; justify-content: space-between; }
.clue-item .clue-name { color: rgba(165,180,252,0.6); font-size: 0.85rem; }
.clue-item .clue-text { color: #e0e7ff; font-weight: 500; }

/* ─── Chat ─── */
.discussion-layout { display: flex; flex-direction: column; gap: 1rem; }
.clues-summary {
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}
.clues-summary-title { color: rgba(165,180,252,0.6); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.clues-summary .clue-item { padding: 0.3rem 0; border-bottom: none; font-size: 0.85rem; }
.discussion-chat { flex: 1; }
.chat-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: 10px;
    height: 180px;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 0.8rem;
    text-align: left;
}
.chat-msg { margin-bottom: 0.4rem; font-size: 0.85rem; }
.chat-msg .chat-name { color: #818cf8; font-weight: 600; }
.chat-msg .chat-text { color: rgba(200,200,220,0.8); }
.chat-input-area { display: flex; gap: 0.5rem; }
.chat-input-area input { flex: 1; }

/* ─── Voting ─── */
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.vote-btn {
    padding: 0.8rem;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    color: #e0e7ff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: inherit;
}
.vote-btn:hover { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.15); transform: translateY(-2px); }
.vote-btn.voted { border-color: #6366f1; background: rgba(99,102,241,0.2); box-shadow: 0 0 12px rgba(99,102,241,0.3); transform: scale(0.97); }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.vote-status { color: rgba(165,180,252,0.5); font-size: 0.8rem; }

/* ─── Reveal ─── */
.reveal-result { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; animation: fadeIn 0.5s ease; }
.reveal-caught { color: #4ade80; text-shadow: 0 0 10px rgba(74,222,128,0.3); }
.reveal-survived { color: #f87171; text-shadow: 0 0 10px rgba(248,113,113,0.3); }
.reveal-words { color: rgba(200,200,220,0.6); font-size: 0.9rem; margin-bottom: 1.5rem; }
.vote-breakdown { background: rgba(99,102,241,0.05); border: 1px solid rgba(99,102,241,0.15); border-radius: 10px; padding: 1rem; margin: 1rem 0; text-align: left; }
.breakdown-title { color: #a5b4fc; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.6rem; }
.breakdown-item { display: flex; justify-content: space-between; padding: 0.3rem 0; color: #e0e7ff; font-size: 0.85rem; }
.breakdown-count { color: #818cf8; font-weight: 600; }
.breakdown-detail { color: rgba(165,180,252,0.5); font-size: 0.75rem; margin-top: 0.8rem; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.breakdown-vote { padding: 0.2rem 0; color: rgba(200,200,220,0.6); font-size: 0.8rem; }
.voter-name { color: rgba(200,200,220,0.8); }
.breakdown-abstain { color: #fca5a5; font-size: 0.8rem; margin-top: 0.6rem; }

/* ─── Scoreboard ─── */
.scoreboard { margin: 1.5rem 0; text-align: left; }
.score-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(99,102,241,0.05);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    animation: slideIn 0.3s ease;
}
.score-item .score-name { font-weight: 500; }
.score-item .score-value { color: #818cf8; font-weight: 700; font-size: 1.1rem; }
.score-item:first-child { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); }
.score-item:first-child .score-name::before { content: '👑 '; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .game-title { font-size: 1.8rem; }
    .word-value { font-size: 1.5rem; }
    .vote-grid { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
    .game-layout { flex-direction: column; }
    .turn-sidebar { flex: none; }
    .turn-list { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
    .turn-item { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
}
