/* ═══════════════════════════════════════════════════
   BORDER PATH — Geography Game Styles
   Theme: Dark navy + glowing cyan + emerald accents
   ═══════════════════════════════════════════════════ */

:root {
    --bp-bg: #f8fafc;
    --bp-surface: #ffffff;
    --bp-surface-2: #f1f5f9;
    --bp-surface-3: #e2e8f0;
    --bp-border: rgba(0, 0, 0, 0.1);
    --bp-border-subtle: rgba(0, 0, 0, 0.05);
    --bp-cyan: #059669;
    --bp-cyan-dim: rgba(5, 150, 105, 0.15);
    --bp-cyan-glow: rgba(5, 150, 105, 0.35);
    --bp-emerald: #10b981;
    --bp-emerald-dim: rgba(16, 185, 129, 0.15);
    --bp-gold: #f59e0b;
    --bp-red: #ef4444;
    --bp-red-dim: rgba(239, 68, 68, 0.15);
    --bp-purple: #8b5cf6;
    --bp-text: #0f172a;
    --bp-text-2: #475569;
    --bp-text-3: #64748b;
    --bp-map-base: #e2e8f0;
    --bp-map-stroke: rgba(0, 0, 0, 0.2);
    --bp-overlay-bg: rgba(255, 255, 255, 0.7);
    --bp-radius: 16px;
    --bp-radius-sm: 10px;
    --bp-radius-pill: 100px;
    --bp-transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --bp-font: 'Inter', sans-serif;
    --bp-font-heading: 'Poppins', sans-serif;
}

[data-theme="dark"] {
    --bp-bg: #0a0f1e;
    --bp-surface: #111827;
    --bp-surface-2: #1a2236;
    --bp-surface-3: #212d45;
    --bp-border: rgba(0, 240, 255, 0.12);
    --bp-border-subtle: rgba(255, 255, 255, 0.06);
    --bp-cyan: #00f0ff;
    --bp-cyan-dim: rgba(0, 240, 255, 0.15);
    --bp-cyan-glow: rgba(0, 240, 255, 0.35);
    --bp-emerald: #10b981;
    --bp-emerald-dim: rgba(16, 185, 129, 0.15);
    --bp-gold: #f59e0b;
    --bp-red: #ef4444;
    --bp-red-dim: rgba(239, 68, 68, 0.15);
    --bp-purple: #8b5cf6;
    --bp-text: #f0f4ff;
    --bp-text-2: #94a3b8;
    --bp-text-3: #64748b;
    --bp-map-base: #1e293b;
    --bp-map-stroke: rgba(255, 255, 255, 0.1);
    --bp-overlay-bg: rgba(15, 23, 42, 0.7);
}

/* ─── GLOBAL OVERRIDES (this page uses its own dark bg) ─── */
.bp-page {
    background: var(--bp-bg);
    color: var(--bp-text);
    min-height: 100vh;
}

.bp-page .study-main {
    background: var(--bp-bg);
}

/* ─── SCREEN SYSTEM ─── */
.bp-screen {
    display: none;
    width: 100%;
    padding: 24px;
    animation: bp-fadeIn 0.5s ease;
}

.bp-screen--active {
    display: block;
}

@keyframes bp-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   MENU SCREEN
   ═══════════════════════════════════════════════════ */

.bp-menu {
    max-width: 720px;
    margin: 0 auto;
    padding-top: 20px;
}

.bp-menu-hero {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.bp-menu-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--bp-cyan-dim) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bp-logo {
    position: relative;
    z-index: 1;
    font-family: var(--bp-font-heading);
    margin-bottom: 8px;
}

.bp-logo-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px var(--bp-cyan-glow));
}

.bp-logo-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--bp-cyan), var(--bp-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.bp-logo-subtitle {
    font-size: 1rem;
    color: var(--bp-text-2);
    font-weight: 400;
    margin-top: 4px;
}

/* Mini stats bar */
.bp-menu-stats-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.bp-mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.bp-mini-stat span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bp-cyan);
    font-family: var(--bp-font-heading);
}

.bp-mini-stat small {
    font-size: 0.75rem;
    color: var(--bp-text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Difficulty Selector */
.bp-section {
    margin-bottom: 28px;
}

.bp-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bp-text-3);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-diff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.bp-diff-btn {
    padding: 14px 8px;
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    background: var(--bp-surface);
    color: var(--bp-text-2);
    font-family: var(--bp-font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bp-transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bp-diff-btn:hover {
    border-color: var(--bp-cyan);
    background: var(--bp-surface-2);
    color: var(--bp-text);
}

.bp-diff-btn--active {
    border-color: var(--bp-cyan) !important;
    background: var(--bp-cyan-dim) !important;
    color: var(--bp-cyan) !important;
    box-shadow: 0 0 20px var(--bp-cyan-dim), inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.bp-diff-emoji {
    font-size: 1.5rem;
}

/* Mode Selector */
.bp-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bp-mode-btn {
    padding: 14px 16px;
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    background: var(--bp-surface);
    color: var(--bp-text-2);
    font-family: var(--bp-font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bp-transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bp-mode-btn:hover {
    border-color: var(--bp-emerald);
    background: var(--bp-surface-2);
}

.bp-mode-btn--active {
    border-color: var(--bp-emerald) !important;
    background: var(--bp-emerald-dim) !important;
    color: var(--bp-emerald) !important;
}

.bp-mode-icon {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bp-surface-2);
    flex-shrink: 0;
}

.bp-mode-btn--active .bp-mode-icon {
    background: rgba(16, 185, 129, 0.2);
}

/* Continent Picker */
.bp-continent-picker {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 16px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
}

.bp-continent-btn {
    padding: 8px 16px;
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-pill);
    background: var(--bp-surface-2);
    color: var(--bp-text-2);
    font-family: var(--bp-font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bp-transition);
}

.bp-continent-btn:hover { border-color: var(--bp-gold); }

.bp-continent-btn--active {
    border-color: var(--bp-gold) !important;
    background: rgba(245, 158, 11, 0.15) !important;
    color: var(--bp-gold) !important;
}

/* Action Buttons */
.bp-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.bp-big-btn {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: var(--bp-radius);
    font-family: var(--bp-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--bp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.bp-big-btn--primary {
    background: linear-gradient(135deg, #059669, #00f0ff);
    color: #0a0f1e;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}

.bp-big-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.5);
}

.bp-big-btn--secondary {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    color: var(--bp-cyan);
}

.bp-big-btn--secondary:hover {
    background: var(--bp-surface-2);
    border-color: var(--bp-cyan);
}

.bp-menu-bottom-btns {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.bp-menu-bottom-btns .bp-big-btn {
    flex: 1;
    padding: 14px;
    font-size: 0.9rem;
}

.bp-big-btn--ghost {
    background: transparent;
    border: 1px solid var(--bp-border-subtle);
    color: var(--bp-text-2);
}

.bp-big-btn--ghost:hover {
    background: var(--bp-surface);
    border-color: var(--bp-border);
    color: var(--bp-text);
}

/* ═══════════════════════════════════════════════════
   GAME SCREEN & MAP LAYER
   ═══════════════════════════════════════════════════ */

.bp-game {
    max-width: 800px;
    margin: 0 auto;
}

.bp-game--premium {
    position: relative;
    max-width: 100%;
    margin-top: -24px;
    margin-left: -24px;
    margin-right: -24px;
    height: calc(100dvh - 88px);
    min-height: 560px;
    overflow: hidden;
    background: var(--bp-bg);
}

.bp-map-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    transition: opacity 0.5s;
}

.bp-map-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--bp-cyan);
    font-size: 0.9rem;
    font-weight: 600;
}

.bp-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 240, 255, 0.2);
    border-top-color: var(--bp-cyan);
    border-radius: 50%;
    animation: bp-spin 1s linear infinite;
}

@keyframes bp-spin { to { transform: rotate(360deg); } }

/* SVG Map Countries */
.bp-country {
    stroke: var(--bp-map-stroke);
    stroke-width: 0.5px;
    transition: all 0.5s ease;
}

.bp-country--base { fill: var(--bp-map-base); }
.bp-country--hidden { fill: transparent; stroke: transparent; }

.bp-country--visited {
    fill: var(--bp-emerald);
    fill-opacity: 0.4;
    stroke: var(--bp-emerald);
    stroke-width: 1px;
}

.bp-country--current {
    fill: var(--bp-cyan);
    fill-opacity: 0.4;
    stroke: var(--bp-cyan);
    stroke-width: 1.5px;
    filter: drop-shadow(0 0 10px var(--bp-cyan-dim));
}

.bp-country--destination {
    fill: rgba(245, 158, 11, 0.2);
    stroke: var(--bp-gold);
    stroke-width: 1.5px;
    stroke-dasharray: 4;
    animation: bp-dash 20s linear infinite;
}

@keyframes bp-dash { to { stroke-dashoffset: -1000; } }

/* SVG Routes */
.bp-route-line {
    stroke: var(--bp-emerald);
    stroke-width: 2.5px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px var(--bp-emerald));
}

.bp-route-node {
    fill: var(--bp-cyan);
    filter: drop-shadow(0 0 8px var(--bp-cyan-glow));
}

/* Floating UI Layer */
.bp-ui-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none; /* Let clicks pass to map */
    padding: 16px;
}

.bp-ui-top {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: min(920px, calc(100% - 32px));
    max-width: calc(100% - 32px);
}

.bp-ui-route-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.bp-ui-middle, .bp-ui-bottom {
    pointer-events: auto; /* Re-enable for UI elements */
}

.bp-ui-middle {
    align-self: flex-start;
    max-width: min(360px, 42vw);
}

.bp-ui-bottom {
    align-self: center;
    width: min(620px, 100%);
}

/* Modified floating components */
.bp-game--premium #bp-game-header {
    background: var(--bp-overlay-bg);
    backdrop-filter: blur(12px);
    border-color: var(--bp-border-subtle);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    margin: 0;
    width: auto;
    max-width: min(520px, 100%);
    flex: 0 0 auto;
    padding: 0;
    border-radius: var(--bp-radius-pill);
}

.bp-game--premium .bp-hud {
    background: var(--bp-overlay-bg);
    backdrop-filter: blur(12px);
    box-shadow: 0 5px 18px rgba(0,0,0,0.25);
    margin: 0;
    padding: 6px;
    border-radius: var(--bp-radius-pill);
    border: 1px solid var(--bp-border-subtle);
    display: flex; 
    width: auto;
}

.bp-game--premium #bp-input-area {
    background: var(--bp-overlay-bg);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 34px rgba(0,0,0,0.25);
    border: 1px solid var(--bp-border-subtle);
    max-width: 620px;
    margin: 0 auto;
    border-radius: var(--bp-radius);
    padding: 10px;
    overflow: visible;
}

.bp-game--premium .bp-path-trail {
    background: var(--bp-overlay-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--bp-border-subtle);
    flex: 1 1 auto;
    width: auto;
    min-width: 160px;
    max-width: 100%;
    max-height: 48px;
    margin-bottom: 0;
    padding: 7px 10px;
    border-radius: var(--bp-radius-pill);
}

.bp-game--premium .bp-quit-btn-wrap {
    position: absolute;
    bottom: 16px;
    right: 16px;
    margin: 0;
}

.bp-quit-link--floating {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(4px);
}
.bp-quit-link--floating:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Game Header — Route Indicator */
.bp-route-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-pill);
    margin-bottom: 0;
}

.bp-route-endpoint {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    min-width: 0;
}

.bp-route-flag {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.bp-flag-img {
    width: 24px; 
    height: 18px; 
    object-fit: cover; 
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
}

.bp-route-name {
    font-family: var(--bp-font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.1;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-route-start .bp-route-name { color: var(--bp-emerald); }
.bp-route-end .bp-route-name { color: var(--bp-cyan); }

.bp-route-arrow {
    color: var(--bp-text-3);
    flex-shrink: 0;
}

.bp-route-glow {
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    background: var(--bp-cyan-dim);
    animation: bp-glow-pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bp-glow-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

/* HUD */
.bp-hud {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.bp-hud-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-pill);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--bp-text-2);
    flex-shrink: 0;
}

.bp-hud-item i {
    color: var(--bp-cyan);
    font-size: 0.92rem;
}

.bp-hud-item--difficulty {
    margin-left: auto;
    font-size: 0.8rem;
}

/* Path Trail */
.bp-path-trail {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 16px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bp-border) transparent;
}

.bp-path-trail::-webkit-scrollbar { height: 4px; }
.bp-path-trail::-webkit-scrollbar-thumb { background: var(--bp-border); border-radius: 10px; }

.bp-trail-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--bp-radius-pill);
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-subtle);
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--bp-text-2);
    animation: bp-nodeAppear 0.4s ease;
}

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

.bp-trail-node--start {
    background: var(--bp-emerald-dim);
    border-color: var(--bp-emerald);
    color: var(--bp-emerald);
}

.bp-trail-node--current {
    background: var(--bp-cyan-dim);
    border-color: var(--bp-cyan);
    color: var(--bp-cyan);
    box-shadow: 0 0 12px var(--bp-cyan-dim);
}

.bp-trail-node--end {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(16, 185, 129, 0.2));
    border-color: var(--bp-cyan);
    color: var(--bp-cyan);
    box-shadow: 0 0 16px var(--bp-cyan-dim);
}

.bp-trail-flag { font-size: 0.95rem; }
.bp-trail-name { font-size: 0.74rem; }

.bp-trail-connector {
    display: flex;
    align-items: center;
    padding: 0 4px;
    flex-shrink: 0;
}

.bp-trail-line {
    width: 18px;
    height: 2px;
    background: linear-gradient(90deg, var(--bp-emerald), var(--bp-cyan));
    border-radius: 2px;
}

/* Current Location Card */
.bp-current-location {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--bp-surface), var(--bp-surface-2));
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-sm);
    margin-bottom: 10px;
}

.bp-current-flag {
    font-size: 2rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.bp-current-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--bp-text-3);
    font-weight: 700;
}

.bp-current-name {
    font-family: var(--bp-font-heading);
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--bp-text);
}

.bp-current-detail {
    font-size: 0.8rem;
    color: var(--bp-text-2);
    margin-top: 2px;
}

/* Neighbor hints (Easy mode) */
.bp-neighbor-hints {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius);
}

.bp-neighbor-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bp-text-3);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.bp-neighbor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bp-neighbor-chip {
    padding: 6px 10px;
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-pill);
    background: var(--bp-surface-2);
    color: var(--bp-text);
    font-family: var(--bp-font);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bp-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bp-neighbor-chip:hover {
    background: var(--bp-cyan-dim);
    border-color: var(--bp-cyan);
    color: var(--bp-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--bp-cyan-dim);
}

/* Input Area */
.bp-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.bp-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bp-surface);
    border: 2px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius);
    transition: all var(--bp-transition);
    position: relative;
    overflow: visible;
}

.bp-input-wrapper:focus-within {
    border-color: var(--bp-cyan);
    box-shadow: 0 0 0 4px var(--bp-cyan-dim);
}

.bp-input-wrapper i {
    color: var(--bp-text-3);
    font-size: 1.1rem;
}

#bp-country-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--bp-text);
    font-family: var(--bp-font);
    font-size: 0.94rem;
    font-weight: 500;
}

#bp-country-input::placeholder {
    color: var(--bp-text-3);
}

/* Input Animations */
.bp-input--success {
    border-color: var(--bp-emerald) !important;
    box-shadow: 0 0 0 4px var(--bp-emerald-dim) !important;
    animation: bp-inputSuccess 0.5s ease;
}

@keyframes bp-inputSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.bp-input--error {
    border-color: var(--bp-red) !important;
    box-shadow: 0 0 0 4px var(--bp-red-dim) !important;
    animation: bp-shake 0.5s ease;
}

@keyframes bp-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-1px); }
}

/* Go / Hint Buttons */
.bp-go-btn,
.bp-hint-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--bp-transition);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bp-go-btn {
    background: var(--bp-cyan);
    color: var(--bp-bg);
    border-color: var(--bp-cyan);
}

.bp-go-btn:hover {
    box-shadow: 0 0 16px var(--bp-cyan-glow);
    transform: translateY(-2px);
}

.bp-hint-btn {
    background: var(--bp-surface);
    color: var(--bp-gold);
    border-color: rgba(245, 158, 11, 0.3);
}

.bp-hint-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--bp-gold);
}

/* Autocomplete Dropdown */
.bp-autocomplete {
    position: absolute;
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-sm);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.bp-autocomplete--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bp-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bp-autocomplete-item:hover,
.bp-autocomplete-item--active {
    background: var(--bp-cyan-dim);
}

.bp-autocomplete-item--border {
    border-left: 3px solid var(--bp-emerald);
}

.bp-autocomplete-flag { font-size: 1.2rem; }

.bp-autocomplete-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bp-text);
}

.bp-autocomplete-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bp-emerald);
    padding: 2px 8px;
    border-radius: var(--bp-radius-pill);
    background: var(--bp-emerald-dim);
}

/* Feedback Messages */
.bp-feedback {
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--bp-radius-sm);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.bp-feedback--show {
    padding: 12px 16px;
    max-height: 80px;
    opacity: 1;
    margin-top: 8px;
}

.bp-feedback--success {
    background: var(--bp-emerald-dim);
    color: var(--bp-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bp-feedback--error {
    background: var(--bp-red-dim);
    color: var(--bp-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.bp-feedback--hint {
    background: rgba(245, 158, 11, 0.1);
    color: var(--bp-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Mini Map (Expert mode) */
.bp-minimap {
    margin-top: 20px;
    padding: 20px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius);
}

.bp-minimap-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bp-text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.bp-minimap-header i {
    color: var(--bp-cyan);
    font-size: 1rem;
}

.bp-minimap-visual {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.bp-minimap-node {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: bp-nodeAppear 0.4s ease forwards;
    opacity: 0;
}

.bp-minimap-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bp-emerald);
    flex-shrink: 0;
}

.bp-minimap-dot--current {
    background: var(--bp-cyan);
    box-shadow: 0 0 8px var(--bp-cyan-glow);
    animation: bp-dotPulse 1.5s ease-in-out infinite;
}

@keyframes bp-dotPulse {
    0%, 100% { box-shadow: 0 0 4px var(--bp-cyan-glow); }
    50% { box-shadow: 0 0 16px var(--bp-cyan-glow); }
}

.bp-minimap-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bp-text-2);
}

.bp-minimap-connector {
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, var(--bp-emerald), var(--bp-cyan));
    border-radius: 2px;
    opacity: 0.5;
}

/* Quit button */
.bp-quit-btn-wrap {
    margin-top: 20px;
    text-align: center;
}

.bp-quit-link {
    font-size: 0.85rem;
    color: var(--bp-text-3);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--bp-font);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--bp-radius-pill);
    transition: all var(--bp-transition);
}

.bp-quit-link:hover {
    color: var(--bp-red);
    background: var(--bp-red-dim);
}

/* ═══════════════════════════════════════════════════
   GAME COMPLETE SCREEN
   ═══════════════════════════════════════════════════ */

.bp-complete-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-top: 20px;
}

.bp-celebration-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bp-particle {
    position: absolute;
    top: -20px;
    border-radius: 50%;
    animation: bp-fall linear forwards;
}

@keyframes bp-fall {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.bp-perfect-banner {
    font-family: var(--bp-font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bp-gold);
    text-align: center;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--bp-radius);
    margin-bottom: 20px;
    letter-spacing: 2px;
    animation: bp-bannerGlow 1.5s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes bp-bannerGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.4); }
}

.bp-complete-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.bp-complete-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.bp-complete-title {
    font-family: var(--bp-font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--bp-cyan), var(--bp-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.bp-complete-route {
    font-size: 1rem;
    color: var(--bp-text-2);
    font-weight: 600;
}

/* Score Display */
.bp-complete-score {
    text-align: center;
    padding: 24px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.bp-score-number {
    font-family: var(--bp-font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--bp-cyan);
    text-shadow: 0 0 20px var(--bp-cyan-glow);
    line-height: 1;
}

.bp-score-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--bp-text-3);
    margin-top: 4px;
}

/* Score Breakdown */
.bp-score-breakdown {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.bp-score-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--bp-text-2);
    border-bottom: 1px solid var(--bp-border-subtle);
}

.bp-score-row:last-child { border-bottom: none; }
.bp-score-row span:last-child { font-weight: 700; color: var(--bp-emerald); }
.bp-score-row--penalty span:last-child { color: var(--bp-red); }
.bp-score-row--multiplier { font-weight: 700; color: var(--bp-cyan) !important; }
.bp-score-row--multiplier span { color: var(--bp-cyan) !important; }

/* Complete Stats Grid */
.bp-complete-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.bp-complete-stat {
    text-align: center;
    padding: 16px 8px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
}

.bp-complete-stat-val {
    font-family: var(--bp-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bp-text);
}

.bp-complete-stat-label {
    font-size: 0.7rem;
    color: var(--bp-text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Route Comparison */
.bp-routes-comparison {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.bp-route-compare {
    padding: 16px 20px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    margin-bottom: 10px;
}

.bp-route-compare-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bp-text-3);
    margin-bottom: 10px;
}

.bp-route-compare-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.bp-route-chip {
    padding: 4px 10px;
    background: var(--bp-surface-2);
    border-radius: var(--bp-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bp-text-2);
    white-space: nowrap;
}

.bp-route-chip--optimal {
    background: var(--bp-cyan-dim);
    color: var(--bp-cyan);
}

.bp-route-arrow-sm {
    color: var(--bp-text-3);
    font-size: 0.75rem;
}

/* Educational Section */
.bp-edu-section {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.bp-edu-title {
    font-family: var(--bp-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--bp-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-edu-title i {
    color: var(--bp-cyan);
}

.bp-edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.bp-edu-card {
    padding: 16px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    text-align: center;
    transition: all var(--bp-transition);
}

.bp-edu-card:hover {
    border-color: var(--bp-border);
    transform: translateY(-2px);
}

.bp-edu-card-flag {
    font-size: 2rem;
    margin-bottom: 6px;
}

.bp-edu-card-name {
    font-family: var(--bp-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--bp-text);
    margin-bottom: 8px;
}

.bp-edu-card-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--bp-text-3);
}

.bp-edu-card-details i {
    color: var(--bp-cyan);
    margin-right: 4px;
}

/* Action Buttons */
.bp-complete-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.bp-action-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: var(--bp-radius);
    font-family: var(--bp-font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--bp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bp-action-btn--primary {
    background: linear-gradient(135deg, #059669, #00f0ff);
    color: var(--bp-bg);
}

.bp-action-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3);
}

.bp-action-btn--secondary {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    color: var(--bp-text-2);
}

.bp-action-btn--secondary:hover {
    background: var(--bp-surface-2);
    color: var(--bp-text);
}

/* ═══════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════ */

.bp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: bp-fadeIn 0.3s ease;
}

.bp-modal {
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.bp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bp-border-subtle);
}

.bp-modal-header h3 {
    font-family: var(--bp-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bp-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-modal-header h3 i {
    color: var(--bp-cyan);
}

.bp-modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--bp-border-subtle);
    border-radius: 8px;
    background: var(--bp-surface-2);
    color: var(--bp-text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bp-modal-close:hover {
    background: var(--bp-red-dim);
    color: var(--bp-red);
    border-color: var(--bp-red);
}

.bp-modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Stats Grid */
.bp-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bp-stat-card {
    text-align: center;
    padding: 20px 12px;
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
}

.bp-stat-card-val {
    font-family: var(--bp-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bp-cyan);
}

.bp-stat-card-label {
    font-size: 0.7rem;
    color: var(--bp-text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Recent Games */
.bp-recent-games {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.bp-recent-game {
    padding: 12px 16px;
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
}

.bp-recent-route {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bp-text);
    margin-bottom: 4px;
}

.bp-recent-meta {
    font-size: 0.75rem;
    color: var(--bp-text-3);
}

/* Achievements Grid */
.bp-achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bp-achievement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bp-surface-2);
    border: 1px solid var(--bp-border-subtle);
    border-radius: var(--bp-radius-sm);
    opacity: 0.5;
    transition: all var(--bp-transition);
}

.bp-achievement-card--unlocked {
    opacity: 1;
    border-color: var(--bp-border);
    background: rgba(0, 240, 255, 0.03);
}

.bp-achievement-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.bp-achievement-info { flex: 1; }

.bp-achievement-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bp-text);
}

.bp-achievement-desc {
    font-size: 0.75rem;
    color: var(--bp-text-3);
    margin-top: 2px;
}

.bp-achievement-date {
    font-size: 0.7rem;
    color: var(--bp-cyan);
    margin-top: 4px;
}

/* Achievement Toast */
.bp-achievement-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 340px;
}

.bp-achievement-toast--show {
    transform: translateX(0);
}

.bp-achievement-toast__icon {
    font-size: 2rem;
}

.bp-achievement-toast__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bp-gold);
}

.bp-achievement-toast__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bp-text);
}

.bp-achievement-toast__desc {
    font-size: 0.75rem;
    color: var(--bp-text-3);
}

/* Notification */
.bp-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: var(--bp-radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 999999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.bp-notification--show {
    transform: translateX(-50%) translateY(0);
}

.bp-notification--error {
    background: var(--bp-red);
    color: white;
}

.bp-notification--info {
    background: var(--bp-cyan);
    color: var(--bp-bg);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .bp-ui-top {
        width: 100%;
        max-width: 100%;
    }

    .bp-ui-route-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .bp-game--premium .bp-path-trail {
        width: 100%;
    }

    .bp-diff-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bp-mode-grid {
        grid-template-columns: 1fr;
    }

    .bp-route-indicator {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .bp-route-arrow { transform: rotate(90deg); }

    .bp-hud {
        gap: 6px;
    }

    .bp-hud-item {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .bp-hud-item--difficulty {
        margin-left: 0;
    }

    .bp-complete-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .bp-complete-actions {
        flex-direction: column;
    }

    .bp-score-number {
        font-size: 2.5rem;
    }

    .bp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bp-edu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bp-menu-bottom-btns {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .bp-screen {
        padding: 16px;
    }

    .bp-logo-title {
        font-size: 2rem;
    }

    .bp-current-flag {
        font-size: 2.5rem;
    }

    .bp-current-name {
        font-size: 1.1rem;
    }

    .bp-edu-grid {
        grid-template-columns: 1fr;
    }
}
