/* ============================================
   MaeMor (แม่หมอ) — Design System
   Thai Fortune Telling LINE Mini App
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --primary: #7C3AED;
    --primary-light: #A78BFA;
    --primary-dark: #5B21B6;
    --secondary: #F59E0B;
    --secondary-light: #FCD34D;
    --accent-pink: #EC4899;
    --accent-mint: #34D399;
    --accent-blue: #60A5FA;

    --bg-dark: #0F0A1A;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --text-primary: #F5F3FF;
    --text-secondary: #C4B5FD;
    --text-muted: #8B7EC8;

    --gradient-main: linear-gradient(135deg, #1a0533 0%, #0F0A1A 50%, #0d1a2e 100%);
    --gradient-card: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
    --gradient-gold: linear-gradient(135deg, #F59E0B, #D97706);
    --gradient-purple: linear-gradient(135deg, #7C3AED, #EC4899);
    --gradient-fortune-bar: linear-gradient(90deg, #7C3AED, #EC4899, #F59E0B);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 999px;

    --font-main: 'Prompt', 'Kanit', sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--gradient-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animated Background Stars */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(167, 139, 250, 0.4), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(236, 72, 153, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(245, 158, 11, 0.4), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(167, 139, 250, 0.3), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(96, 165, 250, 0.3), transparent),
        radial-gradient(1px 1px at 300px 80px, rgba(236, 72, 153, 0.4), transparent),
        radial-gradient(1px 1px at 100px 200px, rgba(245, 158, 11, 0.3), transparent),
        radial-gradient(2px 2px at 350px 150px, rgba(167, 139, 250, 0.5), transparent);
    background-size: 400px 250px;
    animation: twinkle 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* --- Splash Screen --- */
.splash {
    position: fixed;
    inset: 0;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.splash.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.5));
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.splash-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 30px;
}

.splash-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: loadPulse 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadPulse {

    0%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- App Container --- */
.app {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* --- Header --- */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.4));
}

.header-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 300;
}

.btn-icon {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(80px + var(--safe-bottom));
    overflow-y: auto;
}

.page {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.page.active {
    display: block;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--gradient-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--glass-shadow);
}

/* --- Fortune Card (Home) --- */
.fortune-card {
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.fortune-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 70%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.fortune-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.fortune-badge {
    background: var(--gradient-purple);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.fortune-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fortune-overall {
    text-align: center;
    margin-bottom: 20px;
}

.fortune-stars {
    font-size: 1.8rem;
    margin-bottom: 8px;
    letter-spacing: 4px;
}

.fortune-message {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
}

.fortune-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.fortune-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fortune-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.fortune-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    width: 80px;
    white-space: nowrap;
}

.fortune-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.fortune-bar-fill {
    height: 100%;
    background: var(--gradient-fortune-bar);
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

/* Lucky Items */
.fortune-lucky {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.lucky-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lucky-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.lucky-value {
    font-size: 1rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Menu Grid --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.menu-item {
    background: var(--gradient-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-purple);
    opacity: 0;
    transition: opacity 0.3s;
}

.menu-item:hover::before,
.menu-item:active::before {
    opacity: 0.15;
}

.menu-item:active {
    transform: scale(0.96);
}

.menu-icon {
    font-size: 2.2rem;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.menu-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.btn-back {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--bg-card-hover);
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-purple);
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-glow {
    box-shadow: 0 4px 25px rgba(124, 58, 237, 0.4);
}

.btn-glow:hover {
    box-shadow: 0 6px 35px rgba(124, 58, 237, 0.6);
}

.btn-icon-sm {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: var(--bg-card-hover);
}

/* --- Ask Mae Mor (Crystal Ball) --- */
.ask-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.crystal-ball-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
}

/* --- Aura Ring --- */
.crystal-aura {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: conic-gradient(from 0deg, rgba(167, 139, 250, 0.5), rgba(236, 72, 153, 0.3), rgba(245, 158, 11, 0.4), rgba(167, 139, 250, 0.5)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: auraRotate 6s linear infinite;
    filter: blur(2px);
    opacity: 0.7;
}

.crystal-aura::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, rgba(245, 158, 11, 0.2), transparent 30%, rgba(167, 139, 250, 0.3), transparent 60%, rgba(236, 72, 153, 0.2));
    animation: auraRotate 8s linear infinite reverse;
    filter: blur(8px);
}

@keyframes auraRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.crystal-ball {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%,
            rgba(167, 139, 250, 0.5),
            rgba(124, 58, 237, 0.25) 40%,
            rgba(15, 10, 26, 0.85) 70%);
    border: 2px solid rgba(167, 139, 250, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow:
        0 0 40px rgba(124, 58, 237, 0.35),
        0 0 80px rgba(124, 58, 237, 0.15),
        inset 0 0 40px rgba(124, 58, 237, 0.15),
        inset 0 0 80px rgba(124, 58, 237, 0.05);
}

.crystal-ball:hover {
    box-shadow:
        0 0 60px rgba(124, 58, 237, 0.5),
        0 0 120px rgba(124, 58, 237, 0.2),
        inset 0 0 60px rgba(124, 58, 237, 0.25),
        inset 0 0 100px rgba(124, 58, 237, 0.1);
}

.crystal-ball:hover .crystal-aura {
    opacity: 1;
}

.crystal-ball.shake {
    animation: shake 0.6s ease-in-out;
}

.crystal-ball.answering .crystal-glow {
    animation: glowPulse 0.8s ease-in-out 3;
}

.crystal-ball.answering .gold-dust-container {
    animation-play-state: running;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0) rotate(0);
    }

    10% {
        transform: translateX(-8px) rotate(-3deg);
    }

    30% {
        transform: translateX(8px) rotate(3deg);
    }

    50% {
        transform: translateX(-6px) rotate(-2deg);
    }

    70% {
        transform: translateX(6px) rotate(2deg);
    }

    90% {
        transform: translateX(-3px) rotate(-1deg);
    }
}

/* --- Inner Glow --- */
.crystal-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent 60%);
    pointer-events: none;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* --- Shimmer Layer --- */
.crystal-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 10%,
            transparent 20%,
            transparent 40%,
            rgba(167, 139, 250, 0.1) 50%,
            transparent 60%,
            transparent 80%,
            rgba(245, 158, 11, 0.06) 90%,
            transparent 100%);
    animation: shimmerRotate 4s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shimmerRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Gold Dust Particles --- */
.gold-dust-container {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.gold-dust {
    position: absolute;
    width: var(--dust-size, 3px);
    height: var(--dust-size, 3px);
    border-radius: 50%;
    background: radial-gradient(circle, #FCD34D, #F59E0B);
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.6), 0 0 8px rgba(245, 158, 11, 0.3);
    animation: dustOrbit var(--orbit-duration, 6s) linear infinite, dustTwinkle var(--twinkle-duration, 2s) ease-in-out infinite alternate;
    transform-origin: 110px 110px;
    /* center of 220px ball */
    top: calc(50% - var(--dust-size, 3px) / 2);
    left: calc(50% - var(--dust-size, 3px) / 2);
}

/* Each dust particle gets unique orbit, size, speed, and starting position */
.gold-dust:nth-child(1) {
    --dust-size: 3px;
    --orbit-duration: 7s;
    --twinkle-duration: 1.5s;
    animation-delay: 0s;
    --orbit-radius: 60px;
}

.gold-dust:nth-child(2) {
    --dust-size: 2px;
    --orbit-duration: 5s;
    --twinkle-duration: 2.2s;
    animation-delay: -0.8s;
    --orbit-radius: 75px;
}

.gold-dust:nth-child(3) {
    --dust-size: 4px;
    --orbit-duration: 9s;
    --twinkle-duration: 1.8s;
    animation-delay: -2s;
    --orbit-radius: 50px;
}

.gold-dust:nth-child(4) {
    --dust-size: 2px;
    --orbit-duration: 6s;
    --twinkle-duration: 2.5s;
    animation-delay: -3.5s;
    --orbit-radius: 85px;
}

.gold-dust:nth-child(5) {
    --dust-size: 3px;
    --orbit-duration: 8s;
    --twinkle-duration: 1.3s;
    animation-delay: -1.2s;
    --orbit-radius: 40px;
}

.gold-dust:nth-child(6) {
    --dust-size: 2px;
    --orbit-duration: 5.5s;
    --twinkle-duration: 2s;
    animation-delay: -4s;
    --orbit-radius: 70px;
}

.gold-dust:nth-child(7) {
    --dust-size: 3px;
    --orbit-duration: 7.5s;
    --twinkle-duration: 1.7s;
    animation-delay: -5s;
    --orbit-radius: 55px;
}

.gold-dust:nth-child(8) {
    --dust-size: 2px;
    --orbit-duration: 6.5s;
    --twinkle-duration: 2.3s;
    animation-delay: -2.5s;
    --orbit-radius: 90px;
}

.gold-dust:nth-child(9) {
    --dust-size: 4px;
    --orbit-duration: 10s;
    --twinkle-duration: 1.4s;
    animation-delay: -6s;
    --orbit-radius: 45px;
}

.gold-dust:nth-child(10) {
    --dust-size: 2px;
    --orbit-duration: 5s;
    --twinkle-duration: 2.1s;
    animation-delay: -3s;
    --orbit-radius: 80px;
}

.gold-dust:nth-child(11) {
    --dust-size: 3px;
    --orbit-duration: 8.5s;
    --twinkle-duration: 1.6s;
    animation-delay: -7s;
    --orbit-radius: 35px;
}

.gold-dust:nth-child(12) {
    --dust-size: 2px;
    --orbit-duration: 6s;
    --twinkle-duration: 2.4s;
    animation-delay: -4.5s;
    --orbit-radius: 65px;
}

@keyframes dustOrbit {
    0% {
        transform: rotate(calc(var(--i) * 30deg)) translateX(var(--orbit-radius)) rotate(calc(var(--i) * -30deg));
    }

    100% {
        transform: rotate(calc(var(--i) * 30deg + 360deg)) translateX(var(--orbit-radius)) rotate(calc(var(--i) * -30deg - 360deg));
    }
}

@keyframes dustTwinkle {
    0% {
        opacity: 0.3;
        box-shadow: 0 0 2px rgba(245, 158, 11, 0.3);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 6px rgba(245, 158, 11, 0.8), 0 0 12px rgba(252, 211, 77, 0.4);
    }
}

.crystal-answer {
    text-align: center;
    padding: 20px;
    z-index: 2;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.8);
    transition: all 0.5s;
}

/* --- Sparkle Stars (enhanced) --- */
.crystal-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--secondary-light);
    border-radius: 50%;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle-lg {
    width: 6px;
    height: 6px;
    background: #FCD34D;
    box-shadow: 0 0 6px rgba(252, 211, 77, 0.6);
}

.sparkle:nth-child(1) {
    top: 20%;
    left: 25%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 40%;
    right: 20%;
    animation-delay: 0.5s;
}

.sparkle:nth-child(3) {
    bottom: 30%;
    left: 30%;
    animation-delay: 1s;
}

.sparkle:nth-child(4) {
    top: 60%;
    right: 30%;
    animation-delay: 1.5s;
}

.sparkle:nth-child(5) {
    bottom: 20%;
    right: 25%;
    animation-delay: 2s;
}

.sparkle:nth-child(6) {
    top: 15%;
    right: 35%;
    animation-delay: 0.3s;
    animation-duration: 4s;
}

.sparkle:nth-child(7) {
    bottom: 40%;
    left: 20%;
    animation-delay: 1.2s;
    animation-duration: 3.5s;
}

.sparkle:nth-child(8) {
    top: 50%;
    left: 40%;
    animation-delay: 2.5s;
    animation-duration: 4.5s;
}

@keyframes sparkleFloat {

    0%,
    100% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }

    30% {
        opacity: 1;
        transform: scale(1.2) translateY(-5px);
    }

    50% {
        opacity: 0.8;
        transform: scale(1) translateY(-10px);
    }

    70% {
        opacity: 1;
        transform: scale(1.3) translateY(-8px);
    }
}

/* --- Crystal Ball Loading & AI Answer --- */
.crystal-loading {
    font-size: 0.85rem;
    color: var(--secondary-light);
    animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.crystal-ai-answer {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(167, 139, 250, 0.6);
}

.ask-input {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.ask-input::placeholder {
    color: var(--text-muted);
}

.ask-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.ask-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* --- Tarot Cards --- */
/* Tarot Spread Selector */
.tarot-spread-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spread-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.spread-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.spread-btn.active {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

.spread-icon {
    font-size: 1.3rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.spread-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.spread-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.spread-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.spread-cost {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(167, 139, 250, 0.15);
    color: var(--primary-light);
    flex-shrink: 0;
    font-weight: 600;
}

.spread-cost.free {
    background: rgba(52, 211, 153, 0.15);
    color: #6EE7B7;
}

.spread-cost.premium {
    background: rgba(251, 191, 36, 0.15);
    color: #FCD34D;
}

.tarot-question-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tarot-question-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 4px;
}

.btn-draw-tarot {
    font-size: 1.1rem;
    padding: 16px;
}

.tarot-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tarot-topic-select {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tarot-topic {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.tarot-topic.active {
    background: var(--gradient-purple);
    color: white;
    border-color: transparent;
}

.tarot-cards {
    display: flex;
    justify-content: center;
    gap: 12px;
    perspective: 1200px;
    min-height: 200px;
    align-items: center;
}

.tarot-card {
    width: 100px;
    height: 160px;
    cursor: pointer;
    position: relative;
    text-align: center;
}

.tarot-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.tarot-card-front {
    background: linear-gradient(135deg, #2D1B69, #1a0533);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    overflow: hidden;
}

.tarot-back-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 2px);
}

.tarot-card-back-design {
    font-size: 2rem;
    color: var(--primary-light);
    animation: float 3s ease-in-out infinite;
}

.tarot-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(124, 58, 237, 0.1));
    border: 2px solid var(--secondary);
    padding: 4px;
    gap: 2px;
    overflow: hidden;
}

.tarot-card-image {
    width: 100%;
    flex: 1;
    object-fit: contain;
    border-radius: 4px;
    min-height: 0;
}

.tarot-card-name {
    font-size: 0.55rem;
    color: var(--secondary-light);
    font-weight: 600;
    line-height: 1.1;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.tarot-label {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tarot-reading {
    animation: fadeInUp 0.5s ease;
}

.tarot-reading h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.tarot-reading p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.9rem;
}

/* --- Life Graph --- */
.lifegraph-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.birthdate-input {
    text-align: center;
}

.birthdate-input h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.date-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.date-select {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
}

.date-select:focus {
    border-color: var(--primary-light);
}

.graph-period-select {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.period-btn {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.period-btn.active {
    background: var(--gradient-purple);
    color: white;
    border-color: transparent;
}

.graph-canvas-wrap {
    padding: 16px;
    margin-top: 8px;
}

#life-graph-canvas {
    width: 100%;
    height: auto;
}

.graph-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.physical {
    background: #EC4899;
}

.legend-dot.emotional {
    background: #60A5FA;
}

.legend-dot.intellectual {
    background: #34D399;
}

.graph-insight {
    animation: fadeInUp 0.5s ease;
}

.graph-insight h4 {
    margin-bottom: 8px;
    color: var(--secondary-light);
}

.graph-insight p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* --- Calendar (Auspicious Days) --- */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.calendar-nav h3 {
    font-size: 1.1rem;
    min-width: 160px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px 0;
    font-weight: 600;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
}

.cal-day:hover {
    background: var(--bg-card-hover);
}

.cal-day.today {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.15);
}

.cal-day {
    flex-direction: column;
    gap: 1px;
}

.cal-badges {
    display: flex;
    gap: 1px;
    font-size: 0.55rem;
    line-height: 1;
}

.cal-badge {
    display: inline-block;
}

.cal-day.quality-good {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.25);
}

.cal-day.quality-bad {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.cal-day.holy-day {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.cal-day.selected {
    background: var(--gradient-purple);
    color: white;
}

.cal-day.empty {
    cursor: default;
}

.cal-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.good {
    background: #34D399;
}

.dot.neutral {
    background: var(--text-muted);
}

.dot.bad {
    background: #EF4444;
}

.cal-detail {
    animation: fadeInUp 0.3s ease;
}

.cal-detail h4 {
    color: var(--secondary-light);
    margin-bottom: 8px;
}

.cal-detail p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

#cal-detail-activities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.activity-tag {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.activity-tag.good {
    background: rgba(52, 211, 153, 0.15);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.activity-tag.bad {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    background: rgba(15, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-bottom));
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.3s;
    position: relative;
}

.nav-item.active {
    color: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 24px;
    height: 2px;
    background: var(--gradient-purple);
    border-radius: 0 0 2px 2px;
}

.nav-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 500;
}

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.setting-item label {
    font-size: 0.9rem;
}

.setting-input {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    color-scheme: dark;
}

.setting-input::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.setting-input option,
.date-select option {
    background: #1a1028;
    color: #e2d9f3;
}

.setting-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-light);
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #EF4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25) !important;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 3px;
    transition: all 0.3s;
}

.toggle input:checked+.toggle-slider {
    background: var(--gradient-purple);
    border-color: var(--primary);
}

.toggle input:checked+.toggle-slider::before {
    background: white;
    transform: translateX(21px);
}

/* --- Share Canvas --- */
#share-canvas {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: var(--radius-full);
}

/* --- Login Screen --- */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.5s ease;
    overflow-y: auto;
}

/* Floating decorative icons */
.login-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.float-icon {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-size: 1.8rem;
    opacity: 0.25;
    animation: floatRandom var(--dur) ease-in-out var(--delay) infinite;
    filter: blur(0.5px);
}

@keyframes floatRandom {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -20px) rotate(10deg); }
    50% { transform: translate(-5px, -35px) rotate(-5deg); }
    75% { transform: translate(15px, -15px) rotate(8deg); }
}

.login-content {
    text-align: center;
    padding: 1.5rem;
    max-width: 380px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Hero section */
.login-hero {
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(124, 58, 237, 0.6));
}

.login-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.login-tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Feature highlights grid */
.login-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.12);
    border-radius: 12px;
    padding: 0.6rem 0.7rem;
    text-align: left;
    transition: border-color 0.3s;
}

.login-feature-item:hover {
    border-color: rgba(167, 139, 250, 0.3);
}

.login-feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-feature-item strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.login-feature-item span {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Bonus badge */
.login-bonus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.12), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(252, 211, 77, 0.25);
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    margin-bottom: 1.25rem;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0); }
    50% { box-shadow: 0 0 20px 2px rgba(252, 211, 77, 0.15); }
}

.login-bonus-icon {
    font-size: 1.3rem;
}

.login-bonus span {
    font-size: 0.85rem;
    color: #FCD34D;
}

.login-bonus strong {
    color: #FBBF24;
}

/* LINE Login Button */
.btn-line-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #06C755;
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(6, 199, 85, 0.4);
}

.btn-line-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(6, 199, 85, 0.5);
}

.btn-line-login:active {
    transform: translateY(0);
}

.login-terms {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-terms a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* --- Header Right (Credit + Settings) --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Credit Badge --- */
.credit-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.credit-badge:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(236, 72, 153, 0.3));
    transform: scale(1.05);
}

.credit-icon {
    font-size: 1rem;
}

.credit-count {
    min-width: 18px;
    text-align: center;
}

/* Credit count animation */
.credit-count.deducting {
    animation: creditBounce 0.5s ease;
    color: #EF4444;
}

@keyframes creditBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }
}

/* --- Credit Modal --- */
.credit-modal-body {
    text-align: center;
}

.credit-empty-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.credit-empty-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.credit-empty-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.credit-packages {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.credit-package {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 90px;
}

.credit-package:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.credit-package.popular {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
}

.pkg-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-gold);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.pkg-amount {
    font-size: 1.1rem;
    font-weight: 700;
}

.pkg-price {
    font-size: 0.85rem;
    color: var(--accent-mint);
    font-weight: 600;
}

/* --- Profile Modal --- */
.profile-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-light);
    margin-bottom: 0.75rem;
    object-fit: cover;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #EF4444;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* --- Credit Notification Toast --- */
.credit-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(124, 58, 237, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.credit-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Responsive --- */
@media (max-width: 380px) {
    .fortune-lucky {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .tarot-card {
        width: 85px;
        height: 140px;
    }

    .crystal-ball-wrapper {
        width: 180px;
        height: 180px;
    }

    .credit-packages {
        flex-direction: column;
    }
}

/* ============================================
   PDPA Consent Modal
   ============================================ */
.pdpa-modal {
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}

.pdpa-header {
    text-align: center;
    margin-bottom: 16px;
}

.pdpa-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.pdpa-header h3 {
    font-size: 1.2rem;
    margin: 4px 0;
}

.pdpa-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pdpa-intro {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.pdpa-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.pdpa-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.12);
}

.pdpa-item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.pdpa-item strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

.pdpa-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.pdpa-rights {
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    margin-bottom: 16px;
}

.pdpa-rights h4 {
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #4ade80;
}

.pdpa-rights p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.pdpa-rights a {
    color: var(--primary-light);
}

.pdpa-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdpa-accept-btn {
    font-size: 1rem;
    padding: 14px;
    font-weight: 600;
}

.pdpa-decline-btn {
    font-size: 0.85rem;
    padding: 10px;
}

.pdpa-version {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Withdraw */
.withdraw-warning {
    margin-bottom: 16px;
}

.withdraw-warning p {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.withdraw-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.withdraw-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.withdraw-list li::before {
    content: "•";
    color: #ef4444;
    position: absolute;
    left: 4px;
    font-weight: bold;
}

.withdraw-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Settings PDPA section */
.settings-pdpa-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.pdpa-info-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.badge-consent {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.btn-text-danger {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
    opacity: 0.7;
}

.btn-text-danger:hover {
    opacity: 1;
}

.withdraw-credits-warning {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 12px 0;
}

.withdraw-credits-warning p {
    font-size: 0.85rem;
    margin-bottom: 4px;
    line-height: 1.5;
}

.withdraw-credits-warning p:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
}