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

:root {
    --bg-gradient-start: #5B9BD5;
    --bg-gradient-end: #7FB3D5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent-color: #2E86C1;
    --accent-color-alt: #5DADE2;
    --border-color: #D6EAF8;
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --card-bg: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --accent-color: #53a8e2;
    --accent-color-alt: #e94560;
    --border-color: #1e3a5f;
    --success-bg: #1e4d2b;
    --success-text: #7cfc00;
    --error-bg: #4d1e1e;
    --error-text: #ff6b6b;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.game-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: background 0.3s ease;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.settings-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 10px;
    width: 45px;
    height: 45px;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.95);
}

h1 {
    color: var(--accent-color);
    text-align: center;
    font-size: 2.5em;
    margin: 0;
    transition: color 0.3s ease;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

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

.score-item .label {
    color: var(--text-secondary);
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.score-item .value {
    color: var(--accent-color);
    font-size: 1.8em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.hints-sidebar {
    flex: 0 0 250px;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px var(--shadow);
    max-height: 600px;
    overflow-y: auto;
    transition: background 0.3s ease;
}

.hints-sidebar h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.hints-info {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.hint-group {
    background: var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.hint-length {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.hint-count {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.hint-count .found {
    color: #28a745;
    font-weight: bold;
}

.hint-count .skipped {
    color: #dc3545;
    font-weight: bold;
}

.hint-count .total {
    color: var(--accent-color);
    font-weight: bold;
}

.hint-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hint-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    display: inline-block;
    cursor: help;
    transition: transform 0.2s;
}

.hint-dot:hover {
    transform: scale(1.3);
}

.hint-dot.found {
    background: #28a745;
}

.hint-dot.skipped {
    background: #dc3545;
}

.game-area {
    flex: 1;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: background 0.3s ease;
}

.letters-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    transition: transform 0.3s ease;
}

.letters-display.celebrate {
    animation: celebrate 0.5s ease;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-3deg);
    }
    50% {
        transform: scale(1.15) rotate(3deg);
    }
    75% {
        transform: scale(1.1) rotate(-3deg);
    }
}

.letter-tile {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2E86C1 0%, #5DADE2 100%);
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(46, 134, 193, 0.3);
    transition: transform 0.2s;
}

.letter-tile:hover {
    transform: scale(1.05);
}

.progress-info {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.progress-info p {
    margin: 5px 0;
    font-size: 1.1em;
}

.progress-info span {
    color: var(--accent-color);
    font-weight: bold;
    transition: color 0.3s ease;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#word-input {
    flex: 1;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    text-transform: uppercase;
    background: var(--card-bg);
    color: var(--text-primary);
}

#word-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

#submit-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #2E86C1 0%, #5DADE2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 134, 193, 0.4);
}

#submit-btn:active {
    transform: translateY(0);
}

.skip-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

.skip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.skip-btn:active {
    transform: translateY(0);
}

.message {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s, color 0.3s;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
    opacity: 1;
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
    opacity: 1;
}

.found-words {
    margin-top: 30px;
}

.found-words h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    text-align: center;
    transition: color 0.3s ease;
}

.all-words-header {
    color: var(--text-secondary);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

#words-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.found-word {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--border-color);
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    font-weight: bold;
    color: var(--text-primary);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.found-word.missed {
    background: #fff3cd;
    border-color: #ffc107;
}

body.dark-theme .found-word.missed {
    background: #2d1b3d;
    border-color: #9b59b6;
}

.found-word.skipped-word {
    background: #f8d7da;
    border-color: #dc3545;
}

body.dark-theme .found-word.skipped-word {
    background: #3d1b3d;
    border-color: #c9302c;
}

.found-word.skipped-word .word-points {
    color: #dc3545;
}

.word-points {
    color: var(--accent-color);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.next-btn, .hint-btn {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s, color 0.3s;
}

.next-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

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

/* Dark theme adjustments for hint button */
body.dark-theme .hint-btn {
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    color: #eaeaea;
}

body.dark-theme .next-btn {
    background: linear-gradient(135deg, #53a8e2 0%, #1a1a2e 100%);
    color: #eaeaea;
}

.next-btn:hover, .hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.next-btn:active, .hint-btn:active {
    transform: translateY(0);
}

/* Scrollbar styling */
#words-list::-webkit-scrollbar {
    width: 8px;
}

#words-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#words-list::-webkit-scrollbar-thumb {
    background: #2E86C1;
    border-radius: 10px;
}

#words-list::-webkit-scrollbar-thumb:hover {
    background: #5DADE2;
}

/* Scrollbar for hints */
.hints-sidebar::-webkit-scrollbar {
    width: 6px;
}

.hints-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hints-sidebar::-webkit-scrollbar-thumb {
    background: #2E86C1;
    border-radius: 10px;
}

.hints-sidebar::-webkit-scrollbar-thumb:hover {
    background: #5DADE2;
}

/* Responsive design */
@media (max-width: 900px) {
    .game-layout {
        flex-direction: column;
    }

    .hints-sidebar {
        flex: 1;
        max-height: 300px;
        order: 2;
    }

    .game-area {
        order: 1;
    }
}

@media (max-width: 600px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .settings-buttons {
        justify-content: center;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }

    .letter-tile {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .input-area {
        flex-direction: column;
    }

    #words-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Logo Header */
.logo-header {
    text-align: center;
    padding: 0 0 20px;
    margin-bottom: 20px;
}

.logo-header a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-header a:hover {
    transform: scale(1.05);
}

.header-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(46, 134, 193, 0.3));
}
