/* ===== ROBLOX BRAINROT GAME STYLE ===== */
/* Bright, colorful, chunky, FUN! */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;700;900&family=Bungee&display=swap');

:root {
    --bg-sky: #4fc3f7;
    --bg-sky-top: #29b6f6;
    --bg-grass: #66bb6a;
    --bg-card: #ffffff;
    --bg-input: #f0f4ff;
    --text-dark: #1a1a2e;
    --text-medium: #4a4a6a;
    --accent-yellow: #ffd600;
    --accent-orange: #ff9100;
    --accent-pink: #ff4081;
    --accent-green: #00e676;
    --accent-blue: #448aff;
    --accent-purple: #d500f9;
    --accent-red: #ff1744;
    --accent-cyan: #00e5ff;
    --success: #00e676;
    --locked-bg: #b0bec5;
    --locked-text: #78909c;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow-chunky: 0 6px 0 rgba(0,0,0,0.15);
    --shadow-card: 0 4px 0 rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.08);
    --border-thick: 4px solid rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Heebo', sans-serif;
    background: #1a1025;
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

/* Ambient particle overlay (subtle) */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, rgba(255,200,0,0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 60% 70%, rgba(255,150,0,0.2) 0%, transparent 100%),
        radial-gradient(2px 2px at 80% 20%, rgba(255,200,0,0.25) 0%, transparent 100%),
        radial-gradient(2px 2px at 40% 80%, rgba(255,100,0,0.2) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: particleDrift 8s ease-in-out infinite;
}

@keyframes particleDrift {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

#app {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== Screen System ===== */
.screen { display: none; min-height: 100vh; padding-bottom: 40px; }
#screen-home { padding-bottom: 0; height: 100vh; max-height: 100vh; overflow: hidden; }
#screen-quest { height: 100vh; overflow-y: auto; padding-bottom: 0; }
.screen.active { display: block; animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    60% { transform: scale(1.02) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== LAVA GAME MAP HOME SCREEN ===== */
.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    /* Map background image */
    background: url('map-bg.png') center center / cover no-repeat;
    background-color: #1a1025;
    overflow: hidden;
}

/* Subtle vignette overlay for depth */
.map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(10,5,20,0.4) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Lava glow at bottom */
.map-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15%;
    background: linear-gradient(180deg, transparent 0%, rgba(255,100,0,0.08) 50%, rgba(255,60,0,0.15) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Map banner / title */
.map-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: linear-gradient(180deg, rgba(15,15,40,0.95) 0%, rgba(25,25,60,0.92) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--accent-yellow);
    box-shadow: 0 3px 16px rgba(0,0,0,0.3), 0 0 20px rgba(255,214,0,0.15);
    height: 60px;
}

.map-title {
    font-family: 'Bungee', sans-serif;
    font-size: 1.8rem;
    background: linear-gradient(90deg, #ffd600, #ff9100, #ff4081);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(255,145,0,0.4));
    line-height: 1.2;
}

.map-xp {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.map-xp-bar {
    width: 180px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 9px;
    overflow: hidden;
    border: 2px solid rgba(255,214,0,0.4);
}

.map-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6d00, #ffd600, #ff9100);
    border-radius: 6px;
    transition: width 0.8s ease;
    box-shadow: 0 0 8px rgba(255,150,0,0.5);
}

.map-xp-text {
    font-weight: 900;
    font-size: 0.8rem;
    color: #ffd600;
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    text-shadow: 0 0 6px rgba(255,214,0,0.4);
}

/* SVG path layer */
.map-path-svg {
    position: absolute;
    top: 60px; /* offset for banner */
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ===== Quest Map - Positioned Landmarks ===== */
.quest-map {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
    margin-top: 60px; /* space for fixed banner */
    z-index: 2;
}

/* Map node - positioned absolutely */
.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 3;
}

.map-node:hover:not(.map-node-locked) {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 5;
}

.map-node-locked {
    cursor: default;
}

/* Circle - base style */
.map-node-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

/* Completed quest circle */
.map-node-complete-circle {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 5px solid var(--accent-green);
    box-shadow: 0 4px 0 #00a843, 0 0 15px rgba(0,230,118,0.5), 0 8px 20px rgba(0,0,0,0.15);
}

.map-node-check {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 0 #00a843;
    border: 2px solid #fff;
}

/* Mini family tree thumbnail in completed map node */
.map-node-ftree-thumb {
    width: 90px;
    height: 88px;
    padding: 0;
    overflow: hidden;
}

.ftree-mini {
    position: relative;
    width: 100%;
    height: 100%;
    background: url('photos/family-tree-bg.png') center center / contain no-repeat;
    border-radius: 50%;
}

.ftree-mini-photo {
    position: absolute;
    width: 16%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,0.6);
}

.ftree-mini-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ftree-mini-photo.ftree-mini-hero {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 3px rgba(255,214,0,0.5);
}

/* Next quest circle - pulsing with neon glow */
.map-node-next-circle {
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border: 5px solid var(--accent-yellow);
    box-shadow: 0 4px 0 #f9a825, 0 0 20px rgba(255,214,0,0.6), 0 8px 20px rgba(0,0,0,0.15);
    animation: mapNodePulse 2s infinite;
}

@keyframes mapNodePulse {
    0%, 100% { box-shadow: 0 4px 0 #f9a825, 0 0 20px rgba(255,214,0,0.6), 0 0 0 0 rgba(255,214,0,0.4); }
    50% { box-shadow: 0 4px 0 #f9a825, 0 0 30px rgba(255,214,0,0.8), 0 0 0 16px rgba(255,214,0,0); }
}

/* Treasure / book node */
.map-node-treasure-circle {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    border: 5px solid #e65100;
    box-shadow: 0 4px 0 #bf360c, 0 8px 20px rgba(0,0,0,0.2);
    animation: mapNodePulse 2s infinite;
}

/* Locked quest circle - dark volcanic stone */
.map-node-locked-circle {
    background: linear-gradient(135deg, #4a4a5a, #3a3a48, #2d2d3a);
    border: 4px solid #555;
    box-shadow: 0 4px 0 #222, 0 0 8px rgba(255,100,0,0.15), 0 6px 14px rgba(0,0,0,0.4);
}

.map-node-locked .map-node-emoji {
    font-size: 1.4rem;
    opacity: 0.5;
    filter: grayscale(0.5);
}

.map-node-step {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--locked-text);
    background: rgba(255,255,255,0.7);
    padding: 1px 8px;
    border-radius: 8px;
}

.map-node-emoji {
    font-size: 2rem;
}

.map-node-label {
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    background: rgba(15,15,40,0.85);
    padding: 3px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 10px rgba(255,214,0,0.15);
    white-space: nowrap;
    border: 1px solid rgba(255,214,0,0.3);
}

.map-node-subtitle {
    font-size: 0.7rem;
    color: var(--text-medium);
    font-weight: 600;
}

.map-node-xp {
    font-size: 0.7rem;
    font-weight: 900;
    color: #fff;
    background: var(--accent-green);
    padding: 2px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 0 #00a843;
}

.map-node-start {
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #ff9100, #ff4081);
    padding: 5px 18px;
    border-radius: 12px;
    box-shadow: 0 3px 0 #c62828, 0 0 12px rgba(255,64,129,0.4);
    cursor: pointer;
    transition: all 0.15s;
    animation: startBtnPulse 2s infinite;
}

@keyframes startBtnPulse {
    0%, 100% { box-shadow: 0 3px 0 #c62828, 0 0 12px rgba(255,64,129,0.4); }
    50% { box-shadow: 0 3px 0 #c62828, 0 0 20px rgba(255,64,129,0.7); }
}

.map-node-start:hover {
    background: linear-gradient(135deg, #ffab40, #ff80ab);
    transform: translateY(-2px);
}

/* ===== BRAINROT CHARACTERS - Actual image figures on map ===== */
#brainrot-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.brainrot {
    pointer-events: none;
}

/* Float/bounce animations for brainrot characters */
@keyframes brFloat1 {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}
@keyframes brFloat2 {
    0%, 100% { transform: translateY(0) rotate(2deg); }
    50% { transform: translateY(-8px) rotate(-4deg); }
}
@keyframes brFloat3 {
    0%, 100% { transform: translateY(-5px) rotate(5deg); }
    50% { transform: translateY(5px) rotate(-2deg); }
}
@keyframes brBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.05); }
}

/* ===== Quest Screen (centered, max-width for readability) ===== */
#screen-quest, #screen-book {
    max-width: 640px;
    margin: 0 auto;
}

.quest-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-back {
    background: var(--accent-blue);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 0 3px 0 #1565c0;
    transition: all 0.1s;
}

.btn-back:active { transform: translateY(2px); box-shadow: 0 1px 0 #1565c0; }

.quest-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    border: 3px solid rgba(0,0,0,0.1);
}

.quest-title {
    font-size: 1.4rem;
    font-weight: 900;
}

.quest-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quest-intro {
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 3px solid var(--accent-yellow);
    border-right: 8px solid var(--accent-yellow);
    line-height: 1.7;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}

.quest-message {
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border-radius: var(--radius);
    font-size: 1rem;
    border: 3px solid var(--accent-pink);
    box-shadow: var(--shadow-card);
}

.message-label {
    font-weight: 900;
    color: var(--accent-pink);
}

/* ===== Task Blocks ===== */
.task-block {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 3px solid rgba(0,0,0,0.05);
}

.task-info {
    line-height: 1.8;
    color: var(--text-medium);
    font-size: 1rem;
    font-weight: 500;
}

.task-label {
    display: block;
    font-weight: 900;
    font-size: 1.05rem;
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-dark);
}

textarea.task-input,
input[type="text"].task-input-small {
    width: 100%;
    background: var(--bg-input);
    border: 3px solid #c5cae9;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 1rem;
    padding: 14px 16px;
    resize: vertical;
    transition: all 0.2s;
    direction: rtl;
    font-weight: 500;
}

textarea.task-input:focus,
input[type="text"].task-input-small:focus,
select.task-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(68,138,255,0.2);
    background: #fff;
}

input[type="text"].task-input-small { padding: 10px 14px; }

select.task-select {
    width: 100%;
    background: var(--bg-input);
    border: 3px solid #c5cae9;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 1rem;
    padding: 10px 14px;
    direction: rtl;
    cursor: pointer;
    font-weight: 500;
}

/* ===== Story Box ===== */
.story-box {
    background: #fff3e0;
    border-radius: var(--radius-sm);
    padding: 20px;
    line-height: 1.9;
    border-right: 6px solid var(--accent-orange);
    font-style: italic;
    color: var(--text-medium);
    box-shadow: var(--shadow-card);
}

/* ===== Story Parchment (old-fashioned page) ===== */
.story-parchment {
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #f5e6c8 0%, #ede0c8 40%, #e8d5b0 100%);
    border-radius: 4px;
    padding: 28px 24px;
    line-height: 2;
    font-family: 'Frank Ruhl Libre', 'David', serif;
    font-size: 1rem;
    font-weight: 400;
    color: #3e2723;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15), inset 0 0 40px rgba(139,90,43,0.08);
    border: 2px solid #c9a96e;
    position: relative;
}

.story-parchment::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(139,90,43,0.2);
    border-radius: 2px;
    pointer-events: none;
}

/* ===== Drag-Select Task ===== */
.drag-select-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.drag-select-option {
    direction: rtl;
    text-align: right;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.drag-select-option:hover {
    border-color: var(--accent-blue, #2196F3);
    background: #e3f2fd;
}

.drag-select-option.selected {
    border-color: var(--accent-green);
    background: #e8f5e9;
    box-shadow: 0 0 0 2px rgba(0,230,118,0.3);
}

.drag-select-option.selected::before {
    content: '✓ ';
    color: var(--accent-green);
    font-weight: 900;
}

/* ===== Family Grid - With Photos ===== */
.family-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.family-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-radius: var(--radius-sm);
    border: 3px solid #ce93d8;
    box-shadow: 0 3px 0 rgba(0,0,0,0.08);
    transition: transform 0.15s;
}

.family-member:hover { transform: scale(1.03); }

.member-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
    overflow: hidden;
    border: 4px solid var(--accent-yellow);
    box-shadow: 0 3px 0 #f9a825, 0 6px 12px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    color: #fff;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--text-dark);
    text-align: center;
}

.member-relation {
    font-size: 0.7rem;
    color: var(--text-medium);
    font-weight: 600;
}

.family-member .task-input-small { text-align: center; font-size: 0.9rem; }

/* ===== Family Flow - One Person at a Time ===== */
.family-flow-block {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 3px solid rgba(0,0,0,0.05);
}

.flow-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.flow-progress-bar {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.flow-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 5px;
    transition: width 0.4s ease;
}

.flow-progress-text {
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--text-medium);
    white-space: nowrap;
}

.flow-generation {
    text-align: center;
    font-weight: 900;
    font-size: 0.85rem;
    color: #fff;
    background: var(--accent-purple);
    padding: 8px 20px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 3px 0 #9c27b0;
    letter-spacing: 0.5px;
}

.flow-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 0 16px;
    animation: flowSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes flowSlideIn {
    from { opacity: 0; transform: translateX(-30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.flow-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--accent-yellow);
    box-shadow: 0 6px 0 #f9a825, 0 10px 30px rgba(0,0,0,0.15);
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* object-position set per-photo via inline style */
}

.flow-person-hero .flow-photo {
    width: 200px;
    height: 200px;
    border-color: var(--accent-orange);
    box-shadow: 0 6px 0 #e65100, 0 0 0 8px rgba(255,145,0,0.2), 0 10px 30px rgba(0,0,0,0.15);
    animation: heroGlow 1.5s infinite;
}

@keyframes heroGlow {
    0%, 100% { box-shadow: 0 6px 0 #e65100, 0 0 0 8px rgba(255,145,0,0.2), 0 10px 30px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 6px 0 #e65100, 0 0 0 16px rgba(255,145,0,0.1), 0 10px 30px rgba(0,0,0,0.15); }
}

.flow-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-top: 4px;
}

.flow-relation {
    font-size: 1rem;
    color: var(--text-medium);
    font-weight: 700;
    background: #f3e5f5;
    padding: 4px 16px;
    border-radius: 12px;
}

.flow-person-hero .flow-relation {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    color: #fff;
    font-size: 1.1rem;
    padding: 6px 20px;
    box-shadow: 0 2px 0 #e65100;
}

.flow-input-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-top: 8px;
    text-align: center;
}

.flow-word-input {
    max-width: 280px;
    text-align: center;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    border-color: var(--accent-purple) !important;
}

.flow-word-input:focus {
    border-color: var(--accent-pink) !important;
    box-shadow: 0 0 0 4px rgba(213,0,249,0.15) !important;
}

.flow-hero-message {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent-orange);
    text-align: center;
    padding: 12px;
    background: #fff3e0;
    border-radius: var(--radius-sm);
    border: 3px solid var(--accent-yellow);
    margin-top: 4px;
}

.flow-nav {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
}

.flow-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.1s;
}

.flow-btn-prev {
    background: #e0e0e0;
    color: var(--text-medium);
    box-shadow: 0 4px 0 #bdbdbd;
}

.flow-btn-prev:hover:not(:disabled) { background: #d5d5d5; }
.flow-btn-prev:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #bdbdbd; }
.flow-btn-prev:disabled { opacity: 0.4; cursor: not-allowed; }

.flow-btn-next {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 0 #1565c0;
}

.flow-btn-next:hover { background: #2979ff; }
.flow-btn-next:active { transform: translateY(2px); box-shadow: 0 2px 0 #1565c0; }

.flow-btn-done {
    background: var(--accent-green);
    box-shadow: 0 4px 0 #00a843;
}

.flow-btn-done:hover { background: #00c853; }
.flow-btn-done:active { transform: translateY(2px); box-shadow: 0 2px 0 #00a843; }

/* ===== Illustrated Family Tree ===== */
/* ===== ILLUSTRATED FAMILY TREE (Photo Template Overlay) ===== */
.ftree {
    padding: 0;
    text-align: center;
    animation: bounceIn 0.5s ease;
    max-width: 600px;
    margin: 0 auto;
}

.ftree-title {
    font-family: 'Bungee', sans-serif;
    font-size: 1.3rem;
    color: #2e7d32;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
}

/* Tree template container */
.ftree-map {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    aspect-ratio: 2094 / 2048;
    background: url('photos/family-tree-bg.png') center center / contain no-repeat;
    border-radius: 16px;
    overflow: visible;
    container-type: inline-size;
}

/* ---- PHOTO CIRCLES (centered on green template circles) ---- */
.ftree-photo-circle {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    z-index: 3;
}

.ftree-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Photo sizes scale with template (circles are ~10.5% of image width) */
.ftree-photo-circle.ftree-gp,
.ftree-photo-circle.ftree-parent,
.ftree-photo-circle.ftree-child {
    width: 10.5%;
    aspect-ratio: 1;
    border: 2px solid rgba(255,255,255,0.7);
}

.ftree-photo-circle.ftree-hero {
    width: 11.5%;
    aspect-ratio: 1;
    border: 3px solid var(--accent-yellow);
    box-shadow: 0 0 10px rgba(255,214,0,0.5), 0 0 20px rgba(255,145,0,0.25);
    animation: heroGlow 1.5s infinite;
}

/* ---- LABELS (centered on pink banners) ---- */
.ftree-label {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 4;
    gap: 0;
    pointer-events: none;
}

/* Single line "name - relation" centered on the ~3.3%-tall pink banner */
.ftree-label-name {
    font-family: 'Heebo', sans-serif;
    font-size: clamp(0.38rem, 1.6cqi, 0.55rem);
    font-weight: 800;
    color: #fff;
    padding: 0 3px;
    white-space: nowrap;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.4);
}

/* Quote appears below the banner as a subtle separate line */
.ftree-label-word {
    font-family: 'Heebo', sans-serif;
    font-size: clamp(0.34rem, 1.3cqi, 0.44rem);
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    font-style: italic;
    max-width: 90px;
    line-height: 1.15;
    margin-top: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Hero label — same white as everyone else */
.ftree-label.ftree-hero .ftree-label-name {
    font-size: clamp(0.42rem, 1.8cqi, 0.6rem);
}

/* ===== Kahoot Guide ===== */
.kahoot-steps {
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: step;
}

.kahoot-steps li {
    padding: 14px 16px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: var(--radius-sm);
    line-height: 1.6;
    border: 2px solid #a5d6a7;
    font-weight: 600;
    box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

/* ===== Checklist ===== */
.checklist, .multiselect { display: flex; flex-direction: column; gap: 10px; }

.check-item, .select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    border: 3px solid #e0e0e0;
    font-weight: 600;
}

.check-item:hover, .select-item:hover {
    border-color: var(--accent-blue);
    background: #e3f2fd;
    transform: translateY(-2px);
}

.check-item input, .select-item input {
    accent-color: var(--accent-green);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* ===== Twin Inputs ===== */
.twin-inputs { display: flex; flex-direction: column; gap: 10px; }

.twin-input-row { display: flex; align-items: center; gap: 12px; }

.twin-number {
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-pink);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 0 #c51162;
}

.twin-input-row .task-input-small { flex: 1; }

/* ===== Twin Sort (Quest 6) ===== */
.ts-container {
    width: 100%;
}

.ts-stage-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    direction: rtl;
}

.ts-stage-icon {
    font-size: 2rem;
}

.ts-stage-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0;
}

.ts-image-wrap {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ts-image, .ml-image {
    width: 100%;
    border-radius: 16px;
    object-fit: contain;
    max-height: 300px;
}

.ts-intro {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 16px;
    text-align: right;
}

/* Bins row */
.ts-bins {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.ts-bin {
    background: color-mix(in srgb, var(--bin-color) 10%, white);
    border: 3px dashed var(--bin-color);
    border-radius: 16px;
    padding: 10px 6px;
    min-height: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ts-bin:hover {
    border-style: solid;
    background: color-mix(in srgb, var(--bin-color) 18%, white);
}

.ts-bin.drag-over {
    border-style: solid;
    border-width: 4px;
    background: color-mix(in srgb, var(--bin-color) 25%, white);
    box-shadow: 0 0 16px color-mix(in srgb, var(--bin-color) 40%, transparent);
    transform: scale(1.03);
    transition: all 0.15s ease;
}

.ts-bin-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.ts-bin-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

/* Card pool */
.ts-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ts-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    cursor: grab;
    transition: all 0.25s ease;
    text-align: center;
    max-width: 200px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.ts-card:active:not(.placed) {
    cursor: grabbing;
}

.ts-card:hover:not(.placed) {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ts-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.ts-card.selected {
    border-color: #E91E63;
    background: #fce4ec;
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.3);
    transform: scale(1.05);
}

.ts-card.placed {
    font-size: 0.75rem;
    padding: 6px 8px;
    cursor: default;
    max-width: none;
}

.ts-card.correct {
    background: #e8f5e9;
    border-color: #4CAF50;
    color: #2e7d32;
}

.ts-card.correct::after {
    content: ' ✓';
    color: #4CAF50;
    font-weight: 900;
}

.ts-card.wrong {
    background: #ffebee;
    border-color: #f44336;
    animation: shake 0.4s ease;
}

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

/* ===== Mad Libs (Quest 6) ===== */
.ml-container {
    width: 100%;
}

.ml-sentence {
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border: 3px solid #E91E63;
    border-radius: 18px;
    padding: 20px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 2.2;
    color: #333;
    text-align: right;
    direction: rtl;
}

.ml-select {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    border: 2px solid #E91E63;
    border-radius: 10px;
    background: #fff;
    color: #E91E63;
    cursor: pointer;
    appearance: auto;
    margin: 0 4px;
}

.ml-select:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.3);
}

.ml-completion {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease;
}

.ml-completion.visible {
    max-height: 200px;
    opacity: 1;
    margin-top: 16px;
}

.ml-completion p {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #4CAF50;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    font-weight: 700;
    color: #2e7d32;
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== Trophy Cabinet (Quest 7) ===== */
.trophy-hero {
    text-align: center;
    margin-bottom: 8px;
}

.trophy-hero-img,
.trophy-hero-video {
    width: 100%;
    border-radius: 16px;
    border: 4px solid #FFD54F;
    box-shadow: 0 0 20px rgba(255, 213, 79, 0.4);
}

.trophy-hero-caption {
    font-size: 1.15rem;
    font-weight: 800;
    color: #F57F17;
    margin-top: 10px;
}

/* Medal counter */
.tc-counter {
    text-align: center;
    margin-bottom: 10px;
    padding: 8px 16px;
    background: #fff8e1;
    border: 2px solid #FFC107;
    border-radius: 14px;
}

.tc-counter.complete {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.tc-counter.complete .tc-counter-text {
    color: #2e7d32;
}

.tc-counter-text {
    font-size: 1rem;
    color: #F57F17;
}

/* Cabinet */
.tc-wrap {
    width: 100%;
}

.tc-cabinet {
    background: linear-gradient(180deg, #5D4037 0%, #4E342E 100%);
    border: 4px solid #8D6E63;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
    min-height: 200px;
}

.tc-shelf {
    background: linear-gradient(180deg, #8D6E63 0%, #6D4C41 100%);
    border-radius: 10px;
    min-height: 60px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    border-bottom: 4px solid #4E342E;
    transition: all 0.2s ease;
}

.tc-shelf.drag-over {
    background: linear-gradient(180deg, #A1887F 0%, #8D6E63 100%);
    box-shadow: inset 0 0 12px rgba(255, 213, 79, 0.4);
    border-color: #FFD54F;
}

/* Medal pool */
.tc-medal-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    padding: 12px;
    background: #f5f0e8;
    border-radius: 16px;
    border: 2px dashed #BCAAA4;
}

/* Medal */
.tc-medal {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--medal-color), color-mix(in srgb, var(--medal-color) 70%, white));
    border: 2px solid color-mix(in srgb, var(--medal-color) 80%, #333);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    cursor: grab;
    transition: all 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

.tc-medal:active:not(.placed) { cursor: grabbing; }

.tc-medal:hover:not(.placed) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tc-medal.dragging { opacity: 0.5; }

.tc-medal.selected {
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.5);
    transform: scale(1.05);
    border-color: #FFC107;
}

.tc-medal.placed {
    cursor: pointer;
    border-style: solid;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.tc-medal.proudest {
    border-color: #FFD54F;
    box-shadow: 0 0 16px rgba(255, 213, 79, 0.6);
    transform: scale(1.1);
}

.tc-medal-icon { font-size: 1.3rem; }
.tc-medal-text { white-space: nowrap; }

/* Medal Factory */
.mf-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(135deg, #f3e5f5, #ede7f6, #e8eaf6);
    border: 3px solid #CE93D8;
    border-radius: 22px;
    padding: 20px 16px;
    box-shadow: inset 0 2px 8px rgba(156, 39, 176, 0.08), 0 4px 12px rgba(0,0,0,0.06);
}

.mf-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.mf-header-icon { font-size: 1.8rem; }

.mf-header-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4A148C;
}

.mf-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mf-prefix {
    font-weight: 700;
    color: #5D4037;
    font-size: 0.95rem;
}

.mf-select-wrap {
    position: relative;
}

.mf-select-wrap::after {
    content: '▼';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #9575CD;
    pointer-events: none;
}

.mf-select {
    width: 100%;
    padding: 12px 16px;
    padding-left: 32px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid #CE93D8;
    border-radius: 20px;
    background: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
    direction: rtl;
}

.mf-select:hover {
    border-color: #AB47BC;
    box-shadow: 0 2px 8px rgba(171, 71, 188, 0.15);
}

.mf-select:focus {
    outline: none;
    border-color: #AB47BC;
    box-shadow: 0 0 12px rgba(171, 71, 188, 0.25);
}

/* Produce button */
.mf-produce-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: inherit;
    border: 3px solid #ccc;
    border-radius: 20px;
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.mf-produce-btn.ready {
    background: linear-gradient(135deg, #FFC107, #FFD54F);
    border-color: #FFA000;
    color: #4E342E;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.35);
}

.mf-produce-btn.ready:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(255, 193, 7, 0.5);
}

/* Produced medal result */
.mf-result {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s ease, opacity 0.5s ease;
}

.mf-result.visible {
    max-height: 200px;
    opacity: 1;
}

.mf-produced-medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    background: linear-gradient(135deg, #fffde7, #fff8e1);
    border: 3px solid #FFC107;
    border-radius: 22px;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.35);
    text-align: center;
    animation: medalPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes medalPopIn {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.mf-produced-icon { font-size: 2.5rem; }

.mf-produced-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #F57F17;
}

.mf-produced-detail {
    font-size: 0.85rem;
    color: #795548;
    line-height: 1.5;
}

/* Trophy Select */
.tselect-wrap { text-align: center; }

.tselect-hint {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-bottom: 12px;
}

.tselect-trophy {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s ease, opacity 0.5s ease;
    text-align: center;
}

.tselect-trophy.visible {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 12px;
}

.tselect-golden {
    font-size: 5rem;
    animation: trophyPulse 1.5s ease infinite;
}

@keyframes trophyPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255,193,7,0.4)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255,193,7,0.8)); }
}

.tselect-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #F57F17;
    margin-top: 8px;
}

/* ===== Secret Envelopes (Quest 8) ===== */
.env-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.env-card {
    border: 3px solid var(--env-color, #7C4DFF);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.env-card:hover:not(.opened) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--env-color) 30%, transparent);
}

.env-closed {
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    background: color-mix(in srgb, var(--env-color) 8%, white);
}

.env-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease, padding 0.3s ease;
    padding: 0 20px;
    text-align: center;
}

.env-card.opened .env-content {
    max-height: 200px;
    opacity: 1;
    padding: 16px 20px;
}

.env-card.opened .env-closed {
    background: var(--env-color);
    color: #fff;
}

.env-quote {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.7;
    font-style: italic;
    margin: 0 0 8px;
}

.env-from {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--env-color);
}

/* ===== Cinema Videos (Quest 9) ===== */
.cin-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 20px 14px;
}

.cin-video-box {
    border: 2px solid #4FC3F7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.25);
    background: #0d0d1a;
}

.cin-video-title {
    padding: 10px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #4FC3F7;
    text-align: center;
    background: rgba(79, 195, 247, 0.1);
}

.cin-video {
    width: 100%;
    display: block;
    border-radius: 0 0 14px 14px;
}

.cin-placeholder {
    padding: 40px 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    background: #111;
}

/* ===== Emotion Board (Quest 9) ===== */
.emo-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.emo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: 3px solid #e0e0e0;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}

.emo-btn:hover {
    border-color: var(--emo-color);
    transform: translateY(-2px);
}

.emo-btn.selected {
    border-color: var(--emo-color);
    background: color-mix(in srgb, var(--emo-color) 12%, white);
    box-shadow: 0 0 16px color-mix(in srgb, var(--emo-color) 35%, transparent);
    transform: scale(1.08);
}

.emo-icon { font-size: 2rem; }

.emo-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    text-align: center;
}

/* ===== Card Builder (Quest 10 - Grand Finale) ===== */
.cb-wrap {
    width: 100%;
}

.cb-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border: 3px solid #FF5722;
    border-radius: 22px;
    padding: 20px 16px;
}

.cb-reveal-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 900;
    font-family: inherit;
    border: 3px solid #ccc;
    border-radius: 20px;
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.cb-reveal-btn.ready {
    background: linear-gradient(135deg, #FF5722, #FF9800);
    border-color: #E64A19;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.4);
    animation: finaleGlow 2s ease infinite;
}

@keyframes finaleGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 87, 34, 0.4); }
    50% { box-shadow: 0 8px 36px rgba(255, 87, 34, 0.7); }
}

.cb-reveal-btn.ready:hover {
    transform: scale(1.05);
}

.cb-result {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.8s ease, opacity 0.6s ease;
}

.cb-result.visible {
    max-height: 800px;
    opacity: 1;
}

.cb-confetti {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 8px;
    margin-bottom: 16px;
    animation: confettiBounce 1s ease infinite;
}

@keyframes confettiBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.cb-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 4px solid #FFD54F;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 213, 79, 0.4);
    animation: cardFlipIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardFlipIn {
    0% { transform: perspective(600px) rotateY(90deg) scale(0.5); opacity: 0; }
    100% { transform: perspective(600px) rotateY(0deg) scale(1); opacity: 1; }
}

.cb-card-img-wrap {
    width: 100%;
    overflow: hidden;
}

.cb-card-img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.cb-card-body {
    padding: 20px;
    text-align: center;
}

.cb-card-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #FFD54F;
    margin-bottom: 12px;
    font-family: 'Bungee', cursive;
}

.cb-card-line {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 6px 0;
}

.cb-finale {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #FF5722;
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border-radius: 18px;
    border: 3px solid #FF5722;
    animation: medalPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== Superpower Survey ===== */
.superpower-survey { display: flex; flex-direction: column; gap: 12px; }

.survey-person {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f3e5f5;
    border-radius: var(--radius-sm);
    border: 2px solid #ce93d8;
}

.survey-person .task-input-small { flex: 1; }
.survey-person .task-select { flex: 1.5; }

/* ===== Support Map ===== */
.support-map { display: flex; flex-direction: column; gap: 10px; }

.support-cat {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--accent-blue);
    border-radius: 10px;
    box-shadow: 0 3px 0 #1565c0;
}

.support-person {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: #e3f2fd;
    border-radius: var(--radius-sm);
    border: 2px solid #90caf9;
}

.support-person .task-input-small { flex: 1; }

/* ===== Complete Button - BIG CHUNKY GAME BUTTON ===== */
.quest-footer {
    padding: 16px 20px 40px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, rgba(79,195,247,0.8) 30%);
    z-index: 10;
}

.btn-complete {
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--accent-green) 0%, #00c853 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 6px 0 #00a843, 0 8px 20px rgba(0,0,0,0.15);
    text-shadow: 1px 2px 0 rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
}

.btn-complete:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #00a843, 0 12px 30px rgba(0,0,0,0.2);
}

.btn-complete:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #00a843;
}

.btn-complete:disabled, .btn-complete.completed {
    background: linear-gradient(180deg, #b0bec5, #90a4ae);
    box-shadow: 0 4px 0 #78909c;
    cursor: default;
    text-shadow: none;
}

/* ===== XP Overlay - Party Celebration ===== */
.xp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.xp-overlay.visible { opacity: 1; }

.xp-popup {
    text-align: center;
    padding: 40px 30px;
    background: #fff;
    border-radius: 30px;
    border: 5px solid var(--accent-yellow);
    box-shadow: 0 8px 0 #f9a825, 0 20px 60px rgba(0,0,0,0.3);
    animation: popBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 340px;
}

@keyframes popBounce {
    0% { transform: scale(0.3) rotate(-5deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.xp-popup-icon { font-size: 4.5rem; margin-bottom: 12px; }

.xp-popup h3 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.xp-gain {
    font-family: 'Bungee', sans-serif;
    font-size: 3rem;
    color: var(--accent-orange);
    text-shadow: 2px 2px 0 var(--accent-yellow);
}

.xp-message {
    color: var(--text-medium);
    font-size: 1.1rem;
    margin-top: 10px;
    font-style: italic;
    font-weight: 600;
}

.xp-next {
    margin-top: 16px;
    color: #fff;
    font-weight: 900;
    background: var(--accent-green);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 12px;
    box-shadow: 0 3px 0 #00a843;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #fff;
    color: var(--text-dark);
    padding: 16px 24px;
    border-radius: var(--radius);
    border: 3px solid var(--accent-orange);
    font-size: 1rem;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s;
    z-index: 200;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 4px 0 #e65100, 0 8px 20px rgba(0,0,0,0.15);
}

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

/* ===== Hero Book ===== */
.book-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

.book-header h2 { font-size: 1.4rem; font-weight: 900; }

.book-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-page {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 3px solid rgba(0,0,0,0.06);
}

.title-page {
    text-align: center;
    padding: 50px 24px;
    background: linear-gradient(135deg, #fff3e0, #fce4ec, #e8eaf6);
}

.title-page h1 {
    font-family: 'Bungee', sans-serif;
    font-size: 2rem;
    color: var(--accent-orange);
    text-shadow: 2px 2px 0 var(--accent-yellow);
}

.title-page h2 { font-size: 1.5rem; margin-top: 8px; color: var(--text-dark); }
.title-page p { color: var(--text-medium); margin-top: 6px; font-weight: 600; }

.book-chapter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

.chapter-icon { font-size: 1.6rem; }
.book-chapter-header h3 { font-size: 1.1rem; font-weight: 900; }

.book-message {
    text-align: center;
    padding: 10px 20px;
    color: var(--text-medium);
    font-style: italic;
    font-weight: 600;
}

.book-responses {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-response {
    line-height: 1.7;
    padding: 10px 0;
    border-bottom: 2px dashed #e0e0e0;
    font-weight: 500;
}

.book-footer {
    padding: 20px 24px 40px;
    display: flex;
    gap: 12px;
}

.btn-export {
    flex: 1;
    padding: 16px;
    border: 3px solid var(--accent-blue);
    border-radius: var(--radius);
    background: #fff;
    color: var(--accent-blue);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}

.btn-export:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #1565c0;
}

/* ===== Print Styles ===== */
/* ===== Investigation Quiz (Quest 3) ===== */
.iq-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.iq-step {
    background: #f8f6ff;
    border: 2px solid #e0ddf0;
    border-radius: var(--radius);
    padding: 18px;
    transition: opacity 0.3s, border-color 0.3s;
}

.iq-step.locked {
    opacity: 0.4;
    pointer-events: none;
}

.iq-step.solved {
    border-color: var(--accent-green);
    background: #f0fff4;
}

.iq-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.iq-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}

.iq-step.solved .iq-step-number {
    background: var(--accent-green);
}

.iq-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.iq-check {
    color: var(--accent-green);
    font-size: 1.4rem;
    font-weight: 900;
}

.iq-story {
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 14px;
}

.iq-question {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.iq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.iq-option-btn {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 2px solid #d0d4e0;
    border-radius: 14px;
    background: #fff;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iq-option-btn:hover:not(:disabled) {
    background: #f0f4ff;
    border-color: var(--accent-blue);
}

.iq-option-btn.correct {
    background: #e8f5e9;
    border-color: var(--accent-green);
    color: #2e7d32;
}

.iq-option-btn.wrong {
    background: #ffeef0;
    border-color: var(--accent-red);
    animation: shake 0.4s ease;
}

.iq-option-btn.faded {
    opacity: 0.5;
}

.iq-option-btn:disabled {
    cursor: default;
}

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

.iq-reveal {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin 0.3s ease;
    margin-top: 0;
}

.iq-reveal.visible {
    max-height: 800px;
    opacity: 1;
    margin-top: 14px;
}

.iq-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.iq-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    background: #f0f0f0;
}

.iq-caption {
    color: var(--text-medium);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

.iq-reveal-story {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 12px 0 0;
    padding: 12px;
    background: #f8f6ff;
    border-radius: 10px;
    border-right: none;
}

.iq-completion {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease;
}

.iq-completion.visible {
    max-height: 200px;
    opacity: 1;
}

.iq-completion p {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid var(--accent-green);
    border-radius: var(--radius);
    padding: 18px;
    color: #2e7d32;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.7;
    margin: 0;
}

/* ===== Hero Journey Timeline (Quest 4) ===== */
/* ── Hero Journey: Accordion Cards ── */
.hj-container {
    width: 100%;
}

.hj-instruction {
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border: 3px solid #ff8f00;
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #4e342e;
    text-align: center;
    line-height: 1.6;
}

.hj-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card - closed state */
.hj-card {
    border-radius: 18px;
    border: 3px solid var(--station-color, #7EC8E3);
    background: #f7f9ff;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hj-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Card - open state: glowing focus border */
.hj-card.open {
    border-color: var(--station-color, #7EC8E3);
    box-shadow: 0 0 16px color-mix(in srgb, var(--station-color) 35%, transparent),
                0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Card header button */
.hj-card-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    direction: rtl;
    transition: background 0.2s ease;
}

.hj-card-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.hj-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--station-color) 15%, white);
    border-radius: 14px;
    border: 2px solid var(--station-color, #7EC8E3);
}

.hj-card.open .hj-card-icon {
    background: var(--station-color, #7EC8E3);
    border-color: var(--station-color, #7EC8E3);
}

.hj-card-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
    text-align: right;
}

.hj-card-hint {
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.hj-card.open .hj-card-hint {
    color: var(--station-color, #7EC8E3);
}

/* Card body - expandable */
.hj-card-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease, padding 0.3s ease;
    padding: 0 18px;
}

.hj-card.open .hj-card-body {
    max-height: 300px;
    opacity: 1;
    padding: 0 18px 18px;
}

.hj-card-body p {
    background: color-mix(in srgb, var(--station-color) 8%, #f8f9ff);
    border-radius: 14px;
    border-right: 4px solid var(--station-color, #7EC8E3);
    padding: 16px 18px;
    color: #333;
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
    text-align: right;
    animation: fadeSlideIn 0.4s ease;
}

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

/* ===== Power Stones (Quest 4) ===== */
.ps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.ps-stone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 90px;
    padding: 14px 10px;
    border-radius: 16px;
    background: #f0f0f8;
    border: 3px solid #e0e0ee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ps-stone:hover {
    border-color: var(--stone-color, #ccc);
    transform: scale(1.03);
}

.ps-stone.lit {
    background: color-mix(in srgb, var(--stone-color) 20%, white);
    border-color: var(--stone-color);
    box-shadow: 0 0 16px color-mix(in srgb, var(--stone-color) 30%, transparent);
}

.ps-icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.ps-stone.lit .ps-icon {
    transform: scale(1.2);
}

.ps-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
}

/* ===== Message Bubbles (Quest 4) ===== */
.mb-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.mb-bubble {
    padding: 14px 18px;
    border-radius: 20px;
    background: #f0f4ff;
    border: 2px solid #e0e4f0;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
}

.mb-bubble:hover {
    background: #e8ecff;
    border-color: var(--accent-blue);
}

.mb-bubble.selected {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: var(--accent-blue);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(68, 138, 255, 0.2);
}

.mb-container .mb-bubble:not(.selected) {
    opacity: 1;
    transition: opacity 0.3s ease, all 0.3s ease;
}

.mb-container:has(.selected) .mb-bubble:not(.selected) {
    opacity: 0.55;
}

/* ===== Brain Meters (Quest 5) ===== */
.brain-meters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.meter-row {
    background: #f0f4ff;
    border: 2px solid #e0e4f0;
    border-radius: var(--radius-sm);
    padding: 14px;
}

.meter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.meter-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.meter-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.meter-bar-track {
    width: 100%;
    height: 14px;
    background: #e0e4f0;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 10px;
}

.meter-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.4s ease;
}

.meter-levels {
    display: flex;
    gap: 8px;
}

.meter-level-btn {
    flex: 1;
    min-height: 48px;
    padding: 10px 4px;
    border: 2px solid #d0d4e0;
    border-radius: 12px;
    background: #fff;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meter-level-btn:hover {
    background: #f0f4ff;
    border-color: #b0b4c0;
}

.meter-level-btn.selected {
    background: var(--meter-color, #4D96FF);
    border-color: var(--meter-color, #4D96FF);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: scale(1.05);
}

/* ===== Brain Bubble Map (Quest 5) ===== */
.brain-map-section {
    margin-top: 20px;
}

.brain-map-reveal-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: inherit;
    border: 3px solid #ccc;
    border-radius: 16px;
    background: #e8e8e8;
    color: #999;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.brain-map-reveal-btn.ready {
    background: linear-gradient(135deg, #6C63FF, #9B59B6);
    border-color: #6C63FF;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
}

.brain-map-reveal-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4);
}

.brain-map-result {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s ease, opacity 0.5s ease;
}

.brain-map-result.visible {
    max-height: 1400px;
    opacity: 1;
}

.brain-map-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .brain-map-charts {
        grid-template-columns: 1fr;
    }
}

.brain-map-box {
    background: #f7f9ff;
    border-radius: 18px;
    border: 3px solid #e0e0e0;
    padding: 16px 12px;
    text-align: center;
}

.brain-map-box.highlight {
    border-color: #9B59B6;
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.2);
    background: linear-gradient(135deg, #f7f3ff, #f0eaff);
}

.brain-map-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.brain-map-svg {
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.brain-bubble {
    transition: r 0.5s ease;
}

.brain-map-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    margin: 10px 0 0;
    padding: 0 4px;
}

.brain-map-box.highlight .brain-map-desc {
    color: #333;
    font-weight: 600;
}

/* ===== Brain Cards (Quest 5) ===== */
.brain-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.brain-card {
    perspective: 800px;
    height: 180px;
    cursor: pointer;
}

.brain-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.brain-card.flipped .brain-card-inner {
    transform: rotateY(180deg);
}

.brain-card-front,
.brain-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 3px solid rgba(255,255,255,0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.brain-card-front {
    background: linear-gradient(135deg, #2a1a3e 0%, #1a1a2e 100%);
    gap: 10px;
}

.brain-card-icon {
    font-size: 2.5rem;
}

.brain-card-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}

.brain-card-back {
    background: linear-gradient(135deg, #1a2a1e 0%, #1a1a2e 100%);
    transform: rotateY(180deg);
    justify-content: space-between;
}

.brain-card-desc {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

.btn-claim {
    padding: 10px 20px;
    min-height: 44px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-claim:hover {
    background: rgba(255,255,255,0.2);
}

.btn-claim.claimed {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #1a1a2e;
}

.brain-card.claimed .brain-card-front,
.brain-card.claimed .brain-card-back {
    border-color: var(--accent-green);
    box-shadow: 0 0 16px rgba(0,230,118,0.3);
}

@media print {
    body { background: white; color: black; }
    body::before { display: none; }
    #screen-home, #screen-quest, .book-header, .book-footer, .btn-back { display: none !important; }
    #screen-book { display: block !important; }
    .book-page { break-inside: avoid; border: 1px solid #ddd; background: white; box-shadow: none; }
    .book-chapter-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== Responsive ===== */
@media (max-width: 380px) {
    .hero-title { font-size: 1.7rem; }
    .family-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .family-member { padding: 10px 8px; }
    .member-avatar { width: 52px; height: 52px; }
    .survey-person { flex-direction: column; }
    .support-person { flex-direction: column; }
}
