/* Shared CSS stylesheet for Interactive Game Modes across LLOS Explorer Pages */

/* Game Zone UI Components */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-sub-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.game-sub-tab {
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border-subtle);
    background: white;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.game-sub-tab:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.game-sub-tab.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.game-progress-container {
    width: 100%;
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    position: relative;
}

.game-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-fb {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
    display: none;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideInUp 0.3s ease-out;
}

.game-fb.show {
    display: block;
}

.game-fb.correct {
    background: #ecfdf5;
    color: #065f46;
    border: 2px solid #a7f3d0;
}

.game-fb.incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 2px solid #fecaca;
}

.game-fb.hint {
    background: #f3efff;
    color: #6d28d9;
    border: 2px solid #e9e3ff;
}

/* Match Game Tiles Grid */
.match-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

@media (max-width: 600px) {
    .match-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.match-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-tile {
    background: white;
    border: 2px solid var(--border-subtle);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.match-tile:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.match-tile.selected {
    border-color: var(--primary-blue);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* AI Change: Standardize matched tile default states (higher opacity 0.95 for readability, remove default green) and delegate colors to pair-specific classes. */
.match-tile.paired {
    cursor: default;
    transform: none;
    box-shadow: none;
    opacity: 0.95;
    pointer-events: none;
}

/* AI Change: Pair 1 - Emerald Green */
.match-tile.paired.pair-1 {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

/* AI Change: Pair 2 - Sky Blue */
.match-tile.paired.pair-2 {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0369a1;
}

/* AI Change: Pair 3 - Purple */
.match-tile.paired.pair-3 {
    background: #f5f3ff;
    border-color: #8b5cf6;
    color: #6d28d9;
}

/* AI Change: Pair 4 - Orange/Gold */
.match-tile.paired.pair-4 {
    background: #fff7ed;
    border-color: #ea7a27;
    color: #c2410c;
}

.match-tile svg {
    max-width: 80px;
    max-height: 80px;
    display: block;
}

.match-text-tile {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    text-align: center;
}

/* Spelling Bee Inputs */
.spell-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.spell-input-wrap {
    display: flex;
    gap: 12px;
    width: 100%;
}

.spell-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--border-subtle);
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.spell-input:focus {
    border-color: var(--primary-blue);
}

.spell-btn {
    padding: 12px 24px;
    border-radius: 99px;
    background: var(--primary-blue);
    color: white;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.spell-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* Animations and Highlights */
.shake {
    animation: shake-anim 0.4s ease;
}

@keyframes shake-anim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.pulse-gold {
    animation: pulse-gold-anim 1.5s infinite alternate;
}

@keyframes pulse-gold-anim {
    from {
        stroke: #f59e0b;
        stroke-dasharray: 0;
        filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4));
    }
    to {
        stroke: #f59e0b;
        stroke-dasharray: 4;
        filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.9));
    }
}

.dimmed {
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s;
}

#confetti-canvas {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 10000;
}

/* Explorer Mode Default Size Clamping */
/* Inline Comment: Changed overflow to visible on the interactive-section and its inner container elements so that tooltips are never cut off or clipped at the borders */
.interactive-section {
    overflow: visible !important;
}

/* [2026-06-06] Pawan: 'this entire thing only 85% viewport' — page chrome (header tabs ~70px,
   sub-heading ~60px, footer hint ~40px, margins ~40px) totals ~210px. With a 900px viewport,
   85% = 765px; 765 − 210 ≈ 555px for the room. 60vh = 540px on a 900px screen — fits. */
.interactive-section div[class$="-container"] {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 60vh;
    margin: 1rem auto 0 auto;
    overflow: visible !important;
    border-radius: 12px;
    transition: opacity 0.3s;
}

.interactive-section div[class$="-container"] svg {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Viewport Optimization & Scoped Game-Active Styles (No Full Body Height Lock) */

#gameZoneWrapper {
    width: 88% !important;
    margin: 2rem auto !important;
    max-width: 800px;
    box-sizing: border-box;
}

/* Inline Comment: Set visual cards to transparent and borderless when a game is active to blend into the background gradient */
#gameZoneWrapper.game-active .interactive-section {
    padding: 0 !important;
    margin: 0 !important;
    height: 56vh !important;
    max-height: 56vh !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#gameZoneWrapper.game-active .interactive-section div[class$="-container"] {
    height: calc(100% - 40px) !important;
    max-height: calc(100% - 40px) !important;
    margin: 0 auto !important;
    background: transparent !important;
}

#gameZoneWrapper.game-active .interactive-section svg {
    height: 100% !important;
    max-height: 100% !important;
}

#gameZoneWrapper.game-active .interactive-section h3 {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 5px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#gameZoneWrapper.game-active #matchingViewCard {
    height: 56vh !important;
    max-height: 56vh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#gameZoneWrapper.game-active #gameControllerPanel {
    height: 26vh !important;
    max-height: 26vh !important;
    margin: 5px auto 0 auto !important;
    padding: 10px 16px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(243,239,255,0.95) 100%);
    backdrop-filter: blur(8px);
}

#gameZoneWrapper.game-active .match-container {
    height: calc(100% - 45px) !important;
    gap: 10px !important;
    max-width: 100% !important;
}

#gameZoneWrapper.game-active .match-col {
    gap: 6px !important;
}

#gameZoneWrapper.game-active .match-tile {
    min-height: 46px !important;
    height: 46px !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-subtle);
}

#gameZoneWrapper.game-active .match-tile svg {
    max-width: 40px !important;
    max-height: 40px !important;
}

#gameZoneWrapper.game-active .match-text-tile {
    font-size: 0.95rem !important;
}

/* Inline Comment: Hide instruction text during active game rounds */
#gameZoneWrapper.game-active #instructionText {
    display: none !important;
}

/* Inline Comment: Main Game / Quiz Tab Buttons spacing and style */
.game-zone-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 1.5rem;
}

/* Main Switcher Tabs */
.main-tab-btn {
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--border-subtle);
    background: white;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.main-tab-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.main-tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

/* Quiz Carousel Layout enabling horizontal swiping and snapping */
.quiz-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 0.5rem 0.25rem;
    scrollbar-width: none; /* Hide standard scrollbars */
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    height: 56vh; /* Match game card height */
    scroll-behavior: smooth;
    width: 100%;
}

.quiz-carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbars in Chrome/Safari */
}

.quiz-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
    background: white;
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Quiz Navigation Row */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0 0.5rem;
}

.quiz-nav-btn {
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border-subtle);
    background: white;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-nav-btn:hover:not(:disabled) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.quiz-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quiz-progress-dots {
    display: flex;
    gap: 8px;
}

.quiz-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-dot.active {
    background: var(--primary-blue);
    transform: scale(1.25);
}

.quiz-dot.correct {
    background: #10b981;
}

.quiz-dot.incorrect {
    background: #ef4444;
}

/* Quiz Options styling inside carousel */
.quiz-card .quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .quiz-card .quiz-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .quiz-carousel {
        height: 60vh;
    }
}

.quiz-card .quiz-option {
    padding: 10px 14px;
    border: 1.5px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    background: white;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: center;
}

.quiz-card .quiz-option:hover {
    border-color: var(--primary-blue);
    background: var(--accent-soft);
}

.quiz-card .quiz-option.correct {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.quiz-card .quiz-option.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.quiz-card .quiz-feedback {
    margin-top: 0.5rem;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    display: none;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: left;
}

.quiz-card .quiz-feedback.show {
    display: block;
}

.quiz-card .quiz-feedback.correct {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
}

.quiz-card .quiz-feedback.incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 20px, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

/* AI Change: Helper class to hide cards off-screen without display:none to prevent SVG gradient reference resolution failure */
.game-hidden-card {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: none !important;
}
