* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

.container {
    width: 1200px;
    height: 1024px;
    margin: 0 auto;
    background: #1a1a2e;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 100px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

/* Header */
header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(102, 126, 234, 0.3);
    border-bottom: 2px solid rgba(102, 126, 234, 0.4);
}

header h1 {
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.6), 0 0 40px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.5);
    color: #e0e0e0;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.8);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Screens */
.screen {
    display: none;
    height: calc(1024px - 80px);
    padding: 30px;
    overflow-y: auto;
    background: #1a1a2e;
}

.screen.active {
    display: block;
}

/* Theme Selection */
#themeSelection h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: #667eea;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.theme-card {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    transition: left 0.5s;
}

.theme-card:hover::before {
    left: 100%;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4), 0 0 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.8);
}

.theme-card.completed {
    border-color: rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, #1a3a2e 0%, #0f4c3a 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.theme-thumbnail {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 10px;
    background: rgba(26, 26, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.theme-name {
    font-size: 18px;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.theme-progress {
    font-size: 14px;
    color: #a0a0a0;
    width: 100%;
}

.theme-progress-text {
    margin-bottom: 8px;
    font-weight: bold;
}

.theme-progress-bar-container {
    width: 100%;
}

.theme-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.theme-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.theme-progress-info {
    font-size: 12px;
    color: #a0a0a0;
    text-align: center;
}

/* Game Screen */
.game-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.game-header h2 {
    flex: 1;
    font-size: 24px;
    color: #667eea;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.progress-info {
    font-size: 18px;
    font-weight: bold;
    color: #a0a0a0;
}

.game-content {
    display: flex;
    gap: 30px;
    height: calc(100% - 100px);
}

.word-list {
    width: 250px;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.word-list h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.word-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    color: #e0e0e0;
}

.word-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
    border-left-color: rgba(102, 126, 234, 0.6);
}

.word-item.found {
    text-decoration: line-through;
    color: #666;
    border-left-color: rgba(76, 175, 80, 0.8);
    background: rgba(76, 175, 80, 0.15);
}

.grid-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

#wordSearchGrid {
    display: grid;
    gap: 2px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.grid-cell {
    width: 30px;
    height: 30px;
    background: rgba(26, 26, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    border-radius: 3px;
    color: #e0e0e0;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.grid-cell:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.grid-cell.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6), 0 0 30px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.grid-cell.cheat-highlight {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    border-color: rgba(255, 107, 107, 0.9);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8), 0 0 40px rgba(255, 165, 0, 0.5);
    transform: scale(1.1);
    z-index: 10;
    animation: cheatPulse 0.5s ease-in-out infinite;
}

@keyframes cheatPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8), 0 0 40px rgba(255, 165, 0, 0.5);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 1), 0 0 60px rgba(255, 165, 0, 0.8);
        transform: scale(1.15);
    }
}

.grid-cell.found {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5), 0 0 30px rgba(76, 175, 80, 0.2);
}

.grid-cell.tiled-found {
    animation: tilingPulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 50%, #4caf50 100%);
    background-size: 200% 200%;
    animation-delay: calc(var(--tile-delay, 0) * 0.1s);
}

@keyframes tilingPulse {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.5), 0 0 30px rgba(76, 175, 80, 0.2);
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.8), 0 0 50px rgba(76, 175, 80, 0.4);
        transform: scale(1.05);
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-radius: 15px;
    max-width: 1000px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8), 0 0 60px rgba(102, 126, 234, 0.3);
    animation: modalSlideIn 0.3s;
    border: 2px solid rgba(102, 126, 234, 0.4);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.modal-header > div {
    flex: 1;
}

.modal-header h2 {
    color: #667eea;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.modal-close {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.3);
    font-size: 28px;
    cursor: pointer;
    color: #e0e0e0;
    transition: all 0.2s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.modal-body {
    padding: 20px;
    color: #e0e0e0;
}

.unlocked-image {
    width: 100%;
    min-height: 550px;
    max-height: 600px;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    padding: 10px;
}

.unlocked-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6), 0 0 30px rgba(102, 126, 234, 0.3);
}

.progress-content {
    padding: 20px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 10px 0;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.progress-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.progress-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.progress-details {
    flex: 1;
}

.progress-details h3 {
    margin-bottom: 5px;
    color: #e0e0e0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    transition: width 0.3s;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

/* Slideshow */
.slideshow-content {
    max-width: 1100px;
}

.slideshow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
}

.slideshow-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.slideshow-nav:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6), 0 0 30px rgba(102, 126, 234, 0.3);
}

.slideshow-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slideshow-image {
    width: 960px;
    height: 544px;
    max-width: 90vw;
    max-height: 70vh;
    background: rgba(26, 26, 46, 0.6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(102, 126, 234, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 10px;
}

.slideshow-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.slideshow-info {
    text-align: center;
    padding: 15px;
    color: #a0a0a0;
    font-size: 16px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.7);
}

/* Fireworks */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

/* Letter Drop Animation */
.grid-cell.dropping {
    animation: letterDrop 1s ease-out forwards;
    z-index: 1000;
    pointer-events: none;
}

@keyframes letterDrop {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(200px) scale(0.8) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(600px) scale(0.2) rotate(360deg);
        opacity: 0;
    }
}

/* Word Found Animation */
.word-found-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 40px rgba(102, 126, 234, 0.5);
    z-index: 1500;
    pointer-events: none;
    animation: wordFoundPulse 1s ease-out forwards;
}

@keyframes wordFoundPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Options Modal */
.options-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
}

.options-section:last-child {
    border-bottom: none;
}

.options-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.option-item {
    margin-bottom: 20px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e0e0;
    font-size: 16px;
    margin-bottom: 8px;
    cursor: pointer;
}

.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.option-select {
    width: 100%;
    padding: 10px;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-select:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(26, 26, 46, 1);
}

.option-select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.option-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(26, 26, 46, 0.8);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.option-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    transition: all 0.3s;
}

.option-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
}

.option-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    transition: all 0.3s;
}

.option-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
}
