/* home-extra.css — load AFTER style.css */
#sky{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
body>nav,body>section,body>footer,#dynamic-support-banner,#dynamic-promo-banner{position:relative;z-index:1}
#navbar{position:sticky;z-index:50}

/* Cursor Trail Particles */
.cursor-sparkle {
    position: fixed;
    width: 6px; height: 6px;
    background: radial-gradient(circle, #fff 0%, #fcd34d 40%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.6s ease-out;
    box-shadow: 0 0 8px #f59e0b, 0 0 15px #fcd34d;
}

/* Rotating pulse banner */
.rot-banner{display:flex;justify-content:center;padding:10px 16px}
.rot-banner a{display:inline-flex;align-items:center;gap:10px;padding:10px 22px;border-radius:999px;text-decoration:none;
  font-weight:800;color:#fcd34d;background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.45);
  animation:rotPulse 1.6s ease-in-out infinite;transition:opacity .35s}
.rot-banner a.out{opacity:0}
.rot-banner small{font-weight:600;color:#a7f3d0;font-size:12px}
@keyframes rotPulse{0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.5)}50%{box-shadow:0 0 0 12px rgba(245,158,11,0)}}

/* Hero tags */
.hero-curr-tags{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.curr-tag{padding:6px 14px;border-radius:8px;font-size:13px;font-weight:700;color:#d1fae5;
  background:rgba(16,185,129,.14);border:1px solid rgba(16,185,129,.4);text-decoration:none}
.curr-tag.gold{color:#fde68a;background:rgba(245,158,11,.14);border-color:rgba(245,158,11,.45)}

/* Section shells */
.hx-sec{max-width:1200px;margin:0 auto;padding:25px 20px}
.hx-head{margin-bottom:15px}
.hx-head h2{font-size:clamp(26px,4vw,38px);font-weight:900;color:#fff;margin:0 0 6px}
.hx-head p{color:#94a3b8;margin:0;font-weight:500; line-height:1.5}

/* Curriculum rows */
.curr-group{margin-bottom:15px}
.curr-group>h3{color:#fcd34d;font-size:20px;font-weight:800;margin:0 0 4px}
.curr-group>p{color:#94a3b8;margin:0 0 14px;font-size:14px}
.curr-list{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}
.curr-item{display:flex;gap:16px;padding:14px;border-radius:16px;background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.09);cursor:pointer;transition:border-color .2s,transform .2s}
.curr-item:hover{border-color:var(--c,#10b981);transform:translateY(-2px)}
.curr-item img,.curr-ph{width:112px;height:112px;flex:none;border-radius:12px;object-fit:cover;background:var(--bg,rgba(16,185,129,.15));
  display:flex;align-items:center;justify-content:center;font-size:44px}
.curr-body h4{margin:0 0 4px;color:#fff;font-size:18px;font-weight:800}
.curr-body p{margin:0 0 8px;color:#cbd5e1;font-size:14px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.curr-badges{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.curr-badges span{font-size:11px;font-weight:700;padding:3px 9px;border-radius:6px;color:var(--c,#10b981);background:var(--bg,rgba(16,185,129,.15))}
.curr-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.curr-actions a,.curr-actions button,.readmore{font:inherit;font-size:13px;font-weight:800;border-radius:8px;padding:7px 13px;cursor:pointer;text-decoration:none}
.curr-actions a.go{background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;border:0}
.readmore{background:none;border:0;color:#6ee7b7;padding:7px 4px}

/* Platform grid */
.plat-grid{display:grid;gap:40px;grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.plat-card{position:relative;border-radius:16px;overflow:hidden;background:rgba(255,255,255,.04);border:2px solid rgba(255,255,255,.25);cursor:pointer;display:flex;flex-direction:column;box-shadow:0 8px 24px rgba(0,0,0,0.4)}
.plat-card:hover{border-color:#f59e0b;box-shadow:0 12px 32px rgba(245,158,11,0.25)}
.plat-img{height:220px;background:#0b1a12 center/cover no-repeat;display:flex;align-items:center;justify-content:center;font-size:54px}
.plat-ico{position:absolute;top:10px;right:10px;width:38px;height:38px;border-radius:50%;background:rgba(5,13,8,.8);display:flex;align-items:center;justify-content:center;font-size:20px}
.plat-txt{padding:14px}
.plat-txt h4{margin:0 0 4px;color:#fff;font-size:16px;font-weight:800}
.plat-txt p{margin:0 0 6px;color:#cbd5e1;font-size:13.5px;line-height:1.5}

/* NEW: Games Grid (Updated to support detached button clicking) */
.games-grid { display:grid; gap:40px; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); }
.game-card { background: #0b1a12; border: 1px solid #1a4a28; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: all 0.3s; }
.game-card:hover { transform: translateY(-5px); border-color: #f59e0b; box-shadow: 0 10px 20px rgba(245,158,11,0.2); }

/* Ensure pointer-events are disabled on the media elements so click passes to the .game-media-trigger wrapper */
.game-img, .game-video { height: 160px; width: 100%; object-fit: cover; display: block; pointer-events: none; }

.game-info { padding: 20px; flex-grow: 1; display:flex; flex-direction: column;}
.game-info h3 { color: #f9fafb; font-size: 18px; margin: 0 0 8px; font-weight: 800; }
.game-info p { color: #cbd5e1; font-size: 14px; margin: 0 0 15px; line-height: 1.5; flex-grow: 1; }

/* The actual clickable link button */
.game-btn { background: rgba(245,158,11,0.1); color: #fcd34d !important; font-weight: bold; font-size: 14px; border-radius: 8px; padding: 10px 16px; text-align: center; border: 1px solid rgba(245,158,11,0.3); transition: all 0.2s; cursor: pointer; }
.game-card:hover .game-btn { background: #f59e0b; color: #000 !important; }

/* NEW: FAQ Accordion */
.faq-container { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; transition: border-color 0.3s;}
.faq-item:hover { border-color: rgba(245, 158, 11, 0.4); }
.faq-q { padding: 18px 24px; color: #f9fafb; font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { background: rgba(255,255,255,0.06); }
.faq-q::after { content: '+'; color: #f59e0b; font-size: 26px; font-weight: 400; transition: transform 0.3s; line-height: 1; }
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 24px 24px; color: #cbd5e1; font-size: 15px; line-height: 1.6; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 10px; padding-top: 20px; }

/* Split popup */
#split-modal{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;padding:16px;background:rgba(5,13,8,.88);backdrop-filter:blur(8px)}
#split-modal.open{display:flex}
.sm-box{position:relative;display:grid;grid-template-columns:1.2fr 1fr;max-width:1000px;width:100%;max-height:90vh;border-radius:20px;overflow:hidden;background:#0b1a12;border:1px solid rgba(245,158,11,.4)}
.sm-img{background:#050d08 center/contain no-repeat;min-height:320px;display:flex;align-items:center;justify-content:center;font-size:96px}
.sm-img img{width:100%;height:100%;object-fit:contain}
.sm-txt{padding:28px 24px;overflow:auto;color:#e2e8f0;line-height:1.65}
.sm-txt h3{margin:0 0 10px;color:#fff;font-size:24px;font-weight:900}
.sm-txt .go{display:inline-block;margin-top:14px;padding:10px 18px;border-radius:10px;background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;font-weight:800;text-decoration:none}
.sm-x{position:absolute;top:8px;right:12px;z-index:2;background:rgba(0,0,0,.5);color:#fff;border:0;border-radius:50%;width:36px;height:36px;font-size:22px;cursor:pointer}

@media(max-width:720px){.sm-box{grid-template-columns:1fr;overflow:auto}.sm-img{min-height:220px}.curr-item img,.curr-ph{width:84px;height:84px}}
:focus-visible{outline:2px solid #fcd34d;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.rot-banner a{animation:none}}

/* Fix Top Spacings */
.hero-section { padding-top: 15px !important; padding-bottom: 15px !important; }
.testimonials-section { padding: 30px 0 0 !important; }

@media (max-width: 768px) {
    .kloot-hero-grid { padding-top: 10px !important; padding-bottom: 10px !important; gap: 20px; }
}

/* Smart gap for mobile to ensure isolated video viewing */
@media (max-width: 768px) {
    .plat-grid, .games-grid { gap: 80px; }
}

/* --- HERO SECTION SPACING FIXES --- */
.hero-section { padding-top: 10px !important; }
.kloot-hero-grid { padding-top: 0px !important; width: 88% !important; max-width: 1500px !important; }
@media (max-width: 768px) { .kloot-hero-grid { width: 92% !important; } }
.games-grid { gap: 60px !important; }
@media (max-width: 768px) { .games-grid { gap: 100px !important; } }


/* ==============================================================
   HERO GRAPHIC BACKGROUND FIX (Forces the book image to fit beautifully)
   This fixes the massive stretched image issue on mobile devices.
============================================================== */
.hero-graphic {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.hero-graphic-circle {
    position: relative;
    width: 320px;
    height: 320px;
    max-width: 100%; /* Prevents breaking on very small screens */
    margin: 0 auto;
    
    /* If the book is applied as a background image, this forces it to fit perfectly */
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* If the book was inserted as an actual <img> tag by Moodle */
.hero-graphic-circle > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain !important; /* Scales image to fit without stretching */
    z-index: 0;
    pointer-events: none;
}

/* Keep the glowing letter overlay on top of the book */
.hero-graphic-ring, 
.hero-graphic-glow, 
.hero-graphic-center {
    z-index: 2 !important;
}


/* ==============================================================
   MOBILE TYPOGRAPHY & FLOATING GAMEPAD OVERLAP FIX
============================================================== */
@media (max-width: 768px) {
    /* Make section headings & intros easier to scan on narrow phone screens */
    .hx-head {
        text-align: center;
    }
    .hx-head h2 {
        font-size: 26px !important;
        line-height: 1.2 !important;
        letter-spacing: -0.02em;
    }
    .hx-head p {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Move the floating 🎮 console tab out of the middle reading zone on phones */
    #master-gamepad-toggle {
        top: auto !important;
        bottom: 24px !important;
        transform: none !important;
        font-size: 22px !important;
        padding: 10px 12px !important;
        border-radius: 14px 0 0 14px !important;
        opacity: 0.92;
    }
}