:root {
    /* Light Mode Tokens */
    --bg: #f8fafc;
    --text: #0f172a;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #ec4899;
    --secondary-hover: #db2777;
    --surface: #ffffff;
    --surface-border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
}

[data-theme="dark"] {
    /* Dark Mode Tokens */
    --bg: #0f172a;
    --text: #f8fafc;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --secondary: #f472b6;
    --secondary-hover: #ec4899;
    --surface: #1e293b;
    --surface-border: #334155;
    --success: #4ade80;
    --error: #f87171;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

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

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#themeToggleBtn {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

#themeToggleBtn:hover {
    transform: scale(1.1);
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
}

header h1 span {
    color: var(--primary);
}

.user-info {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.menu-btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--surface-border);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.menu-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.menu-btn.primary:hover {
    background: var(--primary-hover);
}

.menu-btn.secondary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}
.menu-btn.secondary:hover {
    background: var(--secondary-hover);
}

.menu-btn.outline {
    background: transparent;
}
.menu-btn.outline:hover {
    background: var(--surface);
}

.timed-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem; /* Space between buttons */
}

.timed-options .menu-btn {
    font-size: 0.9rem;
    padding: 0.8rem 0.5rem;
}

.profile-view {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.4s;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.input-group label {
    font-weight: 600;
}

.input-group input {
    padding: 0.8rem;
    border-radius: 8px;
    border: 2px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

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

.game-view {
    text-align: center;
    animation: zoomIn 0.3s;
}

.game-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.stat { display: flex; flex-direction: column; align-items: center; }

.timer {
    color: var(--secondary);
    font-size: 1.5rem;
}

.word-display-container {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--surface-border);
    margin-bottom: 2rem;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.target-word {
    transition: color 0.2s, transform 0.2s;
}

.target-word.error {
    color: var(--error);
    animation: shake 0.4s;
}

.target-word.success {
    color: var(--success);
    transform: scale(1.05);
}

.word-input {
    width: 100%;
    padding: 1rem;
    font-size: 2rem;
    text-align: center;
    border-radius: 12px;
    border: 3px solid var(--primary);
    background: var(--bg);
    color: var(--text);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    transition: border-color 0.2s;
}

.word-input:focus {
    border-color: var(--secondary);
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.mt-4 { margin-top: 2rem; }
.vs-status {
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
}
