:root {
    --bg: #0b0e14;
    --card: #151a23;
    --primary: #00e5ff;
    --error: #ff2a6d;
    --success: #05ffa1;
    --text: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Courier New', monospace; }

body {
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}
.logo { font-weight: bold; font-size: 1.2rem; letter-spacing: 2px; }
.highlight { color: var(--primary); }
.progress { color: #888; font-size: 0.9rem; }

/* Screens */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.5s;
}
.screen.active { display: flex; }

/* Upload Screen */
.card {
    background: var(--card);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #333;
    width: 100%;
}
.upload-btn {
    display: inline-block;
    margin-top: 20px;
    background: var(--primary);
    color: #000;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
input[type="file"] { display: none; }

/* Game Screen */
.speaker-btn {
    background: var(--card);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    font-size: 3rem;
    cursor: pointer;
    margin-bottom: 40px;
    transition: transform 0.1s;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}
.speaker-btn:active { transform: scale(0.95); }

.input-group { width: 100%; margin-bottom: 20px; }
input[type="text"] {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    text-align: center;
    background: var(--card);
    border: none;
    border-bottom: 2px solid #333;
    color: white;
    outline: none;
    text-transform: lowercase;
}
input[type="text"]:focus { border-bottom-color: var(--primary); }

.action-btn {
    width: 100%;
    padding: 20px;
    background: var(--primary);
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    border-radius: 0 0 10px 10px; /* Stick to bottom style if needed */
    margin-top: auto; /* Pushes to bottom */
}

/* Feedback Overlay */
.feedback {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.feedback.hidden { display: none; }

.feedback-content {
    text-align: center;
    width: 80%;
}
.feedback-content p { color: var(--error); font-size: 2rem; margin-bottom: 20px; font-weight: bold;}

#correctionDisplay {
    font-size: 1.5rem;
    letter-spacing: 3px;
    margin-bottom: 20px;
}
.char-correct { color: var(--success); }
.char-wrong { color: var(--error); text-decoration: underline; }

.timer-line {
    height: 4px;
    background: var(--error);
    width: 100%;
    animation: shrink 5s linear forwards;
}

@keyframes shrink {
    from { width: 100%; }
    to { width: 0%; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

footer {
    margin-top: auto; /* Pushes footer to the absolute bottom */
    border-top: 1px solid rgba(255,255,255,0.05);
}

footer a:hover {
    color: var(--primary) !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.3s ease-out;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    background: none; border: none;
    color: #555; font-size: 2rem;
    cursor: pointer;
}

.hidden { display: none !important; }

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