/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --highlight-color: #fff59d;
    --found-color: #a5d6a7;
    --dark-bg: #2c3e50;
    --player1-color: #2196F3;
    --player2-color: #f44336;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow: hidden;
}

/* ===== Screen Management ===== */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameplay-screen.screen.active {
    align-items: stretch;
}

#gameplay-screen {
    overflow: hidden;
}

.screen.overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
}

/* Main Menu Background */
#main-menu-screen {
    background: url('../assets/background.png') no-repeat center center fixed;
    background-size: cover;
    background-color: #f5e6d3;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

/* Widescreen Background */
@media (min-aspect-ratio: 16/9) {
    #main-menu-screen {
        background-image: url('../assets/background-widescreen.png');
        background-size: cover;
    }
}

#main-menu-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 0;
}

#main-menu-screen .container {
    position: relative;
    z-index: 1;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* ===== Typography ===== */
h1.game-title {
    font-size: 3em;
    margin-bottom: 40px;
    color: white;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.8),
                 0 0 20px rgba(102, 126, 234, 0.5);
    font-weight: 800;
}

h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: var(--dark-bg);
}

h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--dark-bg);
}

/* ===== Buttons ===== */
.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.menu-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.menu-btn:active {
    transform: translateY(-1px);
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: #7f8c8d;
}

.danger-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: #c0392b;
}

.control-btn {
    background: white;
    color: var(--dark-bg);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-weight: 500;
}

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

/* ===== Campaign Level Grid ===== */
.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.level-btn {
    padding: 20px;
    font-size: 1em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.level-btn.unlocked:hover {
    background: #357abd;
    transform: scale(1.05);
}

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

.level-btn.locked {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

/* ===== Quick Play Options ===== */
.quick-play-options {
    text-align: left;
    margin-bottom: 30px;
}

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

.option-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-bg);
}

.select-input {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

.slider-input {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border-color);
    outline: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* ===== Settings ===== */
.settings-options {
    text-align: left;
}

.settings-options label {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    cursor: pointer;
}

.settings-options input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===== Gameplay Screen ===== */
.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(10px, 1.5vw, 16px);
    height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vw, 12px);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: clamp(6px, 1vw, 10px) clamp(10px, 1.6vw, 18px);
    border-radius: 10px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-info, .timer-info {
    font-size: clamp(0.95em, 1.3vw, 1.2em);
    font-weight: 600;
    color: var(--dark-bg);
}

.game-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: clamp(8px, 1.5vw, 14px);
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

/* ===== Word Search Grid ===== */
.grid-wrapper {
    background: white;
    border-radius: 10px;
    padding: clamp(4px, 0.8vmin, 10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

.word-grid {
    display: grid;
    gap: 4px;
    user-select: none;
    touch-action: none;
    aspect-ratio: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.grid-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-weight: bold;
    line-height: 1;
    letter-spacing: 0.5px;
    color: var(--dark-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.grid-cell:hover {
    background: rgba(0, 0, 0, 0.08);
}

.grid-cell.selecting {
    background: var(--highlight-color);
    border-color: #f9a825;
    transform: scale(0.95);
}

.grid-cell.found {
    background: var(--found-color);
    border-color: #66bb6a;
    color: white;
}

.grid-cell.player1-found {
    background: var(--player1-color);
    border-color: #1976d2;
    color: white;
}

.grid-cell.player2-found {
    background: var(--player2-color);
    border-color: #d32f2f;
    color: white;
}

.grid-cell.bonus-found {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-color: #FF8C00;
    color: #333;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    font-weight: bold;
}

/* ===== Bonus Word Effects ===== */
.sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #FFD700, #FFA500);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px #FFD700, 0 0 20px #FFA500;
    animation: sparkleShoot 1s ease-out forwards;
}

@keyframes sparkleShoot {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(
            calc(var(--end-x) - 50%), 
            calc(var(--end-y) - 50%)
        ) scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(
            var(--end-x), 
            var(--end-y)
        ) scale(0);
        opacity: 0;
    }
}

.bonus-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 30px 60px;
    border-radius: 20px;
    font-size: 3em;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6),
                0 0 60px rgba(255, 165, 0, 0.4);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    letter-spacing: 3px;
    border: 4px solid #FFB830;
}

.bonus-popup.show {
    animation: bonusPopup 1.5s ease-out;
}

@keyframes bonusPopup {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
        opacity: 0;
    }
}

/* ===== Game Messages ===== */
.game-message {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: bottom 0.3s ease;
    white-space: nowrap;
}

.game-message.show {
    bottom: 80px;
}

.game-message.warning {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    color: white;
}

.game-message.info {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
}

.game-message.success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

/* ===== Word List Panel ===== */
.word-list-panel {
    background: white;
    border-radius: 10px;
    padding: clamp(10px, 1.2vw, 16px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 100%;
    min-height: 0;
    height: 100%;
}

/* Hide scrollbars while maintaining scroll functionality */
.word-list-panel::-webkit-scrollbar {
    width: 0;
}
.word-list-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.word-list {
    list-style: none;
}

.word-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #ecf0f1;
    border-radius: 6px;
    font-size: clamp(0.9em, 0.95vw, 1em);
    font-weight: 500;
    transition: all 0.3s ease;
}

.word-item.found {
    background: var(--found-color);
    color: white;
    text-decoration: line-through;
}

.word-item.player1-found {
    background: var(--player1-color);
    color: white;
    text-decoration: line-through;
}

.word-item.player2-found {
    background: var(--player2-color);
    color: white;
    text-decoration: line-through;
}

/* ===== Bottom Controls ===== */
.bottom-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: white;
    padding: clamp(6px, 0.8vw, 10px);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== Win Screen ===== */
.win-container {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    text-align: center;
}

.player-score {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.player1-text {
    color: var(--player1-color);
    font-weight: bold;
    font-size: 1.2em;
    margin: 10px 0;
}

.player2-text {
    color: var(--player2-color);
    font-weight: bold;
    font-size: 1.2em;
    margin: 10px 0;
}

/* ===== Player Selection Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 30px;
    font-size: 1.5em;
    color: var(--dark-bg);
}

.player-select-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.player-select-btn {
    padding: 20px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.player1-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

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

.player2-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ===== Two Player Setup ===== */
.player-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1em;
}

.player-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #333;
}

.player1-color {
    background: var(--player1-color);
}

.player2-color {
    background: var(--player2-color);
}

.win-stats {
    font-size: 1.2em;
    margin: 30px 0;
    color: var(--dark-bg);
    line-height: 1.8;
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
    .game-content {
        grid-template-columns: 1fr 220px;
    }
    
    .word-list-panel {
        max-height: 100%;
    }
    
    .grid-cell {
        border-radius: 5px;
    }
    
    .word-item {
        padding: 8px;
        margin-bottom: 6px;
        font-size: 0.9em;
    }
}

/* Mobile landscape — side-by-side but compressed */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        overflow: hidden;
    }
    
    .screen {
        padding: 6px;
    }

    .game-container {
        padding: 4px 8px;
        height: 100dvh;
        gap: 4px;
    }

    .top-bar {
        padding: 4px 10px;
        border-radius: 6px;
    }
    
    .progress-info, .timer-info {
        font-size: 0.85em;
    }

    .game-content {
        grid-template-columns: 1fr 160px;
        gap: 6px;
    }

    .grid-wrapper {
        padding: 4px;
        border-radius: 6px;
        overflow: hidden;
    }

    .word-grid {
        gap: 2px;
    }

    .grid-cell {
        border-radius: 3px;
    }

    .word-list-panel {
        padding: 6px;
        border-radius: 6px;
    }

    .word-list-panel h3 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .word-item {
        padding: 4px 6px;
        margin-bottom: 3px;
        font-size: 0.75em;
    }

    .bottom-controls {
        padding: 3px 6px;
        border-radius: 6px;
        gap: 6px;
    }

    .control-btn {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

/* Larger landscape (tablets rotated) */
@media (min-height: 501px) and (max-height: 700px) and (orientation: landscape) {
    .game-container {
        padding: 6px 12px;
        height: 100dvh;
        gap: 6px;
    }

    .game-content {
        grid-template-columns: 1fr 200px;
        gap: 8px;
    }

    .grid-wrapper {
        overflow: hidden;
    }

    .word-item {
        padding: 6px 8px;
        margin-bottom: 4px;
        font-size: 0.85em;
    }

    .bottom-controls {
        padding: 4px 8px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* Small tablets and large phones portrait */
@media (max-width: 768px) and (orientation: portrait) {
    .container {
        padding: 30px 20px;
    }
    
    h1.game-title {
        font-size: 2.5em;
    }
    
    .menu-btn {
        width: 100%;
        max-width: none;
    }
    
    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .game-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .word-list-panel {
        max-height: 20vh;
        order: 2;
        min-height: 60px;
    }
    
    .grid-wrapper {
        padding: 6px;
        overflow: hidden;
        min-height: 0;
    }
    
    .word-grid {
        gap: 3px;
    }
    
    .grid-cell {
        border-radius: 4px;
    }
    
    .word-item {
        display: inline-block;
        padding: 4px 8px;
        margin: 2px 4px;
        font-size: 0.8em;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
        padding: 6px;
    }
    
    .control-btn {
        flex: 1;
        min-width: 90px;
        padding: 8px;
        font-size: 0.85em;
    }
}

/* Phones portrait */
@media (max-width: 480px) and (orientation: portrait) {
    .screen {
        padding: 6px;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    h1.game-title {
        font-size: 2em;
    }
    
    .top-bar {
        flex-direction: row;
        gap: 0;
        padding: 6px 10px;
        border-radius: 6px;
    }
    
    .progress-info, .timer-info {
        font-size: 0.85em;
    }
    
    .game-container {
        padding: 6px;
        height: calc(100dvh - 12px);
        gap: 4px;
    }
    
    .game-content {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .word-list-panel {
        max-height: 18vh;
        order: 2;
        padding: 6px;
        border-radius: 6px;
        min-height: 50px;
    }
    
    .word-list-panel h3 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .word-item {
        display: inline-block;
        padding: 3px 6px;
        margin: 2px 3px;
        font-size: 0.75em;
        border-radius: 4px;
    }
    
    .grid-wrapper {
        padding: 4px;
        border-radius: 5px;
        overflow: hidden;
    }
    
    .word-grid {
        gap: 2px;
    }
    
    .grid-cell {
        border-radius: 3px;
    }
    
    .bottom-controls {
        padding: 4px;
        border-radius: 6px;
        gap: 6px;
    }
    
    .control-btn {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .game-container {
        padding: 4px;
        gap: 3px;
    }
    
    .top-bar {
        padding: 4px 8px;
    }
    
    .word-list-panel {
        max-height: 15vh;
    }
    
    .word-item {
        font-size: 0.7em;
        padding: 2px 5px;
        margin: 1px 2px;
    }
    
    .control-btn {
        font-size: 0.75em;
        padding: 5px 8px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.word-item.found {
    animation: pulse 0.5s ease;
}

/* ===== Campaign Level Buttons ===== */
.level-button {
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.level-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.level-button.completed {
    background: linear-gradient(135deg, #a5d6a7 0%, #66bb6a 100%);
    border-color: #4caf50;
}

.level-button.locked {
    background: #ecf0f1;
    border-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-button.locked:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.level-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.level-button.completed .level-number {
    color: white;
}

.level-button.locked .level-number {
    color: #95a5a6;
}

.level-stars {
    font-size: 1.2em;
}

.level-time {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

.level-button.completed .level-time {
    color: white;
}

/* ===== Difficulty Buttons ===== */
.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.difficulty-btn {
    flex: 1;
    background: white;
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.difficulty-btn:hover,
.difficulty-btn-2p:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.difficulty-btn.selected,
.difficulty-btn-2p.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.difficulty-btn-2p {
    flex: 1;
    background: white;
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

/* Two Player difficulty buttons */
.difficulty-btn-2p {
    flex: 1;
    background: white;
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.difficulty-btn-2p:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.difficulty-btn-2p.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===== Star Display ===== */
.star-display {
    font-size: 3em;
    margin: 20px 0;
}

.star-animation {
    animation: starPulse 1s ease;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
    }
    25%, 75% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== Text Styles ===== */
.info-text {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-top: 8px;
}

.progress-text {
    color: var(--dark-bg);
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ===== Word Item States ===== */
.word-item.hint {
    background: #fff59d;
    animation: hintBlink 0.5s ease 3;
}

@keyframes hintBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}
