
.map-page { display: flex; flex-direction: column; height: calc(100vh - 56px); }
#map { flex: 1; z-index: 1; }

/* Bottom sheet */
.bottom-sheet {
position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
background: var(--bg);
border-top: 1px solid var(--border);
border-radius: 20px 20px 0 0;
max-height: 60vh;
transform: translateY(calc(100% - 90px));
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-sheet.expanded { transform: translateY(0); }

.sheet-handle {
display: flex; flex-direction: column; align-items: center; padding: 12px 16px 0;
cursor: pointer;
}
.handle-bar { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 10px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 4px; }
.sheet-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 1px; }
.game-count { font-size: 13px; color: var(--muted); }

.games-list { overflow-y: auto; max-height: calc(60vh - 90px); padding: 0 12px 20px; }

.game-card {
background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
cursor: pointer; transition: border-color 0.15s, transform 0.1s;
text-decoration: none; display: block; color: inherit;
}
.game-card:active { transform: scale(0.99); }
.game-card:hover { border-color: var(--accent); }
.game-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.game-title { font-size: 16px; font-weight: 600; }
.game-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; margin-top: 6px; }
.meta-item { display: flex; align-items: center; gap: 4px; }
.players-bar { margin-top: 10px; }
.players-bar-track { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.players-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.players-bar-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.full-badge { background: #ff3333; color: #fff; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 700; }

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
background: var(--surface) !important; color: var(--text) !important;
border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 12px 14px !important; }
.popup-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.popup-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.popup-link {
display: inline-block; padding: 6px 14px; background: var(--accent);
color: #000; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
}

/* Venue marker popup */
.venue-popup-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.venue-popup-link {
display: inline-block; padding: 6px 14px; background: var(--accent2);
color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
}

/* Game markers */
.game-marker {
width: 36px; height: 36px; border-radius: 50% 50% 50% 0;
transform: rotate(-45deg); display: flex; align-items: center; justify-content: center;
border: 2px solid rgba(255,255,255,0.2); font-size: 16px;
}
.game-marker-inner { transform: rotate(45deg); }
.marker-basketball { background: var(--basketball); }
.marker-soccer     { background: var(--soccer); }
.marker-tennis     { background: var(--tennis); }

/* Venue marker */
.venue-marker {
width: 28px; height: 28px; border-radius: 50%;
background: var(--surface2); border: 2px solid var(--border);
display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.venue-marker-basketball { border-color: var(--basketball); }
.venue-marker-soccer     { border-color: var(--soccer); }
.venue-marker-tennis     { border-color: var(--tennis); }
.venue-marker-multi      { border-color: var(--border); }

/* Cluster marker */
.cluster-marker {
width: 40px; height: 40px; border-radius: 50%;
background: var(--accent); color: #000;
font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 15px;
display: flex; align-items: center; justify-content: center;
border: 3px solid rgba(0,0,0,0.25); box-shadow: 0 2px 8px rgba(0,0,0,0.4);
cursor: pointer; transition: transform 0.15s;
}
.cluster-marker:hover { transform: scale(1.1); }

/* Cluster popup */
.cluster-popup { min-width: 220px; }
.cluster-popup-header {
font-family: 'Bebas Neue', sans-serif; font-size: 16px;
letter-spacing: 1px; margin-bottom: 10px; color: var(--accent);
}
.cluster-game-row {
display: flex; align-items: center; justify-content: space-between;
padding: 8px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.cluster-game-row:last-child { border-bottom: none; }
.cluster-game-info { flex: 1; min-width: 0; }
.cluster-game-title {
font-weight: 600; font-size: 13px;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.cluster-game-meta { font-size: 11px; color: var(--muted); }
.cluster-game-link {
flex-shrink: 0; padding: 4px 10px; background: var(--accent);
color: #000; border-radius: 5px; font-size: 12px; font-weight: 700;
text-decoration: none; white-space: nowrap;
}
.cluster-game-link:hover { opacity: 0.85; }

/* Secondary create-game link in single-game popup — orange to distinguish from yellow View button */
.popup-link-secondary {
display: inline-block; padding: 6px 12px;
background: var(--accent2); color: #fff;
border-radius: 6px; font-size: 13px; font-weight: 600;
text-decoration: none; white-space: nowrap;
}
.popup-link-secondary:hover { opacity: 0.88; }

/* Navigate to location button in popups */
.popup-nav-btn {
padding: 6px 12px;
background: #888;
color: #fff;
border: none;
border-radius: 6px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
white-space: nowrap;
touch-action: manipulation;
transition: opacity 0.15s;
}
.popup-nav-btn:active {
opacity: 0.8;
}

/* Create-game footer in cluster popup — yellow, full width */
.cluster-popup-footer { padding-top: 10px; margin-top: 2px; }
.cluster-create-link {
display: block; text-align: center; padding: 7px 12px;
background: var(--accent); color: #000;
border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none;
}
.cluster-create-link:hover { opacity: 0.88; }

.no-games { text-align: center; color: var(--muted); padding: 32px 16px; font-size: 15px; }

/* Locate button */
.locate-btn {
position: absolute; top: 170px; left: 12px; z-index: 400;
width: 30px; height: 30px; background: #fff;
border: 2px solid rgba(0,0,0,0.2); border-radius: 4px;
display: flex; align-items: center; justify-content: center;
cursor: pointer; color: #000; transition: background 0.15s; padding: 0;
}
.locate-btn:hover  { background: #f4f4f4; }
.locate-btn:active { background: #e8e8e8; transform: none; }
