/* ==========================================================================
   WISUDA KEBIDANAN - MIDWIFERY GRADUATION EXPERIENCE
   Theme: Minimalist Elegant, Teal & Navy, Healthcare Professional
   ========================================================================== */

:root {
    --bg-deep: #060b14;
    --bg-card: rgba(10, 20, 38, 0.78);
    --bg-card-hover: rgba(14, 28, 50, 0.88);
    --border-gold: rgba(20, 184, 166, 0.30);
    --border-gold-bright: rgba(20, 184, 166, 0.65);
    --gold-primary: #14b8a6;
    --gold-bright: #2dd4bf;
    --gold-light: #ccfbf1;
    --gold-gradient: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    --gold-text-gradient: linear-gradient(135deg, #99f6e4 0%, #2dd4bf 50%, #0d9488 100%);
    --navy-light: #0f1e3d;
    --text-main: #f0fdfa;
    --text-muted: #94a3b8;
    --accent-emerald: #10b981;
    --accent-crimson: #ef4444;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-gold: 0 0 25px rgba(20, 184, 166, 0.20);
    --shadow-card: 0 20px 45px -10px rgba(0, 0, 0, 0.55);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Ambient Subtle Medical Background */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 15% 25%, rgba(13, 148, 136, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(6, 95, 70, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(6, 11, 20, 0.97) 0%, #040810 100%);
}

.ambient-dust {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(rgba(20, 184, 166, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.4;
    animation: drift 80s linear infinite;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-48px); }
}

/* Canvas Confetti Layer */
.confetti-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

/* Layout App Container */
.app-container {
    position: relative;
    z-index: 10;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation / Top Bar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

.nav-brand span.logo-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(20, 184, 166, 0.4));
    animation: floatCap 3s ease-in-out infinite;
}

@keyframes floatCap {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(4deg); }
}

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

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--gold-primary);
    transform: scale(1.08);
    color: var(--gold-bright);
}

.btn-text-nav {
    background: rgba(20, 184, 166, 0.10);
    border: 1px solid var(--border-gold);
    color: var(--gold-light);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-text-nav:hover {
    background: var(--gold-gradient);
    color: #f0fdfa;
    box-shadow: var(--shadow-gold);
}

/* Stepper Progress Bar */
.progress-section {
    margin-bottom: 2.25rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.step-badge {
    color: var(--gold-bright);
    font-weight: 700;
    background: rgba(20, 184, 166, 0.12);
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-gold);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
    height: 100%;
    width: 14.28%;
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.5);
}

/* Step Stages Container */
.stage {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stage.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Card Container Styles */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

/* Typography Enhancements */
.title-gold {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    line-height: 1.2;
    background: var(--gold-text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

/* General Button Styles */
.btn-primary {
    background: var(--gold-gradient);
    color: #f0fdfa;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.30);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(20, 184, 166, 0.45);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

/* ==========================================================================
   STAGE 1: OPENING - ENVELOPE CEREMONY (3D Realistic)
   ========================================================================== */
.envelope-wrapper {
    position: relative;
    max-width: 520px;
    margin: 3.5rem auto 3rem;
    perspective: 1200px;
    transition: margin-top 0.8s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.envelope-wrapper.open {
    margin-top: 13rem;
}

.envelope {
    position: relative;
    width: 100%;
    height: 330px;
    background: transparent;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.6s ease;
}

.envelope.open {
    overflow: visible;
}

/* Envelope Body Background — the main "back wall" */
.envelope-body-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #0c1a2e, #071018);
    border: 2px solid rgba(20, 184, 166, 0.35);
    border-radius: 18px;
    z-index: 1;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(20, 184, 166, 0.12);
    pointer-events: none;
}

/* === FLAP wrapper + 3D flip === */
.envelope-flap-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 170px;
    z-index: 15;
    perspective: 800px;
    pointer-events: none;
}

.envelope-flap {
    position: absolute;
    inset: 0;
    background: linear-gradient(175deg, #0e1f38, #0a1628);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    border-bottom: 2px solid var(--border-gold-bright);
    z-index: 15;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.6s;
}

.envelope-flap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(175deg, rgba(20, 184, 166, 0.05), transparent 60%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.envelope.open .envelope-flap {
    transform: rotateX(-180deg);
    opacity: 0;
}

/* === POCKET — lipatan depan bawah, menutupi surat === */
.envelope-pocket {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    background: linear-gradient(0deg, #081220 0%, #0d1e35 100%);
    clip-path: polygon(0 28%, 50% 62%, 100% 28%, 100% 100%, 0 100%);
    border-top: 1.5px solid rgba(20, 184, 166, 0.25);
    z-index: 10;
    pointer-events: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    box-shadow: inset 0 -5px 20px rgba(0, 0, 0, 0.3),
                inset 0 2px 10px rgba(20, 184, 166, 0.06);
    transition: box-shadow 0.6s ease;
}

/* Lipatan sisi kiri amplop */
.envelope-pocket::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    width: 50%;
    height: 130px;
    background: linear-gradient(120deg, #0a1628, #0d1e35);
    clip-path: polygon(0 0, 0 100%, 100% 100%);
    z-index: 1;
    border-right: 1px solid rgba(20, 184, 166, 0.10);
}

/* Lipatan sisi kanan amplop */
.envelope-pocket::after {
    content: '';
    position: absolute;
    top: -100px;
    right: 0;
    width: 50%;
    height: 130px;
    background: linear-gradient(240deg, #0a1628, #0d1e35);
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
    z-index: 1;
    border-left: 1px solid rgba(20, 184, 166, 0.10);
}

.envelope.open .envelope-pocket {
    box-shadow: inset 0 -5px 20px rgba(0, 0, 0, 0.3),
                inset 0 2px 10px rgba(20, 184, 166, 0.08),
                0 0 30px rgba(20, 184, 166, 0.10);
}

/* === WAX SEAL === */
.wax-seal {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    background: radial-gradient(circle at 35% 35%, #2dd4bf, #0d9488 70%, #065f46);
    border-radius: 50%;
    z-index: 20;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 25px rgba(20, 184, 166, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.5);
    user-select: none;
    touch-action: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: sealPulse 2.5s ease-in-out infinite;
}

@keyframes sealPulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 25px rgba(20, 184, 166, 0.5); }
    50% { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 45px rgba(20, 184, 166, 0.7), 0 0 80px rgba(20, 184, 166, 0.2); }
}

.wax-seal:hover {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 45px rgba(20, 184, 166, 0.8);
    animation: none;
}

.wax-seal-icon {
    font-size: 2.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.wax-seal-text {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #042f2e;
    text-transform: uppercase;
}

.wax-seal.broken {
    animation: breakSeal 0.7s forwards;
    pointer-events: none;
}

@keyframes breakSeal {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    25% {
        transform: translate(-50%, -60%) scale(1.4) rotate(5deg);
        opacity: 1;
        filter: brightness(1.6);
    }
    50% {
        transform: translate(-50%, -80%) scale(1.2) rotate(15deg);
        opacity: 0.7;
        filter: brightness(1.2);
    }
    100% {
        transform: translate(-50%, -140%) scale(0.3) rotate(60deg);
        opacity: 0;
        filter: brightness(0.5);
        pointer-events: none;
    }
}

/* === LETTER — surat, z-index rendah, tersembunyi di belakang pocket === */
.envelope-letter {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 20px;
    height: 300px;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 60%, #ccfbf1 100%);
    border: 2px solid #14b8a6;
    color: #1e293b;
    border-radius: 14px;
    padding: 1.8rem 1.6rem;
    z-index: 5;
    transform: translateY(0px);
    transition: transform 1s cubic-bezier(0.34, 1.15, 0.64, 1) 0.4s,
                box-shadow 0.8s ease 0.4s,
                z-index 0s linear 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    cursor: pointer;
}

/* Pola dekoratif inner surat */
.envelope-letter::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1.5px dashed rgba(13, 148, 136, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

.envelope.open .envelope-letter {
    transform: translateY(-210px);
    z-index: 25;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75),
                0 0 35px rgba(20, 184, 166, 0.35),
                0 0 80px rgba(20, 184, 166, 0.10);
    cursor: default;
}

.letter-header {
    border-bottom: 2px dashed rgba(13, 148, 136, 0.3);
    padding-bottom: 0.8rem;
}

.letter-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #0f766e;
    font-weight: 700;
}

.letter-recipient {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.25rem;
}

.letter-body {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
    margin: 0.8rem 0;
}

.seal-guide {
    text-align: center;
    margin-top: 2rem;
    color: var(--gold-light);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: pulseText 2s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.7; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* ==========================================================================
   STAGE 2: CHALLENGE 1 - GRADUATION CAP PUZZLE
   ========================================================================== */
.puzzle-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.puzzle-board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .puzzle-board-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
    }
}

.puzzle-dropzone {
    width: 280px;
    height: 280px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px dashed var(--border-gold-bright);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    padding: 10px;
    position: relative;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.6);
}

.puzzle-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(20, 184, 166, 0.25);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.puzzle-slot.highlight {
    background: rgba(20, 184, 166, 0.12);
    border-color: var(--gold-bright);
    box-shadow: inset 0 0 15px rgba(20, 184, 166, 0.3);
}

.puzzle-slot.solved {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
}

.puzzle-piece-tray {
    width: 280px;
    min-height: 280px;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    align-content: center;
}

.puzzle-piece {
    width: 100%;
    height: 110px;
    background: #0a1628;
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    cursor: grab;
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-piece:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 25px rgba(20, 184, 166, 0.25);
}

.puzzle-piece:active {
    cursor: grabbing;
}

.puzzle-piece svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.puzzle-piece.placed {
    cursor: default;
    box-shadow: none;
    border-color: rgba(20, 184, 166, 0.35);
    animation: snapPulse 0.4s ease;
}

@keyframes snapPulse {
    0% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.puzzle-complete-banner {
    display: none;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.puzzle-complete-banner.active {
    display: block;
}

/* ==========================================================================
   STAGE 3: CHALLENGE 2 - MEANINGFUL RIDDLE
   ========================================================================== */
.riddle-card {
    background: linear-gradient(145deg, rgba(10, 20, 40, 0.8), rgba(6, 14, 30, 0.9));
    border: 1px solid var(--border-gold-bright);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card), inset 0 0 30px rgba(20, 184, 166, 0.05);
    position: relative;
    max-width: 650px;
    margin: 0 auto;
}

.riddle-quote-mark {
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 1;
    color: rgba(20, 184, 166, 0.15);
    position: absolute;
    top: 15px;
    left: 20px;
    pointer-events: none;
}

.riddle-poem {
    font-size: 1.15rem;
    font-style: italic;
    color: #e2e8f0;
    line-height: 1.8;
    margin: 1.5rem 0 2rem;
    position: relative;
    z-index: 2;
    text-align: center;
}

.riddle-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .riddle-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.riddle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.riddle-btn:hover {
    background: rgba(20, 184, 166, 0.12);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.riddle-btn.correct {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: var(--accent-emerald) !important;
    color: #6ee7b7;
    animation: correctFlash 0.5s ease;
}

.riddle-btn.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--accent-crimson) !important;
    color: #fca5a5;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes correctFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.riddle-reflection {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(16, 185, 129, 0.12);
    border-left: 4px solid var(--accent-emerald);
    border-radius: var(--radius-sm);
    text-align: left;
    color: #d1fae5;
    animation: fadeIn 0.4s ease;
}

.riddle-reflection.active {
    display: block;
}

/* ==========================================================================
   STAGE 4: CHALLENGE 3 - RELATABLE COLLEGE QUIZ
   ========================================================================== */
.quiz-wrapper {
    max-width: 650px;
    margin: 0 auto;
}

.quiz-card-item {
    background: rgba(16, 24, 48, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.quiz-card-item.active-q {
    border-color: var(--gold-primary);
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.12);
}

.quiz-question-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-choice-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    text-align: left;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-choice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold-primary);
    color: #ffffff;
    transform: translateX(4px);
}

.quiz-choice-btn.selected {
    background: var(--gold-gradient);
    color: #f0fdfa;
    font-weight: 700;
    border-color: var(--gold-bright);
}

.badge-reward {
    display: none;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(10, 20, 38, 0.8));
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    box-shadow: var(--shadow-gold);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-reward.active {
    display: block;
}

@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.badge-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: rotateWiggle 3s infinite ease-in-out;
}

@keyframes rotateWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
}

/* ==========================================================================
   STAGE 5: CHALLENGE 4 - GRADUATION OATH TYPING
   ========================================================================== */
.oath-container {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.oath-target-box {
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    user-select: none;
}

.target-char {
    transition: color 0.15s ease;
}

.target-char.typed {
    color: var(--accent-emerald);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.target-char.current {
    color: #2dd4bf;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.oath-input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 1.15rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.2rem;
    outline: none;
    transition: var(--transition);
}

.oath-input-field:focus {
    border-color: var(--gold-bright);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-gold);
}

.oath-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.oath-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
    transition: width 0.2s ease;
}

/* ==========================================================================
   STAGE 6: CHALLENGE 5 - CATCH THE STARS MINI-GAME
   ========================================================================== */
.game-container {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.game-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full);
    padding: 0.6rem 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.game-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    background: linear-gradient(180deg, #060b14 0%, #0c1a2e 100%);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.8), var(--shadow-gold);
    cursor: crosshair;
    touch-action: none;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-start-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 26, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

/* ==========================================================================
   STAGE 7: GRAND REVEAL - FINAL GRADUATION CELEBRATION
   ========================================================================== */
.reveal-container {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.grand-certificate {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 50%, #f0fdfa 100%);
    border: 8px double #0d9488;
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    color: #1e293b;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(20, 184, 166, 0.20);
    margin-bottom: 2.5rem;
}

.cert-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #0f766e;
}

.cert-corner.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.cert-corner.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.cert-corner.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.cert-corner.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.cert-seal {
    width: 85px;
    height: 85px;
    margin: 0 auto 1.25rem;
    background: radial-gradient(circle, #2dd4bf, #0d9488);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border: 3px solid #fff;
    font-size: 2.2rem;
}

.cert-subtitle {
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #0f766e;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cert-title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: #134e4a;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.cert-presented {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.cert-name {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    color: #0f172a;
    font-weight: 800;
    border-bottom: 2px solid #0d9488;
    display: inline-block;
    padding: 0 1.5rem 0.5rem;
    margin-bottom: 1.25rem;
}

.cert-message {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #334155;
    max-width: 600px;
    margin: 0 auto 1.75rem;
    font-style: italic;
}

.cert-footer {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(13, 148, 136, 0.3);
}

.cert-sign-box {
    text-align: center;
}

.cert-sign-line {
    width: 140px;
    height: 1px;
    background: #0f172a;
    margin-bottom: 0.4rem;
}

.cert-sign-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

/* Polaroids Gallery */
.polaroids-wrapper {
    margin: 3rem 0;
}

.polaroids-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.polaroid-card {
    background: #ffffff;
    padding: 12px 12px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    width: 220px;
    color: #1e293b;
    transition: var(--transition);
    transform: rotate(var(--rot, 0deg));
}

.polaroid-card:hover {
    transform: rotate(0deg) scale(1.08);
    z-index: 20;
    box-shadow: 0 20px 45px rgba(20, 184, 166, 0.3);
}

.polaroid-photo {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #134e4a, #0f766e);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    font-size: 3rem;
}

.polaroid-caption {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
    color: #334155;
}

/* Action Floating Dock */
.action-dock {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Modal Customizer */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 18, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background: #0a1628;
    border: 1px solid var(--border-gold-bright);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
    position: relative;
    animation: popIn 0.35s ease;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

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

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.12);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness */
@media (max-width: 600px) {
    .app-container {
        padding: 0.75rem 0.5rem 3rem;
    }
    .card-glass {
        padding: 1.25rem 0.85rem;
        border-radius: var(--radius-md);
    }
    .title-gold {
        font-size: 1.5rem;
    }
    .subtitle {
        font-size: 0.9rem;
    }

    /* Stepper & Navbar Mobile */
    .navbar {
        padding: 0.6rem 0.85rem;
    }
    .nav-brand {
        font-size: 1rem;
    }
    .progress-header {
        font-size: 0.85rem;
    }

    /* Stage 1: Envelope Mobile */
    .envelope {
        height: 320px;
    }
    .envelope-flap-wrapper,
    .envelope-flap {
        height: 155px;
    }
    .envelope-letter {
        height: 290px;
        padding: 1.2rem 1rem;
        font-size: 0.88rem;
    }
    .letter-title {
        font-size: 1.15rem;
    }
    .letter-recipient {
        font-size: 0.95rem;
    }
    .letter-body {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    .envelope.open .envelope-letter {
        transform: translateY(-210px);
    }
    .envelope-wrapper.open {
        margin-top: 13rem;
    }
    .wax-seal {
        top: 125px;
        width: 68px;
        height: 68px;
    }
    .wax-seal-icon {
        font-size: 1.6rem;
    }
    .envelope-pocket {
        height: 180px;
    }

    /* Stage 4: Quiz Mobile */
    .quiz-card-item {
        padding: 1.25rem 0.85rem;
    }
    .quiz-question-title {
        font-size: 1rem;
    }
    .quiz-choice-btn {
        padding: 0.75rem 0.85rem;
        font-size: 0.88rem;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .quiz-choice-btn span:first-child {
        flex: 1;
        line-height: 1.4;
    }

    /* Stage 7: Polaroids & Certificate Mobile */
    .grand-certificate {
        padding: 1.5rem 0.85rem;
    }
    .cert-title {
        font-size: 1.4rem;
    }
    .cert-name {
        font-size: 1.3rem;
    }
    .cert-footer {
        flex-direction: column;
        gap: 1.25rem;
        align-items: center;
    }
    .cert-seal {
        margin-bottom: 0.5rem;
    }
    .polaroids-grid {
        gap: 1rem;
    }
    .polaroid-card {
        width: calc(50% - 0.5rem);
        padding: 8px 8px 14px;
        transform: rotate(0deg) !important;
    }
    .polaroid-photo {
        height: 110px;
        font-size: 2.2rem;
    }
    .polaroid-caption {
        font-size: 0.8rem;
        margin-top: 6px;
    }
    .action-grid-buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 380px) {
    .polaroid-card {
        width: 100%;
    }
    .letter-title {
        font-size: 1.05rem;
    }
    .letter-body {
        font-size: 0.8rem;
    }
}
