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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-primary);
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.mode-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.mode-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.mode-link.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.mode-separator {
    opacity: 0.5;
    font-size: 1.25rem;
}

.game-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.controls-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.control-group label span {
    color: var(--primary-color);
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.play-section {
    margin-bottom: 2rem;
}

.input-section {
    margin-bottom: 1.5rem;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    min-height: 3rem;
    line-height: 1.6;
    font-size: 1rem;
}

.feedback.show {
    animation: fadeIn 0.3s;
}

.word {
    display: inline;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    margin: 0 0.125rem;
}

.word.correct {
    background-color: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

.word.incorrect {
    background-color: #fee2e2;
    color: #991b1b;
}

.action-section {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-icon {
    font-size: 1.25rem;
}

.result-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.result-message.success {
    background: #d1fae5;
    color: #065f46;
}

.result-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: white;
    opacity: 0.9;
}

footer p {
    margin-bottom: 1rem;
}

.brought-to-you {
    margin-top: 1.5rem;
}

.brought-to-you p {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.brought-to-you a {
    display: inline-block;
    transition: opacity 0.2s;
}

.brought-to-you a:hover {
    opacity: 0.8;
}

.sponsor-logo {
    max-width: 250px;
    width: 100%;
    height: auto;
}

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

@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }
    
    .controls-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
