* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

/* Navigation */
.nav-menu {
    margin-bottom: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.score-board {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 10px;
    min-width: 80px;
}

.score-item .label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.score-item span:last-child {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Game Container */
.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(6, 60px);
    grid-template-rows: repeat(6, 60px);
    gap: 2px;
    background: #ddd;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.grid-cell {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.grid-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.grid-cell.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.grid-cell.fixed {
    background: #f5f5f5;
    cursor: not-allowed;
}

.grid-cell.error {
    background: #ffebee;
    border-color: #f44336;
    animation: shake 0.5s ease-in-out;
}

.grid-cell.hint {
    background: #fff3e0;
    border-color: #ff9800;
}

/* Constraint indicators */
.grid-cell::after {
    content: attr(data-constraint);
    position: absolute;
    top: -12px;
    right: -8px;
    font-size: 0.7rem;
    color: #fff;
    background: #667eea;
    padding: 1px 4px;
    border-radius: 6px;
    min-width: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-weight: bold;
}

.grid-cell[data-constraint=""]::after {
    display: none;
}

.grid-cell[data-constraint="="]::after {
    background: #4caf50;
}

.grid-cell[data-constraint="×"]::after {
    background: #f44336;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Game Description & Rules */
.game-description {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 5px solid #2196f3;
}

.game-description h2 {
    color: #1976d2;
    margin-bottom: 15px;
}

.game-description p {
    color: #333;
    line-height: 1.7;
}

.game-rules {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.game-rules h3 {
    margin-bottom: 15px;
    color: #333;
}

.game-rules ul {
    list-style: none;
    padding-left: 0;
}

.game-rules li {
    margin-bottom: 10px;
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    position: relative;
    padding-left: 30px;
}

.game-rules li::before {
    content: "✓";
    position: absolute;
    left: 10px;
    color: #667eea;
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
}

.footer-content {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.footer-content h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background-color 0.3s ease;
}

.footer-links a:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

.footer p {
    margin-bottom: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.modal-stats p {
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Page-specific Styles */
.guide-content, .about-content, .tips-content {
    max-width: none;
}

.intro, .basic-rules, .how-to-play, .controls, .tips, .mission, .features, .story, .technology, .community {
    margin-bottom: 30px;
}

.intro h2, .mission h2, .features h2, .story h2, .technology h2, .community h2 {
    color: #1976d2;
    border-bottom: 3px solid #e3f2fd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Rule and Tip Items */
.rule-item, .tip-item, .mission-item, .tech-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.rule-item h3, .tip-item h3, .mission-item h3, .tech-item h3 {
    color: #333;
    margin-bottom: 10px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e3f2fd;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.feature-item h3 {
    color: #1976d2;
    margin-bottom: 10px;
}

/* Steps */
.step, .step-item {
    background: linear-gradient(135deg, #e8f4fd 0%, #f3f8ff 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid #2196f3;
}

.step h3, .step-item h3 {
    color: #1976d2;
    margin-bottom: 15px;
}

.step ul, .step-item ul {
    padding-left: 20px;
}

.step li, .step-item li {
    margin-bottom: 8px;
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.control-item {
    background: #fff3e0;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #ff9800;
}

.control-item h3 {
    color: #f57c00;
    margin-bottom: 15px;
}

.control-item ul {
    padding-left: 0;
    list-style: none;
}

.control-item li {
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #ffc107;
}

/* Story List */
.story-list {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid #e3f2fd;
}

.story-list li {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.story-list li:last-child {
    border-bottom: none;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tips Specific Styles */
.tip-category, .strategy-category, .advanced-category {
    margin-bottom: 30px;
}

.tip-category h3, .strategy-category h3, .advanced-category h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.strategy-item, .technique-item {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid #4caf50;
}

.strategy-item h4, .technique-item h4 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.example {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    border-left: 3px solid #4caf50;
    font-family: monospace;
}

.process-steps {
    display: grid;
    gap: 20px;
}

.mistake-item {
    background: #ffebee;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid #f44336;
}

.mistake-item h3 {
    color: #d32f2f;
    margin-bottom: 15px;
}

.improvement-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.practice-item {
    background: #f3e5f5;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #9c27b0;
}

.practice-item h3 {
    color: #7b1fa2;
    margin-bottom: 10px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin: 40px 0;
}

.cta-section h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.cta-section p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.cta-section .btn {
    font-size: 1.1rem;
    padding: 12px 30px;
}

/* Responsive adjustments for new pages */
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .improvement-tips {
        grid-template-columns: 1fr;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    .cta-section {
        padding: 30px 20px;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
}

/* Privacy Policy Specific Styles */
.privacy-content {
    max-width: none;
    line-height: 1.7;
}

.privacy-content .intro {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #2196f3;
    margin-bottom: 30px;
}

.privacy-content .intro p:first-child {
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 15px;
}

.policy-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.policy-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.policy-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.policy-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.contact-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e3f2fd;
    margin: 20px 0;
}

.contact-details p {
    margin-bottom: 5px;
}

.contact-details p:first-child {
    font-weight: bold;
    color: #1976d2;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.summary-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #4caf50;
    margin-top: 20px;
}

.summary-box h3 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-box ul {
    list-style: none;
    padding-left: 0;
}

.summary-box li {
    margin-bottom: 10px;
    padding: 8px 0;
    font-weight: 500;
}

.summary-box li::before {
    content: "";
    margin-right: 10px;
}

.footer-links .privacy-highlight {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: bold;
}

/* Privacy Policy responsive adjustments */
@media (max-width: 768px) {
    .privacy-content {
        font-size: 0.95rem;
    }
    
    .policy-section {
        padding: 15px;
    }
    
    .contact-details {
        padding: 15px;
    }
    
    .summary-box {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .game-info {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .score-board {
        justify-content: center;
    }
    
    .controls {
        justify-content: center;
    }
    
    .game-grid {
        grid-template-columns: repeat(6, 45px);
        grid-template-rows: repeat(6, 45px);
    }
    
    .grid-cell {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(6, 40px);
        grid-template-rows: repeat(6, 40px);
        gap: 1px;
        padding: 5px;
    }
    
    .grid-cell {
        font-size: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .main-content {
        background: #2d3748;
        color: white;
    }
    
    .score-item {
        background: #4a5568;
        color: white;
    }
    
    .score-item .label {
        color: #a0aec0;
    }
    
    .grid-cell {
        background: #4a5568;
        border-color: #2d3748;
        color: white;
    }
    
    .grid-cell.selected {
        background: #2b6cb0;
    }
    
    .game-rules {
        background: #4a5568;
        color: white;
    }
    
    .game-rules li {
        background: #2d3748;
    }
}