/* ============================
   Arrow Escape - Clean White UI
   ============================ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
    font-weight: 600;
    background: #FFFFFF;
    color: #1a1a1a;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== CANVAS ===== */
#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    outline: none;
    touch-action: none;
}

/* ===== UI OVERLAY ===== */
#uiOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#uiOverlay > * {
    pointer-events: auto;
}

/* ===== SCREENS ===== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    display: flex;
}

.hidden {
    display: none !important;
}

/* ===== COMMON BUTTONS ===== */
.back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    box-shadow: none;
    color: #333;
}

.back-btn:active {
    background: #e0e0e0;
}

.back-btn svg path {
    fill: #333;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 28px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    transition: transform 0.1s, opacity 0.15s;
    border: none;
    width: 100%;
    max-width: 260px;
    box-shadow: none;
    text-shadow: none;
}

.menu-btn:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.next-btn {
    background: #1a1a1a;
}

.replay-btn {
    background: #f5f5f5;
    color: #333;
}

.replay-btn svg path {
    fill: #333;
}

.retry-btn {
    background: #1a1a1a;
}

.levels-btn {
    background: #f5f5f5;
    color: #333;
}

/* ===== MAIN MENU ===== */
#menuScreen {
    justify-content: center;
    background: #FFFFFF;
    overflow: hidden;
}

.menu-settings-btn{

    position:absolute;
    top:20px;
    right:20px;
    width:64px;
    height:64px;
    border:none;
    border-radius:50%;
    background:#000;      /* Black Button */
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 6px 16px rgba(0,0,0,.2);

}

.menu-settings-btn:active {
    background: #000000;
}

.menu-settings-btn svg path {

    fill: #ffffff;
}

.menu-content{

    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;

    gap:-50px;

    position:relative;
    z-index:1;

    transform:translateY(-10px);

}

/* ===== LOGO ===== */
.game-title {
    line-height: 1;
    position: relative;
    top:85px;
}

/* .title-line {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.title-arrow {
    font-size: clamp(2.8rem, 11vw, 5rem);
    color: #1a1a1a;
    text-shadow: none;
    animation: none;
}

.title-escape {
    font-size: clamp(3.2rem, 13vw, 5.8rem);
    color: #1a1a1a;
    text-shadow: none;
    margin-top: -0.1em;
    animation: none;

}.title-champ {
    font-size: clamp(2.8rem, 11vw, 5rem);
    color: #1a1a1a;
    text-shadow: none;
    margin-top: -0.1em;
    animation: none;
} */

/* .game-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    margin: 12px auto 0;
    background: #1a1a1a;
    border-radius: 2px;
    animation: none;
} */

/* .menu-subtitle {
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    color: #999;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
} */

/* ===== PLAY BUTTON ===== */
.play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 22px;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    box-shadow: none;
    text-shadow: none;
    transition: transform 0.15s, opacity 0.15s;
    position: relative;
    overflow: hidden;
    animation: none;
    font-size:34px;
    font-weight:700;
    margin-top:160px;
}


.play-btn:active {
    transform: scale(0.96);
    opacity: 0.85;
    animation: none;
}

.play-btn-shine {
    display: none;
}

.play-icon {
    flex-shrink: 0;
}

/* ===== SETTINGS SCREEN ===== */
#settingsScreen {
    display: flex;
    background: #FFFFFF;
    z-index: 150;
    flex-direction: column;
    align-items: center;
    padding-top: clamp(16px, 4vh, 32px);
}

.settings-container {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 18px);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-container::-webkit-scrollbar { width: 3px; }
.settings-container::-webkit-scrollbar-track { background: transparent; }
.settings-container::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-title {
    flex: 1;
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.settings-section-label {
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    color: #999;
    letter-spacing: 0.15em;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== TOGGLE SWITCHES ===== */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8f8f8;
    border: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
}

.settings-toggle-row:active {
    background: #f0f0f0;
}

.toggle-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.toggle-icon svg {
    stroke: #555;
}

.toggle-label {
    flex: 1;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
    color: #333;
}

.toggle-switch {
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: #ddd;
    border: none;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
}

.toggle-switch .toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: left 0.25s;
}

.settings-toggle-row.active .toggle-switch {
    background: #1a1a1a;
}

.settings-toggle-row.active .toggle-switch .toggle-knob {
    left: 23px;
}

/* ===== VOLUME SLIDER ===== */
.settings-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #f8f8f8;
    border: 1px solid #eee;
}

.slider-icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.slider-icon svg {
    stroke: #555;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a1a1a;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
}

.slider-value {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 700;
    color: #555;
    min-width: 36px;
    text-align: right;
}

/* ===== LANGUAGE LIST ===== */
.settings-lang-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.settings-lang-list::-webkit-scrollbar { width: 3px; }
.settings-lang-list::-webkit-scrollbar-track { background: transparent; }
.settings-lang-list::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

.settings-lang-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8f8f8;
    border: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
}

.settings-lang-item:active {
    background: #f0f0f0;
}

.settings-lang-item.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.settings-lang-flag {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.settings-lang-name {
    flex: 1;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: 600;
    color: #333;
}

.settings-lang-item.active .settings-lang-name {
    color: #fff;
}

.settings-lang-check {
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
    line-height: 1;
    color: #fff;
}

.settings-lang-item.active .settings-lang-check {
    opacity: 1;
}

/* ===== RESET BUTTON ===== */
.settings-reset-btn {
    width: 140px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;

    background: #000;
    color: #ff0000;

    cursor: pointer;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;

    transition: all 0.2s ease;

    margin-top: 16px;
}

.settings-reset-btn:hover {
    background: #222;
}

.settings-reset-btn:active {
    background: #444;
    transform: scale(0.98);
}

.settings-reset-btn.confirming {
    background: #111;
    color: #fff;
    border: none;
}

/* ===== LEVEL SELECT ===== */
#levelSelectScreen {
    padding: clamp(16px, 3vh, 24px) 16px;
    background: #FFFFFF;
}

.ls-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin-bottom: clamp(16px, 3vh, 24px);
}

.ls-title {
    flex: 1;
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

.ls-spacer {
    width: 44px;
}

.ls-scroller {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 400px;
    padding: 0 4px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-content: start;
}

.ls-scroller::-webkit-scrollbar { width: 3px; }
.ls-scroller::-webkit-scrollbar-track { background: transparent; }
.ls-scroller::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 2px; }

/* ===== LEVEL CARD ===== */
.level-card {
    aspect-ratio: 1;
    border-radius: 16px;
    background: #f8f8f8;
    border: 1.5px solid #eee;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.level-card:active {
    transform: scale(0.95);
    background: #f0f0f0;
}

.level-card.current {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.level-card.current .level-card-number {
    color: #fff;
}

.level-card.completed {
    background: #f8f8f8;
}

.level-card.locked {
    opacity: 0.3;
    cursor: not-allowed;
}

.level-card.locked:active {
    transform: none;
}

.level-card-number {
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.level-card-check {
    color: #4CAF50;
    line-height: 1;
}

.level-card-lock {
    color: #ccc;
    line-height: 1;
}

/* ================= RESET POPUP ================= */

.popup-overlay{

    position:fixed;
    inset:0;

    background:rgba(0,0,0,.55);

    display:flex;
    justify-content:center;
    align-items:center;

    z-index:9999;

}

.popup-overlay.hidden{

    display:none;

}

.popup-card{

    width:340px;
    max-width:90vw;

    background:#fff;

    border-radius:26px;

    padding:30px;

    text-align:center;

    animation:popup .18s ease;

}

@keyframes popup{

    from{

        transform:scale(.85);
        opacity:0;

    }

    to{

        transform:scale(1);
        opacity:1;

    }

}

.popup-card h2{

    margin:0;

    font-size:32px;

    font-weight:800;

    color:#111;

}

.popup-card p{

    margin:18px 0 28px;

    font-size:19px;

    color:#666;

    line-height:1.5;

}

.popup-buttons{

    display:flex;

    gap:14px;

}

.popup-btn{

    flex:1;

    height:56px;

    border:none;

    border-radius:18px;

    cursor:pointer;

    font-size:20px;

    font-weight:700;

}

.popup-btn.cancel{

    background:#ECECEC;

    color:#222;

}

.popup-btn.danger{

    background:#111;

    color:#fff;

}

.popup-btn:active{

    transform:scale(.96);

}

/* ===== GAME HUD ===== */
#gameHUD {
    pointer-events: none;
    padding: clamp(12px, 2vh, 20px) 16px;
}

.hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    pointer-events: none;
}

.hud-top .back-btn,
.hud-top .hud-arrows-count,
.hud-top .level-badge,
.hud-top .hearts-container {
    pointer-events: auto;
}

/* Arrows count badge */
.hud-arrows-count {
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: clamp(0.8rem, 2.2vw, 0.9rem);
    font-weight: 700;
    color: #555;
}

/* Level Badge */
.level-badge {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.level-badge-text {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}

/* Hearts */
.hearts-container {
    display: flex;
    gap: 2px;
}

.heart {
    color: #e53935;
    filter: none;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
}

.heart.pulse {
    animation: none;
}

.heart.empty {
    color: #e0e0e0;
    filter: none;
}

.heart.breaking {
    animation: heartBreak 0.5s ease-out forwards;
}

@keyframes heartBreak {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}


/* ===== FLOATING TEXT ===== */
#floatingTextContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-text {
    position: absolute;
    font-weight: 800;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: #1a1a1a;
    text-shadow: none;
    pointer-events: none;
    white-space: nowrap;
}

.floating-text.negative {
    color: #e53935;
    text-shadow: none;
}

/* ===== OVERLAYS ===== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20;
}

.overlay.active {
    display: flex;
}

.overlay-panel {
    width: 90%;
    max-width: 340px;
    padding: clamp(32px, 5vh, 44px) clamp(24px, 4vw, 36px);
    text-align: center;
    position: relative;
    border-radius: 24px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.overlay-title {
    font-size: clamp(1.3rem, 4.5vw, 1.7rem);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.victory-title {
    color: #1a1a1a;
    text-shadow: none;
}

.fail-title {
    color: #e53935;
    text-shadow: none;
}

.overlay-subtitle {
    color: #999;
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    font-weight: 500;
    margin-bottom: 24px;
}

.overlay-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ===== CONFETTI ===== */
#confettiContainer, #confettiContainer2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    top: -10px;
}

/* ===== TUTORIAL ===== */
.tutorial-tooltip {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 20px;
    background: #1a1a1a;
    border: none;
    color: #fff;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    font-weight: 600;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 15;
    white-space: nowrap;
    text-shadow: none;
}

.tutorial-tooltip.active {
    display: block;
}

.tooltip-arrow-indicator {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a1a1a;
}

#zoomControls{
    position:absolute;
    left:50%;
    bottom:25px;
    transform:translateX(-50%);

    display:flex;
    align-items:center;
    gap:15px;

    background:#373b56;
    padding:12px 20px;
    border-radius:40px;

    z-index:9999;
    pointer-events:auto;
}

#zoomSlider{

    width:180px;
    height:6px;

    cursor:pointer;

    -webkit-appearance:none;
    appearance:none;

    background:#d9d9d9;
    border-radius:10px;

    pointer-events:auto;

}

#zoomSlider::-webkit-slider-thumb{

    -webkit-appearance:none;

    width:24px;
    height:24px;

    border-radius:50%;

    background:#1E88E5;

    cursor:pointer;

}

#zoomSlider::-moz-range-thumb{

    width:24px;
    height:24px;

    border:none;

    border-radius:50%;

    background:#1E88E5;

    cursor:pointer;

}

.zoom-btn{

    width:32px;
    height:32px;

    border:none;
    border-radius:8px;

    background:#fff;

    cursor:pointer;

    font-size:20px;
    font-weight:bold;

    pointer-events:auto;

}

.next-level-fab{

    position:absolute;

    right:20px;
    bottom:110px;

    width:64px;
    height:64px;

    border:none;
    border-radius:50%;

    background:#4CAF50;
    color:#fff;

    font-size:30px;
    font-weight:bold;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;

    box-shadow:0 6px 18px rgba(0,0,0,.25);

    z-index:99999;

    transition:.2s;

    pointer-events:auto;

}

.next-level-fab:hover{

    transform:scale(1.08);

}

.next-level-fab:active{

    transform:scale(.95);

}

.menu-current-level{

    margin-top:54px;
    margin-bottom:32px;

    font-size:34px;
    font-weight:700;

    color:#5C6CFF;

    text-align:center;

#gameLogo{

    width:320px;
    max-width:80vw;
    height:auto;

    display:block;

    position:relative;
    margin-top:120px;

    user-select:none;
    -webkit-user-drag:none;

}

.menu-reset-btn{

    width:220px;

    height:56px;

    margin-top:20px;

    background:#000;

    color:#fff;

    border:none;

    border-radius:16px;

    font-size:20px;

    font-weight:700;

    cursor:pointer;

    transition:.2s;

}

.menu-reset-btn:hover{

    background:#222;

}

.menu-reset-btn:active{

    transform:scale(.96);

}

.play-image{

    width:240px;          /* apne image size ke hisaab se adjust kar lena */
    max-width:80vw;

    height:auto;

    display:block;

    pointer-events:none;
    user-select:none;
    -webkit-user-drag:none;

}


}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
    .heart svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 320px) {
    .ls-scroller {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 500px) {
    .ls-scroller {
        grid-template-columns: repeat(5, 1fr);
        max-width: 480px;
    }
}

@media (min-width: 768px) {
    .ls-scroller {
        max-width: 480px;
    }

    .settings-container {
        max-width: 420px;
    }
}
