/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Fredoka', 'Quicksand', sans-serif;
    --font-body: 'Quicksand', sans-serif;

    /* Theme Harmonious Colors */
    --forest-deep: hsl(140, 48%, 24%);
    --forest-bright: hsl(145, 63%, 45%);
    --forest-light: hsl(138, 55%, 93%);
    
    --sky-blue: hsl(198, 93%, 60%);
    --sky-blue-soft: hsl(198, 93%, 95%);
    
    --empathy-pink: hsl(340, 88%, 68%);
    --empathy-pink-soft: hsl(340, 88%, 96%);
    
    --anger-vermillion: hsl(8, 88%, 62%);
    --anger-vermillion-soft: hsl(8, 88%, 95%);
    
    --cooperate-orange: hsl(32, 95%, 55%);
    --cooperate-orange-soft: hsl(32, 95%, 94%);
    
    --gold-victory: hsl(45, 98%, 52%);
    
    /* Background Gradients */
    --bg-gradient-day: linear-gradient(135deg, hsl(145, 45%, 88%) 0%, hsl(200, 60%, 90%) 100%);
    --bg-gradient-forest: radial-gradient(circle at 10% 20%, hsl(142, 45%, 95%) 0%, hsl(145, 30%, 82%) 90%);
    
    /* UI Text & Details */
    --text-dark: hsl(210, 29%, 24%);
    --text-muted: hsl(210, 15%, 45%);
    --white: #ffffff;
    
    /* Premium Glassmorphic Styles */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: 0 12px 32px 0 rgba(31, 84, 46, 0.12);
    --inner-border-radius: 20px;
    --outer-border-radius: 28px;
    
    /* Transitions */
    --transition-quick: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   RESET & SYSTEM BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-gradient-day);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition-bounce);
}

button:focus-visible,
.map-node:focus-visible {
    outline: 4px solid var(--forest-bright);
    outline-offset: 3px;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

input {
    font-family: inherit;
    outline: none;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.game-app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-gradient-forest);
    position: relative;
}

/* Game Header HUD */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--glass-border);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--forest-deep);
    cursor: pointer;
}

.logo-emoji {
    font-size: 1.8rem;
    animation: float 4s ease-in-out infinite;
}

.player-hud {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--white);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--glass-border);
}

.player-name-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--forest-deep);
}

.hud-badges {
    display: flex;
    gap: 0.4rem;
}

.hud-badge-slot {
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f0f0;
    filter: grayscale(100%);
    opacity: 0.35;
    transition: var(--transition-bounce);
}

.hud-badge-slot.unlocked {
    filter: grayscale(0%);
    opacity: 1;
    background: var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: scale(1.15);
}

.control-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition-bounce);
}

.btn-control:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.btn-danger-action {
    background: var(--anger-vermillion-soft);
    border-color: var(--anger-vermillion);
}

/* Core Main Area */
.game-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Footer info */
.game-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid var(--glass-border);
    z-index: 10;
}

/* ==========================================================================
   VIEW TOGGLES & CONTAINERS
   ========================================================================== */
.game-view {
    display: none;
    width: 100%;
    animation: slideIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.game-view.active-view {
    display: block;
}

.game-view.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--outer-border-radius);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    width: 100%;
    max-width: 780px;
    position: relative;
    overflow: hidden;
}

/* Helper Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Buttons Action */
.btn-primary-action, .btn-secondary-action {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.9rem 2.2rem;
    border-radius: 40px;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.25);
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.btn-primary-action {
    background: linear-gradient(135deg, var(--forest-bright) 0%, #2ecc71 100%);
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.btn-primary-action:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 28px rgba(46, 204, 113, 0.4);
}

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

.btn-secondary-action {
    background: var(--white);
    color: var(--forest-deep);
    border: 3px solid var(--forest-bright);
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

.btn-secondary-action:hover {
    transform: translateY(-4px) scale(1.03);
    background: var(--forest-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Micro-animations Class Hooks */
.pop-hover {
    transition: var(--transition-bounce);
}
.pop-hover:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   VIEW 1: WELCOME SCREEN
   ========================================================================== */
.welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.guide-avatar-container {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(240,240,240,0.8) 100%);
    border-radius: 50%;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(92, 61, 46, 0.15);
    border: 3px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.guide-owl-svg {
    width: 100%;
    height: 100%;
    animation: float 4s ease-in-out infinite;
}

.welcome-card h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--forest-deep);
}

.welcome-guide-text {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    max-width: 600px;
}

.name-entry-form {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.input-group label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--forest-deep);
    padding-left: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    border: 3px solid var(--glass-border);
    font-size: 1.2rem;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition-quick);
    text-align: center;
}

.input-group input:focus {
    border-color: var(--forest-bright);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
    transform: scale(1.02);
}

/* ==========================================================================
   VIEW 2: FOREST MAP VIEW
   ========================================================================== */
.map-header {
    margin-bottom: 2.5rem;
}

.map-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--forest-deep);
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.map-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Map Grid and Interactive Nodes */
.forest-map-container {
    position: relative;
    background: rgba(255, 255, 255, 0.45);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--outer-border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
    max-width: 960px;
}

/* Background elements for depth */
.forest-map-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.map-cloud {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.4;
}

.cloud-1 { top: 10%; left: 8%; animation: float 14s ease-in-out infinite; }
.cloud-2 { top: 15%; right: 12%; animation: float 18s ease-in-out infinite reverse; }

.map-deco-tree {
    position: absolute;
    font-size: 3rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    opacity: 0.7;
}

.tree-1 { bottom: 8%; left: 4%; }
.tree-2 { top: 40%; right: 3%; }
.tree-3 { bottom: 12%; right: 7%; }

.map-deco-flower {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: float 5s ease-in-out infinite;
}
.flower-1 { bottom: 15%; left: 45%; }
.flower-2 { top: 25%; right: 35%; animation-delay: 2s; }

.map-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 3;
}

/* Node Styling */
.map-node {
    background: var(--glass-bg);
    border: 3px solid var(--glass-border);
    border-radius: var(--inner-border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    text-align: left;
    transition: var(--transition-bounce);
    position: relative;
    overflow: visible;
}

.map-node:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 36px rgba(31, 84, 46, 0.15);
    border-color: var(--white);
}

.map-node.completed {
    border-color: var(--gold-victory);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(254, 241, 154, 0.3) 100%);
}

.node-icon-wrapper {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 2px solid var(--glass-border);
    transition: var(--transition-bounce);
}

.map-node:hover .node-icon-wrapper {
    transform: scale(1.1) rotate(2deg);
}

.node-character-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Badge overlay inside node */
.badge-status-dot {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--white);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    border: 2px solid var(--white);
    z-index: 5;
    animation: float 3s ease-in-out infinite;
}

.map-node.completed .badge-status-dot {
    background: var(--gold-victory);
    animation: pop 0.5s ease-in-out;
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.node-location {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.node-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--forest-deep);
}

.node-skill {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e67e22;
}

/* Loc themes for buttons */
.theme-blue { border-color: var(--sky-blue); }
.theme-pink { border-color: var(--empathy-pink); }
.theme-green { border-color: var(--forest-bright); }
.theme-orange { border-color: var(--cooperate-orange); }

/* Helper text at bottom of map */
.map-helper-box {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem 2rem;
    max-width: 960px;
    border-radius: var(--inner-border-radius);
    background: var(--glass-bg);
}

.mini-guide-avatar {
    font-size: 2.2rem;
    animation: float 4s ease-in-out infinite;
}

.helper-content h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--forest-deep);
    margin-bottom: 0.1rem;
}

.helper-content p {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* ==========================================================================
   VIEW 3: DIALOGUE & VISUAL SCENARIO SCREEN
   ========================================================================== */
.dialogue-container {
    width: 100%;
    max-width: 840px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* The Stage (Upper visual panel) */
.scene-card {
    height: 320px;
    padding: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
    border-radius: var(--outer-border-radius);
    box-shadow: var(--glass-shadow);
}

.scene-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: var(--transition-quick);
}

/* Scenic Themes controlled by javascript class injection */
.scene-backdrop.woods { background: linear-gradient(180deg, #dff9fb 0%, #c7ecee 50%, #95afc0 100%); }
.scene-backdrop.river { background: linear-gradient(180deg, #e0f7fa 0%, #b2ebf2 40%, #00acc1 100%); }
.scene-backdrop.cave { background: linear-gradient(180deg, #dcdde1 0%, #7f8fa6 60%, #353b48 100%); }
.scene-backdrop.clearing { background: linear-gradient(180deg, #f9ca24 0%, #f6e58d 40%, #badc58 100%); }

.backdrop-layers {
    width: 100%;
    height: 100%;
    position: relative;
}

.scene-sun-moon {
    position: absolute;
    top: 10%;
    right: 15%;
    font-size: 3rem;
    animation: float 8s ease-in-out infinite;
}

.scene-cloud {
    position: absolute;
    top: 20%;
    left: 10%;
    font-size: 2.2rem;
    opacity: 0.6;
    animation: float 12s ease-in-out infinite reverse;
}

.scene-flora {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 2rem;
    opacity: 0.8;
}

/* Stage actors positioning */
.scene-actor-stage {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 10px;
}

.actor-main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: -5px;
    z-index: 5;
}

#interactive-character-svg-container {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: var(--transition-bounce);
}

.actor-name-indicator {
    background: var(--forest-deep);
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    border: 2px solid var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-top: 0.3rem;
    letter-spacing: 0.5px;
}

/* Secondary actors (props) left/right */
.actor-prop {
    position: absolute;
    bottom: 15px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: var(--transition-bounce);
}

.prop-left { left: 15%; }
.prop-right { right: 15%; }

/* Dialogue Chat Box (Lower section) */
.dialogue-chat-box {
    padding: 1.5rem 2rem;
    border-radius: var(--inner-border-radius);
    text-align: left;
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
}

.dialogue-speaker-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--forest-deep);
}

.speaker-avatar {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.dialogue-bubble {
    position: relative;
}

.dialogue-bubble p {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Branching Dialogue Options Grid */
.dialogue-choices-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.choice-btn {
    width: 100%;
    background: var(--white);
    border: 3px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem 1.8rem;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.choice-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.15);
    border-color: var(--forest-bright);
    background: var(--forest-light);
}

.choice-emoji {
    font-size: 1.4rem;
}

/* Choice colors for special events */
.choice-btn.calm-action:hover {
    border-color: var(--sky-blue);
    background: var(--sky-blue-soft);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.choice-btn.empathy-action:hover {
    border-color: var(--empathy-pink);
    background: var(--empathy-pink-soft);
    box-shadow: 0 8px 20px rgba(234, 128, 176, 0.25);
}

/* ==========================================================================
   VIEW 4: MINI-GAME CONTAINER STYLES
   ========================================================================== */
.minigame-container {
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-radius: var(--outer-border-radius);
    padding: 3rem;
}

.minigame-header {
    border-bottom: 2px dashed var(--glass-border);
    padding-bottom: 1.2rem;
}

.minigame-icon {
    font-size: 3rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    animation: float 4s ease-in-out infinite;
}

.minigame-header h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--forest-deep);
    margin-bottom: 0.3rem;
}

.minigame-header p {
    font-size: 1.05rem;
    color: var(--text-muted);
}

.minigame-play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Game 1: Breathing Balloon Game Elements */
.breathing-circle-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.breathing-guide-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px dashed var(--sky-blue);
    border-radius: 50%;
    opacity: 0.3;
    animation: rotateRing 20s linear infinite;
}

.balloon-element {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #54a0ff, #2e86de);
    box-shadow: 0 10px 28px rgba(46, 134, 222, 0.4), inset -5px -5px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.05rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: width 0.3s ease-out, height 0.3s ease-out, background 0.5s ease;
    z-index: 5;
    user-select: none;
    -webkit-user-drag: none;
}

/* Interactive breathing active modes */
.balloon-element.inhale {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, #4facfe, #00f2fe);
    box-shadow: 0 15px 36px rgba(0, 242, 254, 0.5), inset -5px -5px 15px rgba(0,0,0,0.15);
}

.balloon-element.hold {
    animation: float 2s ease-in-out infinite;
    background: radial-gradient(circle at 30% 30%, #1dd1a1, #10ac84);
    box-shadow: 0 15px 36px rgba(16, 172, 132, 0.5), inset -5px -5px 15px rgba(0,0,0,0.15);
}

.breathing-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.btn-breathing {
    width: 100%;
    max-width: 320px;
    background: linear-gradient(135deg, var(--sky-blue) 0%, #2e86de 100%);
    box-shadow: 0 8px 20px rgba(46, 134, 222, 0.3);
}

.btn-breathing:hover {
    box-shadow: 0 12px 28px rgba(46, 134, 222, 0.45);
}

.breathing-progress-bar {
    width: 100%;
    max-width: 320px;
    height: 12px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 6px;
    transition: width 0.1s linear;
}

.breathing-counter {
    font-weight: 700;
    color: var(--forest-deep);
    font-size: 1.1rem;
}

#breathing-count-val {
    color: var(--sky-blue);
    font-size: 1.3rem;
}

/* Game 2: Emotion Decoder (Lila) */
.decoder-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.decoder-card-display {
    background: var(--white);
    border: 3px solid var(--glass-border);
    border-radius: var(--inner-border-radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
}

.emotion-subject-avatar {
    width: 130px;
    height: 130px;
    overflow: visible;
}

.bubble-thought {
    background: #f0f3f4;
    padding: 0.6rem 1.4rem;
    border-radius: 18px;
    position: relative;
    border: 2px solid rgba(0,0,0,0.03);
}

.bubble-thought::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: #f0f3f4 transparent;
    display: block;
    width: 0;
}

.thought-q {
    font-weight: 700;
    color: var(--text-dark);
}

.emotion-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 440px;
}

.btn-emotion-choice {
    background: var(--white);
    border: 3px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: var(--transition-bounce);
}

.btn-emotion-choice:hover {
    transform: translateY(-4px);
    border-color: var(--empathy-pink);
    background: var(--empathy-pink-soft);
    box-shadow: 0 8px 20px rgba(234, 128, 176, 0.15);
}

.decoder-tracker {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.decoder-tracker p {
    font-weight: 700;
    color: var(--text-dark);
}

.decoder-stars {
    display: flex;
    gap: 0.4rem;
    font-size: 1.8rem;
    color: #ffd200;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Game 3: Calm Down Toolbox (Toby) */
.sorter-explanation {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

.sorter-split-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.sorter-deck-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 180px;
}

.sorter-strategy-card {
    background: var(--white);
    border: 3px solid var(--forest-bright);
    border-radius: var(--inner-border-radius);
    padding: 1.5rem 2rem;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    box-shadow: 0 12px 28px rgba(46, 204, 113, 0.15);
    transition: var(--transition-bounce);
    cursor: grab;
}

.sorter-strategy-card:active {
    cursor: grabbing;
}

.card-emoji {
    font-size: 3rem;
    animation: float 4s ease-in-out infinite;
}

.sorter-strategy-card h4 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--forest-deep);
}

.sorter-strategy-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.sorter-chests {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    max-width: 580px;
}

.btn-chest {
    flex: 1;
    background: var(--white);
    border: 3px solid var(--glass-border);
    border-radius: var(--inner-border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    transition: var(--transition-bounce);
}

.btn-chest.btn-cool:hover {
    border-color: var(--forest-bright);
    background: var(--forest-light);
    transform: translateY(-4px) scale(1.02);
}

.btn-chest.btn-hot:hover {
    border-color: var(--anger-vermillion);
    background: var(--anger-vermillion-soft);
    transform: translateY(-4px) scale(1.02);
}

.chest-icon {
    font-size: 2.2rem;
    transition: var(--transition-bounce);
}

.btn-chest:hover .chest-icon {
    transform: scale(1.15) rotate(5deg);
}

.chest-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

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

.chest-count {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.2rem 1rem;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
}

/* ==========================================================================
   VIEW 5: GRADUATION & PRINTABLE CERTIFICATE
   ========================================================================== */
.graduation-card {
    max-width: 820px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.grad-celebration-graphics {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.grad-trophy {
    font-size: 4.5rem;
    animation: float 4s ease-in-out infinite, victoryGlow 2s ease-in-out infinite alternate;
}

.graduation-card h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--forest-deep);
}

.grad-subtext {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Confetti System */
.confetti-holder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    border-radius: 2px;
    animation: confettiFall 4s linear infinite;
    opacity: 0.8;
}

/* Elegant Printable Certificate */
.certificate-printable {
    background: var(--white);
    border: 12px double #d4af37;
    padding: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    border-radius: 4px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.certificate-border {
    border: 3px solid #d4af37;
    padding: 2.5rem 1.8rem;
    background: radial-gradient(circle, #fffdf0 0%, #fffbf0 100%);
    position: relative;
}

.certificate-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.cert-seal {
    font-size: 3.5rem;
    position: absolute;
    top: 10px;
    right: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.cert-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: 4px;
    color: #b58900;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.cert-subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest-deep);
    border-bottom: 2px solid #d4af37;
    padding-bottom: 0.4rem;
    width: 70%;
    margin-bottom: 0.5rem;
}

.cert-award-text {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-muted);
}

.cert-player-name {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px dashed #b58900;
    padding: 0 1.5rem 0.2rem;
    display: inline-block;
    min-width: 250px;
    margin: 0.5rem 0;
}

.cert-body-text {
    font-size: 0.95rem;
    max-width: 540px;
    line-height: 1.7;
    color: var(--text-dark);
}

.cert-signatures {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 2rem;
}

.sig-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
}

.sig-handwritten {
    font-family: 'Fredoka', cursive;
    font-size: 1.2rem;
    color: #2e86de;
    font-style: italic;
    margin-bottom: 0.2rem;
}

.sig-line {
    border: none;
    border-top: 1.5px solid var(--text-muted);
    width: 100%;
    margin-bottom: 0.3rem;
}

.sig-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.grad-buttons-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

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

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

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

.shake-element {
    animation: shake 0.4s ease-in-out;
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

@keyframes victoryGlow {
    0% { filter: drop-shadow(0 2px 8px rgba(241, 196, 15, 0.4)); }
    100% { filter: drop-shadow(0 4px 20px rgba(241, 196, 15, 0.8)); transform: scale(1.05) translateY(-5px); }
}

@keyframes confettiFall {
    0% { transform: translateY(-20px) rotate(0deg); left: var(--left, 10%); }
    100% { transform: translateY(320px) rotate(360deg); left: var(--left, 10%); }
}

/* ==========================================================================
   RESPONSIVENESS (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }
    
    .game-header {
        padding: 0.8rem 1.2rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo-emoji {
        font-size: 1.5rem;
    }
    
    .player-hud {
        gap: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
    
    .hud-name {
        display: none; /* Hide name text to save space on very small viewports */
    }
    
    .game-main-content {
        padding: 1rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
    
    .map-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .forest-map-container {
        padding: 1.5rem 1rem;
    }
    
    .map-header h2 {
        font-size: 2rem;
    }
    
    .scene-card {
        height: 240px;
    }
    
    #interactive-character-svg-container {
        width: 130px;
        height: 130px;
    }
    
    .actor-prop {
        width: 70px;
        height: 70px;
    }
    
    .dialogue-chat-box p {
        font-size: 1.05rem;
    }
    
    .choice-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
    
    .sorter-chests {
        flex-direction: column;
        gap: 1rem;
    }
    
    .certificate-border {
        padding: 1.5rem 1rem;
    }
    
    .cert-title {
        font-size: 1.8rem;
    }
    
    .cert-subtitle {
        font-size: 1rem;
        width: 90%;
    }
    
    .cert-player-name {
        font-size: 1.8rem;
    }
    
    .grad-buttons-row {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .btn-primary-action, .btn-secondary-action {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   PRINT LAYOUT SUPPORT (PRINT CERTIFICATE ACTION)
   ========================================================================== */
@media print {
    /* Hide everything on the page except the printable certificate */
    body * {
        visibility: hidden;
    }
    
    .game-app-container, .game-main-content, #view-graduation, #printable-certificate-card, #printable-certificate-card * {
        visibility: visible;
    }
    
    body, .game-app-container {
        background: none !important;
        margin: 0;
        padding: 0;
    }
    
    #view-graduation {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        display: flex !important;
        justify-content: center;
        align-items: center;
        background: none !important;
    }
    
    .graduation-card {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        margin: 0;
        padding: 0 !important;
        width: 100vw;
        max-width: 100% !important;
    }
    
    /* Hide non-certificate visual assets on print */
    .grad-celebration-graphics, .grad-buttons-row, .game-header, .game-footer {
        display: none !important;
    }
    
    #printable-certificate-card {
        border: 12px double #d4af37 !important;
        box-shadow: none !important;
        margin: 0 auto;
        position: relative;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .certificate-border {
        background: radial-gradient(circle, #fffdf0 0%, #fffbf0 100%) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
