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

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
    font-family: Arial, sans-serif;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-container {
    position: relative;
    min-width: 1000px;
    min-height: 600px;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 5px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

h1 {
    margin: 0;
    color: #333;
    font-size: 32px;
    text-align: center;
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.category-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-selector label {
    font-size: 1.1rem;
    color: #333;
}

.category-selector select {
    padding: 8px 12px;
    font-size: 1rem;
    border: 2px solid #2196F3;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.category-selector select:hover {
    border-color: #1976D2;
}

.category-selector select:focus {
    border-color: #1565C0;
}

.game-board {
    display: grid;
    gap: 2px;
    background: #ccc;
    padding: 2px;
    border-radius: 5px;
    margin: 20px 0;
}

.cell {
    width: 40px;
    height: 40px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.cell.selected {
    background: #2196F3;
    color: white;
    transform: scale(1.1);
    z-index: 1;
}

.cell.found {
    background: #4CAF50;
    color: white;
    transform: scale(1);
    z-index: 0;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.word-item {
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    text-align: center;
    transition: all 0.2s ease;
}

.word-item.found {
    background: #4CAF50;
    color: white;
    text-decoration: line-through;
}

#message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 5px;
    font-size: 24px;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    text-align: center;
    min-width: 200px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#message.error {
    opacity: 1;
    visibility: visible;
    background: rgba(255, 0, 0, 0.8);
}

#message.success {
    opacity: 1;
    visibility: visible;
    background: rgba(76, 175, 80, 0.8);
}

.new-game-btn {
    padding: 10px 20px;
    font-size: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.new-game-btn:hover {
    background: #45a049;
}

.back-button {
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.word-counter {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    text-align: center;
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }
    
    .game-board {
        margin: 20px auto;
        overflow-x: auto;
    }
} 