:root {
    --bg-main: #0B0F19; /* Deeper than Midnight Blue for better contrast */
    --bg-secondary: #191970; /* Midnight Blue */
    --accent-gold: #DAA520;
    --accent-gold-light: #FFD700;
    --text-main: #F8F8FF; /* Ghost White */
    --text-dim: #A0A5B5;
    --lock-bg: rgba(11, 15, 25, 0.85);
    --font-heading: 'Noto Serif KR', serif;
    --font-body: 'Pretendard', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app-container {
    width: 100%;
    max-width: 480px; /* Mobile first, center on desktop */
    margin: 0 auto;
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: radial-gradient(circle at center 20%, var(--bg-secondary) 0%, var(--bg-main) 70%);
}

.funnel-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out forwards;
}

.funnel-step.active {
    display: flex;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
    z-index: 2;
    min-height: 0;
}

.scrollable {
    overflow-y: auto;
    overflow-x: hidden;
}

.scrollable::-webkit-scrollbar {
    display: none;
}

.pb-padding {
    padding-bottom: 100px; /* Space for sticky bottom */
}

.centered {
    justify-content: center;
    align-items: center;
    text-align: center;
}

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

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Typography */
h1, h2, h3, .pre-title, .ch-label {
    font-family: var(--font-heading);
}

.gold-text {
    color: var(--accent-gold-light);
}

/* Landing Step */
.header-area {
    text-align: center;
    margin-top: 40px;
}

.pre-title {
    color: var(--accent-gold);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.main-title {
    font-size: 36px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.4);
}

.hero-image-container {
    position: relative;
    height: 300px;
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.goblin-img {
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(25, 25, 112, 0.8));
}

.floating-anim {
    animation: float 4s ease-in-out infinite;
}

.floating-item {
    position: absolute;
    width: 60px;
    filter: drop-shadow(0 0 15px rgba(218, 165, 32, 0.4));
    animation: float-rotate 6s ease-in-out infinite;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.8);
}

.item-anim-1 { top: 20%; left: 10%; animation-delay: 0s; }
.item-anim-2 { bottom: 20%; right: 5%; width: 50px; animation-delay: 1.5s; }
.item-anim-3 { bottom: 10%; left: 15%; width: 55px; animation-delay: 3s; }

@keyframes float-rotate {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.loading-images-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.loading-item {
    position: absolute;
    width: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    animation: cycleLoading 3s infinite;
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.8);
}

.load-anim-1 { animation-delay: 0s; }
.load-anim-2 { animation-delay: 1s; }
.load-anim-3 { animation-delay: 2s; }

@keyframes cycleLoading {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8) rotate(-10deg); }
    10%, 23% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(0deg); }
    33% { opacity: 0; transform: translate(-50%, -50%) scale(0.8) rotate(10deg); }
}

.copy-area {
    text-align: center;
    margin-bottom: 40px;
}

.sub-headline {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--accent-gold-light);
    line-height: 1.4;
}

.desc {
    color: var(--text-dim);
    font-size: 15px;
}

/* Buttons */
.action-area {
    margin-top: auto;
    padding-bottom: 24px;
}

button {
    border: none;
    outline: none;
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8860B 100%);
    color: #000;
    padding: 18px 24px;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary.gold-glow {
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.6);
    animation: flicker 2s infinite;
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--text-dim);
    padding: 16px 24px;
    margin-bottom: 12px;
}

/* Form Styles */
.step-header {
    margin: 32px 0;
    text-align: left;
}

.step-header.center {
    text-align: center;
}

.step-header h2 {
    font-size: 24px;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

input[type="text"], input[type="date"], select, textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 16px;
    transition: border-color 0.3s;
    margin: 0;
}

input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    position: relative;
}

select option {
    background: var(--bg-main);
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-gold);
    outline: none;
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px;
    border-radius: 8px;
    margin: 0;
    cursor: pointer;
}

.radio-group input[type="radio"]:checked + label {
    background: rgba(218, 165, 32, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Loading */
.loading-spinner {
    width: 100px;
    animation: float 2s infinite, flicker 1s infinite;
    margin-bottom: 24px;
}

.loading-text {
    font-size: 20px;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

/* Teaser / Results */
.teaser-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
    margin-top: 24px;
}

.small-goblin {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-gold);
    background: var(--bg-main);
}

.speech-bubble {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 0 16px 16px 16px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.teaser-card {
    background: rgba(25, 25, 112, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
}

.tag {
    display: inline-block;
    font-size: 12px;
    color: var(--bg-main);
    background: var(--accent-gold);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin-bottom: 12px;
}

.teaser-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.teaser-card p {
    color: var(--text-dim);
    font-size: 14px;
}

.lock-card {
    overflow: hidden;
    min-height: 230px;
}

.blur-text {
    filter: blur(4px);
    opacity: 0.5;
    user-select: none;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--lock-bg);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    backdrop-filter: blur(2px);
}

.lock-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.lock-overlay h3 {
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.sticky-bottom {
    margin-top: 32px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    z-index: 20;
}

/* Paywall */
.package-preview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-gold);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 32px;
}

.package-preview img {
    width: 120px;
    margin-bottom: 16px;
    animation: float 3s infinite;
}

.price-box {
    margin-bottom: 24px;
}

.price-label {
    font-size: 12px;
    color: var(--text-dim);
}

.price {
    font-size: 32px;
    color: var(--accent-gold-light);
}

.benefit-list {
    list-style: none;
    text-align: left;
    font-size: 14px;
}

.benefit-list li {
    margin-bottom: 8px;
    color: var(--text-main);
}

.payment-methods h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.btn-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    padding: 16px;
}

.btn-pay.kakaopay { background: #FEE500; color: #000; }
.btn-pay.naverpay { background: #03C75A; color: #FFF; }
.btn-pay.tosspay { background: #0050FF; color: #FFF; }
.btn-pay.creditcard { background: #333; color: #FFF; }

/* Full Results */
.result-view .chapter {
    margin-bottom: 60px;
    padding-top: 24px;
    border-top: 1px dashed rgba(218, 165, 32, 0.3);
}

.result-view .chapter:first-child {
    border-top: none;
}

.ch-label {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}

.result-view h2 {
    font-size: 24px;
    color: var(--accent-gold-light);
    margin-bottom: 24px;
}

.ch-image {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 32px auto;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
}

.info-card.gold-border {
    border: 1px solid var(--accent-gold);
}

.card-title {
    font-weight: 700;
    margin-bottom: 16px;
}

.gauge-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    background: var(--text-main);
    border-radius: 4px;
}

.gauge-bar.gold .gauge-fill {
    background: var(--accent-gold);
}

.timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.t-item {
    position: relative;
    margin-bottom: 24px;
}

.t-dot {
    position: absolute;
    left: -20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
    top: 6px;
}

.t-item.info .t-dot { background: #00E5FF; box-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
.t-item.warning .t-dot { background: #FF4B4B; box-shadow: 0 0 10px rgba(255, 75, 75, 0.5); }
.t-item.success .t-dot { background: var(--accent-gold); box-shadow: 0 0 10px rgba(218, 165, 32, 0.5); }

.t-text {
    font-size: 15px;
}

.ending-card {
    background: radial-gradient(circle at top, rgba(218, 165, 32, 0.2), transparent);
    border: 1px solid var(--accent-gold);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 32px;
}

.ending-card img {
    width: 80px;
    border-radius: 50%;
    margin-bottom: 16px;
    border: 2px solid var(--accent-gold);
}

.ending-card h3 {
    font-size: 18px;
    line-height: 1.5;
    font-family: var(--font-heading);
}

/* Floating Kakao */
.floating-kakao {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FEE500;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    transition: transform 0.2s;
}

.floating-kakao:active {
    transform: scale(0.9);
}

.floating-kakao img {
    width: 30px;
}

/* Updated Thermometer UI */
.thermometer-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 16px 0;
}

.thermo-bulb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #FF4B4B);
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
    border: 2px solid rgba(255,255,255,0.1);
}

.thermometer-wrapper .gauge-bar {
    margin-bottom: 0;
    flex: 1;
    margin-left: -8px;
    height: 12px;
    border-radius: 0 6px 6px 0;
    z-index: 1;
}

/* Updated Timeline UI */
.t-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-left: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.t-month {
    font-size: 13px;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 4px;
}

.t-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.t-desc {
    font-size: 14px;
    color: var(--text-dim);
}

.t-item.warning .t-card { border-left: 3px solid #FF4B4B; }
.t-item.success .t-card { border-left: 3px solid var(--accent-gold); }
.t-item:not(.warning):not(.success) .t-card { border-left: 3px solid #4B8BFF; }

/* Updated Relationship Map UI */
.node-title { font-weight: 700; font-size: 14px; }
.node-desc { font-size: 12px; color: var(--text-dim); }
.map-node.warning .node-desc { color: #FFbaba; }


/* Visualization Components */
.intro-images {
    position: relative;
    height: 250px;
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-images .ch-image {
    max-width: 150px;
}

.ch-image-small {
    position: absolute;
    width: 60px;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.8);
}

.ch-image-small:nth-child(2) { top: 10%; right: 10%; }
.ch-image-small:nth-child(3) { bottom: 10%; left: 10%; }

.delay-1 { animation-delay: 1s; }
.delay-2 { animation-delay: 2s; }

.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge.positive { background: rgba(218, 165, 32, 0.2); color: var(--accent-gold-light); border: 1px solid var(--accent-gold); }
.badge.negative { background: rgba(255, 75, 75, 0.1); color: #FF6B6B; border: 1px solid #FF6B6B; }

.temp-fill { background: linear-gradient(90deg, var(--accent-gold), #FF4B4B) !important; }

.goblin-step {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="%23DAA520"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"/></svg>');
    background-color: transparent !important;
    width: 14px;
    height: 14px;
    left: -22px;
}

.wave-graph {
    height: 40px;
    width: 100%;
    margin-bottom: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="40" viewBox="0 0 100 40"><path d="M0 20 Q 25 0, 50 20 T 100 20" fill="none" stroke="%23DAA520" stroke-width="2"/></svg>') repeat-x;
    animation: float 4s linear infinite;
}

.relationship-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.r-card {
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--text-dim);
}

.r-card h4 { font-size: 15px; margin-bottom: 4px; }
.r-card.good { border-left-color: var(--accent-gold); }
.r-card.good h4 { color: var(--accent-gold); }
.r-card.bad { border-left-color: #FF4B4B; }
.r-card.bad h4 { color: #FF4B4B; }

.cash-flow {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.cf-item {
    flex: 1;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    text-align: center;
}

.cf-item.in strong { color: var(--accent-gold-light); display: block; margin-bottom: 8px; }
.cf-item.out strong { color: #FF6B6B; display: block; margin-bottom: 8px; }

.relationship-map {
    position: relative;
    height: 250px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    margin: 64px auto;
    width: 250px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.map-node {
    position: absolute;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.2);
}

.map-node.center { top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--accent-gold); color: #000; border:none; font-weight: bold; }
.map-node.top { top: 10%; left: 50%; transform: translateX(-50%); }
.map-node.bottom { bottom: 10%; left: 50%; transform: translateX(-50%); }
.map-node.right { top: 50%; right: -40px; transform: translateY(-50%); }
.map-node.warning { border-color: #FF6B6B; color: #FF6B6B; background: rgba(255,75,75,0.1); }

.mt-2 { margin-top: 16px; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 24px 0;
}

.cal-month {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 4px;
    text-align: center;
    border-radius: 8px;
    font-size: 12px;
}

.cal-month.red-bul {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid #FF4B4B;
    color: #FFbaba;
}

.cal-month.gold-bul {
    background: rgba(218, 165, 32, 0.2);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold-light);
    font-weight: bold;
    animation: flicker 2s infinite;
}

.action-list {
    padding-left: 20px;
    list-style-type: none;
}

.action-list li {
    margin-bottom: 12px;
    position: relative;
}

.action-list li::before {
    content: '•';
    color: var(--accent-gold);
    position: absolute;
    left: -15px;
    font-weight: bold;
}

/* Footer Styles */
.app-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-content {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.8;
    opacity: 0.7;
}

.footer-content strong {
    color: var(--text-main);
    font-weight: 600;
}
