:root {
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --secondary-color: #f093fb;
    --background: #fafbfc;
    --surface: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --cell-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --clue-gradient: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    --prefill-gradient: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.game-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-title i {
    font-size: 1.8rem;
}

.game-controls {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.game-info {
    padding: 24px 32px;
    background: var(--background);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.level-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-selector label {
    font-weight: 500;
    color: var(--text-secondary);
}

.difficulty-select {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-select:hover {
    border-color: var(--primary-color);
}

.difficulty-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.game-stats {
    display: flex;
    gap: 32px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.game-play-area {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    position: relative;
    padding: 40px;
}

.game-board-container {
    display: flex;
    justify-content: center;
    position: relative;
}

.game-board-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.game-board {
    display: grid;
    gap: 3px;
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cell {
    width: 55px;
    height: 55px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    border-radius: 10px;
    box-shadow: var(--cell-shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
}

.cell:hover {
    background: #f7fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cell.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.cell.blocked {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    cursor: default;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cell.blocked:hover {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    transform: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cell.clue {
    background: linear-gradient(135deg, var(--clue-gradient) 50%, linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%) 50%);
    cursor: pointer;
    font-size: 0.7rem;
    color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), var(--cell-shadow);
    border: 1px solid #4a5568;
    position: relative;
}

.cell.clue:hover {
    background: linear-gradient(135deg, var(--clue-gradient) 50%, linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%) 50%);
    transform: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(102, 126, 234, 0.4);
}

.clue-text {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.clue-down {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.clue-across {
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.cell.error {
    background: var(--error);
    color: white;
    animation: shake 0.5s ease-in-out;
}

.cell.correct {
    background: var(--success);
    color: white;
}

.cell.hint-highlight {
    background: var(--warning);
    color: white;
    animation: pulse 1s ease-in-out;
}

.cell.prefilled {
    background: var(--prefill-gradient);
    color: #2d3748;
    font-weight: 700;
    border: 2px solid #4fd1c7;
    box-shadow: 0 0 0 2px rgba(79, 209, 199, 0.2), var(--cell-shadow);
}

.cell.prefilled:hover {
    background: var(--prefill-gradient);
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(79, 209, 199, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cell.wrong-input {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border: 2px solid var(--error);
    box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.2), var(--cell-shadow);
    animation: wrongInputShake 0.4s ease-in-out;
}

.cell.correct-input {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 2px solid var(--success);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2), var(--cell-shadow);
}

.cell.duplicate-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border: 2px solid var(--error);
    box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.2), var(--cell-shadow);
}

@keyframes wrongInputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sequence-highlight-down {
    background: linear-gradient(135deg, #e6fffa 0%, #81e6d9 100%) !important;
    border: 2px solid #319795 !important;
    box-shadow: 0 0 0 2px rgba(49, 151, 149, 0.3) !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.sequence-highlight-across {
    background: linear-gradient(135deg, #fef5e7 0%, #f6e05e 100%) !important;
    border: 2px solid #d69e2e !important;
    box-shadow: 0 0 0 2px rgba(214, 158, 46, 0.3) !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.number-pad {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 200px;
}

.number-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.number-row:last-child {
    margin-bottom: 0;
}

.number-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.number-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.erase-btn {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.erase-btn:hover {
    background: #e53e3e;
    border-color: #e53e3e;
}

.hint-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hint-panel.show {
    display: flex;
}

.hint-content {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--border-radius);
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.hint-content h3 {
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.hint-content p {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.victory-modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
}

.victory-icon {
    font-size: 4rem;
    color: var(--warning);
    margin-bottom: 24px;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.1rem;
}

.victory-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--background);
    border-radius: var(--border-radius-sm);
}

.victory-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.victory-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.victory-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-info {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
    }
    
    .game-stats {
        gap: 20px;
    }
    
    .game-play-area {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .game-board-container {
        padding: 0;
    }
    
    .cell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .number-pad {
        padding: 16px;
        min-width: auto;
        width: 100%;
    }
    
    .number-btn {
        width: 45px;
        height: 45px;
    }
    
    .modal-content {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .victory-stats {
        flex-direction: column;
        gap: 16px;
    }
}

/* SEO Content Section Styles */
.game-description {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 60px 0;
    margin-top: 40px;
}

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

.game-info-article {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    line-height: 1.7;
}

.game-info-article h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info-article h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
}

.game-info-article h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-info-article p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: justify;
}

.game-info-article ul, .game-info-article ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.game-info-article li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.game-info-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.game-info-article em {
    color: var(--primary-color);
    font-style: italic;
}

@media (max-width: 768px) {
    .game-description {
        padding: 40px 0;
        margin-top: 20px;
    }
    
    .description-container {
        padding: 0 20px;
    }
    
    .game-info-article {
        padding: 32px 24px;
    }
    
    .game-info-article h2 {
        font-size: 1.8rem;
    }
    
    .game-info-article h3 {
        font-size: 1.4rem;
    }
    
    .game-info-article h4 {
        font-size: 1.2rem;
    }
    
    .cell {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .clue-text {
        font-size: 0.6rem;
    }
    
    .clue-down, .clue-across {
        padding: 1px 2px;
        font-size: 0.6rem;
    }
    
}