* {
    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;
    display: flex;
    flex-direction: column;
}

/* Header and Navigation */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 16px;
}

.nav-menu a:hover {
    color: #667eea;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.menu {
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.diff-btn {
    padding: 15px 30px;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.diff-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.diff-btn.selected {
    background: #667eea;
    color: white;
}

.size-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.size-btn {
    padding: 10px 20px;
    border: 2px solid #764ba2;
    background: white;
    color: #764ba2;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.size-btn:hover {
    background: #764ba2;
    color: white;
}

.size-btn.selected {
    background: #764ba2;
    color: white;
}

.game-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.magic-constant {
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
}

.grid-container {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 20px;
}

.grid {
    display: inline-grid;
    gap: 3px;
    background: #667eea;
    padding: 3px;
    border-radius: 10px;
}

.cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    border-radius: 5px;
    transition: all 0.3s;
}

.cell.fixed {
    background: #e8eaf6;
    color: #667eea;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    background: transparent;
    outline: none;
}

.cell.correct {
    background: #d4edda;
    color: #155724;
}

.cell.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

button.secondary:hover {
    background: #667eea;
    color: white;
}

.message {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

.hidden {
    display: none;
}

/* Footer links in main content */
.footer-links {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.footer-section {
    margin-bottom: 25px;
}

.footer-title {
    color: #667eea;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}

.footer-links-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.footer-link {
    color: #764ba2;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #764ba2;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.footer-link:hover {
    background: #764ba2;
    color: white;
    transform: translateY(-2px);
}

.good-luck {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

.good-luck-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s;
}

.good-luck-link:hover {
    text-decoration: underline;
    opacity: 0.8;
    color: #764ba2;
}

/* Info Section Styles */
.info-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    border-radius: 15px;
    border: 2px solid #667eea;
}

.info-content {
    color: #333;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 20px;
}

.info-content p {
    margin-bottom: 15px;
}

.info-content strong {
    color: #667eea;
}

.info-list {
    margin-left: 20px;
    margin-top: 10px;
}

.info-list li {
    margin-bottom: 10px;
    color: #555;
}

.info-list li::marker {
    color: #667eea;
}

.info-image {
    margin: 25px 0;
    text-align: center;
}

.info-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid #667eea;
}

.video-section {
    margin-top: 30px;
}

.video-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-container iframe {
    display: block;
    width: 100%;
    height: 400px;
    border-radius: 10px;
}

.video-note {
    text-align: center;
    color: #764ba2;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

/* Site Footer */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 20px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 15px 0;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .cell, .cell input {
        font-size: 16px;
    }

    .footer-link {
        font-size: 12px;
        padding: 6px 12px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-section {
        padding: 20px;
    }

    .info-content {
        font-size: 14px;
    }

    .video-container iframe {
        height: 250px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .cell, .cell input {
        font-size: 16px;
    }

    .video-container iframe {
        height: 200px;
    }
}