/* ============================================
   LITTLE GAMES - WARM ARCADE STYLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-cream: #E8E0D8;
    --bg-card: #7D4545;
    --bg-card-hover: #8B4E4E;
    --primary: #7D4545;
    --primary-dark: #6B3A3A;
    --primary-light: #9A5959;
    --text-light: #FFFFFF;
    --text-dark: #2D2D2D;
    --text-muted: #6B6B6B;
    --success: #4A7D4A;
    --warning: #B8860B;
    --danger: #C44444;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Disable text selection for game feel */
.btn, .vote-card-arcade, .player-card, .word-card, .word-peek-card {
    user-select: none;
    -webkit-user-select: none;
}

/* Background Animation - Hidden */
.bg-animation {
    display: none;
}

/* Game Container */
.game-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 500px;
    padding: 0 15px;
    animation: screenFadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
}

@keyframes screenFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo & Title */
.logo-container {
    margin-bottom: 50px;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(36px, 10vw, 56px);
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.glitch {
    animation: none;
}

.tagline {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 8px;
}

/* Buttons - Clean Arcade Style */
.btn {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--text-light);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: scale(0.96) translateY(0);
}

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

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--text-light);
}

.btn-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    margin-top: 30px;
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--text-light);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-sm);
}

.btn-small:hover {
    background: var(--primary-dark);
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    justify-content: center;
}

.btn-group.vertical {
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.pulse {
    animation: none;
}

.rules-hint {
    margin-top: 30px;
    padding: 15px 20px;
    background: rgba(125, 69, 69, 0.1);
    border-radius: var(--radius-md);
}

.rules-hint p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Screen Titles */
.screen-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-dark);
}

/* Input Containers */
.input-container {
    width: 100%;
    margin-bottom: 16px;
}

.input-container label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.input-container input {
    width: 100%;
    background: var(--text-light);
    border: 2px solid #D0C8C0;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 16px;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
}

.input-container input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-container input::placeholder {
    color: #A0A0A0;
}

.code-input {
    text-align: center;
    font-size: 24px !important;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 10px;
    min-height: 20px;
}

/* Game Code Display */
.game-code-display {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
}

.game-code-display p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
}

.code-box {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Players Lobby */
.players-lobby {
    width: 100%;
    background: var(--text-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.players-lobby h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
    text-transform: uppercase;
}

.players-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}

.player-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-cream);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: playerFadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.player-tag:hover {
    transform: translateX(4px);
}

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

.player-tag span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.player-tag .host-badge {
    background: var(--primary);
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 5px;
}

.player-tag .you-badge {
    background: var(--success);
    color: var(--text-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 5px;
}

.host-controls, .guest-waiting {
    margin-top: 20px;
    width: 100%;
}

.waiting-text {
    color: var(--text-muted);
    font-size: 15px;
    animation: waitingPulse 2s ease-in-out infinite;
}

@keyframes waitingPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Word Reveal Screen */
.reveal-container {
    width: 100%;
}

.waiting-overlay {
    padding: 40px 20px;
}

.current-turn-info {
    margin-bottom: 40px;
}

.turn-label {
    color: var(--text-muted);
    font-size: 16px;
}

.current-turn-info h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin: 10px 0;
}

.waiting-animation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.waiting-animation .dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.waiting-animation .dot:nth-child(1) { animation-delay: -0.32s; }
.waiting-animation .dot:nth-child(2) { animation-delay: -0.16s; }
.waiting-animation .dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.progress-text {
    color: var(--text-muted);
    font-size: 14px;
}

.player-turn-name {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 10px;
}

.instruction {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

.word-card {
    width: 260px;
    height: 160px;
    margin: 0 auto 25px;
    perspective: 1000px;
    cursor: pointer;
}

.word-card .card-front,
.word-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transition: transform 0.5s ease;
}

.word-card .card-front {
    background: var(--primary);
    box-shadow: var(--shadow);
}

.word-card .card-front p {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.tap-icon {
    font-size: 32px;
    margin-top: 10px;
    animation: tapBounce 1.2s ease-in-out infinite;
}

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

.word-card .card-back {
    background: var(--success);
    transform: rotateY(180deg);
    box-shadow: var(--shadow);
}

.word-card.flipped .card-front {
    transform: rotateY(-180deg);
}

.word-card.flipped .card-back {
    transform: rotateY(0);
}

.word-card.imposter .card-back {
    background: var(--danger);
}

.word-label {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.word-card.imposter .word-label {
    color: var(--text-light);
}

.secret-word {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-light);
}

.word-card.imposter .secret-word {
    color: var(--text-light);
}

/* Word Peek Card */
.word-peek-card {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 50px;
    perspective: 500px;
    cursor: pointer;
    z-index: 100;
}

.word-peek-card .peek-front,
.word-peek-card .peek-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transition: transform 0.3s ease;
    gap: 2px;
}

.word-peek-card .peek-front {
    background: var(--primary);
}

.word-peek-card .peek-icon {
    font-size: 18px;
}

.word-peek-card .peek-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.word-peek-card .peek-back {
    background: var(--success);
    transform: rotateY(180deg);
}

.word-peek-card.flipped .peek-front {
    transform: rotateY(-180deg);
}

.word-peek-card.flipped .peek-back {
    transform: rotateY(0);
}

.word-peek-card.imposter .peek-back {
    background: var(--danger);
}

.word-peek-card .peek-word {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    padding: 4px;
}

/* Imposter Hint on Reveal Card */
.imposter-hint-reveal {
    margin-top: 15px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--warning);
    border-radius: var(--radius-sm);
}

.hint-label-reveal {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.hint-word-reveal {
    font-size: 14px;
    font-weight: 700;
    color: #FFD700;
    text-transform: uppercase;
}

/* First Speaker Banner */
.first-speaker-banner {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--text-light);
    border: 2px solid var(--primary);
    border-radius: 30px;
    z-index: 90;
    box-shadow: var(--shadow);
}

.first-speaker-banner .speaker-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.first-speaker-banner .speaker-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.first-speaker-banner.is-you {
    background: var(--primary);
}

.first-speaker-banner.is-you .speaker-label {
    color: rgba(255, 255, 255, 0.8);
}

.first-speaker-banner.is-you .speaker-name {
    color: var(--text-light);
}

/* Game Screen */
.game-header {
    margin-bottom: 25px;
}

.game-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.game-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.timer-container {
    margin-bottom: 20px;
}

.timer-ring {
    position: relative;
    width: 160px;
    height: 160px;
    background: var(--text-light);
    border-radius: 50%;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: #E0D8D0;
    stroke-width: 10;
}

.timer-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-display {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
    z-index: 1;
}

.timer-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn-icon {
    padding: 10px 16px;
    font-size: 14px;
    background: var(--text-light);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--primary);
    color: var(--text-light);
}

.btn-pause {
    padding: 10px 24px;
    font-size: 14px;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-sm);
}

.btn-pause:hover {
    background: var(--primary-dark);
}

/* Players Grid */
.players-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 450px;
    margin-top: 20px;
    padding: 0 10px;
}

.player-card {
    background: var(--text-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    min-width: 80px;
    position: relative;
}

.player-card.is-me {
    background: rgba(125, 69, 69, 0.1);
    border: 2px solid var(--primary);
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.player-card .player-avatar {
    font-size: 24px;
    margin-bottom: 4px;
}

.player-card .player-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
}

.player-card .you-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: var(--text-light);
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Voting Screen */
.voting-header {
    margin-bottom: 25px;
}

.glitch-vote {
    animation: none;
}

.vote-instruction {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 10px;
}

.vote-stats {
    margin-top: 15px;
}

.vote-stat {
    background: var(--primary);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.voting-grid-arcade {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 380px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 8px;
    width: 100%;
}

.vote-card-arcade {
    background: var(--text-light);
    border-radius: var(--radius-md);
    padding: 18px 12px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 3px solid transparent;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.vote-card-arcade:active {
    transform: scale(0.96);
}

.vote-card-arcade.my-vote {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(125, 69, 69, 0.15), rgba(125, 69, 69, 0.05));
    box-shadow: 0 4px 15px rgba(125, 69, 69, 0.25);
}

/* Checkmark indicator for your vote */
.vote-card-arcade.my-vote::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkPop 0.25s ease;
}

.vote-card-arcade.my-vote::after {
    content: '';
    position: absolute;
    top: 13px;
    right: 16px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    animation: checkPop 0.25s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes checkPopRotate {
    0% { transform: rotate(45deg) scale(0); opacity: 0; }
    50% { transform: rotate(45deg) scale(1.2); }
    100% { transform: rotate(45deg) scale(1); opacity: 1; }
}

.vote-card-arcade.my-vote::after {
    animation: checkPopRotate 0.25s ease;
}

/* Voting animation (when casting vote) */
.vote-card-arcade.voting {
    animation: votePress 0.2s ease;
}

@keyframes votePress {
    0% { transform: scale(1); }
    50% { transform: scale(0.92); background: rgba(125, 69, 69, 0.2); }
    100% { transform: scale(1); }
}

/* Has votes indicator */
.vote-card-arcade.has-votes {
    border-color: rgba(125, 69, 69, 0.3);
}

.vote-card-arcade .vote-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.2;
}

.vote-card-arcade .vote-count-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.vote-card-arcade .vote-number {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.vote-card-arcade .vote-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.voters-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    min-height: 20px;
}

.voter-chip {
    background: var(--primary);
    color: var(--text-light);
    font-size: 9px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 10px;
    animation: chipFadeIn 0.2s ease;
    white-space: nowrap;
}

.voter-chip.is-me {
    background: var(--text-dark);
}

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

/* Result Screen */
.result-container {
    padding: 30px;
    text-align: center;
}

.result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.imposter-reveal {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    animation: revealPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.imposter-reveal .imposter-avatar {
    font-size: 56px;
    margin-bottom: 15px;
}

.imposter-reveal .imposter-name {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-light);
}

.word-reveal {
    background: var(--text-light);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
}

.word-reveal p {
    font-size: 16px;
    color: var(--text-muted);
}

.word-reveal #final-word {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-top: 8px;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

.dashboard-container {
    align-items: center;
    justify-content: center;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    z-index: 1;
    animation: screenFadeIn 0.4s ease-out;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 0 10px;
}

/* Game Card */
.game-card {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow);
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.game-card:active {
    transform: scale(0.97);
}

.game-card-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.game-emoji {
    font-size: 32px;
}

.game-card-info {
    z-index: 1;
}

.game-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 4px;
}

.game-card-players {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Game Card Overlay */
.game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: var(--radius-lg);
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.play-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
    padding: 10px 24px;
    border: 2px solid var(--text-light);
    border-radius: 30px;
    background: transparent;
}

/* Coming Soon Card */
.game-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-card.coming-soon:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.game-card.coming-soon .game-card-overlay {
    opacity: 0;
}

.game-card.coming-soon:hover .game-card-overlay {
    opacity: 1;
}

.coming-soon-text {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
}

/* Game Suggestions */
.game-suggestions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
}

.suggestion-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
}

/* ============================================
   HOME BUTTON
   ============================================ */

.home-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--text-light);
    border: 2px solid #D0C8C0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.home-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.home-btn:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.home-btn:hover svg {
    color: var(--primary);
}

.home-btn:active {
    transform: scale(0.95);
}

/* ============================================
   LEAVE BUTTON
   ============================================ */

.leave-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--text-light);
    border: 2px solid #D0C8C0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: var(--shadow);
}

.leave-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.leave-btn:hover {
    border-color: var(--danger);
    background: var(--danger);
}

.leave-btn:hover svg {
    color: var(--text-light);
}

.leave-btn:active {
    transform: scale(0.95);
}

/* ============================================
   DYNAMIC ISLAND PILL BAR
   ============================================ */

.pill-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    border-radius: 50px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
    min-width: 160px;
}

.pill-bar.expanded {
    padding: 10px 18px;
    min-width: 280px;
}

/* Default State */
.pill-default {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-radius: 20px;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pill-btn:active {
    transform: scale(0.95);
}

.pill-btn-icon {
    font-size: 16px;
}

.pill-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* Room State */
.pill-room {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pill-room-code {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.pill-room-code:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pill-room-code span {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 2px;
}

.pill-room-code .copy-icon {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.pill-members {
    display: flex;
    align-items: center;
}

.pill-member {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    margin-left: -8px;
    border: 2px solid var(--primary);
}

.pill-member:first-child {
    margin-left: 0;
}

.pill-member.host {
    background: var(--text-light);
    color: var(--primary);
}

.pill-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.pill-close svg {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.pill-close:hover {
    background: var(--danger);
}

.pill-close:hover svg {
    color: var(--text-light);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--text-light);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 380px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-view {
    display: block;
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons .btn {
    flex: 1;
}

/* Debug Modal */
.debug-games {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debug-game-btn {
    width: 100%;
    justify-content: center;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-dark);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 400;
    box-shadow: var(--shadow-hover);
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   TIC TAC TOE STYLES
   ============================================ */

.ttt-logo {
    font-size: clamp(28px, 8vw, 40px) !important;
    color: var(--text-dark) !important;
    background: none !important;
    -webkit-text-fill-color: var(--text-dark) !important;
}

.waiting-info {
    margin-top: 30px;
    text-align: center;
}

.player-count-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 15px;
}

/* Game Header */
.ttt-header {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 320px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    background: var(--text-light);
    border-radius: var(--radius-md);
    border: 2px solid #D0C8C0;
    flex: 1;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.player-info.is-me {
    border-color: var(--primary);
    background: rgba(125, 69, 69, 0.1);
}

.player-info.player-x .player-symbol {
    color: var(--primary);
}

.player-info.player-o .player-symbol {
    color: var(--danger);
}

.player-symbol {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 900;
}

.player-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-dark);
    margin-top: 4px;
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.draws-count {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--warning);
}

.draws-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

/* Status Banner */
.ttt-status {
    padding: 10px 24px;
    background: var(--text-light);
    border-radius: 30px;
    border: 2px solid #D0C8C0;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.ttt-status.my-turn {
    border-color: var(--primary);
    background: rgba(125, 69, 69, 0.1);
}

.ttt-status.my-turn #status-text {
    color: var(--primary);
}

.ttt-status.opponent-turn {
    border-color: #D0C8C0;
}

.ttt-status.opponent-turn #status-text {
    color: var(--text-muted);
}

.ttt-status.win {
    border-color: var(--success);
    background: rgba(74, 125, 74, 0.1);
}

.ttt-status.win #status-text {
    color: var(--success);
}

.ttt-status.lose {
    border-color: var(--danger);
    background: rgba(196, 68, 68, 0.1);
}

.ttt-status.lose #status-text {
    color: var(--danger);
}

.ttt-status.draw {
    border-color: var(--warning);
    background: rgba(184, 134, 11, 0.1);
}

.ttt-status.draw #status-text {
    color: var(--warning);
}

#status-text {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

/* Game Board */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 280px;
    height: 280px;
    margin-bottom: 20px;
    position: relative;
}

.ttt-board.game-over .ttt-cell {
    cursor: default;
}

.ttt-cell {
    background: var(--text-light);
    border-radius: var(--radius-md);
    border: 2px solid #D0C8C0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: var(--shadow);
}

.ttt-cell:hover:not(.x):not(.o) {
    border-color: var(--primary);
    transform: scale(1.02);
}

.ttt-cell:active:not(.x):not(.o) {
    transform: scale(0.95);
}

.ttt-cell.x {
    color: var(--primary);
    animation: cellPop 0.2s ease;
}

.ttt-cell.o {
    color: var(--danger);
    animation: cellPop 0.2s ease;
}

@keyframes cellPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Win Line */
.win-line {
    position: absolute;
    background: var(--primary);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.win-line.x { background: var(--primary); }
.win-line.o { background: var(--danger); }

.win-line.row-0, .win-line.row-1, .win-line.row-2 {
    height: 6px;
    width: 90%;
    left: 5%;
    opacity: 1;
    animation: lineGrow 0.3s ease-out;
}
.win-line.row-0 { top: calc(16.66% - 3px); }
.win-line.row-1 { top: calc(50% - 3px); }
.win-line.row-2 { top: calc(83.33% - 3px); }

.win-line.col-0, .win-line.col-1, .win-line.col-2 {
    width: 6px;
    height: 90%;
    top: 5%;
    opacity: 1;
    animation: lineGrowV 0.3s ease-out;
}
.win-line.col-0 { left: calc(16.66% - 3px); }
.win-line.col-1 { left: calc(50% - 3px); }
.win-line.col-2 { left: calc(83.33% - 3px); }

.win-line.diag-1, .win-line.diag-2 {
    width: 6px;
    height: 120%;
    top: -10%;
    left: calc(50% - 3px);
    opacity: 1;
    animation: lineGrowV 0.3s ease-out;
}
.win-line.diag-1 { transform: rotate(45deg); }
.win-line.diag-2 { transform: rotate(-45deg); }

@keyframes lineGrow {
    0% { width: 0; left: 50%; }
    100% { width: 90%; left: 5%; }
}

@keyframes lineGrowV {
    0% { height: 0; top: 50%; }
    100% { height: 90%; top: 5%; }
}

/* Tap Hint */
.tap-hint {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-bottom: 15px;
}

.tap-hint.visible {
    opacity: 1;
    animation: tapPulse 2s ease-in-out infinite;
}

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

/* Back Button */
.ttt-back-btn {
    padding: 10px 20px;
    font-size: 13px;
}

/* ============================================
   CONNECT 4 STYLES
   ============================================ */

.connect4-logo {
    font-size: clamp(28px, 10vw, 44px) !important;
    color: var(--text-dark) !important;
    background: none !important;
    -webkit-text-fill-color: var(--text-dark) !important;
}

.connect4-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 450px;
    padding: 0 10px;
    margin-bottom: 20px;
}

.player-info.player-red.current-turn {
    border-color: var(--danger);
    background: rgba(196, 68, 68, 0.1);
}

.player-info.player-yellow.current-turn {
    border-color: var(--warning);
    background: rgba(184, 134, 11, 0.1);
}

.player-piece {
    font-size: 24px;
    margin-bottom: 4px;
}

.connect4-status {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    background: var(--text-light);
    border-radius: var(--radius-md);
    border: 2px solid #D0C8C0;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.connect4-status.my-turn {
    border-color: var(--primary);
    background: rgba(125, 69, 69, 0.1);
}

.connect4-status.opponent-turn {
    border-color: #D0C8C0;
}

.connect4-status.win {
    border-color: var(--success);
    background: rgba(74, 125, 74, 0.1);
}

.connect4-status.lose {
    border-color: var(--danger);
    background: rgba(196, 68, 68, 0.1);
}

.connect4-status #status-text {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.connect4-status.my-turn #status-text {
    color: var(--primary);
}

.connect4-status.win #status-text {
    color: var(--success);
}

.connect4-status.lose #status-text {
    color: var(--danger);
}

.connect4-board {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.drop-zones {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    z-index: 10;
}

.drop-zone {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.drop-zone:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.drop-zone:active {
    transform: scale(0.95);
}

.drop-zone::before {
    content: '\2B07';
    font-size: 16px;
    opacity: 0.7;
    color: var(--text-light);
}

.drop-zone:hover::before {
    opacity: 1;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    background: var(--primary-dark);
    border-radius: var(--radius-md);
    padding: 15px;
    position: relative;
}

.connect4-cell {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-cream);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s ease;
    cursor: default;
}

.connect4-cell.red {
    background: var(--danger);
    border-color: #A03030;
    animation: dropIn 0.4s ease-out;
}

.connect4-cell.yellow {
    background: var(--warning);
    border-color: #8B6914;
    animation: dropIn 0.4s ease-out;
}

@keyframes dropIn {
    0% {
        transform: translateY(-80px) scale(0.6);
        opacity: 0;
    }
    60% {
        transform: translateY(8px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.connect4-back-btn {
    margin-top: 10px;
}

/* ============================================
   DEBUG MODE STYLES
   ============================================ */

.debug-btn {
    opacity: 0.6;
    font-size: 12px;
}

.debug-btn:hover {
    opacity: 1;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .logo {
        font-size: clamp(28px, 9vw, 40px);
    }

    .tagline {
        font-size: 14px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-card {
        padding: 20px 15px;
    }

    .game-card-image {
        width: 55px;
        height: 55px;
        margin-bottom: 12px;
    }

    .game-emoji {
        font-size: 26px;
    }

    .game-card-title {
        font-size: 15px;
    }

    .game-card-players {
        font-size: 11px;
    }

    .pill-bar {
        bottom: 20px;
        padding: 6px 12px;
        min-width: 140px;
    }

    .pill-bar.expanded {
        min-width: 240px;
        padding: 8px 14px;
    }

    .pill-btn {
        font-size: 13px;
        padding: 6px 10px;
    }

    .pill-member {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .modal {
        padding: 24px 20px;
        max-width: 340px;
    }

    .modal-title {
        font-size: 20px;
    }

    .home-btn, .leave-btn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .home-btn svg, .leave-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Tic Tac Toe Mobile */
    .ttt-header {
        gap: 10px;
        max-width: 280px;
    }

    .player-info {
        padding: 10px 14px;
    }

    .player-symbol {
        font-size: 20px;
    }

    .player-score {
        font-size: 18px;
    }

    .player-name {
        font-size: 10px;
        max-width: 60px;
    }

    .ttt-board {
        width: 250px;
        height: 250px;
        gap: 8px;
    }

    .ttt-cell {
        font-size: 40px;
        border-radius: var(--radius-sm);
    }

    .ttt-status {
        padding: 8px 18px;
    }

    #status-text {
        font-size: 13px;
    }

    /* Connect 4 Mobile */
    .connect4-header {
        padding: 0 15px;
        max-width: 100%;
    }

    .connect4-status {
        padding: 14px 20px;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .connect4-status #status-text {
        font-size: 14px;
    }

    .connect4-board {
        padding: 15px;
    }

    .drop-zones {
        gap: 6px;
        margin-bottom: 8px;
    }

    .drop-zone {
        width: 40px;
        height: 40px;
    }

    .board-grid {
        gap: 6px;
        padding: 12px;
    }

    .connect4-cell {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .games-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .game-card {
        padding: 15px 10px;
    }

    .game-card-image {
        width: 45px;
        height: 45px;
    }

    .game-emoji {
        font-size: 22px;
    }

    .game-card-title {
        font-size: 13px;
    }

    .ttt-board {
        width: 220px;
        height: 220px;
    }

    .ttt-cell {
        font-size: 34px;
    }

    .drop-zone {
        width: 35px;
        height: 35px;
    }

    .connect4-cell {
        width: 35px;
        height: 35px;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .game-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .pill-bar {
        bottom: max(30px, calc(env(safe-area-inset-bottom) + 10px));
    }

    .word-peek-card {
        left: max(20px, env(safe-area-inset-left));
    }

    .home-btn, .leave-btn {
        right: max(20px, env(safe-area-inset-right));
    }

}

/* ============================================
   MAFIA GAME STYLES
   ============================================ */

.mafia-theme {
    --mafia-dark: #1a1a2e;
    --mafia-darker: #0f0f1a;
    --mafia-accent: #e94560;
    --mafia-gold: #f4a261;
    --mafia-text: #eee;
}

.mafia-container {
    background: linear-gradient(135deg, var(--mafia-dark) 0%, var(--mafia-darker) 100%);
}

.mafia-logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(40px, 12vw, 70px);
    font-weight: 900;
    color: var(--mafia-accent);
    text-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
    letter-spacing: 4px;
}

.mafia-theme .tagline {
    color: rgba(255, 255, 255, 0.6);
}

.mafia-theme .code-box {
    background: rgba(233, 69, 96, 0.2);
    border-color: var(--mafia-accent);
    color: var(--mafia-text);
}

.mafia-theme .players-lobby h3 {
    color: var(--mafia-text);
}

.mafia-theme .player-chip {
    background: rgba(255, 255, 255, 0.1);
    color: var(--mafia-text);
    border-color: rgba(255, 255, 255, 0.2);
}

.mafia-theme .player-chip.is-me {
    background: var(--mafia-accent);
    border-color: var(--mafia-accent);
}

.mafia-theme .btn-primary {
    background: var(--mafia-accent);
    border-color: var(--mafia-accent);
}

.mafia-theme .btn-primary:hover {
    background: #d63d56;
}

.mafia-theme .waiting-text {
    color: rgba(255, 255, 255, 0.6);
}

/* Role Card */
.role-card .card-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.role-emoji {
    font-size: 60px;
    margin-bottom: 15px;
}

.role-name {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--mafia-accent);
    margin-bottom: 10px;
}

.role-description {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.mafia-teammates {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.teammates-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.teammates-names {
    font-weight: 700;
    color: var(--mafia-accent);
}

/* Night Phase */
.night-header {
    text-align: center;
    margin-bottom: 30px;
}

.moon-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.night-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #a0a0ff;
    margin-bottom: 5px;
}

.night-subtitle {
    color: rgba(255, 255, 255, 0.5);
}

.night-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.sleeping-animation span {
    font-size: 40px;
    animation: float 2s ease-in-out infinite;
}

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

.waiting-message {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.action-instruction {
    text-align: center;
    font-size: 16px;
    color: var(--mafia-text);
    margin-bottom: 20px;
}

.night-targets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 350px;
    margin: 0 auto;
}

.night-target-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.night-target-card:hover {
    background: rgba(255, 255, 255, 0.15);
}

.night-target-card.selected {
    background: rgba(233, 69, 96, 0.3);
    border-color: var(--mafia-accent);
}

.target-name {
    color: var(--mafia-text);
    font-weight: 600;
}

/* Day Phase */
.day-header {
    text-align: center;
    margin-bottom: 25px;
}

.sun-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.day-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--mafia-gold);
}

.death-announcement {
    text-align: center;
    padding: 30px;
}

.death-message {
    font-size: 18px;
    color: var(--mafia-text);
    margin-bottom: 20px;
}

.victim-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(233, 69, 96, 0.2);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.victim-emoji {
    font-size: 40px;
}

.victim-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--mafia-text);
}

.victim-role {
    color: rgba(255, 255, 255, 0.6);
}

.discussion-section {
    text-align: center;
    padding: 20px;
}

.discussion-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.mafia-theme #day-timer {
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: var(--mafia-gold);
}

.voting-section {
    padding: 20px;
}

.mafia-theme .vote-card-arcade {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.mafia-theme .vote-card-arcade .vote-name {
    color: var(--mafia-text);
}

.mafia-theme .vote-card-arcade .vote-number {
    color: var(--mafia-accent);
}

.mafia-theme .vote-card-arcade.my-vote {
    background: rgba(233, 69, 96, 0.2);
    border-color: var(--mafia-accent);
}

/* Elimination Screen */
.elimination-container {
    text-align: center;
    padding: 40px 20px;
}

.elimination-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--mafia-text);
    margin-bottom: 30px;
}

.eliminated-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 30px;
}

.eliminated-emoji {
    font-size: 50px;
}

.eliminated-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--mafia-text);
}

.eliminated-role {
    color: rgba(255, 255, 255, 0.6);
}

.no-elimination-text {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Results Screen */
.mafia-theme .result-container {
    background: transparent;
}

.mafia-theme .result-title {
    color: var(--mafia-text);
}

.winner-announcement {
    text-align: center;
    margin-bottom: 30px;
}

.winner-emoji {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

.winner-text {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--mafia-gold);
}

.final-roles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 350px;
    margin: 0 auto;
}

.final-role-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.final-role-card.dead {
    opacity: 0.5;
}

.final-role-emoji {
    font-size: 24px;
}

.final-role-name {
    font-weight: 700;
    color: var(--mafia-text);
    font-size: 14px;
}

.final-role-type {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Mafia theme buttons */
.mafia-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--mafia-text);
}

.mafia-theme .btn-danger {
    background: #c44444;
}

.mafia-theme .timer-controls .btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--mafia-text);
}

.mafia-theme .leave-btn {
    color: rgba(255, 255, 255, 0.5);
}

.mafia-theme .leave-btn:hover {
    color: var(--mafia-accent);
}

/* ============================================
   STORY CHAIN GAME STYLES
   ============================================ */

.story-theme {
    background: #E8E0D8;
}

.story-container {
    background: #E8E0D8;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

.story-logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.story-logo {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(32px, 10vw, 50px);
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
}

.story-tagline {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

/* Turn Indicator */
.turn-indicator {
    text-align: center;
    padding: 20px;
    padding-top: 60px;
}

.turn-label {
    font-size: 16px;
    color: var(--text-muted);
}

.turn-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 5px;
}

.turn-name.is-you {
    color: var(--primary);
}

/* Story Flow Container */
.story-flow-container {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px;
    min-height: 200px;
    overflow: hidden;
}

.story-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
    padding: 20px;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(24px, 7vw, 42px);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.story-flow::-webkit-scrollbar {
    display: none;
}

.story-placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    opacity: 0.5;
}

.story-word {
    display: inline;
    opacity: 0;
    animation: wordFadeIn 0.4s ease forwards;
    white-space: pre;
}

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

.story-word.new-word {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

.story-word.new-word.animate-in {
    animation: newWordPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes newWordPop {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Typing Bubble */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-left: 10px;
    animation: bubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

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

.typing-text {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(18px, 5vw, 28px);
    font-weight: 600;
    color: var(--primary);
}

.typing-cursor {
    font-weight: 300;
    color: var(--primary);
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Input Area */
.story-input-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    padding-bottom: 40px;
    background: linear-gradient(to top, #E8E0D8 80%, transparent);
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.story-input {
    width: 100%;
    padding: 18px 70px 18px 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    border: 3px solid transparent;
    border-radius: 50px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    outline: none;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.story-input:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 25px rgba(125, 69, 69, 0.15);
}

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

.word-count {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.word-count.over-limit {
    color: #C44444;
}

.btn-send {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(125, 69, 69, 0.3);
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(125, 69, 69, 0.4);
}

.btn-send:active:not(:disabled) {
    transform: scale(0.95);
}

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

.btn-send svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* Waiting Turn */
.waiting-turn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    padding-bottom: 50px;
}

.waiting-turn p {
    color: var(--text-muted);
    font-size: 14px;
}

.waiting-dots {
    display: flex;
    gap: 8px;
}

.waiting-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out;
}

.waiting-dots span:nth-child(1) { animation-delay: 0s; }
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Story Complete */
.story-complete {
    padding: 30px;
    text-align: center;
}

.complete-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 25px;
}

.final-story-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-height: 300px;
    overflow-y: auto;
}

.final-story {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.6;
    text-align: left;
}

/* Story Theme Overrides */
.story-theme .leave-btn {
    color: var(--primary);
}

.story-theme .code-box {
    background: white;
    border-color: var(--primary);
}

.story-theme .player-chip {
    background: white;
    border-color: rgba(125, 69, 69, 0.2);
}

.story-theme .player-chip.is-me {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
