/* ============================================
   SHARED CSS - Relaxing Math Games Library
   Use this in ALL your games
   ============================================ */

/* ---------- RESET & BASE ---------- */
* {
    user-select: none;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Quicksand', system-ui, -apple-system, 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Default gradient - can be overridden per game */
    background: linear-gradient(135deg, #d4e0d0 0%, #c2d2bc 100%);
}

/* ---------- GAME CARD CONTAINER ---------- */
.game-card {
    background: #fffdf5;
    border-radius: 60px;
    padding: 25px 20px 35px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1), 0 5px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.2s ease;
    max-width: 1300px;
    width: 100%;
}

/* ---------- TYPOGRAPHY ---------- */
h1 {
    font-size: 2rem;
    font-weight: 500;
    color: #3a6b55;
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.subhead {
    color: #6c917e;
    margin-bottom: 25px;
    border-bottom: 2px dotted #d4e2d0;
    display: inline-block;
    padding-bottom: 8px;
}

/* ---------- BUTTONS (uniform across games) ---------- */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    background: #dbe9e0;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 10px 28px;
    border-radius: 50px;
    color: #3a6b55;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    background: #caddd0;
    transform: scale(0.97);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: #c7e2b5;
    color: #2d5a4c;
}

.btn-secondary {
    background: #f0e5d2;
    color: #8b6946;
}

/* ---------- MESSAGE PANEL (unified feedback) ---------- */
.message-panel {
    background: #eff5ec;
    border-radius: 48px;
    padding: 14px 20px;
    margin-top: 20px;
    font-size: 1rem;
    color: #487a64;
    min-height: 80px;
    transition: all 0.2s;
}

/* ---------- FRACTION DISPLAY (unified) ---------- */
.fraction-badge {
    font-size: 1.8rem;
    font-weight: 600;
    background: #e6f0ea;
    display: inline-block;
    padding: 5px 22px;
    border-radius: 50px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    color: #2c6b58;
}

/* ---------- STATUS INDICATORS ---------- */
.status-badge {
    font-size: 0.85rem;
    background: #eef4ea;
    display: inline-block;
    padding: 5px 16px;
    border-radius: 40px;
    margin-top: 10px;
    color: #527a66;
}

/* ---------- GRID / SHAPE CONTAINERS ---------- */
.shape-container {
    background: #fef7ec;
    border-radius: 48px;
    padding: 18px 15px 22px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s ease;
}

.shape-container canvas {
    display: block;
    margin: 12px auto;
    background: #fffaf0;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    width: 100%;
    height: auto;
}

/* ---------- ANIMATIONS (shared) ---------- */
@keyframes gentlePop {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-pop {
    animation: gentlePop 0.3s ease-out;
}

.animate-fadein {
    animation: fadeInUp 0.4s ease-out;
}

/* ---------- UTILITY CLASSES ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 10px; }
.mb-2 { margin-bottom: 10px; }
.hidden { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 850px) {
    .game-card { padding: 20px 15px 25px; }
    h1 { font-size: 1.5rem; }
    .fraction-badge { font-size: 1.3rem; }
    .btn { padding: 8px 20px; font-size: 0.9rem; }
}

/* ---------- THEMES (optional per game) ---------- */
.theme-ocean {
    background: linear-gradient(135deg, #b8d4e3 0%, #9bc0d4 100%);
}

.theme-forest {
    background: linear-gradient(135deg, #c7dfc5 0%, #b0ceaa 100%);
}

.theme-sunset {
    background: linear-gradient(135deg, #f5e6d3 0%, #ecd9c0 100%);
}