/* Game Mode Styles */

/* Modern Timer Design */
#timer-display,
#solo-timer-display {
    background: #0f172a;
    /* Black/Slate-900 */
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 1.5rem;
    padding: 8px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
    /* Ensure modern font */
    letter-spacing: 1px;
    min-width: 100px;
    text-align: center;
}

#wpm-display,
#solo-wpm-display {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

/* Ensure Countdown is ALWAYS on top of Universal UI (9999) */
#countdown-overlay {
    z-index: 20000 !important;
}

/* Standard Mode Overrides */
.mode-standard .word {
    font-family: 'Times New Roman', Times, serif;
    color: #000 !important;
    /* Force black */
    font-size: 1.5rem;
    /* Ensure readability */
}

/* High Specificity Override for Standard Mode */
#game-text.mode-standard,
#game-text.mode-standard .word,
#game-text.mode-standard .char {
    color: #000000 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    font-weight: 500 !important;
    /* Ensure it's not too thin */
}

/* Ensure Feedback Colors still work */
#game-text.mode-standard .char.correct {
    color: #059669 !important;
}

#game-text.mode-standard .char.incorrect {
    color: #dc2626 !important;
}

.mode-standard .char {
    border-bottom: 2px solid transparent;
    color: #000 !important;
    /* Force all chars black by default */
}

/* Keep feedback colors BUT ensure they override the black if needed, or if user wanted THOSE black too?
   "komple siyah" -> usually means "everything".
   But "hatalı tuşları kırmızı ile gösteren" (standard mode) implies they like the red.
   I will assume they mean the BASE text which is usually gray.
   BUT, to be safe, I will allow correct/incorrect to override IF they have !important or higher specificity.
   My previous code had .char.correct { color: ... }.
   If I put !important on .char, I need !important on .char.correct too.
*/

.mode-standard .char {
    color: #000 !important;
}

.mode-standard .char.correct {
    color: #059669 !important;
    /* Green */
}

.mode-standard .char.incorrect {
    color: #dc2626 !important;
    /* Red */
    background: #fee2e2;
}

.mode-standard .char.current {
    background: #e2e8f0;
    /* Slate-200 cursor */
    border-bottom: 2px solid #0f172a;
}

/* Chat UI Improvements */
.chat-container {
    position: relative;
    z-index: 1;
    overflow: hidden;
    /* Contain watermark */
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Fill parent */
    flex: 1;
}

.chat-container:not(.active) {
    display: none !important;
}

.chat-container.lobby-mode::before {
    /* House Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.15;
    /* Increased from 0.04 */
    pointer-events: none;
    z-index: 0;
}

.chat-container.private-mode::before {
    /* User Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Ensure messages are above watermark */
#chat-messages {
    position: relative;
    z-index: 2;
}

/* Active Tab Visual Pop */
.chat-tab.active {
    background: #fff !important;
    border-color: #e2e8f0 !important;
    border-bottom: 3px solid var(--primary) !important;
    /* Strong emphasis */
    color: var(--primary) !important;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);
    transform: translateY(1px);
    /* Connect with content */
    font-weight: 700;
    z-index: 3;
}

.chat-tab {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}