* {
    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;
    direction: rtl;
    color: #2d2d2d;
}

.container {
    max-width: 960px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.6em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.35);
}

.subtitle {
    margin-top: 10px;
    font-size: 1.2em;
    opacity: 0.9;
}

.content-box {
    background: white;
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.28);
    max-width: 760px;
    margin: 0 auto;
}

.image-container {
    text-align: center;
    margin-bottom: 30px;
}

.home-image {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.25);
    max-height: 380px;
    object-fit: cover;
}

.content-box h2 {
    color: #4b5bd6;
    margin-bottom: 20px;
    font-size: 2em;
}

.rules p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.rules ul {
    list-style: none;
}

.rules li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    font-size: 1.05em;
    line-height: 1.5;
}

.rules li:last-child {
    border-bottom: none;
}

.rules li:before {
    content: "✨ ";
    margin-left: 8px;
}

.start-btn,
.primary-btn,
.secondary-btn {
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 18px rgba(0,0,0,0.22);
}

.start-btn,
.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.secondary-btn {
    background: white;
    color: #4b5bd6;
    border: 2px solid #4b5bd6;
}

.start-btn:hover,
.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

.start-btn:active,
.primary-btn:active,
.secondary-btn:active {
    transform: translateY(0);
}

.nav-links {
    text-align: center;
    margin-top: 30px;
}

.nav-links a {
    color: #4b5bd6;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.1em;
    transition: color 0.2s, opacity 0.2s;
}

.nav-links a:hover {
    color: #764ba2;
}

.game-page .nav-links a {
    color: #f4f4ff;
}

.game-page .nav-links a:hover {
    color: #ffffff;
    opacity: 0.85;
}

.game-info {
    background: white;
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.round-info {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #4b5bd6;
    font-weight: bold;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-card {
    background: #f7f8ff;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.25);
}

.stat-card h3 {
    color: #667eea;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1.8em;
    color: #764ba2;
    font-weight: bold;
}

.game-area {
    background: white;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.28);
}

.mission-intro {
    background: #f2f4ff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px dashed rgba(102, 126, 234, 0.5);
}

.mission-intro h2 {
    color: #4b5bd6;
    margin-bottom: 10px;
}

.question-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 30px;
    border: 2px solid rgba(118, 75, 162, 0.15);
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.question-card.hidden {
    display: none;
}

.question-text {
    font-size: 3em;
    text-align: center;
    color: #764ba2;
    font-weight: bold;
}

.multiply-sign {
    margin: 0 20px;
    font-size: 0.8em;
    opacity: 0.8;
}

.question-instruction {
    text-align: center;
    margin: 25px 0 20px;
    font-size: 1.2em;
    color: #4b4b4b;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 15px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #f6f6ff;
    color: #2d2d2d;
    font-size: 1.3em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border 0.2s;
}

.option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.option-btn.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.option-btn.correct {
    background: #d4edda;
    border-color: #2e7d32;
    color: #1b5e20;
}

.option-btn.incorrect {
    background: #fbe9e7;
    border-color: #d84315;
    color: #bf360c;
}

.option-btn:disabled {
    cursor: default;
    transform: none;
    box-shadow: none;
}

.explanation {
    background: #f8f8ff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(118, 75, 162, 0.2);
    min-height: 90px;
    line-height: 1.6;
    font-size: 1.05em;
}

.explanation p {
    margin-bottom: 10px;
}

.explanation .success {
    color: #1b5e20;
    font-weight: bold;
}

.explanation .error {
    color: #c62828;
    font-weight: bold;
}

.explanation .addition {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(102, 126, 234, 0.08);
    padding: 10px;
    border-radius: 8px;
}

.game-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.game-actions .primary-btn,
.game-actions .secondary-btn {
    min-width: 180px;
}

.about-page .content-box {
    text-align: right;
}

.about-page p {
    margin-bottom: 18px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.1em;
    }

    .content-box {
        padding: 25px;
    }

    .question-text {
        font-size: 2.4em;
    }

    .options-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}
