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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS fix */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 60px; /* Space for top ad (desktop) - reduced to bring content higher */
    padding-bottom: 50px; /* Space for bottom ad (desktop) - reduced for smaller ad */
}

/* Emoji font support - ensures emojis render properly on all systems */
/* Noto Color Emoji from Google Fonts is loaded automatically for Windows users */
.emoji-btn, .emoji-display, .emoji-display-large, .emoji-preview, .emoji-grid, .emoji-tab {
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Android Emoji', 'EmojiSymbols', 'EmojiOne Mozilla', 'Twemoji Mozilla', 'Segoe UI', system-ui, sans-serif !important;
    font-feature-settings: "liga", "kern";
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "liga", "kern";
    -moz-font-feature-settings: "liga", "kern";
}

/* Ad Banners */
.ad-banner-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #ddd;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.ad-placeholder {
    width: 100%;
    max-width: 728px;
    padding: 8px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 5px;
    position: relative;
}

.ad-placeholder:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ad-label {
    position: absolute;
    top: 2px;
    right: 8px;
    font-size: 0.7em;
    color: #999;
    text-transform: uppercase;
}

.ad-content {
    padding: 10px;
    min-height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Mobile: Top ad banner */
@media (max-width: 768px) {
    body {
        padding-top: 50px; /* Space for top ad on mobile */
        padding-bottom: 0; /* No bottom ad on mobile */
    }
    
    .ad-banner-top {
        display: flex; /* Show top ad on mobile */
        min-height: 50px;
    }
    
    .ad-banner-bottom {
        display: none; /* Hide bottom ad on mobile */
    }
    
    .ad-placeholder {
        max-width: 320px;
        min-height: 50px;
    }
    
    /* Floating input bar at bottom (no ad below) */
    .floating-input-bar {
        bottom: 0; /* At bottom since no bottom ad */
    }
}

@media (min-width: 769px) {
    .ad-banner-top {
        min-height: 60px; /* Reduced from 90px to bring content higher */
    }
    
    .ad-banner-bottom {
        min-height: 40px;
    }
    
    .ad-placeholder {
        min-height: 60px; /* Match top ad height */
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Mobile-first: smaller border radius and padding on mobile */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        box-shadow: none;
    }
    
    body {
        padding: 0;
        align-items: stretch;
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

@media (max-width: 768px) {
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.95em;
    }
}

.screen {
    display: none;
    padding: 20px;
    min-height: 500px;
}

@media (max-width: 768px) {
    .screen {
        padding: 15px;
        min-height: auto;
    }
}

.screen.active {
    display: block;
}

#gameScreen {
    position: relative;
}

/* Menu Screen */
.menu-card {
    max-width: 500px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.menu-card h2 {
    margin-bottom: 30px;
    color: #667eea;
}

.btn-large {
    width: 100%;
    margin-bottom: 15px;
    padding: 20px;
    font-size: 1.2em;
}

/* Create/Setup/Play/Share Screens */
.setup-card,
.create-card,
.play-card,
.share-card {
    max-width: 500px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.setup-card h2,
.create-card h2,
.play-card h2,
.share-card h2 {
    margin-bottom: 30px;
    color: #667eea;
    text-align: center;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.room-code-container,
.room-code-display {
    display: flex;
    gap: 10px;
}

.room-code-container input,
.room-code-display input {
    flex: 1;
}

/* Active Rooms List */
.active-room-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-room-item:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.2);
    transform: translateY(-2px);
}

.active-room-item:active {
    transform: translateY(0);
}

.active-room-emoji {
    font-size: 2em;
    line-height: 1;
    flex-shrink: 0;
}

.active-room-info {
    flex: 1;
    min-width: 0;
}

.active-room-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95em;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-room-info p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

.active-room-stats {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.8em;
    color: #888;
}

.active-room-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.active-room-code {
    background: #764ba2;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

.no-active-rooms {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 0.9em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.emoji-input-container {
    margin-bottom: 10px;
}

.emoji-preview {
    padding: 15px;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-size: 2em;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.emoji-preview:not(:empty) {
    color: #333;
    border-color: #667eea;
}

.btn-clear {
    margin-top: 10px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-clear:hover {
    background: #c82333;
}

.emoji-picker {
    margin-top: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0;
    max-height: 400px;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 2px solid #eee;
    background: #f8f9fa;
    cursor: pointer;
}

.emoji-picker-title {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.btn-toggle-picker {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #667eea;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.3s;
}

.btn-toggle-picker:hover {
    transform: scale(1.2);
}

.emoji-picker-content {
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
}

.emoji-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.emoji-tab {
    padding: 8px 12px;
    border: none;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.emoji-tab:hover {
    background: #e9ecef;
}

.emoji-tab.active {
    background: #667eea;
    color: white;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
}

.emoji-btn {
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Android Emoji', 'EmojiSymbols', 'EmojiOne Mozilla', 'Twemoji Mozilla', 'Segoe UI', system-ui, sans-serif !important;
    line-height: 1;
    /* Force emoji rendering */
    font-variant-emoji: emoji;
    -webkit-font-feature-settings: "liga", "kern";
    -moz-font-feature-settings: "liga", "kern";
    font-feature-settings: "liga", "kern";
}

.emoji-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.1);
}

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

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

.share-content {
    text-align: center;
}

.emoji-display-large {
    font-size: 4em;
    padding: 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-label {
    margin: 20px 0 10px;
    font-weight: 600;
    color: #555;
}

.share-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.share-actions button {
    width: 100%;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
    letter-spacing: 0;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.btn-share {
    background: #667eea;
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
    letter-spacing: 0;
}

.btn-share:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.room-code-badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.hint-section {
    margin-top: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

/* Mobile/Desktop visibility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Mobile: hint section inside emoji wrapper */
    .emoji-display-wrapper .hint-section {
        margin-top: 10px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .emoji-display-wrapper .hint-section .btn-secondary {
        width: 100%;
        font-size: 0.9em;
        padding: 10px;
    }
}

.hint-display {
    margin-top: 10px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    font-style: italic;
    display: none;
}

.final-answer {
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-voice {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    touch-action: none; /* Prevent iOS gesture cancellation for push-to-talk */
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

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

.btn-impossible {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
    border: 2px solid #2ecc71;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.btn-impossible:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.5);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-voice {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 40px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto;
    border: none;
    cursor: pointer;
}

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

.btn-voice:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-voice.listening {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    animation: pulse 1.5s infinite;
}

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

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px; /* Reduced from 30px to bring content higher */
    padding-bottom: 10px; /* Reduced from 20px */
    border-bottom: 2px solid #eee;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.vs {
    color: #999;
}

.game-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px; /* Reduced from 30px */
    margin-bottom: 20px; /* Reduced from 30px */
}

@media (max-width: 768px) {
    .game-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 80px; /* Space for floating input bar */
    }
    
    /* Create a side-by-side layout for emoji and hangman */
    .game-info {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Reduce padding throughout */
    .screen {
        padding: 10px;
    }
    
    header {
        padding: 12px;
    }
    
    .create-card, .play-card, .share-card, .menu-card {
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .game-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    /* Emoji and hangman side-by-side on mobile */
    .emoji-hangman-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: start;
    }
    
    .emoji-display-wrapper {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

.hangman-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    gap: 15px;
}

.game-stats-desktop {
    text-align: center;
    padding: 10px 0 0 0;
}

#hangmanDrawing {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .hangman-container {
        padding: 15px;
        max-height: 250px;
        overflow: hidden;
    }
    
    #hangmanDrawing {
        width: 200px;
        height: 250px;
        max-width: 100%;
    }
    
    /* Hide desktop hangman on mobile, show mobile version */
    .hangman-container {
        display: none;
    }
    
    .hangman-container-mobile {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: #f8f9fa;
        border-radius: 10px;
        padding: 10px;
        gap: 8px;
    }
    
    .game-stats-mobile {
        text-align: center;
        padding: 5px 0;
    }
    
    .game-stats-mobile .stat {
        font-size: 0.9em;
    }
    
    .game-stats-mobile .stat-label {
        font-size: 0.85em;
        color: #666;
    }
    
    .game-stats-mobile .stat-value {
        font-size: 1.1em;
        color: #667eea;
        font-weight: 700;
    }
    
    #hangmanDrawingMobile {
        width: 100%;
        height: auto;
        max-width: 150px;
    }
    
    .emoji-display-wrapper {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .emoji-display-wrapper .emoji-display {
        font-size: 2em;
        padding: 10px;
        min-height: 60px;
    }
    
    .emoji-display-wrapper .word-display {
        font-size: 1.1em;
        padding: 10px;
        min-height: 45px;
        letter-spacing: 2px;
    }
    
    /* Hide wrong attempts section on mobile to save space */
    .wrong-attempts {
        display: none;
    }
    
    /* Floating input bar removed - using unified input section */
    
    /* Reduce voice controls spacing */
    .voice-controls {
        margin: 8px 0;
    }
    
    /* Unified input section on mobile */
    .unified-input-section {
        margin: 15px 0;
        padding: 0 10px;
    }
    
    .mic-button-whatsapp {
        width: 72px;
        height: 72px;
        margin-bottom: 10px;
    }
    
    .mic-icon-svg {
        width: 30px;
        height: 30px;
    }
    
    .mic-button-text {
        font-size: 0.7em;
    }
    
    .text-input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .text-input-field {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-btn {
        width: 100%;
    }
    
    .game-stats {
        padding: 10px;
        margin-top: 5px;
    }
    
    .category-badge {
        padding: 6px 12px;
        font-size: 0.85em;
        margin-bottom: 8px;
    }
    
    /* Hide desktop input on mobile */
    .text-input-container {
        display: none;
    }
    
    /* Hide desktop game-stats on mobile (we have it under hangman) */
    .game-stats.desktop-only {
        display: none;
    }
}

/* Desktop: hide mobile hangman */
@media (min-width: 769px) {
    .hangman-container-mobile {
        display: none;
    }
    
    .emoji-hangman-row {
        display: block;
    }
    
    /* Hide duplicate wrong guesses counter on desktop (keep only the one under hangman) */
    .game-stats.desktop-only {
        display: none;
    }
}

#hangmanDrawing line,
#hangmanDrawing circle,
#hangmanDrawingMobile line,
#hangmanDrawingMobile circle {
    transition: opacity 0.3s;
}

.hidden {
    opacity: 0;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    width: fit-content;
}

.emoji-display {
    font-size: 4em;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-display {
    font-size: 2em;
    text-align: center;
    padding: 20px;
    background: #e9ecef;
    border-radius: 15px;
    font-weight: 600;
    letter-spacing: 8px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-controls {
    text-align: center;
    margin: 10px 0;
}

/* Unified Input Section (Mobile & Desktop) */
.unified-input-section {
    margin: 20px 0;
    padding: 0;
}

/* WhatsApp-style Mic Button */
.mic-button-whatsapp {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #25D366; /* WhatsApp green */
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto 8px;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    position: relative;
    padding: 0;
    gap: 2px;
}

.mic-button-whatsapp:hover {
    background: #20BA5A;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transform: scale(1.05);
}

.mic-button-whatsapp:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(37, 211, 102, 0.3);
}

.mic-button-whatsapp.listening {
    background: #f5576c;
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
    animation: pulse-mic 1.5s infinite;
}

.mic-icon-svg {
    width: 26px;
    height: 26px;
    color: white;
    fill: white;
    flex-shrink: 0;
}

.mic-button-text {
    font-size: 0.65em;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
    margin-top: 1px;
}

@keyframes pulse-mic {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(245, 87, 108, 0.7);
    }
}

/* Input Divider */
.input-divider {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin: 12px 0;
    font-style: italic;
}

/* Text Input Row */
.text-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.text-input-field {
    flex: 0 1 auto; /* Don't grow, but can shrink if needed */
    width: 300px; /* Fixed reasonable width for text input */
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.text-input-field:focus {
    outline: none;
    border-color: #764ba2;
}

.submit-btn {
    padding: 8px 16px !important;
    white-space: nowrap;
    width: auto !important; /* Override btn-primary width: 100% */
    min-width: auto !important; /* Remove any min-width */
    margin-top: 0 !important; /* Remove btn-primary margin-top */
}

.voice-feedback {
    margin-top: 5px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 8px;
    min-height: 25px;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

/* Voice status notification (mobile) */
.voice-status-notification {
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.9em;
    text-align: center;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.voice-status-notification.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.voice-status-notification.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.voice-status-notification.listening {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    animation: pulse 1.5s infinite;
}

.voice-status-notification.clickable {
    cursor: pointer;
    transition: transform 0.2s;
}

.voice-status-notification.clickable:active {
    transform: scale(0.98);
}

/* Desktop only button */
.desktop-only {
    display: none;
}

@media (min-width: 769px) {
    .desktop-only {
        display: flex;
    }
}

/* Floating Bottom Input Bar (Mobile) */
.floating-input-bar {
    position: fixed;
    bottom: 50px; /* Above bottom ad banner */
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #ddd;
    padding: 10px 15px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001; /* Above ad banner */
}

.voice-indicator {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    border: 2px solid #ddd;
    touch-action: none; /* Prevent iOS gesture cancellation for push-to-talk */
    -webkit-touch-callout: none; /* Prevent iOS callout menu on long press */
    user-select: none; /* Prevent text selection */
}

.voice-indicator.enabled {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.voice-indicator.listening {
    background: #f5576c;
    border-color: #f5576c;
    animation: pulse 1.5s infinite;
}

.voice-indicator:active {
    transform: scale(0.9);
}

.mic-icon-small {
    font-size: 1.2em;
}

.floating-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
}

.floating-input:focus {
    border-color: #667eea;
}

.btn-send {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-send:hover {
    background: #5568d3;
    transform: scale(1.05);
}

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

.wrong-attempts {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.wrong-attempts h3 {
    margin-bottom: 10px;
    font-size: 1em;
    color: #666;
}

.attempts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.attempt-badge {
    display: inline-block;
    padding: 8px 14px;
    background: #dc3545;
    color: white;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.text-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

/* Game Over Screen */
.game-over-card {
    max-width: 500px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-over-card h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #667eea;
}

#gameOverMessage {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #555;
}

.final-score {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #333;
}

.final-score span {
    color: #667eea;
    font-weight: 700;
}

/* Mobile Notification */
.mobile-notification {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
    animation: slideDown 0.3s ease-out;
    transition: opacity 0.3s ease-out;
}

.mobile-notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mobile-notification.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mobile-notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

/* Mobile Voice Controls */
.mobile-voice-controls .btn-voice.mobile-fallback {
    width: 100%;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-content {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }

    .emoji-display {
        font-size: 2.5em;
        padding: 15px;
        min-height: 80px;
    }

    .word-display {
        font-size: 1.3em;
        letter-spacing: 3px;
        padding: 15px;
        min-height: 60px;
    }

    .game-actions {
        flex-direction: column;
    }

    .game-actions button {
        width: 100%;
    }

    /* Mobile-specific button sizing */
    .btn-voice {
        min-height: 50px;
        font-size: 16px;
    }

    /* Larger touch targets on mobile */
    button, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 14px 20px;
    }

    /* Better spacing for mobile */
    .voice-controls {
        margin: 20px 0;
    }

    .text-input-container input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
    }

    /* Mobile notification adjustments */
    .mobile-notification {
        font-size: 0.95em;
        padding: 14px;
    }

    /* Mobile emoji input optimizations */
    #emojiInput {
        font-size: 18px; /* Larger text for easier emoji selection */
        padding: 16px;
        min-height: 50px;
    }

    .emoji-preview {
        font-size: 1.8em;
        min-height: 70px;
        padding: 20px;
    }

    /* Mobile emoji picker - collapsed by default */
    .emoji-picker.mobile-picker {
        border: 1px solid #ddd;
    }

    .emoji-picker.mobile-picker .emoji-picker-header {
        padding: 14px;
    }

    .emoji-picker.mobile-picker .emoji-picker-title {
        font-size: 0.95em;
    }

    /* Make emoji input more prominent on mobile */
    .emoji-input-container {
        margin-bottom: 15px;
    }

    /* WhatsApp button - make it more prominent on mobile */
    .btn-whatsapp {
        font-size: 18px;
        padding: 16px;
        min-height: 54px;
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    }

    /* Share actions - better spacing on mobile */
    .share-actions {
        gap: 12px;
    }

    /* Cards - less padding on mobile */
    .create-card, .play-card, .share-card, .menu-card {
        padding: 25px 20px;
    }

    /* Form inputs - larger on mobile */
    .form-group input, .form-group textarea, .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.3s ease-out;
}

/* Game Over Overlay */
.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.game-over-overlay-content {
    text-align: center;
    color: white;
    padding: 40px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: pulse 1s infinite;
}

.game-over-overlay-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-over-overlay-content p {
    font-size: 2em;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

