/* ========================================
   COTE: ULTIMATUM - OAA Website Styles
   PC-Optimized Version
   ======================================== */

:root {
    /* Core Colors - Deep Navy (from colors.png) */
    --bg-primary: #050a12;
    --bg-secondary: #0a1220;
    --bg-tertiary: #0c1628;
    --bg-card: #0f1a2e;
    --bg-card-hover: #132238;

    /* Accent Colors - Cool Blue (refined from cyan) */
    --cyan: #4dc9e6;
    --cyan-dim: #3a9db8;
    --cyan-glow: rgba(77, 201, 230, 0.35);
    --cyan-subtle: rgba(77, 201, 230, 0.1);

    /* Accent Colors - Crimson (from uniforms in colors.png) */
    --crimson: #7a2438;
    --crimson-light: #9a2e48;
    --crimson-glow: rgba(122, 36, 56, 0.4);

    /* Class Colors - Pink to Crimson gradient */
    --class-a: #fecdd3;
    --class-a-glow: rgba(254, 205, 211, 0.4);
    --class-b: #fda4af;
    --class-b-glow: rgba(253, 164, 175, 0.4);
    --class-c: #e11d48;
    --class-c-glow: rgba(225, 29, 72, 0.4);
    --class-d: #881337;
    --class-d-glow: rgba(136, 19, 55, 0.4);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Stat bar colors */
    --stat-bar-bg: #151f30;
    --stat-bar-fill: linear-gradient(90deg, #3a9db8, #4dc9e6);

    /* Sizing */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --glow-spread: 0 0 20px var(--cyan-glow);
    --glow-crimson: 0 0 20px var(--crimson-glow);
    --max-width: 1400px;
}

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

html {
    font-size: 16px;
}

/* Custom cursor - applied globally */
*, *::before, *::after {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='2' fill='%234dc9e6'/%3E%3Ccircle cx='10' cy='10' r='6' fill='none' stroke='%234dc9e6' stroke-width='1' opacity='0.5'/%3E%3C/svg%3E") 10 10, crosshair !important;
}

/* Pointer cursor for clickable elements and ALL their children */
a, button, [role="button"], input[type="submit"], input[type="button"],
.app-icon, .class-card, .student-card, .student-preview,
.back-link, .nav-btn, .lock-btn, .view-all-link,
#lock-screen,
/* Include all descendants of clickable elements */
a *, button *, [role="button"] *,
.app-icon *, .class-card *, .student-card *, .student-preview *,
.back-link *, .nav-btn *, .lock-btn *, .view-all-link *,
#lock-screen *,
.enter-hint, .enter-hint *,
.key-hint, .key-hint * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='3' fill='%234dc9e6'/%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='%234dc9e6' stroke-width='1.5' opacity='0.6'/%3E%3C/svg%3E") 10 10, pointer !important;
}

/* Text cursor for input fields */
input[type="text"], input[type="search"], textarea, .search-input {
    cursor: text !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Subtle vignette overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
}

/* Subtle scan lines overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.5;
}

/* Noise texture overlay for film grain effect */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9996;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========================================
   PAGE CONTAINER
   ======================================== */

.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    border-left: 1px solid rgba(0, 245, 255, 0.05);
    border-right: 1px solid rgba(0, 245, 255, 0.05);
    box-shadow:
        -20px 0 60px rgba(0, 0, 0, 0.5),
        20px 0 60px rgba(0, 0, 0, 0.5);
}

/* ========================================
   BOOT SCREEN
   ======================================== */

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: bootFadeOut 0.8s ease 2.2s forwards;
}

@keyframes bootFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.boot-content {
    text-align: center;
}

.boot-logo {
    font-family: 'Orbitron', monospace;
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.1em;
    /* Glitch the whole COTE: logo using same effect as lock screen hover */
    animation: glitchEffect 0.15s ease 0.9s 2;
}

.boot-letter {
    opacity: 0;
    animation: bootLetterIn 0.3s ease forwards;
    color: var(--cyan);
    text-shadow: 0 0 30px var(--cyan-glow);
    text-transform: uppercase;
}

.boot-c { animation-delay: 0.1s; }
.boot-o { animation-delay: 0.2s; }
.boot-t { animation-delay: 0.3s; }
.boot-e { animation-delay: 0.4s; }

.boot-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--crimson-light);
    letter-spacing: 0.5em;
    margin-right: -0.5em; /* Compensate for letter-spacing */
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: bootSubtitleIn 0.5s ease 0.6s forwards;
    text-shadow: 0 0 20px var(--crimson-glow);
    text-transform: uppercase;
}

@keyframes bootSubtitleIn {
    from {
        opacity: 0;
        letter-spacing: 1em;
    }
    to {
        opacity: 1;
        letter-spacing: 0.5em;
    }
}

@keyframes bootLetterIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.boot-loader {
    width: 200px;
    height: 3px;
    background: rgba(77, 201, 230, 0.2);
    border-radius: 3px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.boot-loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--crimson-light));
    border-radius: 3px;
    animation: bootLoad 1.8s ease 0.5s forwards;
    box-shadow: 0 0 10px var(--cyan-glow);
}

@keyframes bootLoad {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

.boot-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.3em;
    opacity: 0;
    animation: bootTextIn 0.5s ease 0.6s forwards;
}

@keyframes bootTextIn {
    to { opacity: 1; }
}

/* ========================================
   SCREEN SYSTEM
   ======================================== */

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: screenFadeIn 0.5s ease-out;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   STARFIELD BACKGROUND
   ======================================== */

.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    opacity: 0;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--opacity); transform: scale(1); }
}

.particle {
    position: absolute;
    background: var(--cyan);
    border-radius: 50%;
    animation: float var(--duration) ease-in-out infinite;
    opacity: 0;
    filter: blur(1px);
}

@keyframes float {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: var(--opacity);
    }
    90% {
        opacity: var(--opacity);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* Shooting star effect */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow:
        0 0 6px 2px rgba(255, 255, 255, 0.8),
        0 0 12px 4px rgba(77, 201, 230, 0.5);
    animation: shootingStar var(--duration) linear forwards;
    pointer-events: none;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: var(--tail-length, 80px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 201, 230, 0.6), white);
    transform: translateY(-50%);
}

@keyframes shootingStar {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(var(--angle));
    }
    100% {
        opacity: 0;
        transform: translate(var(--distance-x), var(--distance-y)) rotate(var(--angle));
    }
}

/* ========================================
   LOCK SCREEN
   ======================================== */

#lock-screen {
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.92) 0%, rgba(5, 10, 18, 0.95) 100%);
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* Smooth aurora background effect */
#lock-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(122, 36, 56, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(77, 201, 230, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 100% 60% at 50% 100%, rgba(122, 36, 56, 0.2) 0%, transparent 60%);
    filter: blur(60px);
    animation: auroraFlow 30s ease-in-out infinite;
    pointer-events: none;
}

#lock-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 70% 70% at 70% 30%, rgba(77, 201, 230, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 100% at 30% 70%, rgba(122, 36, 56, 0.18) 0%, transparent 60%);
    filter: blur(80px);
    animation: auroraFlow 25s ease-in-out infinite reverse;
    animation-delay: -5s;
    pointer-events: none;
    z-index: 0;
}

@keyframes auroraFlow {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(0) translateY(0);
    }
    33% {
        opacity: 1;
        transform: translateX(30px) translateY(-20px);
    }
    66% {
        opacity: 0.8;
        transform: translateX(-20px) translateY(30px);
    }
}

.lock-content {
    text-align: center;
    padding: 3rem;
    z-index: 10;
    position: relative;
}

/* Decorative corner brackets */
.lock-content::before,
.lock-content::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--cyan-dim);
    pointer-events: none;
    opacity: 0.6; /* Show immediately with lower opacity */
}

.lock-content::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.lock-content::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.lock-time {
    font-family: 'Orbitron', monospace;
    font-size: 6rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.lock-date {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 6rem;
    letter-spacing: 0.05em;
}

.lock-branding {
    margin-bottom: 6rem;
}

.lock-title {
    font-family: 'Orbitron', monospace;
    font-size: 5rem;
    font-weight: 900;
    color: var(--cyan);
    text-shadow:
        0 0 20px var(--cyan-glow),
        0 0 40px var(--cyan-glow),
        0 0 60px rgba(0, 245, 255, 0.2);
    letter-spacing: 0.4em;
    margin-right: -0.4em; /* Compensate for letter-spacing on last letter */
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    position: relative;
    animation: titleGlow 4s ease-in-out infinite;
}

.lock-title.glitching {
    animation: glitchEffect 0.15s ease;
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
        text-shadow:
            0 0 20px var(--cyan-glow),
            0 0 40px var(--cyan-glow),
            0 0 60px rgba(0, 245, 255, 0.2);
    }
    50% {
        filter: brightness(1.1);
        text-shadow:
            0 0 30px var(--cyan-glow),
            0 0 60px var(--cyan-glow),
            0 0 90px rgba(0, 245, 255, 0.3);
    }
}

.lock-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--crimson-light);
    letter-spacing: 0.6em;
    margin-right: -0.6em; /* Compensate for letter-spacing */
    text-shadow: 0 0 20px var(--crimson-glow);
    text-transform: uppercase;
}

.enter-hint {
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    transition: color 0.3s ease;
}

.enter-hint:hover {
    color: var(--text-secondary);
}

.enter-hint:hover .enter-key {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-subtle);
}

.enter-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ========================================
   HOME SCREEN
   ======================================== */

#home-screen {
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.90) 0%, rgba(5, 10, 18, 0.93) 100%);
    position: relative;
    overflow: hidden;
}

#home-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 90% 50% at 20% 30%, rgba(77, 201, 230, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 70% 80% at 80% 70%, rgba(122, 36, 56, 0.2) 0%, transparent 70%);
    filter: blur(70px);
    animation: auroraFlow 28s ease-in-out infinite;
    animation-delay: -10s;
    pointer-events: none;
}

#home-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 60% 60% at 60% 20%, rgba(122, 36, 56, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 40% 80%, rgba(77, 201, 230, 0.08) 0%, transparent 60%);
    filter: blur(90px);
    animation: auroraFlow 35s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
}

.home-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 20;
    position: relative;
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.6) 0%, transparent 100%);
}

.home-header .header-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.home-header .header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.home-brand {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: center;
}

.home-brand-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px var(--cyan-glow);
    text-transform: uppercase;
}

.home-brand-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: var(--crimson-light);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.home-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-time {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.lock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lock-btn:hover {
    background: var(--cyan-subtle);
    border-color: var(--cyan);
    color: var(--cyan);
}

.lock-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

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

.lock-btn svg {
    width: 20px;
    height: 20px;
}

.home-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 3rem;
    z-index: 10;
    position: relative;
}

/* App Dock */
.app-dock {
    display: flex;
    gap: 2rem;
    padding: 2rem 3rem;
    background: linear-gradient(135deg, rgba(10, 20, 40, 0.7) 0%, rgba(15, 26, 46, 0.6) 100%);
    border: 1px solid rgba(77, 201, 230, 0.2);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(77, 201, 230, 0.1);
}

/* Animated border glow */
.app-dock::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--cyan), transparent, var(--crimson-light), transparent, var(--cyan));
    background-size: 400% 400%;
    border-radius: calc(var(--border-radius-lg) + 2px);
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 8s ease infinite;
}

.app-dock::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 201, 230, 0.4), transparent);
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.5rem;
}

.app-icon:hover {
    /* Glitch effect handled by JS */
}

.app-icon:active {
    transform: scale(0.95);
}

.app-icon:focus-visible {
    outline: none;
}

.app-icon:focus-visible .app-icon-image {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}

.app-icon-image {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--cyan-dim);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        var(--glow-spread),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.app-icon-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.app-icon:hover .app-icon-image {
    border-color: var(--cyan);
}

.app-icon-image svg {
    width: 48px;
    height: 48px;
    color: var(--cyan);
    filter: drop-shadow(0 0 10px var(--cyan-glow));
}

.app-name {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* School Quote */
.school-quote {
    margin-top: 4rem;
    text-align: center;
    max-width: 600px;
    position: relative;
    padding: 0 2rem;
    min-height: 120px; /* Prevent layout shift when quote types in */
}

.school-quote::before,
.school-quote::after {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    color: var(--cyan);
    opacity: 0.15;
    position: absolute;
    line-height: 1;
}

.school-quote::before {
    content: '"';
    top: -1rem;
    left: 0;
}

.school-quote::after {
    content: '"';
    bottom: -1rem;
    right: 0;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.quote-attribution {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Keyboard hint */
.keyboard-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    z-index: 100;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: default;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.key-hint:hover {
    color: var(--text-secondary);
}

.key-hint:hover .key {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

/* OAA App keyboard hints */
.oaa-hints,
.events-hints {
    transition: bottom 0.3s ease, opacity 0.3s ease;
}

/* Move keyboard hints up when compare bar is active */
.compare-mode .oaa-hints {
    bottom: 7.5rem;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    transition: all 0.2s ease;
}

/* ========================================
   APP SCREENS - SHARED
   ======================================== */

.app-screen {
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.92) 0%, rgba(5, 10, 18, 0.95) 100%);
    position: relative;
    overflow: hidden;
}

.app-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 60% at 25% 20%, rgba(77, 201, 230, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 70% 70% at 75% 80%, rgba(122, 36, 56, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    animation: auroraFlow 32s ease-in-out infinite;
    animation-delay: -15s;
    pointer-events: none;
    z-index: 0;
}

.app-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(77, 201, 230, 0.08) 0%, transparent 60%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}

.app-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.95) 0%, rgba(10, 20, 40, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.app-header .nav-group {
    flex: 1;
}

.app-header .header-brand {
    flex: 1;
    justify-content: center;
}

.app-header .header-right {
    flex: 1;
    justify-content: flex-end;
}

.header-brand {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.brand-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px var(--cyan-glow);
}

.brand-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--crimson-light);
    letter-spacing: 0.3em;
    text-shadow: 0 0 10px var(--crimson-glow);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.5;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-hint {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
}

.nav-btn:hover {
    background: var(--cyan-subtle);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.nav-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

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

.nav-btn svg {
    width: 22px;
    height: 22px;
}

.app-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-glow);
    flex: 1;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Push to right edge */
}

.header-time {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* Shared top bar styling for consistent sort UI positioning */
.dashboard-header,
.class-view-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-left: -3rem;
    margin-right: -3rem;
    padding: 1.5rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.dashboard-header .filter-btn {
    margin-left: auto;
}

/* Favorites Filter Button */
.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--cyan-subtle);
    border-color: var(--cyan);
    color: var(--cyan);
}

.filter-btn.active {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f1c40f;
    color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

/* Sort Controls */
.sort-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sort-buttons {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sort-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sort-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.sort-btn.active {
    color: var(--cyan);
    background: rgba(77, 201, 230, 0.15);
    box-shadow: 0 0 10px rgba(77, 201, 230, 0.2);
}

/* Sort button colors by stat type */
.sort-btn[data-sort="default"] {
    color: var(--text-muted);
}
.sort-btn[data-sort="default"]:hover {
    color: var(--cyan);
    background: rgba(77, 201, 230, 0.1);
}
.sort-btn[data-sort="default"].active {
    color: var(--cyan);
    background: rgba(77, 201, 230, 0.15);
    box-shadow: 0 0 10px rgba(77, 201, 230, 0.2);
}

.sort-btn[data-sort="overall"] {
    color: #ef4444;
}
.sort-btn[data-sort="overall"]:hover {
    background: rgba(231, 76, 60, 0.15);
}
.sort-btn[data-sort="overall"].active {
    color: #ef4444;
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.sort-btn[data-sort="academic"] {
    color: #9b59b6;
}
.sort-btn[data-sort="academic"]:hover {
    background: rgba(155, 89, 182, 0.15);
}
.sort-btn[data-sort="academic"].active {
    color: #9b59b6;
    background: rgba(155, 89, 182, 0.2);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
}

.sort-btn[data-sort="intelligence"] {
    color: #f1c40f;
}
.sort-btn[data-sort="intelligence"]:hover {
    background: rgba(241, 196, 15, 0.15);
}
.sort-btn[data-sort="intelligence"].active {
    color: #f1c40f;
    background: rgba(241, 196, 15, 0.2);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.sort-btn[data-sort="decision"] {
    color: #e67e22;
}
.sort-btn[data-sort="decision"]:hover {
    background: rgba(230, 126, 34, 0.15);
}
.sort-btn[data-sort="decision"].active {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.2);
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.3);
}

.sort-btn[data-sort="physical"] {
    color: #2ecc71;
}
.sort-btn[data-sort="physical"]:hover {
    background: rgba(46, 204, 113, 0.15);
}
.sort-btn[data-sort="physical"].active {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.sort-btn[data-sort="cooperativeness"] {
    color: #3498db;
}
.sort-btn[data-sort="cooperativeness"]:hover {
    background: rgba(52, 152, 219, 0.15);
}
.sort-btn[data-sort="cooperativeness"].active {
    color: #3498db;
    background: rgba(52, 152, 219, 0.2);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    min-width: 250px;
}

.search-container:focus-within {
    border-color: var(--cyan);
    background: rgba(77, 201, 230, 0.05);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-container:focus-within .search-icon {
    color: var(--cyan);
}

.search-input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ========================================
   OAA APP - DASHBOARD
   ======================================== */

.app-view {
    display: none;
    padding: 0 3rem 3rem;
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

.app-view.active {
    display: block;
    animation: viewFadeIn 0.35s ease-out;
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.year-section {
    margin-bottom: 3rem;
    transition: margin-bottom 0.3s ease;
}

.year-section.collapsed {
    margin-bottom: 1.5rem;
}

.year-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(77, 201, 230, 0.15);
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: margin-bottom 0.3s ease;
}

.year-section.collapsed .year-header {
    margin-bottom: 0;
}

.year-toggle {
    margin-left: auto;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--cyan);
    border-bottom: 2px solid var(--cyan);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.year-section.collapsed .year-toggle {
    transform: rotate(-45deg);
}

.year-header:hover .year-toggle {
    opacity: 1;
}

/* Smooth, uniform collapse using a wrapper grid + 1fr→0fr trick.
   Keeps .year-section as a normal block (so hover translateY on
   member cards doesn't get clipped by the year layout) and only
   the inner wrapper does the animated clipping. */
.year-collapse {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.35s ease;
}
.year-section.collapsed .year-collapse {
    grid-template-rows: 0fr;
}
.year-collapse-inner {
    min-height: 0;
    overflow: clip;
    overflow-clip-margin: 8px; /* let hover lift breathe past the edge */
    opacity: 1;
    transition: opacity 0.25s ease;
}
.year-section.collapsed .year-collapse-inner {
    opacity: 0;
    pointer-events: none;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ===== Council / Faculty member cards ===== */
.member-card {
    position: relative;
    background: linear-gradient(160deg, rgba(16, 29, 50, 0.95) 0%, rgba(10, 18, 32, 0.95) 100%);
    border: 1px solid color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent);
    border-radius: 10px;
    padding: 2.25rem 1rem 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0),
                inset 0 0 24px color-mix(in srgb, var(--rank-color, var(--cyan)) 10%, transparent);
}
.member-card:hover {
    transform: translateY(-3px);
    border-color: var(--rank-color, var(--cyan));
    box-shadow: 0 8px 28px color-mix(in srgb, var(--rank-color, var(--cyan)) 35%, transparent),
                inset 0 0 32px color-mix(in srgb, var(--rank-color, var(--cyan)) 18%, transparent);
}
.member-card-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.35rem 0.75rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--rank-color, var(--cyan)) 85%, #000) 0%,
        var(--rank-color, var(--cyan)) 50%,
        color-mix(in srgb, var(--rank-color, var(--cyan)) 85%, #000) 100%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--rank-color, var(--cyan)) 45%, transparent);
}
.member-card-body {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
}
.member-avatar-frame {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--rank-color, var(--cyan));
    box-shadow: 0 0 12px color-mix(in srgb, var(--rank-color, var(--cyan)) 50%, transparent);
    display: inline-block;
}
.member-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.member-avatar-placeholder {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--rank-color, var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    color: var(--rank-color, var(--cyan));
    background: rgba(0, 0, 0, 0.3);
}
.member-card-info {
    flex: 1;
    min-width: 0;
}
.member-card-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-card-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    letter-spacing: 0.05em;
}
.member-card-stats {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    margin-top: 0.5rem;
}
.member-card.comparing {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan), 0 0 24px rgba(77, 201, 230, 0.5);
}
/* Compare checkbox sits inline at the end of the member card body, like the student preview */
.member-card .member-card-body > .compare-checkbox {
    margin-right: 0;
    margin-left: 0.25rem;
    align-self: center;
    flex-shrink: 0;
}

/* ===== Profile rank crest — appears above student name ===== */
.profile-rank-crest {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.5rem;
    padding-left: 0.9rem;
    border-left: 3px solid var(--rank-color, var(--cyan));
    line-height: 1;
}
.profile-rank-insignia {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    color: var(--rank-color, var(--cyan));
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent));
    flex-shrink: 0;
}
.profile-rank-insignia .rank-insignia-svg {
    width: 100%;
    height: 100%;
}
.profile-rank-text {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}
.profile-rank-crest .profile-rank-kind {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--rank-color, var(--cyan)) 75%, #fff);
    opacity: 0.9;
}
.profile-rank-crest .profile-rank-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rank-color, var(--cyan));
    text-shadow: 0 0 18px color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent),
                 0 2px 6px rgba(0, 0, 0, 0.6);
}
.profile-rank-crest .profile-rank-since {
    font-family: 'Orbitron', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--rank-color, var(--cyan)) 60%, #aab8d4);
    opacity: 0.85;
    margin-top: 0.1rem;
}
.profile-rank-quote {
    position: relative;
    margin: 1.1rem auto 0;
    padding: 0.4rem 2rem 0.6rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.55;
    color: color-mix(in srgb, var(--rank-color, var(--cyan)) 22%, #c8d2e2);
    max-width: 60ch;
    min-height: 2.6em;
    letter-spacing: 0.005em;
}
.profile-rank-quote::before,
.profile-rank-quote::after {
    font-family: 'Orbitron', monospace;
    font-size: 2.6rem;
    line-height: 1;
    position: absolute;
    color: var(--rank-color, var(--cyan));
    opacity: 0.35;
    text-shadow: 0 0 14px color-mix(in srgb, var(--rank-color, var(--cyan)) 40%, transparent);
}
.profile-rank-quote::before {
    content: '"';
    top: -0.6rem;
    left: 0;
}
.profile-rank-quote::after {
    content: '"';
    bottom: -0.9rem;
    right: 0;
}

/* When ranked, align student name + class line with the rank title text
   (i.e. start them at the same x as the title, past the insignia). */
.profile-card--ranked #profile-name,
.profile-card--ranked #profile-class {
    margin-left: calc(0.9rem + 3px);
}

/* Tab card insignia — small, top-right corner of the member card */
.member-card { position: relative; }
.member-card-insignia {
    position: absolute;
    top: 2.55rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    color: var(--rank-color, var(--cyan));
    opacity: 0.7;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rank-color, var(--cyan)) 60%, transparent));
    pointer-events: none;
    z-index: 2;
}
.member-card-insignia .rank-insignia-svg { width: 100%; height: 100%; }
.member-card:hover .member-card-insignia { opacity: 1; }

/* Rank sort row — sits inside the year-section under the header */
.sort-container.rank-sort,
.sort-container.year-sort {
    margin: 0.4rem 0 0.9rem 0;
    padding: 0 0.25rem;
    flex-wrap: wrap;
}

/* Tenure date picker — three fields side-by-side inside the admin modal */
.admin-tenure-fields {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}
.admin-tenure-fields .admin-tenure-day { flex: 0 0 5.5rem; }
.admin-tenure-fields .admin-tenure-month { flex: 1 1 auto; min-width: 0; }
.admin-tenure-fields .admin-tenure-year { flex: 0 0 6rem; }

.admin-form-locked {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Premium ranked profile card — "high-tier credit card" treatment ===== */
.profile-card.profile-card--ranked {
    border-color: var(--rank-color, var(--cyan));
    background:
        radial-gradient(ellipse at top left,
            color-mix(in srgb, var(--rank-color, var(--cyan)) 20%, transparent) 0%,
            transparent 55%),
        radial-gradient(ellipse at bottom right,
            color-mix(in srgb, var(--rank-color, var(--cyan)) 10%, transparent) 0%,
            transparent 60%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--rank-color, var(--cyan)) 7%, var(--bg-card)) 0%,
            rgba(10, 18, 32, 0.95) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--rank-color, var(--cyan)) 40%, transparent),
        0 0 30px color-mix(in srgb, var(--rank-color, var(--cyan)) 32%, transparent),
        0 20px 60px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.3s ease;
}

/* Hover AMPLIFIES rank presence (never dims it) */
.profile-card.profile-card--ranked:hover {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--rank-color, var(--cyan)) 65%, transparent),
        0 0 48px color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent),
        0 0 90px color-mix(in srgb, var(--rank-color, var(--cyan)) 22%, transparent),
        0 24px 70px rgba(0, 0, 0, 0.65);
}

/* Override base cyan accent bar */
.profile-card.profile-card--ranked::before {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--rank-color, var(--cyan)) 18%,
        color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, #fff) 50%,
        var(--rank-color, var(--cyan)) 82%,
        transparent 100%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--rank-color, var(--cyan)) 70%, transparent);
}

/* Override base cyan corner decoration */
.profile-card.profile-card--ranked::after {
    border-top-color: color-mix(in srgb, var(--rank-color, var(--cyan)) 65%, transparent);
    border-right-color: color-mix(in srgb, var(--rank-color, var(--cyan)) 65%, transparent);
}

/* Ring the image frame only — never the container (don't box it with overall-grade) */
.profile-card.profile-card--ranked .profile-image-frame,
.profile-card.profile-card--ranked .profile-image-placeholder {
    border-color: var(--rank-color, var(--cyan)) !important;
    box-shadow: 0 0 25px color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent) !important;
}

/* Overall grade box — its own themed element */
.profile-card.profile-card--ranked .overall-grade-box {
    border-color: var(--rank-color, var(--cyan));
    box-shadow: 0 0 16px color-mix(in srgb, var(--rank-color, var(--cyan)) 45%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--rank-color, var(--cyan)) 14%, transparent) 0%,
        transparent 100%);
}

/* Student name stays white, but glows in the rank color so it reads as
   the focal anchor and breaks up the wall of rank-tinted text. */
.profile-card.profile-card--ranked .profile-header-info h2 {
    color: var(--text-primary);
    text-shadow:
        0 0 18px color-mix(in srgb, var(--rank-color, var(--cyan)) 75%, transparent),
        0 0 36px color-mix(in srgb, var(--rank-color, var(--cyan)) 35%, transparent);
}

.profile-card.profile-card--ranked .profile-id {
    border-color: var(--rank-color, var(--cyan));
    background: color-mix(in srgb, var(--rank-color, var(--cyan)) 8%, transparent);
}
.profile-card.profile-card--ranked .id-value {
    color: var(--rank-color, var(--cyan));
    text-shadow: 0 0 10px color-mix(in srgb, var(--rank-color, var(--cyan)) 60%, transparent);
}
.profile-card.profile-card--ranked .profile-download-btn {
    border-color: var(--rank-color, var(--cyan));
    color: var(--rank-color, var(--cyan));
    background: color-mix(in srgb, var(--rank-color, var(--cyan)) 6%, transparent);
}
.profile-card.profile-card--ranked .profile-download-btn:hover {
    background: color-mix(in srgb, var(--rank-color, var(--cyan)) 18%, transparent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--rank-color, var(--cyan)) 65%, transparent);
}

/* Inline insignia is replaced by a large watermark on ranked cards */
.profile-card.profile-card--ranked .profile-rank-crest .profile-rank-insignia {
    display: none;
}

/* Large faint watermark of the rank insignia — centered engraving on the card */
.profile-rank-watermark {
    display: none;
}
.profile-card.profile-card--ranked .profile-rank-watermark {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80%, 720px);
    aspect-ratio: 1 / 1;
    color: var(--rank-color, var(--cyan));
    opacity: 0.05;
    filter: drop-shadow(0 0 40px color-mix(in srgb, var(--rank-color, var(--cyan)) 45%, transparent));
    pointer-events: none;
    z-index: 0;
}
.profile-rank-watermark .rank-insignia-svg {
    width: 100%;
    height: 100%;
}
/* Ensure every card section sits above the watermark engraving */
.profile-card.profile-card--ranked > *:not(.profile-rank-watermark) {
    position: relative;
    z-index: 1;
}


/* Ranked entry in the comparison modal — visual treatment must NOT change layout
   (no border/padding) so ranked and non-ranked entries align identically */
.comparison-student--ranked h3 {
    color: var(--rank-color, var(--cyan));
    text-shadow: 0 0 10px color-mix(in srgb, var(--rank-color, var(--cyan)) 50%, transparent);
}
.comparison-student--ranked .comparison-avatar {
    box-shadow: 0 0 22px color-mix(in srgb, var(--rank-color, var(--cyan)) 55%, transparent),
                inset 0 0 15px color-mix(in srgb, var(--rank-color, var(--cyan)) 25%, transparent),
                0 0 0 2px var(--rank-color, var(--cyan)) !important;
}

/* ===== Admin faculty list styling ===== */
.admin-faculty-item {
    border-left: 3px solid var(--rank-color, var(--cyan));
}
.admin-faculty-item .admin-student-meta {
    margin-top: 0.35rem;
}
.admin-faculty-rank-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    background: var(--rank-color, var(--cyan));
    border-radius: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.member-grid .empty-class {
    grid-column: 1 / -1;
}

.year-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.year-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.year-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .class-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .class-grid {
        grid-template-columns: 1fr;
    }
}

.class-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    animation: cardSlideIn 0.5s ease backwards;
}

.class-card:nth-child(1) { animation-delay: 0.05s; }
.class-card:nth-child(2) { animation-delay: 0.1s; }
.class-card:nth-child(3) { animation-delay: 0.15s; }
.class-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--class-color);
    opacity: 0.8;
}

.class-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px var(--class-glow), 0 10px 40px rgba(0, 0, 0, 0.3);
}

.class-card:hover::before {
    opacity: 1;
}

.class-card:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}

/* Staggered class card entrance - opacity only to avoid hover conflict */
.class-card:nth-child(1) { animation: classCardIn 0.5s ease backwards 0.1s; }
.class-card:nth-child(2) { animation: classCardIn 0.5s ease backwards 0.2s; }
.class-card:nth-child(3) { animation: classCardIn 0.5s ease backwards 0.3s; }
.class-card:nth-child(4) { animation: classCardIn 0.5s ease backwards 0.4s; }

@keyframes classCardIn {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Match the staggered fade-in on council/faculty member cards so
   re-sorting feels like the same "refresh" the class cards have. */
.member-card { animation: classCardIn 0.45s ease backwards; }
.member-card:nth-child(1)  { animation-delay: 0.04s; }
.member-card:nth-child(2)  { animation-delay: 0.08s; }
.member-card:nth-child(3)  { animation-delay: 0.12s; }
.member-card:nth-child(4)  { animation-delay: 0.16s; }
.member-card:nth-child(5)  { animation-delay: 0.20s; }
.member-card:nth-child(6)  { animation-delay: 0.24s; }
.member-card:nth-child(7)  { animation-delay: 0.28s; }
.member-card:nth-child(8)  { animation-delay: 0.32s; }
.member-card:nth-child(n+9) { animation-delay: 0.36s; }

.class-card.class-a { --class-color: var(--class-a); --class-glow: var(--class-a-glow); }
.class-card.class-b { --class-color: var(--class-b); --class-glow: var(--class-b-glow); }
.class-card.class-c { --class-color: var(--class-c); --class-glow: var(--class-c-glow); }
.class-card.class-d { --class-color: var(--class-d); --class-glow: var(--class-d-glow); }

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.class-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.class-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--class-color);
    border-radius: 12px;
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 15px var(--class-glow);
}

.class-label {
    font-weight: 600;
    font-size: 1.1rem;
}

.class-card-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.class-rank {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.class-points {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.points-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    animation: deltaAppear 0.3s ease;
}

@keyframes deltaAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.points-delta.positive {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.points-delta.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.points-delta .delta-arrow {
    font-size: 0.65rem;
}

.points-delta.positive .delta-arrow::before {
    content: '▲';
}

.points-delta.negative .delta-arrow::before {
    content: '▼';
}

/* Database connection indicator */
.db-status {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 100;
    transition: all 0.3s ease;
}

.db-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    transition: background 0.3s ease;
}

.db-status.connected .db-status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.db-status.local .db-status-dot {
    background: #f59e0b;
}

.class-card-students {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.student-preview::after {
    content: '›';
    position: absolute;
    right: 0.5rem;
    font-size: 1.2rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
}

.student-preview:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 0.75rem;
}

.student-preview:hover::after {
    opacity: 1;
    transform: translateX(0);
    color: var(--cyan);
}

.student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-darker);
    border: 2px solid var(--bg-secondary);
}

.student-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--class-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--class-color);
    font-weight: 600;
    font-size: 0.75rem;
}

.student-preview-info {
    flex: 1;
    min-width: 0;
}

.student-preview-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-preview-id {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.student-preview-stats {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 12px;
}

.student-preview-stats .stat-mini-bar {
    width: 3px;
    height: 12px;
}

.student-preview:hover .stat-mini-bar::after {
    filter: brightness(1.2);
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin: 0 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.view-all-link:hover {
    background: rgba(77, 201, 230, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 15px rgba(77, 201, 230, 0.2);
}

.empty-class {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   OAA APP - CLASS VIEW
   ======================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.back-link svg {
    width: 20px;
    height: 20px;
}

.back-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.back-link:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
    border-radius: 4px;
}

/* class-view-top base styles merged into shared .dashboard-header, .class-view-top rule above */

.class-sort {
    flex-wrap: wrap;
}

.class-sort .sort-buttons {
    flex-wrap: wrap;
}

.class-view-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.class-view-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    font-family: 'Orbitron', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.class-view-badge.class-a { background: var(--class-a); box-shadow: 0 0 20px var(--class-a-glow); }
.class-view-badge.class-b { background: var(--class-b); box-shadow: 0 0 20px var(--class-b-glow); }
.class-view-badge.class-c { background: var(--class-c); box-shadow: 0 0 20px var(--class-c-glow); }
.class-view-badge.class-d { background: var(--class-d); box-shadow: 0 0 20px var(--class-d-glow); }

.class-view-info h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.class-view-info .student-count {
    color: var(--text-muted);
    font-size: 1rem;
}

.student-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.student-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: studentCardIn 0.4s ease backwards;
}

/* Staggered entrance animation */
.student-card:nth-child(1) { animation-delay: 0.03s; }
.student-card:nth-child(2) { animation-delay: 0.06s; }
.student-card:nth-child(3) { animation-delay: 0.09s; }
.student-card:nth-child(4) { animation-delay: 0.12s; }
.student-card:nth-child(5) { animation-delay: 0.15s; }
.student-card:nth-child(6) { animation-delay: 0.18s; }
.student-card:nth-child(7) { animation-delay: 0.21s; }
.student-card:nth-child(8) { animation-delay: 0.24s; }
.student-card:nth-child(9) { animation-delay: 0.27s; }
.student-card:nth-child(10) { animation-delay: 0.30s; }
.student-card:nth-child(11) { animation-delay: 0.33s; }
.student-card:nth-child(12) { animation-delay: 0.36s; }

@keyframes studentCardIn {
    from {
        opacity: 0;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.student-card:hover {
    border-color: var(--cyan);
    box-shadow: var(--glow-spread), 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(16, 29, 50, 0.95) 0%, rgba(0, 196, 204, 0.08) 100%);
}

.student-card:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 4px;
}

.student-card:active {
    transform: translateY(-2px);
}

.student-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--bg-darker);
    border: 2px solid var(--cyan-dim);
}

.student-card-avatar-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--cyan-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    font-weight: 600;
    font-size: 1.1rem;
}

.student-card-info {
    flex: 1;
    min-width: 0;
}

.student-card-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.student-card-class {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.student-card-id {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.student-card-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.rating-grade {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.rating-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Student Card Stat Preview Mini Bars */
.student-card-stats-preview {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.stat-mini-bar {
    width: 4px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.stat-mini-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bar-height, 8px);
    border-radius: 2px;
    transition: height 0.3s ease, filter 0.2s ease;
}

.stat-mini-bar.stat-academic::after { background: #9b59b6; }
.stat-mini-bar.stat-intelligence::after { background: #f1c40f; }
.stat-mini-bar.stat-decision::after { background: #e67e22; }
.stat-mini-bar.stat-physical::after { background: #2ecc71; }
.stat-mini-bar.stat-cooperativeness::after { background: #3498db; }

.student-card:hover .stat-mini-bar::after {
    filter: brightness(1.2);
}

/* ========================================
   OAA APP - PROFILE VIEW
   ======================================== */

.profile-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.9) 100%);
    border: 2px solid var(--cyan);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow:
        var(--glow-spread),
        0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 1000px;
    margin: 2rem auto 0;
    position: relative;
    animation: profileCardIn 0.5s ease;
    transition: box-shadow 0.3s ease;
}

.profile-card:hover {
    box-shadow:
        0 0 30px var(--cyan-glow),
        0 0 60px rgba(77, 201, 230, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes profileCardIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--crimson), var(--cyan), var(--crimson));
}

/* Corner decorations */
.profile-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-top: 2px solid rgba(0, 245, 255, 0.3);
    border-right: 2px solid rgba(0, 245, 255, 0.3);
    pointer-events: none;
}

.profile-header {
    padding: 2rem;
    position: relative;
    background: linear-gradient(180deg, rgba(0, 245, 255, 0.05) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.profile-header-info h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--cyan);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--cyan-glow);
}

.profile-header-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.profile-header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.profile-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid var(--cyan);
    border-radius: var(--border-radius-sm);
    color: var(--cyan);
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.profile-download-btn:hover {
    background: rgba(0, 245, 255, 0.12);
    box-shadow: 0 0 12px var(--cyan-glow);
    transform: translateY(-1px);
}

.profile-id {
    text-align: center;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--cyan);
    border-radius: var(--border-radius-sm);
    background: rgba(0, 245, 255, 0.05);
}

.id-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

.id-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.profile-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    padding: 0 2rem 2rem;
}

@media (max-width: 800px) {
    .profile-body {
        grid-template-columns: 1fr;
    }
}

.profile-image-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    border: 2px solid var(--cyan);
    border-radius: var(--border-radius);
    box-shadow: var(--glow-spread);
    background: var(--bg-secondary);
}

/* Class-specific profile image glows */
.profile-image-container.class-a-glow .profile-image,
.profile-image-container.class-a-glow .profile-image-placeholder {
    border-color: var(--class-a);
    box-shadow: 0 0 25px var(--class-a-glow);
}
.profile-image-container.class-b-glow .profile-image,
.profile-image-container.class-b-glow .profile-image-placeholder {
    border-color: var(--class-b);
    box-shadow: 0 0 25px var(--class-b-glow);
}
.profile-image-container.class-c-glow .profile-image,
.profile-image-container.class-c-glow .profile-image-placeholder {
    border-color: var(--class-c);
    box-shadow: 0 0 25px var(--class-c-glow);
}
.profile-image-container.class-d-glow .profile-image,
.profile-image-container.class-d-glow .profile-image-placeholder {
    border-color: var(--class-d);
    box-shadow: 0 0 25px var(--class-d-glow);
}

.profile-image-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--cyan-dim);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer effect */
.profile-image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(77, 201, 230, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.profile-image-placeholder svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    opacity: 0.3;
}

.overall-grade-box {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 0 24px rgba(231, 76, 60, 0.32);
}

.overall-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.overall-value {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.profile-stats {
    flex: 1;
}

.stats-title {
    font-family: 'Orbitron', monospace;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--crimson);
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: statRowIn 0.4s ease backwards;
}

.stat-row:nth-child(1) { animation-delay: 0.1s; }
.stat-row:nth-child(2) { animation-delay: 0.2s; }
.stat-row:nth-child(3) { animation-delay: 0.3s; }
.stat-row:nth-child(4) { animation-delay: 0.4s; }
.stat-row:nth-child(5) { animation-delay: 0.5s; }

@keyframes statRowIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-grade {
    color: var(--cyan);
    margin-left: 0.5rem;
    text-shadow: 0 0 10px var(--cyan-glow);
}

.stat-bar {
    height: 10px;
    background: var(--stat-bar-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.stat-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 9.8%,
        rgba(255, 255, 255, 0.06) 9.8%,
        rgba(255, 255, 255, 0.06) 10%
    );
    z-index: 1;
}

.stat-bar-fill {
    height: 100%;
    background: var(--stat-bar-fill);
    border-radius: 4px;
    transition: width 0.8s ease, background 0.3s ease;
    position: relative;
    box-shadow: 0 0 15px var(--cyan-glow);
}

/* Dynamic stat colors based on value */
/* Stat-specific colors matching exam tags */
.stat-bar-fill.stat-academic {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.4);
}

.stat-bar-fill.stat-intelligence {
    background: linear-gradient(90deg, #d4a10f, #f1c40f);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

.stat-bar-fill.stat-decision {
    background: linear-gradient(90deg, #d35400, #e67e22);
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.4);
}

.stat-bar-fill.stat-physical {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.stat-bar-fill.stat-cooperativeness {
    background: linear-gradient(90deg, #2980b9, #3498db);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
}

/* Stat traits in profile */
.stat-trait {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.stat-trait.positive {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.stat-trait.negative {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* ========================================
   EVENTS APP
   ======================================== */

.events-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 3rem 5rem; /* Extra bottom padding for keyboard hints */
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Section styling */
.events-section {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.6) 100%);
    border: 1px solid rgba(77, 201, 230, 0.1);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.events-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(77, 201, 230, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* Collapsible sections */
.events-section.collapsible .events-section-header {
    cursor: pointer;
    transition: background 0.2s ease;
}

.events-section.collapsible .events-section-header:hover {
    background: rgba(77, 201, 230, 0.05);
}

.collapse-icon {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.events-section.collapsible:hover .collapse-icon {
    color: var(--cyan);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.section-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.section-indicator.standby {
    background: var(--text-muted);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    animation: standbyBlink 4s ease-in-out infinite;
}

@keyframes standbyBlink {
    0%, 90%, 100% { opacity: 0.4; }
    95% { opacity: 1; }
}

.section-indicator.active {
    background: var(--crimson-light);
    box-shadow: 0 0 10px var(--crimson-glow);
}

.section-indicator.upcoming {
    background: var(--cyan-dim);
    box-shadow: 0 0 10px var(--cyan-glow);
    animation: none;
}

.section-indicator.past {
    background: var(--text-muted);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.events-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Current event card */
.current-event-card {
    padding: 2rem;
}

.standby-state {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.standby-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    animation: standbyPulse 3s ease-in-out infinite;
}

@keyframes standbyPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.standby-icon svg {
    width: 100%;
    height: 100%;
}

.standby-text h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.standby-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Upcoming list */
.upcoming-list {
    padding: 1.5rem;
}

.upcoming-empty {
    text-align: center;
    padding: 1rem;
}

.upcoming-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Past events list */
.past-events-list {
    padding: 0.5rem 0;
}

.past-event-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(77, 201, 230, 0.05);
    transition: background 0.2s ease;
}

.past-event-item:last-child {
    border-bottom: none;
}

.past-event-item:hover {
    background: rgba(77, 201, 230, 0.03);
}

.past-event-date {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 80px;
}

.past-event-info {
    flex: 1;
}

.past-event-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.past-event-result {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Exam Types Grid */
.exam-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

@media (max-width: 800px) {
    .exam-types-grid {
        grid-template-columns: 1fr;
    }
}

.exam-type-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(15, 26, 46, 0.8) 0%, rgba(10, 18, 32, 0.6) 100%);
    border: 1px solid rgba(77, 201, 230, 0.1);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.exam-type-card:hover {
    border-color: rgba(77, 201, 230, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.exam-type-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(77, 201, 230, 0.1);
    border: 1px solid rgba(77, 201, 230, 0.2);
}

.exam-type-icon svg {
    width: 24px;
    height: 24px;
    color: var(--cyan);
}

.exam-type-icon.survival {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
}
.exam-type-icon.survival svg { color: #2ecc71; }

.exam-type-icon.written {
    background: rgba(155, 89, 182, 0.1);
    border-color: rgba(155, 89, 182, 0.3);
}
.exam-type-icon.written svg { color: #9b59b6; }

.exam-type-icon.zodiac {
    background: rgba(241, 196, 15, 0.1);
    border-color: rgba(241, 196, 15, 0.3);
}
.exam-type-icon.zodiac svg { color: #f1c40f; }

.exam-type-icon.poll {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
}
.exam-type-icon.poll svg { color: #ef4444; }

.exam-type-icon.sports {
    background: rgba(230, 126, 34, 0.1);
    border-color: rgba(230, 126, 34, 0.3);
}
.exam-type-icon.sports svg { color: #e67e22; }

.exam-type-icon.final {
    background: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.3);
}
.exam-type-icon.final svg { color: #3498db; }

.exam-type-icon.special {
    background: rgba(122, 36, 56, 0.15);
    border-color: rgba(122, 36, 56, 0.4);
}
.exam-type-icon.special svg { color: var(--crimson-light); }

.exam-type-info {
    flex: 1;
    min-width: 0;
}

.exam-type-info h4 {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.exam-type-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.exam-type-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exam-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(77, 201, 230, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(77, 201, 230, 0.2);
}

.exam-tag.physical {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

.exam-tag.academic {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
    border-color: rgba(155, 89, 182, 0.3);
}

.exam-tag.intelligence {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.3);
}

.exam-tag.cooperativeness {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.3);
}

.exam-tag.decision {
    background: rgba(230, 126, 34, 0.1);
    color: #e67e22;
    border-color: rgba(230, 126, 34, 0.3);
}

.exam-tag.danger {
    background: rgba(231, 76, 60, 0.15);
    color: #ef4444;
    border-color: rgba(231, 76, 60, 0.3);
}

.exam-tag.unknown {
    background: rgba(122, 36, 56, 0.15);
    color: var(--crimson-light);
    border-color: rgba(122, 36, 56, 0.3);
}

.section-indicator.info {
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
    animation: none;
}

/* ========================================
   SCROLLBAR - Hidden but functional
   ======================================== */

* {
    scrollbar-width: none; /* Firefox */
}

::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* Selection */
::selection {
    background: var(--cyan);
    color: var(--bg-primary);
}

/* ========================================
   GLITCH EFFECTS
   ======================================== */

.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9995;
    opacity: 0;
}

.glitch-overlay.active {
    animation: glitchFlash 0.15s ease-out;
}

@keyframes glitchFlash {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(77, 201, 230, 0.03) 15%,
            transparent 15.5%,
            transparent 30%,
            rgba(122, 36, 56, 0.03) 30%,
            rgba(122, 36, 56, 0.03) 31%,
            transparent 31.5%
        );
        transform: translateX(-2px);
    }
    40% {
        opacity: 0.8;
        transform: translateX(2px);
    }
    60% {
        opacity: 0.5;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(122, 36, 56, 0.02) 45%,
            transparent 45.5%,
            transparent 70%,
            rgba(77, 201, 230, 0.02) 70%,
            transparent 71%
        );
        transform: translateX(-1px);
    }
    100% {
        opacity: 0;
        transform: translateX(0);
    }
}

/* Screen flicker class */
.screen-flicker {
    animation: screenFlicker 0.1s ease;
}

@keyframes screenFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* ========================================
   CLICK RIPPLE EFFECT
   ======================================== */

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(77, 201, 230, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   GLITCH EFFECTS
   ======================================== */

.glitching {
    animation: glitchEffect 0.15s ease;
}

@keyframes glitchEffect {
    0%, 100% {
        transform: translate(0);
        filter: none;
    }
    20% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(2px, -1px);
        filter: hue-rotate(-90deg) saturate(2);
    }
    60% {
        transform: translate(-1px, 2px);
        filter: hue-rotate(180deg);
    }
    80% {
        transform: translate(1px, -2px);
        filter: hue-rotate(0deg) brightness(1.5);
    }
}

/* ========================================
   FAVORITES SYSTEM
   ======================================== */

.favorite-star {
    color: var(--class-a);
    font-size: 0.9em;
    margin-left: 0.25rem;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.favorite-btn:hover {
    color: var(--class-a);
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: var(--class-a);
    text-shadow: 0 0 10px var(--class-a-glow);
}

/* ========================================
   COMPARE MODE
   ======================================== */

.compare-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.compare-checkbox.checked {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.compare-checkbox.checked::after {
    content: '✓';
    color: var(--bg-primary);
    font-weight: bold;
    font-size: 0.85rem;
}

.student-preview.comparing,
.student-card.comparing {
    border-color: var(--cyan);
    background: rgba(77, 201, 230, 0.08);
    box-shadow: 0 0 15px var(--cyan-glow);
}

/* Compare Bar */
.compare-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 1px solid rgba(77, 201, 230, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 1rem 2rem;
    z-index: 1000;
    transition: bottom 0.3s ease;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--cyan-glow);
}

.compare-bar.active {
    bottom: 2rem;
}

.compare-bar-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.compare-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.compare-btn {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, var(--cyan-dim), var(--cyan));
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.compare-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--cyan-glow);
}

.compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-cancel {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.compare-cancel:hover {
    border-color: var(--crimson-light);
    color: var(--crimson-light);
    background: rgba(154, 46, 72, 0.1);
}

/* ========================================
   COMPARISON MODAL
   ======================================== */

.comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.comparison-modal.active {
    opacity: 1;
    visibility: visible;
}

.comparison-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid rgba(77, 201, 230, 0.2);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 40px var(--cyan-glow);
}

.comparison-modal.active .comparison-content {
    transform: scale(1) translateY(0);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--cyan);
    margin: 0;
}

.comparison-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.comparison-close:hover {
    background: rgba(154, 46, 72, 0.2);
    border-color: var(--crimson-light);
    color: var(--crimson-light);
}

.comparison-grid {
    display: grid;
    gap: 1.5rem;
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-student {
    text-align: center;
}

.comparison-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    transition: box-shadow 0.3s ease;
}

/* Class-specific avatar glows */
.comparison-avatar.class-a-glow {
    box-shadow: 0 0 20px var(--class-a-glow), inset 0 0 15px rgba(254, 205, 211, 0.2);
}
.comparison-avatar.class-b-glow {
    box-shadow: 0 0 20px var(--class-b-glow), inset 0 0 15px rgba(253, 164, 175, 0.2);
}
.comparison-avatar.class-c-glow {
    box-shadow: 0 0 20px var(--class-c-glow), inset 0 0 15px rgba(225, 29, 72, 0.2);
}
.comparison-avatar.class-d-glow {
    box-shadow: 0 0 20px var(--class-d-glow), inset 0 0 15px rgba(136, 19, 55, 0.2);
}

.comparison-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-darker);
}

.comparison-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.comparison-student h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.comparison-student p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.comparison-grade {
    font-family: 'Orbitron', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ef4444;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

.comparison-stats {
    padding: 1.5rem 2rem 2rem;
}

.comparison-stat-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-stat-row:last-child {
    border-bottom: none;
}

.comparison-stat-row .stat-name {
    flex: 0 0 150px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-values {
    display: flex;
    flex: 1;
    justify-content: space-around;
}

.stat-val {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* Stat-specific colors for best values */
.stat-val.best.stat-color-academic {
    color: #9b59b6;
    text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}
.stat-val.best.stat-color-intelligence {
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}
.stat-val.best.stat-color-decision {
    color: #e67e22;
    text-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
}
.stat-val.best.stat-color-physical {
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}
.stat-val.best.stat-color-cooperativeness {
    color: #3498db;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
    .app-view, .app-header {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* Match negative margins with reduced padding for both headers */
    .dashboard-header,
    .class-view-top {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding: 1.5rem;
    }

    .home-header {
        padding: 1.5rem;
    }

    .app-dock {
        padding: 1.5rem 2rem;
    }

    .lock-time {
        font-size: 4rem;
    }

    .lock-title {
        font-size: 3rem;
    }

    .search-container {
        min-width: 180px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header .filter-btn {
        margin-left: 0;
    }

    .dashboard-header .search-container {
        width: 100%;
    }

    .comparison-content {
        width: 95%;
        max-height: 90vh;
    }

    .comparison-stat-row .stat-name {
        flex: 0 0 100px;
        font-size: 0.75rem;
    }

    .stat-val {
        font-size: 0.9rem;
    }
}

/* ========================================
   ADMIN APP
   ======================================== */

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Login View */
.admin-login-container {
    max-width: 320px;
    margin: 3rem auto;
    text-align: center;
}

.admin-login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--cyan);
}

.admin-login-icon svg {
    width: 100%;
    height: 100%;
}

.admin-login-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-input-group {
    text-align: left;
}

.admin-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-input-group input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.admin-input-group input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-subtle);
}

.admin-input-group input::placeholder {
    color: var(--text-muted);
}

.admin-login-btn {
    background: var(--cyan);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.admin-login-btn:hover {
    background: var(--cyan-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--cyan-glow);
}

.admin-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Panel View */
.admin-panel-view {
    padding: 1.5rem;
    padding-bottom: 5rem; /* Space for keyboard hints */
}

.admin-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-icon {
    width: 36px;
    height: 36px;
    color: var(--cyan);
}

.admin-user-icon svg {
    width: 100%;
    height: 100%;
}

.admin-user-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.admin-logout-btn {
    background: transparent;
    border: 1px solid var(--crimson-light);
    color: var(--crimson-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-logout-btn:hover {
    background: var(--crimson-light);
    color: white;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    color: var(--cyan);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(77, 201, 230, 0.15);
    letter-spacing: 0.05em;
}

.admin-years-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-year-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.admin-year-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.admin-year-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.admin-class-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.admin-class-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.admin-class-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-class-badge.class-a { background: var(--class-a); color: #000; }
.admin-class-badge.class-b { background: var(--class-b); color: #000; }
.admin-class-badge.class-c { background: var(--class-c); color: #fff; }
.admin-class-badge.class-d { background: var(--class-d); color: #fff; }

.admin-class-input input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.85rem;
    color: var(--text-primary);
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.admin-class-input input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px var(--cyan-subtle);
}

.admin-class-input input.changed-up {
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.admin-class-input input.changed-up:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2), 0 0 12px rgba(34, 197, 94, 0.3);
}

.admin-class-input input.changed-down {
    border-color: var(--crimson-light);
    box-shadow: 0 0 8px rgba(154, 46, 72, 0.3);
}

.admin-class-input input.changed-down:focus {
    border-color: var(--crimson-light);
    box-shadow: 0 0 0 2px rgba(154, 46, 72, 0.2), 0 0 12px rgba(154, 46, 72, 0.3);
}

.admin-class-input input::-webkit-inner-spin-button,
.admin-class-input input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-save-btn {
    flex: 1;
    background: var(--cyan);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-save-btn:hover {
    background: var(--cyan-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--cyan-glow);
}

.admin-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-reset-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-reset-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}


/* Changelog */
.admin-changelog {
    max-height: 250px;
    overflow-y: auto;
}

.admin-changelog-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

.admin-changelog-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-left: 2px solid transparent;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.admin-changelog-item:hover {
    background: rgba(77, 201, 230, 0.05);
    border-left-color: var(--cyan-dim);
}

.admin-changelog-item:last-child {
    margin-bottom: 0;
}

.admin-changelog-info {
    flex: 1;
}

.admin-changelog-action {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.admin-changelog-user {
    color: var(--cyan);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-changelog-user::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    opacity: 0.6;
}

.changelog-positive {
    color: #22c55e;
    font-weight: 500;
}

.changelog-negative {
    color: #ef4444;
    font-weight: 500;
}

/* Save Confirmation Modal */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal {
    background: var(--bg-card);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: modalSlideIn 0.2s ease-out;
}

/* The student edit/add modal has many fields — give it more breathing room */
#admin-student-modal .admin-modal {
    max-width: 640px;
}
@media (max-width: 700px) {
    #admin-student-modal .admin-modal {
        max-width: 95vw;
    }
    /* On phones, stack the image preview above the URL input so the
       preview can take full width and stay big enough to frame on. */
    .admin-image-row {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-image-preview {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
        max-height: 60vw;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.admin-modal-header {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.admin-modal-body p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.admin-modal-changes {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.admin-modal-change {
    padding: 0.25rem 0;
    color: var(--text-primary);
}

.admin-modal-change.positive {
    color: #22c55e;
}

.admin-modal-change.negative {
    color: #ef4444;
}

.admin-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-modal-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.admin-modal-confirm {
    flex: 1;
    background: var(--cyan);
    border: none;
    color: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-confirm:hover {
    background: var(--cyan-dim);
}

.admin-changelog-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    margin-left: 1rem;
}

/* Admin App Icon - subtle indicator */
.admin-app-icon .app-icon-image {
    color: var(--text-secondary);
}

.admin-app-icon:hover .app-icon-image {
    color: var(--cyan);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .admin-class-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-user-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-user-info {
        flex-direction: column;
    }
}

/* Admin View Transitions */
.admin-login-container {
    animation: adminFadeIn 0.35s ease-out;
}

#admin-login-view.fading-out {
    animation: adminFadeOut 0.35s ease-in forwards;
}

@keyframes adminFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes adminFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.96); }
}


/* Saving button animation */
.admin-save-btn.saving {
    position: relative;
    overflow: hidden;
}

.admin-save-btn.saving::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: savingShimmer 1s infinite;
}

@keyframes savingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Login button loading state */
.admin-login-btn:disabled {
    position: relative;
    overflow: hidden;
}

.admin-login-btn:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: savingShimmer 1s infinite;
}


/* Admin login icon glitch on hover */
.admin-login-icon {
    transition: color 0.2s ease;
}

.admin-login-icon:hover {
    animation: glitchEffect 0.15s ease;
    cursor: pointer;
}

/* Input hover states */
.admin-input-group input:hover:not(:focus) {
    border-color: var(--text-muted);
}

.admin-class-input input:hover:not(:focus) {
    border-color: var(--text-muted);
}

/* Student Management */
.admin-student-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-add-student-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--cyan-subtle);
    border: 1px solid var(--cyan);
    border-radius: var(--border-radius-sm);
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-add-student-btn:hover {
    background: var(--cyan);
    color: var(--bg-primary);
}

.admin-add-student-btn svg {
    width: 16px;
    height: 16px;
}

.admin-student-filter {
    display: flex;
    gap: 0.5rem;
}

.admin-student-filter select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.admin-student-filter select:hover {
    border-color: var(--text-muted);
}

.admin-student-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.admin-student-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-student-item:hover {
    border-color: var(--cyan);
    background: rgba(77, 201, 230, 0.05);
}

.admin-student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-darker);
    border: 2px solid var(--bg-tertiary);
}

.admin-student-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-student-info {
    min-width: 0;
    flex: 0 1 auto;
    max-width: 60%;
}

.admin-student-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-student-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-student-grade {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cyan);
    flex-shrink: 0;
}

.admin-student-download {
    margin-left: auto;
    background: none;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}
.admin-student-download svg {
    width: 18px;
    height: 18px;
}
.admin-student-download:hover {
    color: var(--cyan);
    background: rgba(77, 201, 230, 0.1);
    transform: scale(1.1);
}
.admin-student-download + .admin-student-retire {
    margin-left: 0;
}

.admin-student-retire {
    margin-left: auto;
    background: none;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.admin-student-retire svg {
    width: 18px;
    height: 18px;
}

.admin-student-retire:hover {
    color: var(--crimson-light);
    background: rgba(154, 46, 72, 0.1);
    transform: scale(1.1);
}

.admin-student-item.retired {
    opacity: 0.55;
}

.admin-student-item.retired .admin-student-retire {
    color: var(--crimson-light);
}

.admin-student-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Student Modal */
.admin-student-modal {
    max-width: 500px;
}

.admin-modal-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-close:hover {
    background: rgba(154, 46, 72, 0.2);
    border-color: var(--crimson-light);
    color: var(--crimson-light);
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-form-row {
    margin-bottom: 1rem;
}

.admin-form-row label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.admin-image-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.admin-image-preview {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.admin-image-preview svg {
    width: 56px;
    height: 56px;
}

.admin-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.admin-image-input {
    flex: 1;
}

.admin-form-row input,
.admin-form-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}
/* Centered + clickable applies only to the year/class selects, not to the
   name/URL text inputs which should stay left-aligned like the Creator. */
.admin-form-row select {
    cursor: pointer;
    text-align: center;
    text-align-last: center;
}

.admin-form-row input:focus,
.admin-form-row select:focus {
    outline: none;
    border-color: var(--cyan);
}

.admin-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-form-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bg-tertiary);
    letter-spacing: 0.1em;
}

.admin-form-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.admin-stat-input {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.admin-stat-input label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    min-height: 2em;
    line-height: 1.1;
}

.admin-stat-input input {
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    -moz-appearance: textfield;
    appearance: textfield;
    font-weight: 500;
}

.admin-stat-input input:focus {
    outline: none;
    border-color: var(--cyan);
}
.admin-stat-input input::-webkit-outer-spin-button,
.admin-stat-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-trait-select {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    text-align: center;
    text-align-last: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}
/* Firefox: hide the dropdown arrow */
.admin-trait-select::-ms-expand {
    display: none;
}

/* Color the admin stat inputs by category to match the OAA bars */
.admin-stat-input.stat-academic input { border-color: #9b59b6; box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.25); }
.admin-stat-input.stat-academic input:focus { border-color: #9b59b6; box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.35); }
.admin-stat-input.stat-academic label { color: #c39bd3; }

.admin-stat-input.stat-intelligence input { border-color: #f1c40f; box-shadow: inset 0 0 0 1px rgba(241, 196, 15, 0.25); }
.admin-stat-input.stat-intelligence input:focus { border-color: #f1c40f; box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.35); }
.admin-stat-input.stat-intelligence label { color: #f4d35e; }

.admin-stat-input.stat-decision input { border-color: #e67e22; box-shadow: inset 0 0 0 1px rgba(230, 126, 34, 0.25); }
.admin-stat-input.stat-decision input:focus { border-color: #e67e22; box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.35); }
.admin-stat-input.stat-decision label { color: #f0a868; }

.admin-stat-input.stat-physical input { border-color: #2ecc71; box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.25); }
.admin-stat-input.stat-physical input:focus { border-color: #2ecc71; box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.35); }
.admin-stat-input.stat-physical label { color: #6ee0a0; }

.admin-stat-input.stat-cooperativeness input { border-color: #3498db; box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.25); }
.admin-stat-input.stat-cooperativeness input:focus { border-color: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.35); }
.admin-stat-input.stat-cooperativeness label { color: #6cb8e7; }

/* ========================================
   IMAGE FRAMER (zoom + drag-to-pan)
   ======================================== */
.image-framer-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.6rem;
}
.image-framer-controls.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.image-framer-zoom-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.image-framer-zoom-input {
    width: 4.5em;
    padding: 0.4rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: 'Orbitron', monospace;
    text-align: center;
    transition: border-color var(--transition-fast);
}
.image-framer-zoom-input:focus {
    outline: none;
    border-color: var(--cyan);
}
.image-framer-zoom-suffix {
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-muted);
    font-family: 'Orbitron', monospace;
    margin-left: 0.1rem;
    margin-right: auto;
    align-self: center;
}

.image-framer-reset {
    padding: 0.35rem 0.65rem;
    font-size: 0.65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: inherit;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}
.image-framer-reset:hover {
    border-color: var(--cyan);
    color: var(--text-primary);
}
/* Avatar wrappers — give the image a clipping container so transform: scale()
   from imageFrame doesn't bleed outside the visible bounds. */
.student-avatar-frame,
.student-card-avatar-frame,
.admin-student-avatar-frame {
    display: inline-block;
    overflow: hidden;
    flex-shrink: 0;
    line-height: 0;
}
.student-avatar-frame {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}
.student-card-avatar-frame {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}
.admin-student-avatar-frame {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.student-avatar-frame .student-avatar,
.student-card-avatar-frame .student-card-avatar,
.admin-student-avatar-frame .admin-student-avatar {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: block;
}

/* Profile image: wrap img in .profile-image-frame so transforms clip,
   while keeping the glow box-shadow on the frame itself. */
.profile-image-frame {
    width: 100%;
    aspect-ratio: 1/1;
    border: 2px solid var(--cyan);
    border-radius: var(--border-radius);
    box-shadow: var(--glow-spread);
    background: var(--bg-secondary);
    overflow: hidden;
    display: block;
}
.profile-image-frame .profile-image {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: block;
}
/* Re-target class glows to the frame when present */
.profile-image-container.class-a-glow .profile-image-frame {
    border-color: var(--class-a);
    box-shadow: 0 0 25px var(--class-a-glow);
}
.profile-image-container.class-b-glow .profile-image-frame {
    border-color: var(--class-b);
    box-shadow: 0 0 25px var(--class-b-glow);
}
.profile-image-container.class-c-glow .profile-image-frame {
    border-color: var(--class-c);
    box-shadow: 0 0 25px var(--class-c-glow);
}
.profile-image-container.class-d-glow .profile-image-frame {
    border-color: var(--class-d);
    box-shadow: 0 0 25px var(--class-d-glow);
}

.admin-trait-select:focus {
    outline: none;
    border-color: var(--cyan);
}

.admin-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-actions-right {
    display: flex;
    gap: 0.5rem;
}

.admin-modal-delete {
    flex: 1;
    padding: 0.75rem;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-delete:hover {
    background: #ef4444;
    color: white;
}

.admin-modal-confirm.saving,
.admin-modal-confirm:disabled {
    opacity: 0.7;
    cursor: wait;
}

.admin-modal-delete:disabled {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 480px) {
    .admin-form-row-half {
        grid-template-columns: 1fr;
    }

    .admin-form-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .admin-stat-input input {
        min-height: 36px;
    }

    .admin-student-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-student-filter {
        justify-content: stretch;
    }

    .admin-student-filter select {
        flex: 1;
    }
}

/* ========================================
   CREATOR APP
   ======================================== */

.creator-content {
    padding: 1rem 1.5rem;
    padding-bottom: 4rem; /* Space for keyboard hints */
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* Progress Indicator */
.creator-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

/* Always visible - no opacity changes */
.progress-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-darker);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(77, 201, 230, 0.15);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.progress-step.completed .step-number {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-dark);
}

/* Show checkmark for completed */
.progress-step.completed .step-number::after {
    content: '\2713';
    font-size: 1rem;
}

.progress-step.completed .step-number span {
    display: none;
}

.step-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: var(--cyan);
}

.progress-step.completed .step-label {
    color: rgba(255, 255, 255, 0.6);
}

.progress-line {
    width: 50px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.75rem;
    margin-bottom: 1.4rem;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.progress-line.completed {
    background: var(--cyan);
}

/* Creator Card (OAA style) */
.creator-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.9) 100%);
    border: 1px solid var(--cyan);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 0 20px var(--cyan-glow);
}


.creator-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.creator-card-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.creator-card-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: rgba(77, 201, 230, 0.15);
    color: var(--cyan);
    border: 1px solid var(--cyan);
}

.creator-card-badge.optional {
    background: rgba(154, 46, 72, 0.15);
    color: var(--crimson);
    border-color: var(--crimson);
}

/* Identity Layout (2-column) */
.creator-identity-layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 2rem;
}

.creator-avatar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.creator-avatar-preview {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.creator-avatar-preview:hover {
    border-color: var(--cyan);
}

.creator-avatar-preview svg {
    width: 60%;
    height: 60%;
    color: var(--text-muted);
}

.creator-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.creator-details-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Creator Steps */
.creator-step {
    display: none;
    animation: creatorFadeIn 0.35s ease-out;
}

.creator-step.active {
    display: block;
}

@keyframes creatorFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Creator Form */
.creator-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.creator-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.creator-input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.creator-image-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.creator-image-input-row input[type="url"],
.creator-image-input-row input[type="text"] {
    flex: 1;
    min-width: 0;
    width: auto;
}

.creator-image-input-row .creator-upload-btn,
.creator-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.5rem;
    margin: 0;
    text-transform: none;
    flex-shrink: 0;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.creator-upload-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.creator-upload-btn:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(77, 201, 230, 0.1);
}

.creator-upload-btn:hover svg {
    color: var(--cyan);
}

/* Creator form has taller inputs — bump button padding so it stays
   square at the input's height there too. */
.creator-input-group .creator-upload-btn {
    padding: 0.75rem;
}

.creator-input-group input[type="text"],
.creator-input-group input[type="url"] {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.creator-input-group input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(77, 201, 230, 0.1);
}

.creator-input-group textarea {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.creator-input-group textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(77, 201, 230, 0.1);
}

.input-sublabel {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.input-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

/* Select Button Groups */
.creator-select-group {
    display: flex;
    gap: 0.75rem;
}

.creator-select-btn {
    flex: 1;
    padding: 0.75rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.creator-select-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
}

.creator-select-btn.active {
    border-color: var(--cyan);
    background: rgba(77, 201, 230, 0.15);
    color: var(--cyan);
    box-shadow: 0 0 10px rgba(77, 201, 230, 0.2);
}

/* Class select with letter + description */
.creator-select-group.class-select {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.creator-select-group.class-select .creator-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    gap: 0.25rem;
}

.class-letter {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
}

.class-desc {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* Class-colored buttons - pink/red gradient (A=lightest, D=darkest) */
.creator-select-btn.class-a-btn {
    border-color: rgba(254, 205, 211, 0.4);
}
.creator-select-btn.class-a-btn:hover {
    border-color: rgba(254, 205, 211, 0.6);
    background: rgba(254, 205, 211, 0.1);
}
.creator-select-btn.class-a-btn.active {
    border-color: var(--class-a);
    background: rgba(254, 205, 211, 0.2);
    color: var(--class-a);
    box-shadow: 0 0 15px var(--class-a-glow);
}

.creator-select-btn.class-b-btn {
    border-color: rgba(253, 164, 175, 0.4);
}
.creator-select-btn.class-b-btn:hover {
    border-color: rgba(253, 164, 175, 0.6);
    background: rgba(253, 164, 175, 0.1);
}
.creator-select-btn.class-b-btn.active {
    border-color: var(--class-b);
    background: rgba(253, 164, 175, 0.2);
    color: var(--class-b);
    box-shadow: 0 0 15px var(--class-b-glow);
}

.creator-select-btn.class-c-btn {
    border-color: rgba(225, 29, 72, 0.4);
}
.creator-select-btn.class-c-btn:hover {
    border-color: rgba(225, 29, 72, 0.6);
    background: rgba(225, 29, 72, 0.1);
}
.creator-select-btn.class-c-btn.active {
    border-color: var(--class-c);
    background: rgba(225, 29, 72, 0.2);
    color: var(--class-c);
    box-shadow: 0 0 15px var(--class-c-glow);
}

.creator-select-btn.class-d-btn {
    border-color: rgba(136, 19, 55, 0.4);
}
.creator-select-btn.class-d-btn:hover {
    border-color: rgba(136, 19, 55, 0.6);
    background: rgba(136, 19, 55, 0.15);
}
.creator-select-btn.class-d-btn.active {
    border-color: var(--class-d);
    background: rgba(136, 19, 55, 0.25);
    color: #f472b6;
    box-shadow: 0 0 15px var(--class-d-glow);
}

/* Overall Grade Badge */
.creator-overall-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
}

.creator-overall-badge .overall-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.creator-overall-badge .overall-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
    line-height: 1;
}

/* Evaluation Tab - Card Layout */

/* Overall Grade Display */
.eval-overall-wrapper {
    text-align: center;
    margin-bottom: 1.25rem;
}

.eval-overall {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 2rem 0.75rem 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(154, 46, 72, 0.3);
    border-radius: 50px;
}

.eval-overall-grade {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

.eval-overall-letter {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.eval-overall-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stat Cards Grid */
.eval-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual Stat Card */
.eval-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
}

.eval-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.eval-card.has-trait {
    border-color: rgba(255, 255, 255, 0.1);
}

.eval-card.trait-positive {
    border-color: rgba(34, 197, 94, 0.3);
}

.eval-card.trait-negative {
    border-color: rgba(239, 68, 68, 0.3);
}

.eval-card.trait-neutral {
    border-color: rgba(148, 163, 184, 0.3);
}

/* Card Header */
.eval-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.eval-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.eval-card-trait {
    flex: 1;
}

.eval-card-trait:empty {
    display: none;
}

.trait-badge,
.eval-card-trait .trait-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.trait-badge.positive,
.eval-card-trait .trait-badge.positive {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.trait-badge.negative,
.eval-card-trait .trait-badge.negative {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.trait-badge.neutral,
.eval-card-trait .trait-badge.neutral {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #94a3b8;
}

.trait-icon,
.eval-card-trait .trait-icon {
    font-size: 0.6rem;
    margin-right: 0.25rem;
}

.trait-icon.positive,
.eval-card-trait .trait-icon.positive {
    color: #22c55e;
}

.trait-icon.negative,
.eval-card-trait .trait-icon.negative {
    color: #ef4444;
}

.trait-icon.neutral,
.eval-card-trait .trait-icon.neutral {
    color: #94a3b8;
}

/* Spacing when the badge sits under a stat bar (OAA profile + creator
   live preview). align-self:flex-start prevents the parent flex column
   from stretching the badge to full row width. */
.stat-row .trait-badge {
    margin-top: 0.4rem;
    align-self: flex-start;
}

.eval-card-trait .trait-badge.clickable {
    cursor: pointer;
    transition: opacity 0.15s, filter 0.15s;
}

.eval-card-trait .trait-badge.clickable:hover {
    opacity: 0.6;
}

.eval-card-trait .trait-badge.clickable:hover .trait-name {
    text-decoration: line-through;
}

/* Bar Container - match slider width */
.eval-card-bar-container {
    margin-bottom: 0.75rem;
    margin-right: calc(35px + 1rem);
}

.eval-card-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.eval-card-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 9.8%,
        rgba(255, 255, 255, 0.06) 9.8%,
        rgba(255, 255, 255, 0.06) 10%
    );
    z-index: 2;
}

/* Locked area pattern - diagonal stripes */
.eval-bar-locked {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 2; /* Above fill bar so locked areas are always visible */
    transition: width 0.4s ease;
}

.eval-bar-locked-left {
    left: 0;
    width: 25%;
    border-radius: 4px 0 0 4px;
    opacity: 0.55;
}

#locked-left-academic {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45) 2px, transparent 2px, transparent 4px),
        linear-gradient(90deg, #8e44ad, #9b59b6);
}
#locked-left-intelligence {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45) 2px, transparent 2px, transparent 4px),
        linear-gradient(90deg, #d4a10f, #f1c40f);
}
#locked-left-decision {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45) 2px, transparent 2px, transparent 4px),
        linear-gradient(90deg, #d35400, #e67e22);
}
#locked-left-physical {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45) 2px, transparent 2px, transparent 4px),
        linear-gradient(90deg, #27ae60, #2ecc71);
}
#locked-left-cooperativeness {
    background:
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.45), rgba(0,0,0,0.45) 2px, transparent 2px, transparent 4px),
        linear-gradient(90deg, #2980b9, #3498db);
}

.eval-bar-locked-right {
    right: 0;
    width: 25%;
    border-radius: 0 4px 4px 0;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(0, 0, 0, 0.5),
            rgba(0, 0, 0, 0.5) 2px,
            rgba(60, 60, 60, 0.4) 2px,
            rgba(60, 60, 60, 0.4) 4px
        ),
        rgba(30, 30, 30, 0.6);
}

/* Fill bar */
.eval-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, left 0.3s ease;
    position: absolute;
    top: 0;
    left: 40%;
    z-index: 1;
}

.eval-bar-fill.stat-academic {
    background: linear-gradient(90deg, #8e44ad, #9b59b6);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.eval-bar-fill.stat-intelligence {
    background: linear-gradient(90deg, #d4a10f, #f1c40f);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.eval-bar-fill.stat-decision {
    background: linear-gradient(90deg, #d35400, #e67e22);
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
}

.eval-bar-fill.stat-physical {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.eval-bar-fill.stat-cooperativeness {
    background: linear-gradient(90deg, #2980b9, #3498db);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Bar Labels */
.eval-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

.eval-bar-labels span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Orbitron', monospace;
}

.eval-bar-labels span:nth-child(2) {
    display: none;
}

/* Controls - Slider and Value */
.eval-card-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.eval-card-slider {
    flex: 1;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.eval-card-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.05) var(--limit-min, 25%),
        rgba(255, 255, 255, 0.15) var(--limit-min, 25%),
        rgba(255, 255, 255, 0.15) var(--limit-max, 75%),
        rgba(255, 255, 255, 0.05) var(--limit-max, 75%),
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 2px;
}

.eval-card-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--cyan);
    margin-top: -7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eval-card-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px var(--cyan-glow);
}

.eval-card-slider::-moz-range-track {
    height: 4px;
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.05) var(--limit-min, 25%),
        rgba(255, 255, 255, 0.15) var(--limit-min, 25%),
        rgba(255, 255, 255, 0.15) var(--limit-max, 75%),
        rgba(255, 255, 255, 0.05) var(--limit-max, 75%),
        rgba(255, 255, 255, 0.05) 100%
    );
    border-radius: 2px;
}

.eval-card-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--cyan);
    cursor: pointer;
}

.eval-card-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 35px;
    text-align: right;
}

/* Discover Button */
.eval-card-discover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--crimson-light);
    border-radius: 8px;
    background: rgba(154, 46, 72, 0.1);
    color: var(--crimson-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eval-card-discover:hover {
    background: rgba(154, 46, 72, 0.25);
    border-color: #b8304f;
    box-shadow: 0 0 15px var(--crimson-glow);
}

.eval-card.has-trait .eval-card-discover {
    display: none;
}

/* Responsive */
@media (max-width: 500px) {
    .eval-overall-label {
        font-size: 0.75rem;
    }

    .eval-card {
        padding: 1rem;
    }

    .eval-card-name {
        font-size: 0.9rem;
    }

    .eval-card-bar {
        height: 12px;
    }
}

/* Visible Slider Track */
.stat-slider {
    flex: 1;
    max-width: 180px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--cyan) 0%, var(--cyan) var(--value, 50%), rgba(255, 255, 255, 0.1) var(--value, 50%), rgba(255, 255, 255, 0.1) 100%);
    border-radius: 4px;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--cyan);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.stat-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px var(--cyan-glow);
}

.stat-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--cyan);
    cursor: pointer;
}

.stat-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    height: 8px;
}

.stat-number {
    width: 55px;
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    text-align: center;
}

.stat-number:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(77, 201, 230, 0.1);
}

/* Prominent Quiz Button */
.trait-quiz-btn {
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(154, 46, 72, 0.15);
    border: 2px solid var(--crimson);
    border-radius: 8px;
    color: var(--crimson);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.trait-quiz-btn::after {
    content: 'QUIZ';
}

.trait-quiz-btn:hover {
    background: rgba(154, 46, 72, 0.25);
    box-shadow: 0 0 10px rgba(154, 46, 72, 0.3);
    transform: translateY(-1px);
}

.trait-quiz-btn.has-trait {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.trait-quiz-btn.has-trait::after {
    content: 'DONE';
}

.abilities-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: rgba(154, 46, 72, 0.1);
    border: 1px solid rgba(154, 46, 72, 0.2);
    border-radius: 8px;
}

.abilities-hint svg {
    color: var(--crimson);
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.error-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.success-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(34, 197, 94, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Navigation Buttons */
.creator-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.creator-nav-buttons.centered {
    justify-content: center;
}

.creator-btn {
    padding: 1rem 1.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.creator-btn.primary {
    background: var(--cyan);
    border: none;
    color: var(--bg-primary);
}

.creator-btn.primary:hover {
    background: var(--cyan-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--cyan-glow);
}

.creator-btn.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.creator-btn.secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.creator-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Position keyboard hints in creator */
.creator-hints {
    bottom: 2rem;
}

/* Export Section */
/* Creator Preview Card - OAA Profile Style */
.creator-preview-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.9) 100%);
    border: 2px solid var(--cyan);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--glow-spread), 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: 0 auto 1.5rem;
    position: relative;
    animation: profileCardIn 0.5s ease;
}

.creator-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--crimson), var(--cyan), var(--crimson));
}

.creator-preview-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-top: 2px solid rgba(0, 245, 255, 0.3);
    border-right: 2px solid rgba(0, 245, 255, 0.3);
    pointer-events: none;
}


/* Creator preview overrides for OAA profile classes */
.creator-preview-card .profile-body {
    grid-template-columns: 200px 1fr;
}

.preview-pending-id {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
}

.preview-pending-id .id-value.pending {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}



/* Preview Bio Section */
.preview-bio-section {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-bio-item h4 {
    font-family: 'Orbitron', monospace;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--crimson);
}

.preview-bio-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Export Actions */
.creator-export-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.creator-export-actions .creator-btn {
    min-width: 180px;
    justify-content: center;
}

.creator-export-actions .creator-btn.primary {
    padding: 1rem 2rem;
}

.creator-export-actions .creator-btn.secondary {
    padding: 1rem 2rem;
    border: 2px solid var(--crimson);
    color: var(--crimson);
    background: rgba(154, 46, 72, 0.1);
}

.creator-export-actions .creator-btn.secondary:hover {
    background: rgba(154, 46, 72, 0.2);
    border-color: var(--crimson);
    color: var(--crimson);
    box-shadow: 0 4px 15px rgba(154, 46, 72, 0.3);
}

/* Trait Quiz Modal */
/* ========================================
   TRAIT QUIZ MODAL - Redesigned
   ======================================== */

.trait-quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 18, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.trait-quiz-modal.active {
    opacity: 1;
    visibility: visible;
}

.trait-quiz-content {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 29, 50, 0.98) 100%);
    border: 2px solid var(--crimson);
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: quizSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 0 40px rgba(154, 46, 72, 0.3),
        0 25px 80px rgba(0, 0, 0, 0.5);
    position: relative;
}

.trait-quiz-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--crimson), var(--cyan), var(--crimson));
}

@keyframes quizSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.trait-quiz-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(180deg, rgba(154, 46, 72, 0.1) 0%, transparent 100%);
}

.trait-quiz-category-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trait-quiz-category-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}


.trait-quiz-header-text {
    flex: 1;
}

.trait-quiz-category-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--crimson-light);
    display: block;
    margin-bottom: 0.2rem;
}

.trait-quiz-header h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.trait-quiz-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trait-quiz-close svg {
    width: 18px;
    height: 18px;
}

.trait-quiz-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.trait-quiz-body {
    padding: 1rem 1.5rem 1.5rem;
}

.trait-quiz-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.trait-quiz-progress-steps {
    font-family: 'Orbitron', monospace;
    display: flex;
    align-items: baseline;
}

.progress-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-glow);
}

.progress-divider {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0.2rem;
}

.progress-total {
    font-size: 1rem;
    color: var(--text-muted);
}

.trait-quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.trait-quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--crimson), var(--cyan));
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.trait-quiz-question-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.trait-quiz-question {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.trait-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trait-quiz-option {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.trait-quiz-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--crimson);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.trait-quiz-option:hover {
    border-color: var(--crimson);
    background: rgba(154, 46, 72, 0.1);
    color: var(--text-primary);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(154, 46, 72, 0.2);
}

.trait-quiz-option:hover::before {
    transform: scaleY(1);
}

.trait-quiz-option:active {
    transform: translateX(5px) scale(0.98);
}

.trait-quiz-footer {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.trait-quiz-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trait-quiz-hint svg {
    opacity: 0.6;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .creator-content {
        padding: 1rem;
    }

    .creator-progress {
        padding: 0;
    }

    .progress-line {
        width: 15px;
    }

    .step-label {
        display: none;
    }

    .creator-input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .creator-nav-buttons {
        flex-direction: column-reverse;
    }

    .creator-btn {
        width: 100%;
        justify-content: center;
    }

    .creator-export-buttons {
        flex-direction: column;
    }

    .export-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   MOBILE - SMALL SCREENS
   ======================================== */

@media (max-width: 600px) {
    /* App dock - wrap icons into 2x2 grid */
    .app-dock {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        padding: 1.5rem;
        max-width: 280px;
    }

    .app-icon-image {
        width: 70px;
        height: 70px;
        border-radius: 16px;
    }

    .app-icon-image svg {
        width: 32px;
        height: 32px;
    }

    .app-name {
        font-size: 0.75rem;
    }

    .app-icon {
        gap: 0.5rem;
    }

    /* Lock screen - smaller text */
    .lock-time {
        font-size: 3rem;
    }

    .lock-date {
        font-size: 0.9rem;
        margin-bottom: 3rem;
    }

    .lock-title {
        font-size: 2rem;
        letter-spacing: 0.2em;
    }

    .lock-subtitle {
        font-size: 0.9rem;
    }

    .lock-branding {
        margin-bottom: 3rem;
    }

    .enter-hint span {
        display: none;
    }

    .enter-hint::after {
        content: 'Tap anywhere';
        font-size: 0.85rem;
    }

    /* Hide keyboard hints on mobile */
    .keyboard-hint {
        display: none;
    }

    /* Home header adjustments */
    .home-header {
        padding: 1rem;
    }

    .home-brand-title {
        font-size: 1rem;
    }

    .home-brand-subtitle {
        font-size: 0.6rem;
    }

    /* Quote section */
    .school-quote {
        margin-top: 2rem;
        min-height: 100px;
    }

    .quote-text {
        font-size: 0.9rem;
    }

    /* App headers */
    .app-header {
        padding: 1rem;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .header-brand,
    .header-time,
    .home-time {
        display: none;
    }

    .nav-btn {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 400px) {
    /* Very small screens */
    .lock-time {
        font-size: 2.5rem;
    }

    .lock-title {
        font-size: 1.75rem;
    }

    .app-dock {
        max-width: 240px;
        gap: 0.75rem;
        padding: 1rem;
    }

    .app-icon-image {
        width: 60px;
        height: 60px;
    }

    .app-icon-image svg {
        width: 28px;
        height: 28px;
    }
}

/* ========================================
   MOBILE - COMPREHENSIVE FIXES (600px)
   ======================================== */

@media (max-width: 600px) {
    /* --- Global --- */
    .app-view {
        padding: 0 1rem 2rem;
    }

    .dashboard-header,
    .class-view-top {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1rem;
    }

    .nav-btn {
        width: 44px;
        height: 44px;
    }

    /* --- Boot screen --- */
    .boot-logo {
        font-size: 3rem;
        margin-bottom: 2rem;
    }

    .boot-loader {
        width: 150px;
    }

    /* --- Lock screen --- */
    .lock-content {
        padding: 2rem;
    }

    .lock-content::before,
    .lock-content::after {
        width: 40px;
        height: 40px;
    }

    /* --- OAA dashboard --- */
    .search-container {
        min-width: 0;
        width: 100%;
    }

    .sort-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    .sort-btn {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 40px;
    }

    /* --- OAA class view / student cards --- */
    .student-list {
        grid-template-columns: 1fr;
    }

    .member-grid {
        grid-template-columns: 1fr;
    }

    .student-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .student-card-avatar {
        width: 44px;
        height: 44px;
    }

    .student-card-name {
        font-size: 0.9rem;
    }

    /* --- OAA profile --- */
    .profile-header {
        padding: 1.25rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .profile-header-info h2 {
        font-size: 1.5rem;
    }

    .profile-header-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .profile-body {
        padding: 0 1rem 1rem;
        gap: 1.5rem;
    }

    .profile-image-container {
        max-width: 200px;
        margin: 0 auto;
    }

    /* --- Compare mode --- */
    .compare-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .comparison-stat-row .stat-name {
        flex: 0 0 80px;
        font-size: 0.7rem;
    }

    /* --- Comparison modal --- */
    .comparison-header {
        padding: 1rem 1.25rem;
    }

    .comparison-header h2 {
        font-size: 1.1rem;
    }

    .comparison-grid {
        padding: 1.25rem;
        gap: 1rem;
    }

    .comparison-avatar {
        width: 60px;
        height: 60px;
    }

    .comparison-grade {
        font-size: 1.25rem;
    }

    .comparison-stats {
        padding: 1rem 1.25rem 1.25rem;
    }

    .comparison-stat-row .stat-name {
        flex: 0 0 100px;
        font-size: 0.75rem;
    }

    .stat-val {
        font-size: 0.9rem;
        min-width: 40px;
    }

    /* --- Exams --- */
    .events-content {
        padding: 1rem;
    }

    .exam-type-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    /* --- Admin --- */
    .admin-content {
        padding: 1rem;
    }

    .admin-login-container {
        max-width: 100%;
        margin: 2rem 1rem;
    }

    .admin-student-modal {
        max-width: calc(100vw - 2rem);
    }

    .admin-class-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-class-badge {
        width: 36px;
        height: 36px;
    }

    .admin-student-controls {
        flex-direction: column;
    }

    .admin-student-filter {
        width: 100%;
    }

    /* --- Creator --- */
    .creator-identity-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .creator-avatar-section {
        align-items: center;
    }

    .creator-avatar-preview {
        width: 120px;
        height: 120px;
    }

    .creator-select-group.class-select {
        grid-template-columns: repeat(2, 1fr);
    }

    .creator-card {
        padding: 1.25rem;
    }

    /* --- Creator export preview --- */
    .creator-preview-card .profile-header {
        padding: 1.25rem;
    }

    .creator-preview-card .profile-body {
        grid-template-columns: 1fr;
        padding: 0 1.25rem 1.25rem;
    }

    .creator-preview-card .profile-image-container {
        max-width: 200px;
        margin: 0 auto;
    }

    .creator-preview-card .profile-header-info h2 {
        font-size: 1.3rem;
    }

    .creator-export-actions {
        flex-direction: column;
    }

    .creator-export-actions .creator-btn {
        min-width: unset;
        width: 100%;
    }

    /* --- Trait quiz --- */
    .trait-quiz-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        min-height: 40px;
    }

    .trait-quiz-content {
        width: 95%;
    }

    .trait-quiz-header {
        padding: 1rem;
    }

    .trait-quiz-header h3 {
        font-size: 1.05rem;
    }

    .trait-quiz-body {
        padding: 1rem;
    }

    .trait-quiz-question {
        font-size: 0.9rem;
    }

    .trait-quiz-option {
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   MOBILE - SMALL SCREENS (400px)
   ======================================== */

@media (max-width: 400px) {
    .app-view {
        padding: 0 0.75rem 1.5rem;
    }

    .dashboard-header,
    .class-view-top {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding: 0.75rem;
    }

    .boot-logo {
        font-size: 2.5rem;
    }

    .lock-content {
        padding: 1.5rem;
    }

    .lock-content::before,
    .lock-content::after {
        width: 30px;
        height: 30px;
    }

    .student-card {
        padding: 0.75rem;
    }

    .student-card-avatar {
        width: 38px;
        height: 38px;
    }

    .profile-header {
        padding: 1rem;
    }

    .profile-header-info h2 {
        font-size: 1.25rem;
    }

    .profile-body {
        gap: 1rem;
    }

    .creator-avatar-preview {
        width: 100px;
        height: 100px;
    }

    .creator-card {
        padding: 1rem;
    }

    .creator-preview-card .profile-header {
        padding: 1rem;
    }

    .creator-preview-card .profile-body {
        grid-template-columns: 1fr;
        padding: 0 1rem 1rem;
        gap: 1rem;
    }

    .creator-preview-card .profile-header-info h2 {
        font-size: 1.1rem;
    }

    .eval-card {
        padding: 0.85rem;
    }

    .eval-card-controls {
        gap: 0.5rem;
    }

    .admin-content {
        padding: 0.75rem;
    }

    .admin-login-container {
        margin: 1.5rem 0.5rem;
    }

    .admin-login-icon {
        width: 60px;
        height: 60px;
    }

    /* --- Comparison modal --- */
    .comparison-stat-row .stat-name {
        flex: 0 0 80px;
        font-size: 0.7rem;
    }

    .stat-val {
        font-size: 0.8rem;
        min-width: 35px;
    }

    .comparison-header h2 {
        font-size: 1rem;
    }
}

/* ========================================
   MUSIC TOGGLE
   ======================================== */

.music-toggle {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(10, 20, 40, 0.8);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.music-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

.music-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.music-toggle:focus {
    outline: none;
}

.music-toggle:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(77, 201, 230, 0.15);
}

.music-toggle:hover svg {
    color: var(--cyan);
}

.music-toggle .music-icon-off {
    display: none;
}

.music-toggle.muted .music-icon-on {
    display: none;
}

.music-toggle.muted .music-icon-off {
    display: block;
}
