/* ── Shared styles: tutorial + flashcards ──────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    /* Scale with viewport: targets 60% of the 200%-zoom experience.
       Phone  (400px)  → 16px
       Laptop (1440px) → 19px
       4K     (3840px) → 30px */
    font-size: clamp(16px, calc(12px + 0.47vw), 32px);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ── Language selector ─────────────────────────────────── */

.lang-select {
    padding: 0.3rem 0.5rem;
    background: #1a1a2e;
    color: #e2b96f;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Image carousel ────────────────────────────────────── */

.card-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* ── Tile images (shared) ──────────────────────────────── */

.tile-img {
    aspect-ratio: 74.7 / 95.1;
    border-radius: 4px;
    vertical-align: middle;
}

.tile-img.greyed { opacity: 0.35; }

/* ── Pattern tile layout ───────────────────────────────── */

.pattern-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    align-items: center;
    max-height: 22rem;
    width: 100%;
}

.pattern-tiles .tile-img {
    width: calc((100% - 12px) / 7);
    max-width: 5rem;
}

.situational-badge {
    position: absolute;
    top: -0.25rem;
    right: 0.25rem;
    font-size: 1.5rem;
    background: rgba(26, 26, 46, 0.85);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    border: 1px solid #e2b96f55;
}

.card-image-wrapper.carousel {
    flex-direction: column;
    align-items: center;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.carousel-btn {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #e2b96f55;
    border-radius: 50%;
    background: #2a2a4e;
    color: #e2b96f;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.carousel-btn:hover {
    background: #3a3a5e;
    border-color: #e2b96f;
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-counter {
    font-size: 0.75rem;
    color: #888;
    min-width: 2.5rem;
    text-align: center;
}

/* ── Modal ─────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal-content {
    position: relative;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 44rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover { color: #fff; }
