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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    padding-bottom: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.5em;
    color: #f5576c;
    margin: 0;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-icon {
    background: transparent;
    font-size: 1.2em;
    padding: 8px 12px;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

/* Container - Vertical Layout */
.container {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Game Card */
.game-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.game-header {
    text-align: center;
    margin-bottom: 15px;
}

.game-header h2 {
    color: #f5576c;
    font-size: 1.5em;
    margin-bottom: 8px;
}

.game-instructions {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Mode Selection */
.mode-section {
    margin-bottom: 15px;
    text-align: center;
}

.mode-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 20px;
    border: 2px solid #f093fb;
    border-radius: 10px;
    background: white;
    color: #f093fb;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: #f093fb;
    color: white;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: #f5576c;
}

/* Target Word Section */
.target-word-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f093fb10 0%, #f5576c10 100%);
    border-radius: 10px;
}

.target-word-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-word {
    font-size: 3em;
    font-weight: bold;
    color: #f5576c;
    margin-bottom: 15px;
}

/* Timer */
.timer-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
}

.timer-icon {
    font-size: 1.2em;
}

/* Input Section */
.input-section {
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.rhyme-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.rhyme-input:focus {
    outline: none;
    border-color: #f093fb;
}

.rhyme-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Found Rhymes */
.found-rhymes-section {
    margin-bottom: 25px;
}

.found-rhymes-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.rhymes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 60px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.rhyme-tag {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.rhyme-tag.imperfect {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #333;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.word-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-block;
    margin: 0 5px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.word-group {
    margin-bottom: 20px;
}

.word-group-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #f5576c;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.word-group-rhymes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-result-section {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.word-result-section h4 {
    color: #f5576c;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.empty-state {
    color: #999;
    font-style: italic;
    text-align: center;
}

/* Score Display */
.score-display {
    text-align: center;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.score-number {
    color: #f5576c;
    font-size: 1.5em;
}

/* Stats Card */
.stats-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stats-card h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #f5576c;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Settings */
.settings-section {
    margin: 20px 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.setting-description {
    font-size: 0.85em;
    color: #666;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.settings-actions {
    margin-top: 20px;
    text-align: right;
}

/* Results Modal */
.results-content {
    text-align: center;
}

.results-content h2 {
    color: #f5576c;
    margin-bottom: 20px;
}

.results-summary {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.result-stat {
    margin: 15px 0;
    font-size: 1.1em;
}

.result-stat strong {
    color: #f5576c;
}

.missed-rhymes {
    margin-top: 20px;
    text-align: left;
}

.missed-rhymes h4 {
    color: #333;
    margin-bottom: 10px;
}

.missed-rhymes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
}

.missed-rhyme {
    background: #ffc107;
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9em;
}

/* Notification */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid #4caf50;
}

.notification.error {
    border-left: 4px solid #f44336;
}

.notification.warning {
    border-left: 4px solid #ff9800;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #06b6d4;
    text-decoration: underline;
}

.footer-links .separator {
    color: #ccc;
}

.footer-social {
    margin: 15px 0;
}

.social-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    display: inline-block;
    text-decoration: none;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.footer-copyright {
    color: #666;
    font-size: 0.9em;
    margin-top: 15px;
}

/* Dark Mode */
.dark-mode {
    background: linear-gradient(135deg, #2d1b36 0%, #3d1a2e 100%);
}

.dark-mode .navbar,
.dark-mode .game-card,
.dark-mode .stats-card,
.dark-mode .modal-content {
    background: #2a2a2a;
    color: #e0e0e0;
}

.dark-mode .navbar h1,
.dark-mode .game-header h2 {
    color: #f093fb;
}

.dark-mode .game-instructions,
.dark-mode .target-word-label,
.dark-mode .stat-label,
.dark-mode .setting-description {
    color: #aaa;
}

.dark-mode .rhyme-input {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode .rhymes-list {
    background: #333;
}

.dark-mode .footer {
    background: rgba(26, 26, 46, 0.95);
}

.dark-mode .footer-links a {
    color: #8a9aef;
}

.dark-mode .footer-links a:hover {
    color: #a8b4f5;
}

.dark-mode .footer-links .separator {
    color: #555;
}

.dark-mode .footer-copyright {
    color: #b0b0b0;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar h1 {
        font-size: 1.2em;
    }
    
    .target-word {
        font-size: 2em;
    }
    
    .timer-display {
        font-size: 1.2em;
        padding: 10px 20px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        margin: 10% 20px;
        padding: 20px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links .separator {
        display: none;
    }
}

.hidden {
    display: none !important;
}
