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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 25px;
    position: relative;
    overflow: hidden;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #718096;
    font-size: 1.1em;
}

/* Game info panels */
.game-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.rules-panel, .score-panel {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.score-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Hint panel */
.hint-panel {
    margin-bottom: 20px;
}

.hint-btn {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hint-btn:hover {
    background: #feebeb;
    transform: translateY(-2px);
}

.hint-text {
    margin-top: 10px;
    padding: 15px;
    background: #ebf8ff;
    border-radius: 10px;
    color: #2b6cb0;
    display: none;
}

.hint-text.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Game area layout using CSS Grid [citation:3] */
.game-area {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 25px;
}

/* Symbol palette */
.symbol-palette {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

.symbol {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    background: white;
    border: 3px solid #cbd5e0;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.symbol:hover {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.symbol[draggable="true"]:active {
    cursor: grabbing;
}

/* Game grid using CSS Grid [citation:3] */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    aspect-ratio: 1;
    background: #edf2f7;
    padding: 15px;
    border-radius: 10px;
    border: 3px solid #e2e8f0;
}

.grid-cell {
    background: white;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    transition: all 0.3s ease;
    min-height: 80px;
}

.grid-cell:hover {
    background: #f7fafc;
    border-color: #667eea;
}

.grid-cell.occupied {
    border-style: solid;
    border-color: #a0aec0;
}

.grid-cell.drag-over {
    background: #ebf8ff;
    border-color: #4299e1;
    transform: scale(1.05);
}

/* Buttons */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

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

/* Feedback panel */
.feedback-panel {
    text-align: center;
    padding: 15px;
}

.validation-result {
    font-size: 1.1em;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.validation-result.success {
    background: #c6f6d5;
    color: #2d5016;
}

.validation-result.error {
    background: #fed7d7;
    color: #c53030;
}

.validation-result.info {
    background: #bee3f8;
    color: #2c5282;
}

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

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

.pulse {
    animation: pulse 0.5s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .game-info {
        grid-template-columns: 1fr;
    }
    
    .symbol-palette {
        flex-direction: row;
        justify-content: center;
    }
}