:root {
    --primary: #4F46E5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text: #1f2937;
    --text-light: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

h1 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

h2 {
    color: var(--text);
    margin-bottom: 1.5rem;
}

p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text);
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.secondary {
    background: #e5e7eb;
    color: var(--text);
    margin-bottom: 1rem;
}

.btn.secondary:hover {
    background: #d1d5db;
}

/* Test Screen Specifics */
.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

.timer {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.word-display {
    margin: 2rem 0;
}

.word-display h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0;
}

.input-area {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: white;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.icon-btn.listening {
    background: var(--error);
    color: white;
    border-color: var(--error);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Feedback States */
input.correct {
    border-color: var(--success);
    background-color: #ecfdf5;
    color: var(--success);
}

input.incorrect {
    border-color: var(--error);
    background-color: #fef2f2;
    color: var(--error);
}

/* Result Screen */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 6px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.stat-item {
    font-weight: 600;
}

.stat-item.correct { color: var(--success); }
.stat-item.incorrect { color: var(--error); }

.warning {
    color: var(--error);
    background: #fef2f2;
    padding: 10px;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.admin-link {
    display: block;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: none;
}
