body {
    font-family: 'Sora', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    /* Light mode bg */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.5s ease-in-out;
    /* Smooth transition for theme change */
}

.dark body {
    background-color: #000;
    /* Pure black background */
}

/* 🌞 Light mode portal cards */
html:not(.dark) .portal-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(147, 51, 234, 0.15); /* faint purple border */
  box-shadow: 0 8px 20px rgba(147, 51, 234, 0.1); /* soft purple shadow */
  transition: all 0.3s ease;
}

html:not(.dark) .portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.2);
}

/* 🌞 Light mode footer */
html:not(.dark) footer {
  color: #4b5563; /* slate-600, more visible than gray-200 */
}

/* 🌟 Glow divider only in Light mode */
html:not(.dark) .glow-divider {
  border: none;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(147, 51, 234, 0.7), /* purple in center */
    transparent
  );
  box-shadow: 0 0 8px rgba(147, 51, 234, 0.5);
  border-radius: 50%;
}

/* 🌞 Light mode dropdown visibility fix */
html:not(.dark) #language-switcher {
  background-color: #1f2937; /* dark slate bg */
  color: #ffffff;            /* white text */
  border: 1px solid #cbd5e1; /* subtle gray border */
}

/* 🌙 Dark mode dropdown (keep readable too) */
.dark #language-switcher {
  background-color: #f1f5f9; /* light gray bg */
  color: #1f2937;           /* dark text */
  border: 1px solid #475569; /* subtle dark border */
}


/* 🌞 Light mode portal cards */
html:not(.dark) .portal-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(147, 51, 234, 0.15); /* faint purple border */
  box-shadow: 0 8px 20px rgba(147, 51, 234, 0.1); /* soft purple shadow */
  transition: all 0.3s ease;
}

html:not(.dark) .portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.2);
}

/* 🌟 Light mode gradient headings (cyan + pink faint gradient) */
html:not(.dark) .gradient-text {
  background: linear-gradient(
    270deg,
    #3b82f6,   /* cyan-500 */
    #ec4899,   /* pink-500 */
    #06b6d4,   /* cyan-400 */
    #d946ef,   /* fuchsia-500 */
    #3b82f6    /* back to cyan */
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: animated-gradient 8s ease infinite;
}

@keyframes animated-gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* 🌞 Light mode footer */
html:not(.dark) footer {
  color: #4b5563; /* slate-600, more visible than gray-200 */
}
/* Dynamic Ripple Background */
.background-ripples {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Behind content */
}

.ripple {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(80px);
    /* Soft blur effect */
}

.r1 {
    width: 50vmax;
    height: 50vmax;
    background: rgba(0, 255, 255, 0.2);
    /* Cyan */
    animation: move-ripple 25s linear infinite;
}

.r2 {
    width: 40vmax;
    height: 40vmax;
    background: rgba(79, 70, 229, 0.2);
    /* Indigo */
    animation: move-ripple 30s linear infinite -10s;
    /* offset animation */
}

.r3 {
    width: 30vmax;
    height: 30vmax;
    background: rgba(167, 139, 250, 0.2);
    /* Violet */
    animation: move-ripple 20s linear infinite -5s;
}

@keyframes move-ripple {
    0% {
        transform: translate(10vw, 80vh) scale(1);
    }

    25% {
        transform: translate(80vw, 10vh) scale(0.8);
    }

    50% {
        transform: translate(50vw, 90vh) scale(1.2);
    }

    75% {
        transform: translate(20vw, 20vh) scale(1.1);
    }

    100% {
        transform: translate(10vw, 80vh) scale(1);
    }
}


/* Page transition animation */
.page {
    display: none;
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Awesome 3D Card Style --- */
.portal-card {
    border-radius: 1.75rem;
    /* 28px */
    cursor: pointer;
    position: relative;
    background: transparent;
    /* Changed for glassmorphism */
    transform-style: preserve-3d;
    perspective: 1000px;
    overflow: hidden;
    /* Moved here to prevent clipping */
}

.portal-card-content {
    background: #1e293b;
    border-radius: 1.6rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    will-change: transform;
}

.dark .portal-card-content {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Shine effect */
.portal-card-content::before {
    content: '';
    position: absolute;
    top: var(--shine-y, -120px);
    left: var(--shine-x, -120px);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 35%, rgba(255, 255, 255, 0) 60%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.25s ease-out;
    pointer-events: none;
}

.portal-card:hover .portal-card-content::before {
    opacity: 1;
}

/* Steam-like sweeping glare */
.portal-card-content::after {
    content: '';
    position: absolute;
    inset: -20%;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0) 60%);
    transform: translateX(-140%) rotate(8deg);
    opacity: 0;
    pointer-events: none;
}

.portal-card:hover .portal-card-content::after {
    animation: sheenSweep 1.2s ease-out forwards;
    opacity: 1;
}

@keyframes sheenSweep {
    from {
        transform: translateX(-140%) rotate(8deg);
    }

    to {
        transform: translateX(140%) rotate(8deg);
    }
}

.light .portal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.light .portal-card:hover {
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.25);
    transform: translateY(-4px);
}

.portal-card .fa-solid {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #c4b5fd;
    height: 4rem;
    width: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
    /* Smooth icon movement */
}

.portal-card-content h3,
.portal-card-content p,
.portal-card-content button {
    transition: transform 0.3s;
    /* Smooth text/button movement */
}


/* Glassmorphism for other containers */
.dark .glass-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light mode glass container */
.glass-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Option button styling */
.option-btn {
    width: 100%;
    padding: 1rem;
    background: #f3f4f6;
    /* gray-100 */
    border-radius: 0.5rem;
    text-align: left;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.dark .option-btn {
    background: #334155;
    color: #e5e7eb;
}

/* slate-700 */
.option-btn:hover {
    transform: scale(1.05);
    background: #dbeafe;
}

/* blue-100 */
.dark .option-btn:hover {
    background: #1e3a8a;
}

/* blue-900 */

.option-btn.correct {
    background: #22c55e;
    color: #ffffff;
    font-weight: 700;
}

.option-btn.incorrect {
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
}

.option-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Cute pop animation for the score */
.score-pop {
    animation: pop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Animated theme icon */
#theme-icon-container svg {
    display: none;
    animation: spin-in 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html:not(.dark) #sun-icon {
    display: block;
}

.dark #moon-icon {
    display: block;
}

@keyframes spin-in {
    from {
        transform: rotate(-180deg) scale(0.5);
        opacity: 0;
    }

    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

.typewriter h1 {
    font-weight: 800;
    background: linear-gradient(270deg, #db2777, #8b5cf6, #06b6d4, #db2777);
    background-size: 800% 800%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}





/* --- RESTYLIZED COOL FORMS --- */
.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    /* slate-500 */
    transition: color 0.3s ease;
}

.cool-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    /* slate-700 */
    border-radius: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    /* left for icon */
    font-size: 1rem;
    color: #ffffff;
    caret-color: #ffffff;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.cool-input::placeholder {
    color: transparent;
}

.cool-input:focus {
    outline: none;
    border-color: #4f46e5;
}

.input-group .cool-label {
    position: absolute;
    left: 2.5rem;
    top: 0.875rem;
    color: #94a3b8;
    /* slate-400 */
    font-size: 1rem;
    line-height: 1.25rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cool-input:focus+.cool-label,
.cool-input:not(:placeholder-shown)+.cool-label {
    top: -0.5rem;
    left: 2rem;
    font-size: 0.75rem;
    color: #60a5fa;
    /* indigo-ish */
    background: #0f172a;
    /* slate-900 */
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

.cool-input:focus~.input-icon {
    color: #60a5fa;
}

.select-wrapper {
    position: relative;
}

.select-wrapper .fa-chevron-down {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}


/* Student Portal & Games Hub & Teacher Portal Specific Styles */
.learning-path-item.locked,
.game-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.learning-path-item.locked .start-btn,
.game-card.locked button {
    background-color: #4a5568;
    cursor: not-allowed;
}

.stylish-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #4f46e5;
    color: #ffffff;
    font-weight: 600;
    border-radius: 9999px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.stylish-btn:hover {
    background: #4338ca;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.custom-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid #475569;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.custom-file-btn:hover {
    background: #334155;
    border-color: #4f46e5;
}

/* Teacher Portal Tabs */
.tab-btn {
    width: 100%;
    text-align: center;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9ca3af;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-btn.active {
    background: #4f46e5;
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

/* Speed Arithmetic Game Styles */
#speed-arithmetic-modal {
    display: none;
}

#speed-arithmetic-modal.active {
    display: flex;
}

#game-problem {
    font-size: 3rem;
    font-weight: 700;
}

#game-answer {
    text-align: center;
    font-size: 2rem;
}

/* Student Report Modal */
#student-report-modal {
    display: none;
}

#student-report-modal.active {
    display: flex;
}

/* Offline banner */
.offline-banner {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #b45309;
    /* amber-700 */
    color: #fff7ed;
    /* amber-50 */
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: top 0.3s ease;
}

.offline-banner.show {
    top: 0;
}

/* Card and portal hover polish */
.portal-card:hover .portal-card-content {
    transform: translateY(-4px);
}

.portal-card:hover .fa-solid {
    transform: translateY(-2px) scale(1.05);
}

/* Game cards consistency */
.game-card {
    min-height: 14rem;
}

/* Progress bar */
.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #4f46e5);
    transition: width 0.2s linear;
}

/* Locked overlay for game cards */
.locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-weight: 700;
    border-radius: 1rem;
}

/* Badges grid */
#badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.badge-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.25);
    color: #e9e5ff;
}

.badge-chip i {
    color: #fbbf24;
}

.badge-chip .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.badge-chip .meta .name {
    font-weight: 700;
    font-size: 0.9rem;
}

.badge-chip .meta .desc {
    font-size: 0.75rem;
    color: #a5b4fc;
}

/* Improved chip styles */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .25rem .5rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 600;
}

.chip-success {
    background: rgba(34, 197, 94, .18);
    color: #a7f3d0;
    border: 1px solid rgba(34, 197, 94, .35);
}

.chip-info {
    background: rgba(56, 189, 248, .18);
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, .35);
}

.chip-improved {
    background: rgba(250, 204, 21, .2);
    color: #fef3c7;
    border: 1px solid rgba(250, 204, 21, .35);
}

.chip-active {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4) inset;
}

/* Game modal polish */
.game-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.game-modal .modal-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 1rem;
    width: 100%;
    max-width: 28rem;
}

.game-modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.game-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

body.modal-open {
    overflow: hidden;
}

/* Sleek Glassmorphism + Gradient Glow Enhancements */
/* Gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Elevated glass card with gradient border */
.glass-container {
    position: relative;
    border: 1px solid transparent;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(79, 70, 229, 0.35), rgba(6, 182, 212, 0.35));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 6px 30px rgba(2, 6, 23, 0.35);
}

.dark .glass-container {
    background-image:
        linear-gradient(rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.4)),
        linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(59, 130, 246, 0.35), rgba(34, 197, 94, 0.35));
}

.glass-container:hover {
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* ===============================
   PORTAL CARD BORDER (always visible)
=============================== */
.portal-card-content {
    border: 2px solid rgba(255, 255, 255, 0.25);
    /* visible at all times */
    border-radius: 1.25rem;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg,
            rgba(124, 58, 237, 0.45),
            rgba(79, 70, 229, 0.4),
            rgba(6, 182, 212, 0.4));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 250% 250%;
    animation: borderShift 10s linear infinite;
    transition: box-shadow .3s ease, border .3s ease;
    position: relative;
}

/* Glow outline effect (instead of border expansion hiding content) */
.portal-card-content::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 1.5rem;
    background: linear-gradient(135deg,
            rgba(124, 58, 237, 0.65),
            rgba(6, 182, 212, 0.65),
            rgba(255, 255, 255, 0.35));
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
    animation: borderShift 8s linear infinite;
}

/* On hover, increase glow */
.portal-card:hover .portal-card-content::before {
    opacity: 0.9;
}

/* ===============================
   VIBRANT BUTTONS (lighter + colorful)
=============================== */
.portal-card-content span {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Explore Button */
.btn-explore {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent 40%),
        linear-gradient(135deg, #86efac, #4ade80, #22c55e);
    color: #064e3b;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    border-radius: 30px; /* liquid morph base */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-explore:hover {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25), transparent 40%),
        linear-gradient(135deg, #bbf7d0, #86efac, #4ade80);
    border-radius: 12px; /* morph */
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.55);
}

/* Liquid glow pseudo-element */
.btn-explore,
.btn-play,
.btn-open {
        position: relative;
        isolation: isolate; /* contain the glow */
}

.btn-explore::after,
.btn-play::after,
.btn-open::after {
        content: "";
        position: absolute;
        inset: -4px;
        border-radius: inherit;
        background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,0.25), rgba(255,255,255,0) 70%), var(--btn-liquid-bg, transparent);
        filter: blur(10px);
        opacity: 0;
        transform: scale(0.98);
        transition: opacity .4s ease, transform .4s ease, filter .4s ease;
        z-index: -1;
}

.btn-explore:hover::after,
.btn-play:hover::after,
.btn-open:hover::after {
        opacity: 1;
        transform: scale(1.03);
        filter: blur(14px);
        animation: blobWobble 2.4s ease-in-out infinite;
}

/* Themed liquid tints per button */
.btn-explore { --btn-liquid-bg: linear-gradient(135deg, rgba(34,197,94,.35), rgba(16,185,129,.25)); }
.btn-play    { --btn-liquid-bg: linear-gradient(135deg, rgba(249,115,22,.35), rgba(245,158,11,.25)); }
.btn-open    { --btn-liquid-bg: linear-gradient(135deg, rgba(59,130,246,.35), rgba(147,197,253,.25)); }

@keyframes blobWobble {
    0%   { transform: scale(1.03) translate(0, 0); }
    25%  { transform: scale(1.04) translate(1px, -1px); }
    50%  { transform: scale(1.02) translate(-1px, 1px); }
    75%  { transform: scale(1.035) translate(1px, 1px); }
    100% { transform: scale(1.03) translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .btn-explore:hover::after,
    .btn-play:hover::after,
    .btn-open:hover::after {
        animation: none;
    }
}

/* Play Button */
.btn-play {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent 40%),
        linear-gradient(135deg, #fdba74, #fb923c, #f97316);
    color: #7c2d12;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
    border-radius: 30px; /* liquid morph base */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-play:hover {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25), transparent 40%),
        linear-gradient(135deg, #fed7aa, #fdba74, #fb923c);
    border-radius: 12px; /* morph */
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(234, 88, 12, 0.55);
}

/* Open Button */
.btn-open {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent 40%),
        linear-gradient(135deg, #93c5fd, #60a5fa, #3b82f6);
    color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    border-radius: 30px; /* liquid morph base */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-open:hover {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25), transparent 40%),
        linear-gradient(135deg, #bfdbfe, #93c5fd, #60a5fa);
    border-radius: 12px; /* morph */
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.55);
}



/* Stylish gradient button with glow */
.stylish-btn {
    background: linear-gradient(135deg, #7c3aed, #4f46e5, #06b6d4);
    background-size: 200% 200%;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.stylish-btn:hover {
    background-position: 100% 0%;
    box-shadow: 0 14px 36px rgba(79, 70, 229, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.stylish-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

/* Modal card glow and gradient border */
.game-modal .modal-card {
    border: 1px solid transparent;
    background-image:
        linear-gradient(rgba(30, 41, 59, 0.7), rgba(30, 41, 59, 0.6)),
        linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(59, 130, 246, 0.35), rgba(34, 197, 94, 0.35));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 10px 50px rgba(2, 6, 23, 0.6), 0 0 60px rgba(99, 102, 241, 0.15);
}

/* Themed glowing divider */
.glow-divider {
  position: relative;
  height: 2px;
  border: none;
  background: linear-gradient(
    to right,
    rgba(124, 58, 237, 0),   /* purple faint left */
    rgba(124, 58, 237, 0.6), /* brighter near center */
    #06b6d4,                 /* cyan highlight center */
    rgba(124, 58, 237, 0.6), /* brighter near center */
    rgba(124, 58, 237, 0)    /* purple faint right */
  );
  filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.7));
  border-radius: 9999px;
  overflow: hidden;
}


/* Pulse glow utility */
@keyframes glowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, .5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.glow-pulse {
    animation: glowPulse 2s infinite;
}

/* Navbar pulse button effect (brand-colored, gentle) */
.btn-pulse:hover {
    animation: navPulse 1.35s ease-in-out infinite;
}

@keyframes navPulse {
    0% {
        transform: translateY(-2px) scale(1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.55);
    }
    70% {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 0 0 12px rgba(79, 70, 229, 0);
    }
    100% {
        transform: translateY(-2px) scale(1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-pulse:hover {
        animation: none;
    }
}

/* Tilt effect base */
.portal-card {
    transform-style: preserve-3d;
}

.portal-card[data-tilt] .portal-card-content {
    transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
    transition: transform .18s ease;
}

/* Subtle idle float when not hovered */
@media (prefers-reduced-motion: no-preference) {
    .portal-card:not(:hover) .portal-card-content {
        animation: floaty 5.5s ease-in-out infinite;
    }
}

@keyframes floaty {

    0%,
    100% {
        transform: translateY(0) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
    }

    50% {
        transform: translateY(-3px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
    }
}

/* Button ripple */
.stylish-btn {
    position: relative;
    overflow: hidden;
}

.stylish-btn .btn-ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
    animation: ripple .6s ease-out forwards;
}

@keyframes ripple {
    from {
        opacity: .6;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(16);
    }
}

/* Modal pop animation */
.game-modal {
    opacity: 0;
    transition: opacity .2s ease;
}

.game-modal.active,
.game-modal[style*="display: flex"] {
    opacity: 1;
}

.game-modal .modal-card {
    transform: scale(.96);
    opacity: 0;
    animation: modalPop .18s ease forwards;
}

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

/* Skeleton shimmer */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.15);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.1s infinite;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

/* Role visibility utilities */
.role-student .only-teacher {
    display: none !important;
}

.role-teacher .only-student {
    display: none !important;
}

.role-guest .only-teacher,
.role-guest .only-student {
    display: none !important;
}

/* Minimalist theme layer */
body.minimalist {
    --card-bg: rgba(17, 24, 39, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-2: #06b6d4;
}

body.minimalist .glass-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 6px 24px rgba(2, 6, 23, 0.35);
}

body.minimalist .stylish-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    background-size: 120% 120%;
    border-radius: 12px;
    padding: 0.6rem 1.1rem;
}

body.minimalist .stylish-btn:hover {
    transform: translateY(-1px);
}

body.minimalist .portal-card-content {
    border-radius: 1.25rem;
}

body.minimalist .chip {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.minimalist .input-group .cool-label {
    color: var(--text-muted);
}

body.minimalist .cool-input {
    border-color: var(--card-border);
    background: rgba(15, 23, 42, 0.6);
}

body.minimalist .cool-input:focus {
    border-color: var(--accent);
}

body.minimalist .badge-chip {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

/* Base button */
.stylish-btn {
  position: relative;
  overflow: hidden;
  border: none;
  outline: none;
  border-radius: 0.75rem; /* same rounding as your design */
  background: #111827; /* fallback bg */
  color: white;
  padding: 0.5rem 1.25rem;
  z-index: 1;
}

/* 🚫 Clean default state */
#language-switcher-btn {
  transform: scale(1); /* keep it stable */
}

/* 🌟 Transition + scale only on hover/focus */
#language-switcher-btn:hover,
#language-switcher-btn:focus {
  transform: scale(1.05);
  transition: transform 0.2s ease; 
}

/* Inner content stays above */
button span,
button i {
  position: relative;
  z-index: 2;
}

@keyframes spinRainbow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.stylish-btn {
  position: relative;
  padding: 0.5rem 1.2rem;
  border-radius: 12px;
  background: #0f172a !important; /* Solid inner bg */
  color: #fff;
  font-weight: 600;
  transition: color 0.3s ease, background 0.3s ease;
  z-index: 1;
}

/* Dark mode variant */
.dark .stylish-btn {
  background: #1e293b;
  color: #f8fafc;
}

/* Default cyan border */
.stylish-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px; /* border thickness */
  background: linear-gradient(90deg, #06b6d4, #22d3ee); /* cyan-ish gradient border */
  background-size: 300% 300%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 1; /* visible by default */
  transition: opacity 0.3s ease;
  z-index: -1;
}

/* On hover: cyan border fades, rainbow animates in */
.stylish-btn:hover::before {
  background: linear-gradient(90deg, #ff0080, #7928ca, #2af598, #f9d423);
  background-size: 300% 300%;
  opacity: 1;
  animation: border-flow 3s linear infinite;
}

@keyframes border-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}



/* Micro-interactions and focus-visible */
*:focus {
    outline: none;
}

:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
    border-radius: 10px;
}

.stylish-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.portal-card {
    transition: transform .2s ease, box-shadow .25s ease;
}

.portal-card:hover .portal-card-content {
    transform: translateY(-3px);
}

/* Reveal animations (opt-in via class) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .5s ease, transform .5s ease;
    }

    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrolling and subtle link animations */
html {
    scroll-behavior: smooth;
}

a {
    transition: color .2s ease, opacity .2s ease;
}

a:hover {
    opacity: .9;
}

/* Reduced motion: tone down elaborate animations */
@media (prefers-reduced-motion: reduce) {
    .portal-card-content {
        transition: transform .1s ease;
    }

    .portal-card-content::after {
        display: none;
    }

    .portal-card:not(:hover) .portal-card-content {
        animation: none;
    }

    .stylish-btn .btn-ripple {
        display: none;
    }
}

/* Fix clipping for Brainiac brand in header */
header h1 {
  line-height: 1.4;     /* give breathing space */
  padding-top: 2px;     /* avoid top cut */
  padding-bottom: 2px;  /* avoid bottom cut */
}

/* Fix clipping for the big Hindi heading */
.gradient-text {
  line-height: 1.4;     
  padding-top: 10px;
  padding-bottom: 4px;
}
