/* ============================================
   In a Better Game - Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #1a0533 0%, #0d1b2a 50%, #1a0533 100%);
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    touch-action: manipulation;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
}

/* --- Screen Base --- */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.screen.active, .screen:only-child {
    opacity: 1;
}

.screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* --- Splash Screen --- */
.splash-screen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0533, #2d1b69, #0d1b2a);
    opacity: 1;
}

.splash-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.floating-candy {
    position: absolute;
    left: var(--x);
    font-size: var(--size);
    color: rgba(255, 255, 255, 0.15);
    animation: floatUp 4s ease-in-out infinite;
    animation-delay: var(--delay);
    bottom: -50px;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

.splash-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.splash-logo {
    animation: splashPulse 2s ease-in-out infinite;
}

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

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo-word {
    font-family: 'Fredoka One', cursive;
    display: block;
    line-height: 1.1;
}

.logo-word-1 {
    font-size: 28px;
    color: #FFD700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    animation: wordSlide 0.6s ease-out both;
}

.logo-word-2 {
    font-size: 52px;
    background: linear-gradient(135deg, #FF4757, #FFA502, #FFDA79, #2ED573, #1E90FF, #A855F7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
    animation: wordSlide 0.6s ease-out 0.2s both;
}

.logo-word-3 {
    font-size: 44px;
    color: #fff;
    text-shadow: 0 2px 20px rgba(168, 85, 247, 0.6);
    animation: wordSlide 0.6s ease-out 0.4s both;
}

@keyframes wordSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.splash-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fadeIn 1s ease 0.8s both;
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    animation: fadeIn 1s ease 1s both;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #A855F7, #1E90FF, #2ED573, #FFD700);
    border-radius: 2px;
    animation: loadBar 2.5s ease-in-out forwards;
}

@keyframes loadBar {
    to { width: 100%; }
}

.splash-tap {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    animation: blink 1.5s ease-in-out 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

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

/* --- Menu Screen --- */
.menu-screen {
    background: linear-gradient(160deg, #1a0533 0%, #0f0a2e 40%, #0d1b2a 100%);
    overflow: hidden;
}

.menu-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Top bar: lives, stars, settings */
.menu-top-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
    flex-shrink: 0;
}

.lives-pill, .stars-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.07);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.lives-hearts {
    display: flex;
    gap: 2px;
}

.heart-icon {
    font-size: 15px;
    animation: heartPop 0.4s ease-out both;
    animation-delay: var(--d);
}
.heart-icon.full {
    color: #FF4757;
    text-shadow: 0 0 6px rgba(255, 71, 87, 0.5);
}
.heart-icon.empty {
    color: rgba(255, 255, 255, 0.2);
}
@keyframes heartPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.lives-timer-text {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.stars-pill .stars-icon {
    color: #FFD700;
    font-size: 14px;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}
.stars-pill .stars-count {
    font-family: 'Fredoka One', cursive;
    font-size: 15px;
    color: #FFD700;
}

.menu-settings-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.menu-settings-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Menu body */
.menu-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 0 24px;
}

/* Logo area with glow */
.menu-logo-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.logo-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, rgba(30, 144, 255, 0.1) 40%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

.logo-ring {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(168, 85, 247, 0.15);
    animation: ringRotate 20s linear infinite;
    pointer-events: none;
}
.logo-ring::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #A855F7;
    box-shadow: 0 0 10px #A855F7;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}
@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.menu-logo {
    position: relative;
    text-align: center;
}

.logo-line-1, .logo-line-2 {
    display: flex;
    justify-content: center;
    gap: 3px;
}
.logo-line-1 {
    margin-bottom: 2px;
}

.logo-char {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    display: inline-block;
    color: var(--c, #fff);
    text-shadow:
        0 2px 8px color-mix(in srgb, var(--c, #fff) 50%, transparent),
        0 0 30px color-mix(in srgb, var(--c, #fff) 25%, transparent);
    animation: charFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 150ms);
}
.logo-char.logo-space {
    width: 10px;
}
.logo-line-2 .logo-char {
    font-size: 42px;
}

@keyframes charFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.05); }
}

.logo-line-3 {
    font-family: 'Fredoka One', cursive;
    font-size: 64px;
    color: #FFD700;
    line-height: 1;
    margin-top: -4px;
    text-shadow:
        0 4px 15px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.25),
        0 -2px 0 rgba(255, 180, 0, 1);
    animation: gameTextGlow 3s ease-in-out infinite;
}
@keyframes gameTextGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

/* Circular level ring */
.menu-level-ring {
    position: relative;
    width: 100px;
    height: 100px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 5;
}

.ring-progress {
    fill: none;
    stroke: url(#ringGrad);
    stroke-width: 5;
    stroke-linecap: round;
    stroke: #A855F7;
    transition: stroke-dashoffset 1s ease;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.5));
}

.ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
}

.ring-number {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    color: #FFD700;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* Action buttons */
.menu-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.menu-play-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    background: linear-gradient(135deg, #2ED573, #1abc9c);
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: #fff;
    letter-spacing: 2px;
    overflow: hidden;
    box-shadow:
        0 8px 25px rgba(46, 213, 115, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.menu-play-btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

.play-icon {
    font-size: 18px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.play-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: shimmerSlide 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shimmerSlide {
    0% { left: -60%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.menu-levels-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Fredoka One', cursive;
    font-size: 16px;
    letter-spacing: 1px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.menu-levels-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.levels-icon {
    opacity: 0.5;
    display: flex;
}

/* Footer */
.menu-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 16px;
    flex-shrink: 0;
}

.footer-text {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
}

/* Lives display used in overlays */
.lives-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.lives-display.big {
    justify-content: center;
    font-size: 28px;
    padding: 12px 20px;
}
.lives-display.big .heart {
    font-size: 28px;
}
.heart.full {
    color: #FF4757;
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}
.heart.empty {
    color: rgba(255, 255, 255, 0.2);
}

/* --- Buttons --- */
.btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    letter-spacing: 1px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: scale(0.95);
}

.btn-play {
    background: linear-gradient(135deg, #2ED573, #1abc9c);
    color: #fff;
    box-shadow: 0 6px 20px rgba(46, 213, 115, 0.4), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn-play:active {
    box-shadow: 0 3px 10px rgba(46, 213, 115, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #FF4757, #c0392b);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

/* --- Screen Header --- */
.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    flex-shrink: 0;
}

.screen-title {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    color: #fff;
}

/* --- Level Select --- */
.level-select-screen {
    background: linear-gradient(135deg, #1a0533, #0d1b2a);
}

.level-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 24px;
}

.world-section {
    margin-bottom: 24px;
}

.world-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.world-icon {
    font-size: 24px;
}

.world-name {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #FFD700;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.level-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    transition: transform 0.2s ease;
}

.level-node.unlocked {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(30, 144, 255, 0.3));
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.level-node.unlocked:active {
    transform: scale(0.92);
}

.level-node.current {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.4), rgba(30, 144, 255, 0.4));
    border-color: #2ED573;
    animation: currentPulse 2s ease-in-out infinite;
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(46, 213, 115, 0); }
}

.level-node.locked {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
}

.level-num {
    font-size: 20px;
    line-height: 1;
}

.level-stars {
    display: flex;
    gap: 1px;
    font-size: 10px;
}

.star {
    color: rgba(255, 255, 255, 0.2);
}

.star.earned {
    color: #FFD700;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.lock-icon {
    position: absolute;
    font-size: 14px;
    opacity: 0.3;
}

/* --- Game Screen --- */
.game-screen {
    background: linear-gradient(180deg, #1a0533, #0d1b2a);
    opacity: 1;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 12px 8px;
    flex-shrink: 0;
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-right {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.hud-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
}

.hud-value {
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    color: #FFD700;
    line-height: 1;
}

.hud-score .hud-value {
    font-size: 24px;
}

.hud-moves .hud-value {
    font-size: 28px;
    color: #fff;
}

.hud-moves .hud-value.danger {
    color: #FF4757;
    animation: dangerPulse 0.5s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hud-level-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hud-level-text {
    font-family: 'Fredoka One', cursive;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.hud-target-val {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.pause-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

/* Progress bar */
.hud-progress-bar {
    position: relative;
    height: 8px;
    margin: 0 12px 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: visible;
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #A855F7, #1E90FF, #2ED573, #FFD700);
    transition: width 0.5s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.progress-stars {
    position: absolute;
    inset: 0;
}

.progress-star {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-star.earned {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    transform: translate(-50%, -50%) scale(1.3);
}

#gameCanvas {
    flex: 1;
    display: block;
}

/* --- Overlay --- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    z-index: 100;
    transition: background 0.3s ease;
    padding: 20px;
}

.overlay.active {
    background: rgba(0, 0, 0, 0.6);
}

.overlay-card {
    background: linear-gradient(135deg, rgba(26, 5, 51, 0.95), rgba(13, 27, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 320px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.overlay.active .overlay-card {
    transform: scale(1);
    opacity: 1;
}

.overlay-title {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #FFD700;
}

.game-over-title {
    color: #FF4757;
}

.overlay-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.5;
}

.gameover-score, .gameover-target {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.go-label {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.go-value {
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: #FFD700;
}

/* --- Level Complete --- */
.level-complete-screen {
    background: linear-gradient(135deg, #1a0533, #0d1b2a);
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.confetti-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.lc-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.lc-title {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    color: #FFD700;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    animation: titleBounce 0.6s ease-out;
}

@keyframes titleBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.lc-stars {
    display: flex;
    gap: 12px;
}

.lc-star {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
}

.lc-star.earned {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.lc-star.pop {
    animation: starPop 0.5s ease-out;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.lc-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lc-score-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
}

.lc-score-value {
    font-family: 'Fredoka One', cursive;
    font-size: 42px;
    color: #fff;
}

.lc-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}

/* --- Settings --- */
.settings-screen {
    background: linear-gradient(135deg, #1a0533, #0d1b2a);
}

.settings-content {
    flex: 1;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-group .btn {
    margin: 12px auto;
    max-width: 240px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 600;
    font-size: 16px;
}

.setting-value {
    font-family: 'Fredoka One', cursive;
    color: #FFD700;
    font-size: 18px;
}

/* Toggle */
.toggle-btn {
    width: 52px;
    height: 30px;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-btn.active {
    background: #2ED573;
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #fff;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active .toggle-knob {
    transform: translateX(22px);
}

/* --- Utility Animations --- */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* --- Safe Area (notch) --- */
@supports (padding-top: env(safe-area-inset-top)) {
    .game-hud, .screen-header, .menu-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* --- Responsive --- */
@media (min-width: 481px) {
    #app {
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }
}

@media (max-height: 600px) {
    .menu-logo {
        transform: scale(0.8);
    }
    .lc-star {
        font-size: 36px;
    }
    .lc-score-value {
        font-size: 32px;
    }
}
