@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&display=swap');

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

:root {
    --pink: #ff6b9d;
    --purple: #c44dff;
    --blue: #4d79ff;
    --cyan: #00d4ff;
    --green: #00e676;
    --yellow: #ffea00;
    --orange: #ff9100;
    --red: #ff5252;
    --dark: #1a1a2e;
    --darker: #16213e;
    --card: #1e2a4a;
    --card-light: #263354;
    --text: #ffffff;
    --text-dim: #8892b0;
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Screens */
.screen {
    display: none;
    padding: 20px;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; flex-direction: column; align-items: center; }

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

/* Home Screen */
#screen-home {
    justify-content: flex-start;
    padding-top: 15vh;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

#screen-home::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(196,77,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(77,121,255,0.1) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.logo-container {
    text-align: center;
    margin-bottom: 50px;
    z-index: 1;
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoShine 3s ease-in-out infinite;
    text-shadow: none;
}

@keyframes logoShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-top: 8px;
    letter-spacing: 1px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 340px;
    z-index: 1;
}

/* Buttons */
.btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius);
    padding: 16px 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

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

.btn-icon { font-size: 1.4rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    box-shadow: 0 4px 20px rgba(196,77,255,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(196,77,255,0.6); transform: translateY(-2px); }

.btn-secondary {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: white;
    box-shadow: 0 4px 20px rgba(77,121,255,0.4);
}
.btn-secondary:hover { box-shadow: 0 6px 30px rgba(77,121,255,0.6); transform: translateY(-2px); }

.btn-accent {
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    color: #1a1a2e;
    box-shadow: 0 4px 20px rgba(255,145,0,0.4);
}
.btn-accent:hover { box-shadow: 0 6px 30px rgba(255,145,0,0.6); transform: translateY(-2px); }

.btn-large { padding: 18px 32px; font-size: 1.15rem; }

.btn-back {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 0;
    align-self: flex-start;
    font-family: 'Nunito', sans-serif;
    margin-bottom: 20px;
}
.btn-back:hover { color: var(--text); }

/* Form */
.form-group {
    margin-bottom: 20px;
    width: 100%;
    max-width: 340px;
    text-align: left;
}

#screen-create .btn,
#screen-join .btn,
#screen-join-big .btn {
    width: 100%;
    max-width: 340px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dim);
}
.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}
.form-group input:focus { border-color: var(--purple); }
.form-group input::placeholder { color: #4a5568; }

.code-input {
    text-align: center;
    font-size: 2rem !important;
    font-weight: 800;
    letter-spacing: 12px;
    text-transform: uppercase;
    font-family: 'Fredoka One', cursive !important;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 24px;
    text-align: center;
}

/* Lobby */
.lobby-header {
    text-align: center;
    margin-bottom: 24px;
}

.party-code-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 32px;
    border: 2px solid var(--card-light);
}
.code-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.code-value {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-list h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#lobby-players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.player-tag {
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: 30px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: popIn 0.3s ease;
}

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

/* Game Voting */
.game-voting h3 {
    margin-bottom: 16px;
    text-align: center;
}

#game-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 400px) {
    #game-list { grid-template-columns: repeat(2, 1fr); }
}

.game-tile {
    position: relative;
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius);
    padding: 18px 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.game-tile:active { transform: scale(0.95); }
.game-tile.voted {
    border-color: var(--cyan);
    background: rgba(0,212,255,0.15);
    box-shadow: 0 0 25px rgba(0,212,255,0.3);
    transform: scale(1.05);
    filter: brightness(1.2);
}

.game-tile-emoji { font-size: 2.6rem; line-height: 1; }
.game-tile-name { font-weight: 700; font-size: 0.8rem; line-height: 1.2; }

.game-tile-votes {
    background: var(--card-light);
    border-radius: 20px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 28px;
    text-align: center;
}

.game-tile-info {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--text-dim);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}
.game-tile-info:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.game-tile-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--card-light);
    color: var(--text-dim);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    line-height: 1.4;
}

.vote-progress {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Big Screen */
.big-screen {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 100%);
    padding: 40px;
}

.big-header {
    text-align: center;
    margin-bottom: 40px;
}
.big-header .logo { font-size: 4rem; }
.big-header .party-code-display { padding: 20px 48px; margin-top: 20px; }
.big-header .party-code-display.big .code-value { font-size: 4rem; letter-spacing: 16px; }
.big-header .party-code-display.big .code-label { font-size: 1.1rem; }

.big-content {
    display: flex;
    gap: 40px;
    flex: 1;
}
.big-players, .big-scores {
    flex: 1;
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    border: 2px solid var(--card-light);
}
.big-players h2, .big-scores h2 {
    font-family: 'Fredoka One', cursive;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#big-player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.big-player-tag {
    background: var(--card-light);
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 1.2rem;
    animation: popIn 0.3s ease;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.2rem;
}
.score-row:nth-child(1) { background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.05)); }
.score-row:nth-child(2) { background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(192,192,192,0.05)); }
.score-row:nth-child(3) { background: linear-gradient(135deg, rgba(205,127,50,0.2), rgba(205,127,50,0.05)); }
.score-row .medal { font-size: 1.4rem; margin-right: 8px; }
.score-row .points {
    font-family: 'Fredoka One', cursive;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.big-vote-section {
    margin-top: 24px;
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-dim);
}

/* Game Screen */
#screen-game, #screen-big-game {
    justify-content: flex-start;
    align-items: center;
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 8px;
}

.game-round {
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.game-question {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.4;
}

.game-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.option-btn {
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.option-btn:active { transform: scale(0.97); }
.option-btn.selected {
    border-color: var(--blue);
    background: rgba(77,121,255,0.2);
}
.option-btn.correct {
    border-color: var(--green);
    background: rgba(0,230,118,0.2);
    animation: correctPulse 0.5s ease;
}
.option-btn.wrong {
    border-color: var(--red);
    background: rgba(255,82,82,0.2);
}

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

/* Emoji game */
.emoji-display {
    font-size: 4rem;
    text-align: center;
    margin: 20px 0;
    animation: emojiPop 0.5s ease;
}
@keyframes emojiPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.guess-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}
.guess-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
}
.guess-input-group input:focus { border-color: var(--cyan); }
.guess-input-group .btn {
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    white-space: nowrap;
}

.guess-feedback {
    text-align: center;
    margin-top: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    min-height: 30px;
}
.guess-feedback.correct { color: var(--green); }
.guess-feedback.wrong { color: var(--red); animation: shake 0.3s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Speed Tap */
.tap-zone {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 8px 40px rgba(196,77,255,0.5);
    transition: transform 0.05s;
}
.tap-zone:active { transform: scale(0.92); box-shadow: 0 4px 20px rgba(196,77,255,0.7); }

.tap-counter {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    text-align: center;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: var(--card);
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}
.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Countdown */
.countdown {
    font-family: 'Fredoka One', cursive;
    font-size: 8rem;
    text-align: center;
    animation: countPop 0.8s ease;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@keyframes countPop {
    from { transform: scale(2); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* WYR */
.wyr-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.wyr-btn {
    padding: 24px 20px;
    border: 3px solid var(--card-light);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
}
.wyr-btn:active { transform: scale(0.97); }
.wyr-btn.option-a:hover, .wyr-btn.option-a.selected { border-color: var(--pink); background: rgba(255,107,157,0.15); }
.wyr-btn.option-b:hover, .wyr-btn.option-b.selected { border-color: var(--cyan); background: rgba(0,212,255,0.15); }

.wyr-or {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    color: var(--text-dim);
}

.wyr-result-bar {
    width: 100%;
    max-width: 400px;
    height: 50px;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    margin: 16px 0;
}
.wyr-bar-a {
    background: linear-gradient(135deg, var(--pink), #ff8fbb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    transition: width 1s ease;
    min-width: 30px;
}
.wyr-bar-b {
    background: linear-gradient(135deg, #4dcfff, var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    transition: width 1s ease;
    min-width: 30px;
}

/* Results */
.results-container {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.result-points {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin: 16px 0;
}
.result-points.positive { color: var(--green); }
.result-points.zero { color: var(--text-dim); }

.ranking-list {
    width: 100%;
    max-width: 500px;
}
.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--card);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.ranking-pos {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    width: 40px;
    text-align: center;
}
.ranking-name { flex: 1; }
.ranking-taps {
    font-family: 'Fredoka One', cursive;
    color: var(--cyan);
}

/* Big Screen Game */
.big-game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 16px;
}
.big-game-question {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    max-width: 800px;
}
.big-emoji-display {
    font-size: 8rem;
    text-align: center;
    margin: 30px 0;
}
.big-answer-count {
    font-size: 1.5rem;
    color: var(--text-dim);
    text-align: center;
}

.big-tap-race {
    width: 100%;
    max-width: 800px;
}
.tap-race-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.tap-race-name {
    width: 120px;
    font-weight: 700;
    text-align: right;
    font-size: 1.2rem;
}
.tap-race-bar-bg {
    flex: 1;
    height: 36px;
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
}
.tap-race-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 18px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-weight: 800;
    min-width: 40px;
}

.big-wyr-bar { max-width: 700px; height: 80px; font-size: 1.5rem; }

/* Toast */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--red);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    transition: bottom 0.3s ease;
    z-index: 100;
    white-space: nowrap;
}
.toast.show { bottom: 30px; }

/* Confetti */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 99;
    animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
    to { top: 110vh; transform: rotate(720deg); opacity: 0; }
}

/* Floating emojis on home */
.floating-emoji {
    position: absolute;
    font-size: 2rem;
    opacity: 0;
    animation: floatUp 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 480px) {
    .logo { font-size: 2.2rem; }
    .btn-large { padding: 15px 24px; font-size: 1rem; }
    .code-value { font-size: 2rem; }
    .big-header .logo { font-size: 2.5rem; }
}

@media (min-width: 768px) {
    .big-header .party-code-display.big .code-value { font-size: 5rem; }
}

/* ========== FICTIONARY (DEFINITION GAME) ========== */

.def-word-display {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    text-align: center;
    color: var(--yellow);
    margin: 16px 0;
    text-shadow: 0 0 20px rgba(255, 234, 0, 0.3);
}

.big-def-word {
    font-size: 3.5rem;
    margin: 24px 0;
}

.def-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
}

.def-input-group textarea {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--card-light);
    background: var(--darker);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    resize: none;
    transition: border-color 0.3s;
}

.def-input-group textarea:focus {
    outline: none;
    border-color: var(--purple);
}

.def-input-group textarea:disabled {
    opacity: 0.5;
}

.def-input-group .btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.def-input-group .btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.def-feedback {
    text-align: center;
    margin-top: 12px;
    font-weight: 700;
    font-size: 1rem;
    min-height: 24px;
}

.def-feedback.submitted { color: var(--green); }
.def-feedback.wrong { color: var(--red); }

.def-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.def-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    width: 100%;
}

button.def-option-card {
    -webkit-appearance: none;
    appearance: none;
}

.def-option-card:hover:not(:disabled):not(.own-def) {
    border-color: var(--purple);
    background: var(--card-light);
    transform: translateX(4px);
}

.def-option-card.selected {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.15);
}

.def-option-card.own-def {
    opacity: 0.5;
    cursor: default;
    border-style: dashed;
}

.def-option-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.def-option-text {
    flex: 1;
    line-height: 1.4;
}

.def-own-tag {
    flex-shrink: 0;
    font-size: 0.75rem;
    background: var(--card-light);
    padding: 2px 8px;
    border-radius: 8px;
    color: var(--text-dim);
}

.def-reveal-real {
    text-align: center;
    max-width: 600px;
    margin: 16px auto;
    padding: 16px 20px;
    background: rgba(0, 230, 118, 0.1);
    border: 2px solid var(--green);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    line-height: 1.4;
}

.def-reveal-label {
    display: block;
    font-weight: 800;
    color: var(--green);
    margin-bottom: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.def-reveal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 16px auto 0;
    padding: 0 16px;
    width: 100%;
}

.def-reveal-entry {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--card-light);
    background: var(--card);
}

.def-reveal-entry.real {
    border-color: var(--green);
    background: rgba(0, 230, 118, 0.08);
}

.def-reveal-entry.fake {
    border-color: var(--card-light);
}

.def-reveal-text {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.def-reveal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
}

.def-reveal-author {
    color: var(--cyan);
    font-weight: 700;
}

.def-reveal-voters {
    color: var(--pink);
    font-weight: 600;
}

/* ========== WORD SCRAMBLE (ANAGRAM) ========== */

.anagram-letters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.anagram-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--orange), var(--red));
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 145, 0, 0.4);
    animation: letterPop 0.4s ease-out backwards;
}

.anagram-letter:nth-child(1) { animation-delay: 0s; }
.anagram-letter:nth-child(2) { animation-delay: 0.05s; }
.anagram-letter:nth-child(3) { animation-delay: 0.1s; }
.anagram-letter:nth-child(4) { animation-delay: 0.15s; }
.anagram-letter:nth-child(5) { animation-delay: 0.2s; }
.anagram-letter:nth-child(6) { animation-delay: 0.25s; }
.anagram-letter:nth-child(7) { animation-delay: 0.3s; }

@keyframes letterPop {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.big-anagram-letters .anagram-letter {
    width: 80px;
    height: 80px;
    font-size: 2.8rem;
    border-radius: 16px;
    gap: 16px;
}

.anagram-timer {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--cyan);
    margin: 8px 0;
}

.anagram-timer.urgent {
    color: var(--red);
    animation: pulse 0.5s ease-in-out infinite;
}

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

.anagram-input-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 12px;
}

.anagram-input-group input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: var(--card);
    color: white;
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    text-transform: lowercase;
}

.anagram-input-group input:focus {
    outline: none;
    border-color: var(--orange);
}

.anagram-input-group .btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    white-space: nowrap;
}

.anagram-feedback {
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    min-height: 28px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.anagram-feedback.valid { color: var(--green); }
.anagram-feedback.invalid { color: var(--red); }

.anagram-word-count {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.anagram-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.anagram-word-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 145, 0, 0.15);
    border: 1px solid rgba(255, 145, 0, 0.3);
    border-radius: 20px;
    color: var(--orange);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: lowercase;
}

.anagram-my-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
}

.anagram-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.anagram-stat-val {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--orange);
}

.anagram-stat-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.anagram-race {
    max-width: 700px;
    width: 100%;
    margin: 20px auto 0;
}

.anagram-race-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.anagram-race-name {
    width: 100px;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.anagram-race-bar-bg {
    flex: 1;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.anagram-race-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--red));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 30px;
    transition: width 0.3s ease;
}

.ranking-row.highlight {
    border: 2px solid var(--orange);
}

/* ========== LIAR CARD GAME ========== */

.liar-info-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 8px 0;
}

.liar-status {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cyan);
    margin: 12px 0;
}

.liar-last-play {
    text-align: center;
    color: var(--yellow);
    font-weight: 600;
    font-size: 1rem;
    margin: 8px 0;
}

.liar-hand {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
    padding: 8px;
}

.liar-card {
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 10px 8px;
    min-width: 52px;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.liar-card.selectable {
    cursor: pointer;
}

.liar-card.selectable:hover {
    transform: translateY(-4px);
    border-color: var(--purple);
}

.liar-card.selected {
    border-color: var(--purple);
    box-shadow: 0 0 12px rgba(196, 77, 255, 0.5);
    transform: translateY(-6px);
    background: #f3e8ff;
}

.liar-card-display {
    font-size: 1.1rem;
}

.liar-card-small {
    display: inline-block;
    background: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 2px;
}

.liar-announce {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.liar-select {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--purple);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.liar-call-btn {
    display: block;
    width: 80%;
    max-width: 300px;
    margin: 16px auto;
    padding: 16px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.liar-call-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 82, 82, 0.4);
}

.liar-call-banner {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    color: var(--red);
    text-shadow: 0 0 20px rgba(255, 82, 82, 0.5);
    margin: 20px 0;
    animation: liarPulse 0.5s ease-in-out 3;
}

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

.liar-call-info {
    text-align: center;
    color: var(--text-dim);
    font-size: 1.1rem;
    margin: 8px 0;
}

.liar-reveal-cards {
    text-align: center;
    margin: 16px 0;
    font-size: 1.1rem;
}

.liar-players-list {
    max-width: 400px;
    margin: 16px auto;
}

.liar-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background 0.2s;
}

.liar-player-row.active {
    background: var(--card-light);
    border-left: 3px solid var(--cyan);
}

.liar-player-row.finished {
    opacity: 0.5;
}

.liar-player-name {
    font-weight: 600;
}

.liar-player-cards {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.liar-vote-btns {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.liar-vote-btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius);
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.15s;
    color: white;
}

.liar-vote-btn.lie {
    background: linear-gradient(135deg, var(--red), var(--orange));
}

.liar-vote-btn.honest {
    background: linear-gradient(135deg, var(--green), var(--cyan));
}

.liar-vote-btn:hover {
    transform: scale(1.05);
}

.liar-vote-result {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    margin: 20px 0;
}

.liar-vote-result.was-lie {
    color: var(--red);
}

.liar-vote-result.was-honest {
    color: var(--green);
}

.liar-vote-tally {
    text-align: center;
    color: var(--text-dim);
    font-size: 1rem;
    margin: 8px 0;
}

.liar-pickup-banner {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: var(--orange);
    margin: 20px 0;
}

.liar-won-banner {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--green);
    margin: 12px 0;
    animation: liarPulse 0.5s ease-in-out 2;
}

.liar-feedback {
    text-align: center;
    margin: 8px 0;
    font-size: 0.95rem;
}

.liar-feedback.submitted {
    color: var(--green);
}

.liar-first-card {
    text-align: center;
    margin: 12px 0;
    font-size: 1.1rem;
    color: var(--yellow);
}

.liar-announcement {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 16px 0;
}

/* ========== COUNTRY GUESS ========== */

.country-guess-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 400px;
}

.country-guess-group .btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    white-space: nowrap;
}

.country-autocomplete-wrap {
    flex: 1;
    position: relative;
}

.country-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
}

.country-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.country-input:focus {
    border-color: var(--cyan);
}

.country-input:disabled {
    opacity: 0.5;
    cursor: default;
}

.country-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 4px;
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.country-suggestion-item {
    padding: 10px 16px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
}

.country-suggestion-item:hover {
    background: var(--card-light);
}

/* Contain Leaflet z-indexes so map stays below modal */
#country-map {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

/* ========== GAME INFO MODAL ========== */

.game-info-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--card-light);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.game-info-btn:hover {
    border-color: var(--purple);
    transform: scale(1.1);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--darker);
    border: 2px solid var(--card-light);
    border-radius: var(--radius);
    padding: 28px 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    margin-bottom: 8px;
    text-align: center;
}

.modal-emoji {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--text-dim);
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-section {
    margin-top: 20px;
}

.modal-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.modal-players-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-score-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-weight: 600;
}

.modal-score-row .points {
    font-family: 'Fredoka One', cursive;
    color: var(--cyan);
}

.modal-score-points {
    font-family: 'Fredoka One', cursive;
    color: var(--cyan);
    font-size: 1.1rem;
}

.modal-leave-btn {
    background: linear-gradient(135deg, #ff4757, #ff6b81) !important;
    border: none;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    margin: 0 auto;
}

.modal-leave-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

/* ===== MINESWEEPER ===== */
.ms-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 6px auto;
    font-weight: 700;
    font-size: 0.9rem;
}
.ms-turn { color: var(--text-dim); }
.ms-turn.my-turn { color: var(--cyan); animation: pulse 1s infinite; }
.ms-info { color: var(--text-dim); font-size: 0.8rem; }
.ms-players {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 6px 0;
}
.ms-player-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 2px solid;
    font-size: 0.8rem;
    font-weight: 600;
}
.ms-player-tag.ms-elim {
    opacity: 0.4;
    border-color: var(--text-dim);
    text-decoration: line-through;
}
.ms-player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ms-action {
    text-align: center;
    color: var(--yellow);
    font-weight: 700;
    font-size: 0.85rem;
    margin: 4px 0;
    min-height: 1.2em;
}
.ms-grid {
    display: grid;
    gap: 2px;
    width: 100%;
    max-width: 400px;
    margin: 8px auto;
}
.ms-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(0.65rem, 2.5vw, 0.9rem);
    border-radius: 4px;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
}
.ms-hidden {
    background: var(--card-light);
    border: none;
    color: transparent;
    cursor: default;
}
button.ms-hidden {
    cursor: pointer;
    padding: 0;
    font: inherit;
}
button.ms-hidden:hover {
    background: var(--card);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}
button.ms-hidden:active {
    transform: scale(0.92);
}
.ms-revealed {
    background: var(--darker);
}
.ms-mine {
    background: rgba(255, 82, 82, 0.3);
    font-size: 1.1rem;
    animation: mineReveal 0.3s ease;
}
@keyframes mineReveal {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.ms-result {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 12px 16px;
    margin: 8px auto;
    max-width: 400px;
    background: linear-gradient(135deg, var(--card), var(--card-light));
    border-radius: var(--radius);
}
.ms-scores {
    max-width: 400px;
    margin: 12px auto;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.ms-score-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-weight: 600;
}
.ms-score-row + .ms-score-row {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Big screen minesweeper */
.big-screen .ms-grid {
    max-width: 600px;
}
.big-screen .ms-cell {
    font-size: 1.4rem;
}
.big-screen .ms-status {
    max-width: 600px;
    font-size: 1.1rem;
}
.big-screen .ms-result {
    max-width: 600px;
    font-size: 1.5rem;
}

/* ===== MORSE DECODER ===== */
.morse-progress-label {
    text-align: center;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 4px;
}
.morse-word-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.morse-wp-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 42px;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Fredoka One', sans-serif;
    border-radius: 8px;
    background: var(--card);
}
.morse-wp-char.blank {
    border-bottom: 3px solid var(--text-dim);
    background: transparent;
}
.morse-wp-char.filled {
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.12);
    border-bottom: 3px solid var(--cyan);
}
.morse-points-badge {
    text-align: center;
    color: var(--yellow);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 4px 0 8px;
}
.morse-pattern-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    margin: 10px 0;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.morse-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cyan);
    opacity: 0;
    animation: morsePop 0.2s ease forwards;
    flex-shrink: 0;
}
.morse-dash {
    width: 52px;
    height: 18px;
    border-radius: 9px;
    background: var(--cyan);
    opacity: 0;
    animation: morsePop 0.2s ease forwards;
    flex-shrink: 0;
}
.morse-dot.revealed, .morse-dash.revealed {
    opacity: 1;
    animation: none;
}
@keyframes morsePop {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}
.morse-reveal-letter {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Fredoka One', sans-serif;
    color: var(--green);
    animation: letterReveal 0.4s ease;
}
@keyframes letterReveal {
    from { transform: scale(0) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.morse-letter-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-width: 400px;
    width: 100%;
    margin: 10px auto;
}
.morse-letter-btn {
    padding: 10px 0;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    border: 2px solid var(--card-light);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.12s;
}
.morse-letter-btn:hover {
    background: var(--card-light);
    border-color: var(--cyan);
}
.morse-letter-btn:active {
    transform: scale(0.93);
}
.morse-letter-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.morse-letter-btn.morse-selected {
    background: var(--cyan);
    color: var(--dark);
    border-color: var(--cyan);
    opacity: 1;
}
.morse-feedback {
    text-align: center;
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.9rem;
    margin: 8px 0;
}
.morse-result-text {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 10px 0;
}
.morse-result-text.correct {
    color: var(--green);
}
.morse-result-text.wrong {
    color: var(--red);
}
.morse-big-results {
    text-align: center;
    color: var(--green);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 8px 0;
}
.morse-guess-count {
    text-align: center;
    color: var(--text-dim);
    margin-top: 12px;
}
.morse-ref {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-width: 400px;
    width: 100%;
    margin: 14px auto 0;
    padding: 10px;
    background: var(--card);
    border-radius: var(--radius);
    opacity: 0.7;
}
.morse-ref-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    padding: 2px 4px;
}
.morse-ref-letter {
    font-weight: 800;
    min-width: 12px;
    color: var(--text);
    font-size: 0.75rem;
}
.morse-ref-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    flex-shrink: 0;
}
.morse-ref-dash {
    width: 16px;
    height: 6px;
    border-radius: 3px;
    background: var(--cyan);
    flex-shrink: 0;
}
.morse-final-word {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.morse-result-banner {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.morse-scores {
    max-width: 400px;
    margin: 0 auto;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.morse-score-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-weight: 600;
}
.morse-score-row + .morse-score-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Big screen morse */
.big-screen .morse-pattern-display {
    max-width: 600px;
    min-height: 70px;
}
.big-screen .morse-dot { width: 24px; height: 24px; }
.big-screen .morse-dash { width: 72px; height: 24px; }
.big-screen .morse-reveal-letter { font-size: 5rem; }
.big-screen .morse-ref { max-width: 700px; }
.big-screen .morse-wp-char { width: 48px; height: 56px; font-size: 1.8rem; }

/* ===== DRAWING GUESSER ===== */
.draw-round {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
}
.draw-role {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0;
}
.draw-word {
    text-align: center;
    font-size: 1.3rem;
    margin: 4px 0 6px;
    color: var(--yellow);
}
.draw-hint {
    text-align: center;
    font-size: 1.4rem;
    font-family: 'Fredoka One', monospace;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin: 4px 0;
}
.draw-hint-len {
    font-size: 0.8rem;
    letter-spacing: normal;
    font-family: 'Nunito', sans-serif;
}
.draw-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin: 6px auto;
    max-width: 400px;
}
.draw-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    padding: 0;
}
.draw-color.active {
    border-color: var(--cyan);
    transform: scale(1.2);
}
.draw-color:hover { transform: scale(1.15); }
.draw-tool-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
}
.draw-size {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--card-light);
    background: var(--card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.1s;
}
.draw-size.active { border-color: var(--cyan); }
.draw-size-dot {
    border-radius: 50%;
    background: var(--text);
    display: block;
}
.draw-clear {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--card-light);
    background: var(--card);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 4px;
}
.draw-clear:hover { border-color: var(--red); }
.draw-canvas-wrap {
    width: 100%;
    max-width: 400px;
    margin: 6px auto;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--card-light);
    aspect-ratio: 1;
}
.draw-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}
.draw-replay-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
}
.draw-timer {
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dim);
    margin: 6px 0;
    transition: color 0.3s;
}
.draw-timer.urgent {
    color: var(--red);
    animation: pulse 0.5s infinite;
}
.draw-guess-area {
    display: flex;
    gap: 8px;
    max-width: 400px;
    width: 100%;
    margin: 6px auto;
}
.draw-guess-area input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--card-light);
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    outline: none;
}
.draw-guess-area input:focus {
    border-color: var(--cyan);
}
.draw-feedback {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    min-height: 1.3em;
    margin: 4px 0;
    transition: color 0.2s;
}
.draw-feedback.wrong {
    color: var(--red);
}
.draw-big-feed {
    max-width: 600px;
    margin: 8px auto;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.draw-big-feed-item {
    padding: 2px 0;
    animation: fadeIn 0.3s ease;
}
.draw-result-banner {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 12px 16px;
    margin: 8px auto;
    max-width: 400px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--card), var(--card-light));
}
.draw-result-banner.correct { color: var(--green); }
.draw-result-banner.timeout { color: var(--orange); }
.draw-word-reveal {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-dim);
    margin: 8px 0;
}
.draw-points-split {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-weight: 700;
    font-size: 1rem;
    margin: 8px 0;
    color: var(--cyan);
}
.draw-scores {
    max-width: 400px;
    margin: 12px auto;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.draw-score-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-weight: 600;
}
.draw-score-row + .draw-score-row {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Big screen drawing */
.big-screen .draw-canvas-wrap { max-width: 600px; }
.big-screen .draw-timer { font-size: 1.3rem; }
.big-screen .draw-result-banner { max-width: 600px; font-size: 1.6rem; }
.big-screen .draw-hint { font-size: 2rem; }

/* ========== UI POLISH & ANIMATIONS ========== */

/* Animated gradient on home screen */
#screen-home {
    background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #1a1a3e, #2a1a3e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Logo entrance */
.logo-container {
    animation: logoEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes logoEntrance {
    from { transform: scale(0.3) translateY(40px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Menu button stagger */
.menu-buttons .btn:nth-child(1) { animation: slideUp 0.5s ease 0.2s both; }
.menu-buttons .btn:nth-child(2) { animation: slideUp 0.5s ease 0.35s both; }
.menu-buttons .btn:nth-child(3) { animation: slideUp 0.5s ease 0.5s both; }
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Game tile improvements */
.game-tile {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: rgba(196,77,255,0.4);
}
.game-tile.voted {
    animation: votedGlow 2s ease-in-out infinite;
}
@keyframes votedGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(0,212,255,0.3); }
    50% { box-shadow: 0 0 40px rgba(0,212,255,0.6); }
}

/* Staggered tile entrance */
.game-tile { opacity: 0; animation: tileIn 0.4s ease forwards; }
.game-tile:nth-child(1) { animation-delay: 0.05s; }
.game-tile:nth-child(2) { animation-delay: 0.1s; }
.game-tile:nth-child(3) { animation-delay: 0.15s; }
.game-tile:nth-child(4) { animation-delay: 0.2s; }
.game-tile:nth-child(5) { animation-delay: 0.25s; }
.game-tile:nth-child(6) { animation-delay: 0.3s; }
.game-tile:nth-child(7) { animation-delay: 0.35s; }
.game-tile:nth-child(8) { animation-delay: 0.4s; }
.game-tile:nth-child(9) { animation-delay: 0.45s; }
.game-tile:nth-child(10) { animation-delay: 0.5s; }
.game-tile:nth-child(11) { animation-delay: 0.55s; }
@keyframes tileIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Vote count badge bounce */
.game-tile-votes {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.game-tile.voted .game-tile-votes {
    background: var(--cyan);
    transform: scale(1.2);
}

/* Floating points animation */
.points-popup {
    position: absolute;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: var(--green);
    pointer-events: none;
    animation: pointsFloat 1.2s ease-out forwards;
    z-index: 50;
    text-shadow: 0 2px 8px rgba(0,230,118,0.5);
}
@keyframes pointsFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

/* Enhanced confetti */
.confetti-piece {
    animation: confettiDrop 3s ease-in forwards;
}
@keyframes confettiDrop {
    0% { top: -10px; transform: rotate(0deg) scale(1); opacity: 1; }
    100% { top: 110vh; transform: rotate(1080deg) scale(0.3); opacity: 0; }
}

/* Score change animation in lobby */
.player-tag small {
    transition: all 0.3s ease;
}

/* Game screen entrance */
#screen-game.active, #screen-big-game.active {
    animation: gameEnter 0.5s ease;
}
@keyframes gameEnter {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Better touch targets for mobile */
@media (max-width: 480px) {
    .game-tile { padding: 14px 8px 12px; min-height: 100px; }
    .game-tile-emoji { font-size: 2.2rem; }
    .option-btn { padding: 18px 16px; min-height: 54px; }
    .morse-letter-btn { padding: 14px 0; min-height: 48px; }
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--card-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* Party code copy hint */
.code-value {
    cursor: pointer;
    transition: all 0.2s;
}
.code-value:hover {
    filter: brightness(1.3);
}
.code-value:active {
    transform: scale(0.95);
}

/* ===== MODAL CENTERING ===== */
.modal-section {
    text-align: center;
}
.modal-section h4 {
    text-align: center;
}
.modal-score-row {
    justify-content: center;
    gap: 12px;
}

/* ===== LIAR PLAYER BOXES ===== */
.liar-player-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 16px auto;
    max-width: 500px;
}
.liar-pbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.liar-pbox.active {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}
.liar-pbox.me {
    border-color: var(--purple);
}
.liar-pbox.finished {
    opacity: 0.4;
}
.liar-pbox-count {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: var(--cyan);
}
.liar-pbox.finished .liar-pbox-count {
    color: var(--green);
    font-size: 1.4rem;
}
.liar-pbox-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ===== LIAR DECK DISPLAY ===== */
.liar-decks {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 8px 0;
}
.liar-deck-card {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.liar-deck-card.pile {
    background: linear-gradient(135deg, var(--orange), var(--red));
}
.liar-deck-count {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: white;
}
.liar-deck-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== LIAR RANK BUTTONS ===== */
.liar-rank-btn {
    padding: 12px 20px !important;
    font-size: 1rem !important;
    min-width: 120px;
}

/* ===== LIAR CARD DRAG ===== */
.liar-card[draggable="true"] {
    cursor: grab;
}
.liar-card[draggable="true"]:active {
    cursor: grabbing;
    opacity: 0.7;
}

/* ===== GAME TITLE TOP-LEFT ===== */
.game-title-tl {
    position: absolute;
    top: 12px;
    left: 16px;
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: var(--text-dim);
    z-index: 2;
}

#game-content {
    position: relative;
    padding-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.more-games-btn {
    margin-top: 24px;
    padding: 14px 36px;
    font-size: 1.1rem;
}

/* ===== PROGRESS BAR (MULTI-ROUND GAMES) ===== */
.game-progress {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--card-light);
    border-radius: 3px;
    margin: 8px auto 16px;
    overflow: hidden;
}
.game-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== COUNTDOWN BAR ===== */
.countdown-bar {
    width: 100%;
    max-width: 400px;
    height: 4px;
    background: var(--card-light);
    border-radius: 2px;
    margin: 12px auto 8px;
    overflow: hidden;
}
.countdown-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
    border-radius: 2px;
    transition: width 0.05s linear;
}

/* ===== ANIMATED GAME RESULTS ===== */
.game-results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin: 24px auto 0;
    padding: 0 16px;
}
.game-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--card);
    border: 2px solid var(--card-light);
    border-radius: var(--radius);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: resultSlideIn 0.5s ease forwards;
}
.game-result-row:first-child {
    border-color: var(--yellow);
    background: linear-gradient(135deg, rgba(255,234,0,0.15), rgba(255,145,0,0.1));
}
.game-result-row:nth-child(2) {
    border-color: var(--text-dim);
    background: linear-gradient(135deg, rgba(136,146,176,0.15), rgba(136,146,176,0.05));
}
.game-result-row:nth-child(3) {
    border-color: var(--orange);
    background: linear-gradient(135deg, rgba(255,145,0,0.12), rgba(255,145,0,0.05));
}
.game-result-medal {
    font-size: 1.8rem;
    min-width: 40px;
    text-align: center;
}
.game-result-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
}
.game-result-score {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@keyframes resultSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== LIAR PLAY ANNOUNCEMENT ===== */
.liar-play-announcement {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    text-align: center;
    margin: 20px 0;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(196,77,255,0.15), rgba(77,121,255,0.15));
    border: 2px solid var(--purple);
    border-radius: var(--radius);
}

/* ===== LIAR CARD DRAGGING ===== */
.liar-card.dragging {
    opacity: 0.5;
    transform: scale(1.1);
    z-index: 10;
}
