/* 
 * Design System & Variables 
 * Implements a premium, warm aesthetic with modern touches.
 */
:root {
    --bg-color: #FFFAE8;
    --text-color: #333333;
    
    /* Brand Colors */
    --primary-color: #FF4215;
    --secondary-color: #FFD215;
    --tertiary-color: #157BFF;
    
    /* UI Element Colors */
    --bubble-bg: rgba(255, 255, 255, 0.7);
    --bubble-border: rgba(255, 255, 255, 0.4);
    --bubble-shadow: 0 8px 32px rgba(255, 66, 21, 0.05); /* Soft warming shadow */
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-color);
    overflow: hidden; /* Prevent scrolling, fixed single-page app feel */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Particle Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none; /* Let clicks pass through to UI */
}

/* Main App Container */
#app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

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

/* Character Styling */
#character-container {
    width: 250px;
    height: 250px;
    filter: drop-shadow(0 15px 35px rgba(21, 123, 255, 0.15));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy hover */
}

#character-container:hover {
    transform: translateY(-8px) scale(1.02);
}

#character-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Dialogue Glassmorphism Bubble */
#dialogue-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

#dialogue-bubble {
    background: var(--bubble-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bubble-border);
    border-radius: 24px;
    padding: 30px 40px;
    box-shadow: var(--bubble-shadow);
    position: relative;
    transition: all 0.3s ease;
}

/* Speech Bubble 'Tail' */
#dialogue-bubble::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 18px 18px 18px;
    border-style: solid;
    border-color: transparent transparent var(--bubble-bg) transparent;
}

#dialogue-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    line-height: 1.6;
    font-weight: 400;
    min-height: 3em; /* Keep bubble size somewhat stable while typing */
    text-align: center;
}

/* Controls Container for dynamic elements */
#controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 60px;
    transition: opacity 0.3s ease;
}

/* Standard Button Properties */
.choice-btn {
    background: white;
    border: 2px solid transparent;
    padding: 14px 34px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-color);
}

.choice-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(21, 123, 255, 0.15); /* Tertiary color glow */
    border-color: var(--tertiary-color);
    color: var(--tertiary-color);
}

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

/* Input Box Layout & Styling */
.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.text-input {
    width: 100%;
    max-width: 450px;
    padding: 16px 28px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.text-input:focus {
    border-color: var(--tertiary-color);
    box-shadow: 0 0 0 4px rgba(21, 123, 255, 0.15);
    background: white;
}

/* Error State Animation for wrong input */
.text-input.error {
    border-color: var(--primary-color);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.input-hint {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
    font-weight: 500;
}
