/* ===================================
   GLOBAL STYLES & RESET
   =================================== */

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

:root {
    /* Hauptfarben - Kirschblüten Theme */
    --primary: #FFB7C5;
    --primary-dark: #FF9BAD;
    --secondary: #B8E6D5;
    --accent: #D4B5F1;
    --accent-dark: #C09FE8;

    /* Neutrale Farben - Light Mode */
    --bg-primary: #FAFBFC;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-gradient: linear-gradient(135deg, #FAFBFC 0%, #F7FAFC 100%);
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-light: #A0AEC0;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-colored: 0 8px 24px rgba(255, 183, 197, 0.3);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Quicksand', sans-serif;
}

.level-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    /* Hauptfarben - angepasst für Dark Mode */
    --primary: #ff2ee6;
    --primary-dark: #ff5be9;
    --secondary: #68d2bb;
    --accent: #c7a9ff;
    --accent-dark: #a684ff;

    /* Neutrale Farben - Dark Mode */
    --bg-primary: #0d0b1a;
    --bg-secondary: #121027;
    --bg-card: #1b1933;
    --bg-gradient: radial-gradient(circle at 20% 20%, rgba(255, 46, 230, 0.08), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(104, 210, 187, 0.08), transparent 40%),
        linear-gradient(160deg, #0d0b1a 0%, #0f1022 50%, #11142d 100%);
    --text-primary: #f5f5f8;
    --text-secondary: #c7c7d2;
    --text-light: #9696a5;

    /* Shadows & Effects - angepasst für Dark Mode */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
    --shadow-colored: 0 0 25px rgba(255, 46, 230, 0.45), 0 12px 40px rgba(0, 0, 0, 0.45);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
}

body.menu-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../image/background_branch.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('../image/background_branch.png'), url('../image/background_branch.png');
    background-size: contain, contain;
    background-position: left top, right bottom;
    background-repeat: no-repeat, no-repeat;
    opacity: 0.1;
    pointer-events: none;
    z-index: -2;
}

[data-theme="dark"] body::after {
    opacity: 0.08;
    filter: brightness(0.85);
}

body.sakura-theme {
    background: radial-gradient(circle at 20% 20%, rgba(255, 221, 235, 0.7), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(212, 181, 241, 0.35), transparent 30%),
                linear-gradient(135deg, #fff4f8 0%, #f9fbff 35%, #ffe9f2 100%);
}

[data-theme="dark"] body.sakura-theme {
    background: radial-gradient(circle at 20% 20%, rgba(255, 155, 173, 0.35), transparent 32%),
                radial-gradient(circle at 80% 0%, rgba(192, 159, 232, 0.25), transparent 28%),
                linear-gradient(135deg, #0f1424 0%, #171c2f 40%, #24162a 100%);
}

.blossom-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.blossom-background .petal {
    position: absolute;
    top: -10%;
    left: var(--x);
    width: var(--size, 18px);
    height: var(--size, 16px);
    background: url('../image/cherry_petal.svg') center/contain no-repeat;
    opacity: 0.9;
    filter: drop-shadow(0 8px 12px rgba(255, 183, 197, 0.45));
    transform-origin: center;
    animation: blossomFall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes blossomFall {
    0% {
        transform: translate3d(0, -10vh, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    100% {
        transform: translate3d(calc(var(--drift, 0px)), 110vh, 0) rotate(320deg);
        opacity: 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   NAVIGATION
   =================================== */

.navbar {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(17, 16, 45, 0.9);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-decoration: none;
}

.logo-home:hover,
.logo-home:focus-visible {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    outline: none;
}

[data-theme="dark"] .logo-home:hover,
[data-theme="dark"] .logo-home:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.logo-image {
    width: 44px;
    height: 44px;
}

.logo-emoji {
    font-size: 44px;
    line-height: 1;
    display: inline-block;
    margin-left: 1rem;
}

.logo-text-link {
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.85;
}

.logo-text-link::after {
    content: "";
    position: absolute;
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.2rem;
    height: 2px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transform: scaleX(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-text-link:hover,
.logo-text-link:focus-visible {
    color: var(--primary);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.35);
    outline: none;
    opacity: 1;
}

.logo-text-link:hover::after,
.logo-text-link:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

[data-theme="dark"] .logo-text-link:hover,
[data-theme="dark"] .logo-text-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #b2c4ff;
    opacity: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-sm);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    outline: none;
    border-color: rgba(0, 0, 0, 0.12);
}

.nav-toggle-box {
    position: relative;
    width: 20px;
    height: 14px;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle-bar {
    top: 50%;
    transform: translateY(-50%);
}

.nav-toggle-bar::before {
    content: "";
    top: -6px;
}

.nav-toggle-bar::after {
    content: "";
    top: 6px;
}

.nav-toggle.is-active .nav-toggle-bar {
    background: transparent;
}

.nav-toggle.is-active .nav-toggle-bar::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar::after {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 900;
}

.nav-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.nav-menu-header {
    display: none;
}

.user-points {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #FFF7E6 0%, #FFF3D6 100%);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .user-points {
    background: linear-gradient(135deg, rgba(255, 46, 230, 0.16) 0%, rgba(104, 210, 187, 0.12) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(199, 199, 210, 0.16);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 46, 230, 0.22);
}

.points-icon {
    width: 36px;
    height: 36px;
    position: relative;
    animation: coinFloat 2.4s ease-in-out infinite;
}

.user-points#points-history-trigger {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.user-points#points-history-trigger:focus-visible {
    outline: 3px solid rgba(212, 181, 241, 0.65);
    outline-offset: 4px;
}

.user-points#points-history-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.1), 0 0 16px rgba(255, 183, 197, 0.35);
}

[data-theme="dark"] .user-points#points-history-trigger:hover {
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 46, 230, 0.28);
}

.coin-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

[data-theme="dark"] .coin-svg {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 12px rgba(255, 183, 0, 0.28));
}

.coin-shine {
    animation: coinShine 2.8s ease-in-out infinite;
    transform-origin: 50% 50%;
    mix-blend-mode: screen;
}

[data-theme="dark"] .points-value {
    color: #ffd27f;
}

.theme-toggle {
    position: relative;
    width: 96px;
    height: 48px;
    padding: 6px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(212, 181, 241, 0.6);
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.35) 0%, rgba(184, 230, 213, 0.3) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(212, 181, 241, 0.65);
    outline-offset: 3px;
}

.theme-toggle .toggle-track {
    position: absolute;
    inset: 4px;
    border-radius: var(--radius-full);
    overflow: hidden;
    pointer-events: none;
}

.theme-toggle .sky {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transition: opacity 0.4s ease, transform 0.45s ease;
}

.theme-toggle .sky-day {
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.9) 0%, rgba(184, 230, 213, 0.95) 100%);
    box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.4);
    transform: translateY(0);
}

.theme-toggle .sky-night {
    background: linear-gradient(145deg, rgba(26, 24, 53, 0.95) 0%, rgba(52, 37, 92, 0.9) 100%);
    box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(8px);
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, rgba(255, 46, 230, 0.18) 0%, rgba(167, 132, 255, 0.18) 100%);
    border-color: rgba(167, 132, 255, 0.7);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-toggle .sky-night {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="dark"] .theme-toggle .sky-day {
    opacity: 0;
    transform: translateY(-8px);
}

.theme-toggle .toggle-thumb {
    position: relative;
    width: 38px;
    height: 38px;
    background: radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.35) 42%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(145deg, #f6f0ff 0%, #d7c8f3 100%);
    border-radius: 50%;
    box-shadow: inset 0 -8px 14px rgba(0, 0, 0, 0.14), inset 0 8px 12px rgba(255, 255, 255, 0.7),
        0 10px 18px rgba(0, 0, 0, 0.18), 0 0 10px rgba(255, 183, 197, 0.35);
    transform: translateX(-18px);
    transition: transform 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
    z-index: 1;
}

.theme-toggle .toggle-thumb::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0)),
        linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(215, 200, 243, 0.35));
    box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.75), inset 0 -6px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

[data-theme="dark"] .theme-toggle .toggle-thumb {
    transform: translateX(18px);
    background: radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 45%, rgba(255, 255, 255, 0) 65%),
        linear-gradient(145deg, #1a1535 0%, #231c44 100%);
    box-shadow: inset 0 -10px 16px rgba(0, 0, 0, 0.35), inset 0 8px 10px rgba(255, 255, 255, 0.15),
        0 14px 26px rgba(0, 0, 0, 0.4), 0 0 18px rgba(167, 132, 255, 0.4);
}

.theme-toggle:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 18px rgba(212, 181, 241, 0.3);
}

.theme-toggle .sun {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffe7a3;
    box-shadow: 0 0 0 8px rgba(255, 183, 197, 0.36);
    top: 12px;
    left: 14px;
}

.theme-toggle .cloud {
    position: absolute;
    background: #ffffff;
    border-radius: 999px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.theme-toggle .cloud-1 {
    width: 24px;
    height: 12px;
    top: 24px;
    left: 32px;
    box-shadow: 10px -4px 0 2px #ffffff;
}

.theme-toggle .cloud-2 {
    width: 18px;
    height: 10px;
    top: 16px;
    right: 12px;
    box-shadow: 8px -3px 0 1px #ffffff;
}

.theme-toggle .moon {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5f5f8 0%, #d6d6e8 100%);
    box-shadow: inset -4px -4px 8px rgba(0, 0, 0, 0.16);
    top: 13px;
    left: 40px;
}

.theme-toggle .moon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2b244c;
    top: 3px;
    left: 7px;
}

.theme-toggle .star {
    position: absolute;
    background: #d7d9ff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(199, 169, 255, 0.7);
}

.theme-toggle .star-1 { width: 6px; height: 6px; top: 12px; left: 14px; }
.theme-toggle .star-2 { width: 4px; height: 4px; top: 26px; left: 20px; }
.theme-toggle .star-3 { width: 5px; height: 5px; top: 30px; right: 14px; }

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg,
        rgba(255, 183, 197, 0.14) 0%,
        rgba(212, 181, 241, 0.12) 50%,
        rgba(184, 230, 213, 0.12) 100%);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg,
        rgba(255, 46, 230, 0.12) 0%,
        rgba(167, 132, 255, 0.12) 50%,
        rgba(104, 210, 187, 0.08) 100%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 183, 197, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    transform: translateY(-2px);
}

/* ===================================
   TREE VISUALIZATION
   =================================== */

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tree-container {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(230, 162, 194, 0.25), var(--shadow-lg);
    text-align: center;
    position: relative;
}

.cherry-tree,
.home-tree-image,
.tree-visual-stage {
    width: 100%;
    max-width: 320px;
    filter: drop-shadow(0 20px 40px rgba(197, 121, 152, 0.35)) drop-shadow(0 10px 22px rgba(0,0,0,0.16));
    transition: transform 0.3s ease, filter 0.3s ease;
}

[data-theme="dark"] .tree-visual-stage {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3)) brightness(0.92) contrast(1.05);
}

.cherry-tree .foliage rect,
.cherry-tree .trunk rect,
.cherry-tree .soil rect,
.cherry-tree .pot rect {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hero-floating-petals,
.timer-petal-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.tree-visual-stage {
    position: relative;
    height: 380px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}

.home-tree-stage {
    height: 400px;
}

.tree-layer {
    position: absolute;
    inset: 0;
    /* Note: cherry_blossom_tree.svg does not exist - using CSS gradient as fallback */
    background: linear-gradient(to bottom, rgba(228, 158, 184, 0.15), rgba(197, 121, 152, 0.08));
    opacity: 0;
    transform-origin: 50% 90%;
    filter: drop-shadow(0 12px 28px rgba(197, 121, 152, 0.25));
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

.tree-layer-trunk {
    clip-path: polygon(44% 100%, 56% 100%, 56% 68%, 46% 60%, 42% 40%, 44% 24%, 48% 12%, 52% 0%, 44% 0%, 35% 0%, 30% 14%, 34% 36%, 38% 48%, 42% 68%);
    transform: translateZ(2px) scale(1.01);
    filter: drop-shadow(0 10px 18px rgba(110, 68, 86, 0.35)) saturate(1.02);
}

.tree-layer-branches {
    clip-path: polygon(0% 38%, 40% 34%, 60% 32%, 82% 36%, 100% 44%, 100% 82%, 0% 82%);
    transform: translateZ(4px) scale(1.015);
    filter: drop-shadow(0 12px 22px rgba(163, 112, 138, 0.3)) saturate(1.04);
}

.tree-layer-blooms {
    clip-path: polygon(6% 0%, 94% 0%, 100% 30%, 90% 50%, 70% 60%, 52% 72%, 42% 70%, 20% 62%, 6% 40%);
    opacity: 0;
    transform: translateZ(6px) scale(1.02);
    filter: drop-shadow(0 16px 28px rgba(228, 158, 184, 0.35)) contrast(1.03);
}

.tree-layer-glow {
    background: radial-gradient(circle at 50% 45%, rgba(255, 183, 197, 0.55) 0%, rgba(255, 183, 197, 0) 40%);
    opacity: 0;
    filter: blur(14px) drop-shadow(0 18px 36px rgba(255, 183, 197, 0.4));
    transform: translateZ(1px) scale(1.02);
}

.floating-petal,
.timer-floating-petal {
    position: absolute;
    top: -12%;
    left: var(--x, 50%);
    width: 28px;
    height: 24px;
    background: url('../image/cherry_petal.svg') center/contain no-repeat;
    filter: drop-shadow(0 10px 14px rgba(230, 150, 180, 0.45));
    animation: blossomFall var(--duration, 14s) linear infinite;
    animation-delay: var(--delay, 0s);
    transform: scale(var(--scale, 1));
}

.cherry-tree .foliage {
    animation: pixel-pop 1.1s ease-out;
}

.cherry-tree .trunk {
    animation: pixel-pop 0.9s ease-out;
}

.cherry-tree .falling-petals rect {
    animation: pixel-fall 4s ease-in-out infinite;
}

.cherry-tree .falling-petals .petal-fall-2 {
    animation-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto;
    }

    #home-cherry-tree,
    .tree-layer,
    .floating-petal,
    .hero-floating-petals .floating-petal,
    .blossom-background .petal {
        animation: none !important;
        transform: none !important;
        transition: opacity 0.6s ease;
    }

    .tree-layer,
    #home-cherry-tree {
        opacity: 1 !important;
    }
}

/* Floating mini timer shown across pages */
#floating-timer {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #2c3e50);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 0.9rem 1.1rem;
    display: none;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid rgba(102, 126, 234, 0.15);
    z-index: 1200;
    min-width: 220px;
    backdrop-filter: blur(8px);
}

.floating-timer-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.floating-timer-time {
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-primary, #2c3e50);
}

.floating-timer-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.floating-timer-mode {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
}

.floating-timer-status {
    font-size: 0.85rem;
    color: var(--text-secondary, #5a6c7d);
}

.floating-timer-link {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.35);
}

.floating-timer-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(118, 75, 162, 0.4);
}

.floating-timer-running {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.cherry-tree .falling-petals .petal-fall-3 {
    animation-delay: 0.8s;
}

.tree-info {
    margin-top: var(--spacing-md);
}

.tree-level {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.tree-progress {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===================================
   DASHBOARD STATS
   =================================== */

.dashboard {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-secondary);
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   FEATURES SECTION
   =================================== */

.features {
    padding: var(--spacing-xl) 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .feature-card {
    background: linear-gradient(135deg, rgba(27, 25, 51, 0.95) 0%, rgba(18, 16, 39, 0.92) 100%);
    border-color: rgba(255, 46, 230, 0.3);
}

[data-theme="dark"] .feature-card:hover {
    box-shadow: var(--shadow-colored);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    display: inline-block;
}

.feature-icon-img {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border-radius: 50%;
    vertical-align: baseline;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    min-height: 3.4em;
    display: flex;
    align-items: center;
}

.feature-card .btn {
    margin-top: auto;
}

/* ===================================
   TIKTOK VIDEO PREVIEW
   =================================== */

.tiktok-preview {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg,
        rgba(255, 183, 197, 0.05) 0%,
        rgba(212, 181, 241, 0.05) 100%);
}

[data-theme="dark"] .tiktok-preview {
    background: linear-gradient(135deg,
        rgba(255, 46, 230, 0.06) 0%,
        rgba(167, 132, 255, 0.06) 60%,
        rgba(104, 210, 187, 0.04) 100%);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.video-thumbnail .tiktok-iframe {
    width: 100%;
    height: 100%;
    border: none;
    max-width: 605px;
    min-width: 0;
}

.placeholder-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.placeholder-thumbnail p {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
}

.video-title {
    padding: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    height: 6.5rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.video-meta {
    padding: 0 var(--spacing-sm) var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.section-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

[data-theme="dark"] .footer {
    background: linear-gradient(180deg, #16142d 0%, #0d0b1a 100%);
    color: var(--text-primary);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary);
}

[data-theme="dark"] .footer-section h4 {
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

[data-theme="dark"] .footer-section a {
    color: rgba(245, 245, 248, 0.85);
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .footer-bottom {
    border-top: 1px solid rgba(199, 199, 210, 0.14);
    color: var(--text-secondary);
}

/* ===================================
   POINTS HISTORY MODAL
   =================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1200;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: min(520px, 90vw);
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid rgba(212, 181, 241, 0.35);
    animation: popIn 0.28s ease;
}

[data-theme="dark"] .modal {
    background: linear-gradient(145deg, rgba(27, 25, 51, 0.98) 0%, rgba(18, 16, 39, 0.96) 100%);
    border: 1px solid rgba(167, 132, 255, 0.35);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 46, 230, 0.28);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-kicker {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.modal h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    border: none;
    background: rgba(255, 183, 197, 0.18);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.28) 0%, rgba(212, 181, 241, 0.24) 100%);
}

[data-theme="dark"] .modal-close {
    background: rgba(167, 132, 255, 0.18);
    color: var(--text-secondary);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.25) 0%, rgba(212, 181, 241, 0.18) 100%);
    border: 1px solid rgba(212, 181, 241, 0.45);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .history-item {
    background: linear-gradient(135deg, rgba(255, 46, 230, 0.18) 0%, rgba(104, 210, 187, 0.12) 100%);
    border: 1px solid rgba(167, 132, 255, 0.35);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.history-title {
    font-weight: 700;
    color: var(--text-primary);
}

.history-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-points {
    font-weight: 800;
    color: #e09900;
    align-self: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(255, 239, 199, 0.8);
    border: 1px solid rgba(255, 207, 115, 0.55);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .history-points {
    color: #ffd27f;
    background: rgba(255, 207, 115, 0.12);
    border: 1px solid rgba(255, 207, 115, 0.4);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.08);
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem 0.5rem;
}

@keyframes popIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes coinFloat {
    0%, 100% {
        transform: translateY(0px) rotate(-6deg);
    }
    50% {
        transform: translateY(-6px) rotate(6deg);
    }
}

@keyframes coinShine {
    0%, 100% {
        transform: translate(-6px, -4px) scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: translate(6px, 4px) scale(1.05);
        opacity: 0.85;
    }
}

@keyframes pixel-pop {
    from {
        transform: scale(0.92) translateY(6px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes pixel-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(22px) rotate(12deg);
        opacity: 0;
    }
}

@keyframes grow-trunk {
    from {
        opacity: 0;
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }
    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

@keyframes grow-branch {
    from {
        opacity: 0;
        stroke-dasharray: 500;
        stroke-dashoffset: 500;
    }
    to {
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

@keyframes bloom {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .nav-container {
        gap: 0.5rem;
        padding: var(--spacing-sm) var(--spacing-sm);
    }

    [data-theme="dark"] .nav-container {
        background: transparent;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .logo {
        gap: 0.75rem;
        font-size: 1rem;
    }

    .logo-text-link {
        font-size: 0.9rem;
    }

    .logo-emoji {
        font-size: 32px;
        margin-left: 0.5rem;
    }

    .user-points {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    [data-theme="dark"] .user-points {
        background: linear-gradient(135deg, rgba(255, 46, 230, 0.16) 0%, rgba(104, 210, 187, 0.12) 100%);
        border: 1px solid rgba(199, 199, 210, 0.16);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 46, 230, 0.22);
    }

    .points-icon {
        width: 28px;
        height: 28px;
    }

    .theme-toggle {
        width: 80px;
        height: 40px;
    }

    [data-theme="dark"] .theme-toggle {
        background: linear-gradient(135deg, rgba(255, 46, 230, 0.18) 0%, rgba(167, 132, 255, 0.18) 100%);
        border-color: rgba(167, 132, 255, 0.7);
        box-shadow: var(--shadow-md);
    }

    .theme-toggle .toggle-thumb {
        width: 32px;
        height: 32px;
    }

    .shop-trigger-btn {
        width: 40px;
        height: 40px;
        margin-left: 0;
        margin-right: 0;
    }

    .shop-icon {
        font-size: 1.2rem;
    }

    [data-theme="dark"] .shop-trigger-btn {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        border-color: rgba(167, 132, 255, 0.4);
        box-shadow: var(--shadow-md);
    }

    [data-theme="dark"] .shop-trigger-btn:hover {
        box-shadow: var(--shadow-colored);
    }

    .nav-toggle {
        display: inline-flex;
    }

    [data-theme="dark"] .nav-toggle {
        background: rgba(27, 25, 51, 0.95);
        border-color: rgba(167, 132, 255, 0.3);
        box-shadow: var(--shadow-md);
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: min(85vw, 340px);
        height: 100vh;
        background: var(--bg-secondary);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        padding: calc(var(--spacing-xl) + 0.5rem) var(--spacing-lg);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
        z-index: 1000;
        border-left: 1px solid rgba(255, 183, 197, 0.2);
    }

    [data-theme="dark"] .nav-menu {
        background: rgba(18, 16, 39, 0.95);
        border-left: 1px solid rgba(167, 132, 255, 0.3);
        box-shadow: -12px 0 50px rgba(0, 0, 0, 0.4);
    }

    .nav-menu.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-md);
        border-bottom: 2px solid rgba(255, 183, 197, 0.2);
    }

    [data-theme="dark"] .nav-menu-header {
        border-bottom: 2px solid rgba(167, 132, 255, 0.3);
    }

    .nav-menu-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--text-primary);
        font-family: var(--font-secondary);
    }

    .nav-menu-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: rgba(255, 183, 197, 0.15);
        color: var(--text-primary);
        border-radius: var(--radius-md);
        font-size: 1.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
        line-height: 1;
    }

    .nav-menu-close:hover {
        background: rgba(255, 183, 197, 0.25);
        transform: rotate(90deg);
    }

    [data-theme="dark"] .nav-menu-close {
        background: rgba(167, 132, 255, 0.18);
    }

    [data-theme="dark"] .nav-menu-close:hover {
        background: rgba(167, 132, 255, 0.28);
    }

    .nav-menu .nav-link {
        width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1.05rem;
        border-radius: var(--radius-md);
        transition: all 0.25s ease;
        position: relative;
        overflow: hidden;
    }

    .nav-menu .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
        transform: scaleY(0);
        transition: transform 0.25s ease;
    }

    .nav-menu .nav-link:hover::before,
    .nav-menu .nav-link.active::before {
        transform: scaleY(1);
    }

    .nav-menu .nav-link:hover {
        transform: translateX(8px);
        background: rgba(255, 183, 197, 0.1);
    }

    [data-theme="dark"] .nav-menu .nav-link:hover {
        background: rgba(167, 132, 255, 0.12);
    }

    .nav-menu .nav-link:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ===================================
   SHOP SYSTEM
   =================================== */

.shop-trigger-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    margin-left: 8px;
    position: relative;
    flex-shrink: 0;
}

.shop-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.5);
}

.shop-trigger-btn:active {
    transform: translateY(0);
}

.shop-modal {
    max-width: 1100px;
    width: 95vw;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.shop-item {
    background: var(--bg-card);
    border: 2px solid rgba(255, 183, 197, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.shop-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-colored);
    transform: translateY(-4px);
}

.shop-item.purchased {
    opacity: 0.6;
    border-color: var(--secondary);
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.shop-item-header h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.shop-item-price {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.shop-item-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.shop-buy-btn {
    width: 100%;
    margin-top: 0.5rem;
}

.shop-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item-purchased {
    display: none;
    text-align: center;
    color: var(--secondary);
    font-weight: 600;
    padding: 0.75rem;
    background: rgba(184, 230, 213, 0.1);
    border-radius: var(--radius-sm);
}

.shop-item.purchased .shop-item-purchased {
    display: block;
}

.shop-admin {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 2px dashed rgba(255, 183, 197, 0.4);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.08), rgba(255, 107, 142, 0.05));
}

.shop-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.shop-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.shop-admin-description,
.shop-admin-hint {
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.shop-admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.shop-admin-form input {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 183, 197, 0.3);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.shop-admin-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.email-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 183, 197, 0.2);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--bg-card);
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--primary);
}

.discount-code-inline {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px dashed rgba(255, 183, 197, 0.4);
    border-radius: var(--radius-md);
    background: rgba(255, 183, 197, 0.08);
}

.discount-code-label {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.discount-code-value {
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    font-weight: 800;
    color: var(--primary-dark);
    background: rgba(255, 183, 197, 0.15);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 0.35rem;
}

.discount-code-hint {
    margin: 0.35rem 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.discount-code-display {
    font-size: 1.4rem;
    letter-spacing: 0.16em;
    font-weight: 900;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.2), rgba(255, 183, 197, 0.4));
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
    margin: 0.75rem 0 0.5rem;
}

/* ===================================
   MUSIC TOGGLE BUTTON (Global floating button only)
   =================================== */

#music-toggle-btn {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.75rem;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
}

#music-toggle-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-colored);
}

#music-toggle-btn:active {
    transform: translateY(-2px);
}

[data-theme="dark"] #music-toggle-btn {
    color: #000000;
}

body > .music-volume-control {
    position: fixed;
    bottom: 7rem;
    right: 4.5rem;
    background: var(--bg-card);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    z-index: 998;
}

.music-volume-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.music-volume-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ===================================
   SHOP NOTIFICATIONS
   =================================== */

.shop-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
    max-width: 350px;
}

.shop-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.shop-notification.success {
    border-left-color: var(--secondary);
}

.shop-notification.error {
    border-left-color: #FF6B6B;
}

.shop-notification.info {
    border-left-color: #4ECDC4;
}

/* ===================================
   ACHIEVEMENT NOTIFICATION (for secret achievement)
   =================================== */

.achievement-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-colored);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border: 2px solid var(--primary);
    max-width: 320px;
}

.achievement-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-icon {
    font-size: 3rem;
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .shop-items {
        grid-template-columns: 1fr;
    }

    .shop-modal {
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem;
    }

    .logo {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .logo-text-link {
        font-size: 0.8rem;
        padding: 0.1rem 0.3rem;
    }

    .logo-emoji {
        font-size: 28px;
        margin-left: 0.25rem;
    }

    .user-points {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }

    .points-icon {
        width: 24px;
        height: 24px;
    }

    .theme-toggle {
        width: 72px;
        height: 36px;
    }

    .theme-toggle .toggle-thumb {
        width: 28px;
        height: 28px;
        transform: translateX(-16px);
    }

    [data-theme="dark"] .theme-toggle .toggle-thumb {
        transform: translateX(16px);
    }

    .shop-trigger-btn {
        width: 36px;
        height: 36px;
        margin-left: 0;
        padding: 0;
    }

    .shop-icon {
        font-size: 1.1rem;
    }

    [data-theme="dark"] .shop-trigger-btn {
        border-color: rgba(167, 132, 255, 0.5);
    }

    [data-theme="dark"] .user-points {
        font-size: 0.85rem;
    }

    [data-theme="dark"] .theme-toggle {
        border-color: rgba(167, 132, 255, 0.6);
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}
