/* ============================================
   Ciallo Breeze — Galgame Style Design System
   ============================================ */

:root {
    /* ---- Sakura / Lavender / Sky Palette ---- */
    --pink-50:  #fff5f8;
    --pink-100: #ffe4ec;
    --pink-200: #ffd0de;
    --pink-300: #ffb7c5;
    --pink-400: #ff8fab;
    --pink-500: #ff6b9d;
    --pink-600: #e85d8a;

    --lavender-100: #f3ebfb;
    --lavender-200: #e8d5f5;
    --lavender-300: #d4b3e8;
    --lavender-400: #c490e4;
    --lavender-500: #b077d4;

    --sky-100: #e8f4fc;
    --sky-200: #c5e3f6;
    --sky-300: #a5d4f0;
    --sky-400: #7ec8e3;

    --mint-200: #d4f5e8;
    --mint-300: #b5e8d4;

    --gold:       #f9d976;
    --gold-deep:  #e8c25a;

    --cream: #fff9f5;

    /* ---- Text ---- */
    --text-dark:  #4a3b5c;
    --text-mid:   #8b7ba5;
    --text-light: #b5a8c8;

    /* ---- Glass ---- */
    --glass-bg:       rgba(255, 255, 255, 0.48);
    --glass-border:   rgba(255, 255, 255, 0.65);
    --glass-blur:     20px;

    /* ---- Shadows ---- */
    --shadow-soft:  0 20px 60px -15px rgba(196, 144, 228, 0.28);
    --shadow-card:  0 30px 80px -20px rgba(180, 120, 220, 0.22),
                    0 8px 32px -8px rgba(255, 107, 157, 0.12);
    --shadow-glow:  0 0 40px rgba(255, 107, 157, 0.15);

    /* ---- Radii ---- */
    --r-sm: 12px;
    --r-md: 20px;
    --r-lg: 32px;
    --r-pill: 100px;
}

/* ---- Reset ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
}

/* ---- Body / Atmosphere ---- */
body {
    min-height: 100vh;
    overflow: hidden;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-dark);
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(255, 183, 197, 0.45), transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(196, 144, 228, 0.35), transparent 60%),
        radial-gradient(ellipse 55% 45% at 80% 85%, rgba(126, 200, 227, 0.30), transparent 60%),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(212, 179, 232, 0.28), transparent 60%),
        linear-gradient(140deg, #fff5f8 0%, #faf0ff 30%, #f0f5ff 65%, #fff0f5 100%);
    background-attachment: fixed;
}

/* ---- Vignette overlay ---- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(74, 59, 92, 0.07) 100%);
    pointer-events: none;
    z-index: 5;
}

/* ============================================
   Background Layers
   ============================================ */

/* ---- Scrolling text layer ---- */
.scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

.ciallo-item {
    position: absolute;
    white-space: nowrap;
    font-family: 'Zen Maru Gothic', sans-serif;
    text-shadow: 0 2px 12px rgba(255, 183, 197, 0.35);
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

/* ---- Sakura petals ---- */
.petals-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.petal {
    position: fixed;
    top: -30px;
    background: radial-gradient(circle at 30% 30%, #ffd6e3, #ffb7c5 55%, #ff9eb5);
    border-radius: 50% 8% 50% 8%;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    animation: petal-fall linear infinite;
}

@keyframes petal-fall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    8% {
        opacity: 0.75;
    }
    50% {
        transform: translateY(50vh) translateX(var(--drift, 40px)) rotate(360deg) scale(0.95);
    }
    92% {
        opacity: 0.75;
    }
    100% {
        transform: translateY(108vh) translateX(calc(var(--drift, 40px) * -0.5)) rotate(720deg) scale(0.85);
        opacity: 0;
    }
}

/* ---- Gold sparkles ---- */
.sparkle-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.sparkle {
    position: fixed;
    width: 5px;
    height: 5px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold), 0 0 20px rgba(249, 217, 118, 0.4);
    opacity: 0;
    pointer-events: none;
    animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3);
    }
}

/* ============================================
   Hero Card
   ============================================ */
.hero {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 24px;
    pointer-events: none;
}

.hero-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 60px 48px 52px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    pointer-events: auto;
    animation: card-float 6s ease-in-out infinite;
    overflow: hidden;
}

/* Card top accent line */
.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--pink-400), var(--lavender-400), var(--sky-400), transparent);
    border-radius: var(--r-pill);
}

/* Card inner glow */
.hero-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.25), transparent 60%);
    pointer-events: none;
}

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

/* ---- Eyebrow label ---- */
.card-eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.35em;
    color: var(--lavender-500);
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.8;
}

.card-eyebrow .eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lavender-400);
}

/* ---- Title ---- */
.card-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(52px, 9vw, 80px);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--pink-500) 0%, var(--lavender-400) 50%, var(--sky-400) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 4px 20px rgba(255, 107, 157, 0.25));
}

/* ---- Greeting line ---- */
.card-greeting {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 32px;
    letter-spacing: 0.02em;
}

/* ---- Divider ---- */
.card-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.card-divider .div-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--lavender-300), transparent);
}

.card-divider .div-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pink-400);
}

.card-divider .div-icon svg {
    width: 18px;
    height: 18px;
}

/* ---- Game tags ---- */
.card-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 40px;
}

.card-tags .tag {
    padding: 7px 20px;
    border: 1px solid var(--lavender-300);
    border-radius: var(--r-pill);
    font-family: 'Noto Serif SC', serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--lavender-500);
    background: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.06em;
    transition: all 0.3s ease;
}

.card-tags .tag:hover {
    border-color: var(--pink-300);
    color: var(--pink-500);
    background: rgba(255, 255, 255, 0.5);
}

.card-tags .tag-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pink-300);
    opacity: 0.7;
}

/* ---- Button ---- */
.ciallo-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 44px;
    border: none;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--pink-500), var(--lavender-400));
    color: #fff;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
    cursor: pointer;
    box-shadow: 0 10px 30px -8px rgba(255, 107, 157, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ciallo-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.ciallo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -8px rgba(255, 107, 157, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ciallo-btn:hover::before {
    left: 100%;
}

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

.ciallo-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Counter Badge
   ============================================ */
.counter-badge {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.05em;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.counter-badge.pulse {
    animation: badge-pulse 0.5s ease;
}

@keyframes badge-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.counter-badge svg {
    width: 16px;
    height: 16px;
    color: var(--pink-500);
}

.counter-badge .count-num {
    color: var(--pink-500);
    font-size: 15px;
    min-width: 20px;
    text-align: center;
}

/* ============================================
   Bottom Hint
   ============================================ */
.hint-bar {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    color: var(--text-mid);
    letter-spacing: 0.05em;
    pointer-events: none;
    animation: hint-breathe 3s ease-in-out infinite;
}

.hint-bar svg {
    width: 16px;
    height: 16px;
    color: var(--lavender-400);
}

@keyframes hint-breathe {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* ============================================
   Popup Animation
   ============================================ */
.ciallo-popup {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    font-family: 'Zen Maru Gothic', sans-serif;
    text-shadow: 0 2px 16px rgba(255, 183, 197, 0.5);
    animation: popup 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes popup {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-8deg);
        opacity: 0;
    }
    12% {
        transform: translate(-50%, -60%) scale(1.25) rotate(2deg);
        opacity: 1;
    }
    25% {
        transform: translate(-50%, -68%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -280%) scale(0.85) rotate(0deg);
        opacity: 0;
    }
}

/* ============================================
   Scroll Text Float
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* ============================================
   Entrance Animation
   ============================================ */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card > * {
    animation: fade-up 0.8s ease backwards;
}
.hero-card > *:nth-child(1) { animation-delay: 0.1s; }
.hero-card > *:nth-child(2) { animation-delay: 0.2s; }
.hero-card > *:nth-child(3) { animation-delay: 0.3s; }
.hero-card > *:nth-child(4) { animation-delay: 0.4s; }
.hero-card > *:nth-child(5) { animation-delay: 0.5s; }
.hero-card > *:nth-child(6) { animation-delay: 0.6s; }

.counter-badge {
    animation: fade-up 0.6s ease 0.8s backwards;
}

.hint-bar {
    animation: fade-up 0.6s ease 1s backwards, hint-breathe 3s ease-in-out 1.6s infinite;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .hero-card {
        padding: 40px 28px 36px;
        max-width: calc(100vw - 32px);
    }

    .card-title {
        font-size: clamp(44px, 14vw, 60px);
    }

    .card-greeting {
        font-size: 16px;
    }

    .card-tags .tag {
        font-size: 12px;
        padding: 6px 16px;
    }

    .ciallo-btn {
        padding: 13px 36px;
        font-size: 14px;
    }

    .counter-badge {
        top: 16px;
        right: 16px;
        padding: 7px 14px;
        font-size: 12px;
    }

    .hint-bar {
        bottom: 20px;
        font-size: 12px;
        padding: 8px 18px;
    }
}

@media (max-height: 640px) {
    .hero-card {
        padding: 32px 36px 28px;
    }

    .card-title {
        margin-bottom: 8px;
    }

    .card-greeting {
        margin-bottom: 18px;
    }

    .card-divider {
        margin-bottom: 18px;
    }

    .card-tags {
        margin-bottom: 24px;
    }

    .hint-bar {
        bottom: 12px;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-card,
    .ciallo-item,
    .petal,
    .sparkle,
    .hint-bar {
        animation: none !important;
    }

    .ciallo-popup {
        animation: popup 1s ease forwards;
    }
}
