/* ── Area Explorer Game Styles ── */

body {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

.game-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ── Navigation ── */
.game-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.home-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: bold;
    transition: background 0.3s;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.game-title {
    color: white;
    font-size: 1.6em;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-spacer {
    width: 120px;
}

/* ── Game Container ── */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* ── Level Info Bar ── */
.level-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 10px 24px;
    text-align: center;
    min-width: 80px;
}

.info-label {
    display: block;
    font-size: 0.75em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    color: #15803d;
}

/* ── Level Description ── */
.level-description {
    text-align: center;
    margin-bottom: 15px;
}

.level-description h2 {
    color: #15803d;
    margin: 0 0 5px;
    font-size: 1.3em;
}

.level-description p {
    color: #666;
    margin: 0;
    font-size: 0.95em;
}

/* ── Progress Bar ── */
.progress-container {
    background: #e5e7eb;
    border-radius: 10px;
    height: 24px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #11998e, #38ef7d);
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8em;
    font-weight: bold;
    color: #333;
}

/* ── Shape Display Area ── */
.shape-area {
    text-align: center;
    margin-bottom: 20px;
}

#shape-canvas {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    max-width: 100%;
    height: auto;
}

.question-text {
    font-size: 1.15em;
    font-weight: bold;
    color: #333;
    margin-top: 12px;
}

/* ── Answer Section ── */
.answer-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.answer-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-input {
    width: 140px;
    padding: 12px 16px;
    font-size: 1.2em;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.answer-input:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.15);
}

.unit-label {
    font-size: 0.9em;
    color: #888;
}

.submit-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.35);
}

/* ── Feedback ── */
.feedback {
    text-align: center;
    min-height: 32px;
    font-size: 1.05em;
    font-weight: bold;
    margin-bottom: 15px;
    transition: opacity 0.3s;
}

.feedback.correct {
    color: #16a34a;
}

.feedback.incorrect {
    color: #dc2626;
}

.feedback.hint {
    color: #2563eb;
}

/* ── Controls ── */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.hint-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.skip-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.new-btn:hover {
    border-color: #11998e;
    color: #11998e;
}

.diff-change-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

/* ── Difficulty Selection Screen ── */
.screen-heading {
    text-align: center;
    color: #15803d;
    margin: 0 0 6px;
    font-size: 1.5em;
}

.screen-subtext {
    text-align: center;
    color: #666;
    margin: 0 0 24px;
}

.difficulty-cards {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.diff-card {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    padding: 24px 16px;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.diff-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.diff-easy:hover  { border-color: #22c55e; }
.diff-medium:hover { border-color: #eab308; }
.diff-hard:hover   { border-color: #ef4444; }

.diff-icon {
    font-size: 2em;
}

.diff-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.diff-detail {
    font-size: 0.85em;
    color: #888;
    line-height: 1.4;
}

.diff-badge-card .info-value {
    font-size: 1em;
    text-transform: capitalize;
}

/* ── Modals ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.modal-content h2 {
    color: #15803d;
    margin-top: 0;
}

.modal-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

/* ── Animations ── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}

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

.shake {
    animation: shake 0.4s ease;
}

.bounce {
    animation: bounce 0.4s ease;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .game-wrapper {
        padding: 10px;
    }

    .game-title {
        font-size: 1.2em;
    }

    .game-container {
        padding: 18px;
    }

    .level-info {
        gap: 10px;
        flex-wrap: wrap;
    }

    .info-card {
        padding: 8px 14px;
        min-width: 60px;
    }

    .info-value {
        font-size: 1.1em;
    }

    .answer-section {
        flex-direction: column;
    }

    .answer-input {
        width: 120px;
    }

    #shape-canvas {
        width: 100%;
    }

    .controls {
        gap: 8px;
    }

    .control-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .difficulty-cards {
        flex-direction: column;
        align-items: center;
    }

    .diff-card {
        max-width: 280px;
        width: 100%;
    }
}
