/* ==========================================================================
   PulseCatcher Stylesheet - Cyberpunk Glassmorphism Neon Theme
   ========================================================================== */

:root {
    --bg-dark: #0B0E14;
    --surface-dark: rgba(23, 28, 38, 0.75);
    --surface-border: rgba(255, 255, 255, 0.08);
    
    /* Neon Colors matching the Jetpack Compose Android app */
    --accent-cyan: #00E5FF;
    --accent-pink: #FF007F;
    --accent-yellow: #FFEA00;
    --accent-green: #00E676;
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E9AA8;
    --font-cyber: 'Outfit', 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevents double-tap zoom and scrolling */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-cyber);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* SCREEN MANAGEMENT */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

/* 1. SPLASH SCREEN STYLES */
#splash-screen {
    background-color: var(--bg-dark);
}

.splash-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
    animation: floatLogo 3s ease-in-out infinite;
}

.splash-title {
    font-size: 38px;
    font-weight: 900;
    color: var(--accent-cyan);
    letter-spacing: 8px;
    margin-bottom: 4px;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.splash-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-pink);
    letter-spacing: 10px;
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
    margin-bottom: 80px;
}

.brand-credits {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUpBrand 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    animation-delay: 0.5s;
}

.powered-by {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.studio-name {
    font-size: 16px;
    font-weight: 900;
    color: var(--accent-yellow);
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 234, 0, 0.5);
}

/* 2. MAIN MENU SCREEN STYLES */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 90vh;
    max-height: 750px;
    width: 90%;
    max-width: 420px;
    padding: 20px;
}

.menu-header {
    text-align: center;
    margin-top: 30px;
}

.menu-title {
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-cyan);
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    animation: pulsateGlow 2.5s ease-in-out infinite alternate;
}

.menu-subtitle {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-pink);
    letter-spacing: 12px;
    text-shadow: 0 0 12px rgba(255, 0, 127, 0.4);
}

.menu-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.social-btn {
    background-color: var(--surface-dark);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

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

.icon {
    width: 20px;
    height: 20px;
}

#btn-share .icon {
    fill: var(--accent-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.4));
}

#btn-rate .icon {
    fill: var(--accent-pink);
    filter: drop-shadow(0 0 5px rgba(255, 0, 127, 0.4));
}

.high-score-badge {
    background-color: rgba(23, 28, 38, 0.8);
    border: 1px solid var(--surface-border);
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-yellow);
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.level-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(23, 28, 38, 0.8);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.level-arrow-btn {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: scale 0.2s ease;
}

.level-arrow-btn:active {
    scale: 0.85;
}

.level-arrow-btn.disabled {
    color: #4A5568 !important;
    cursor: not-allowed;
    pointer-events: none;
}

.level-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-picker-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.level-picker-val {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
}

/* Pulsing Play Button */
.btn-play-pulse {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: playPulse 2s infinite;
}

.btn-play-inner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-play-pulse:hover .btn-play-inner {
    transform: scale(1.08);
    box-shadow: 0 0 35px rgba(255, 0, 127, 0.5);
}

.play-icon {
    width: 38px;
    height: 38px;
    fill: var(--text-primary);
    margin-left: 6px;
}

/* Settings Toggle switches */
.settings-card {
    background-color: var(--surface-dark);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Custom Checkbox Toggle Switch styled premium */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--surface-border);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(0, 229, 255, 0.2);
    border-color: var(--accent-cyan);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

/* Custom switch colors for accessibility pink toggle */
#setting-accessibility:checked + .slider {
    background-color: rgba(255, 0, 127, 0.2);
    border-color: var(--accent-pink);
}

#setting-accessibility:checked + .slider:before {
    background-color: var(--accent-pink);
    box-shadow: 0 0 8px var(--accent-pink);
}

/* 3. GAME PLAY SCREEN STYLES */
#game-container {
    background-color: var(--bg-dark);
}

/* Bound screen shakes to this wrapper */
#canvas-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    display: block;
    background-color: transparent;
}

.hud-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Let clicks pass to the swipe layer */
    z-index: 30;
}

.hud-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hud-level-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.hud-score-text {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Combo badge styled juicy and spring animated */
.combo-badge {
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
    font-size: 13px;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 0 12px rgba(255, 234, 0, 0.4);
    transform-origin: left center;
}

.combo-badge.hidden {
    display: none;
}

/* Custom class added via JS to trigger pop/bounce */
.combo-pop {
    animation: comboPopEffect 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

.hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 150px;
}

.hud-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-cyan);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
    transition: width 0.15s ease-out, background-color 0.3s ease;
}

.progress-bar.warning-health {
    background-color: var(--accent-pink) !important;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.5) !important;
}

.controller-guide {
    position: absolute;
    bottom: 40px;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 30;
    opacity: 0.4;
    animation: fadeGuide 3s ease-in-out infinite;
}

.guide-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

/* Red damage flash */
.damage-flash {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 0, 0, 0.4);
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    transition: opacity 0.05s ease-out;
}

/* 4. OVERLAYS & MODALS STYLES */
.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
}

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

/* Level Up Overlay */
#levelup-overlay {
    background-color: rgba(0, 0, 0, 0.6);
}

.levelup-content {
    text-align: center;
}

.levelup-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-green);
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
    margin-bottom: 12px;
}

.levelup-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* Reusable Glass Card Modal styles */
.card {
    background: var(--surface-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    width: 88%;
    max-width: 360px;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.card-icon.warning {
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
}

.warning-icon {
    width: 100%;
    height: 100%;
    fill: var(--accent-pink);
    filter: drop-shadow(0 0 8px rgba(255, 0, 127, 0.5));
}

.card-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.text-pink {
    color: var(--accent-pink);
    text-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.card-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Countdown circle loader inside Revive Dialog */
.countdown-circle {
    position: relative;
    width: 70px;
    height: 70px;
    margin-bottom: 28px;
}

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

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3;
}

.circle-progress {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s linear;
}

.timer-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Button styles matching Android Compose buttons */
.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn-primary {
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
    font-family: var(--font-cyber);
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 20px;
    height: 50px;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

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

.play-btn-icon {
    width: 18px;
    height: 18px;
    fill: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-cyber);
    font-size: 14px;
    font-weight: 700;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    height: 50px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

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

/* 6. GAME OVER LAYOUT */
.gameover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 380px;
    text-align: center;
}

.gameover-title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.gameover-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.gameover-score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}

.gameover-score-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

.gameover-score-val {
    font-size: 72px;
    font-weight: 900;
    color: var(--accent-cyan);
    line-height: 1;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
    margin-top: 4px;
}

.gameover-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    align-items: center;
}

.gameover-buttons button {
    width: 75%;
    max-width: 260px;
}

.btn-yellow {
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
    font-family: var(--font-cyber);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 24px;
    height: 50px;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 234, 0, 0.2);
    transition: all 0.2s ease;
}

.btn-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 234, 0, 0.35);
}

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

.btn-icon {
    width: 18px;
    height: 18px;
    fill: var(--bg-dark);
}

#btn-retry .btn-icon {
    fill: var(--bg-dark);
}

/* ==========================================================================
   CSS KEYFRAMES ANIMATIONS
   ========================================================================== */

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

@keyframes slideUpBrand {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0px); opacity: 1; }
}

@keyframes pulsateGlow {
    0% { text-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
    100% { text-shadow: 0 0 25px rgba(0, 229, 255, 0.6); }
}

@keyframes playPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.25); }
    70% { box-shadow: 0 0 0 20px rgba(0, 229, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

@keyframes comboPopEffect {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); color: var(--accent-cyan); }
    100% { transform: scale(1); }
}

@keyframes fadeGuide {
    0% { opacity: 0.2; }
    50% { opacity: 0.6; }
    100% { opacity: 0.2; }
}
