/* Tennis Lady — proposed additions for the open-spots map.
   Plain CSS on top of tokens.css + components/bundle.css. Prefix tl-. Phone-first.
   New tokens first (Day = light, Night = dark), then components in the order of the DS-additions board. */

:root, [data-theme="light"] {
  --map-land: #f3eee5;
  --map-water: #cfdbe0;
  --map-road: #ffffff;
  --map-road-minor: #fbf8f2;
  --map-place: #5a4b5c;
  --map-area-fill: rgba(123, 30, 63, 0.10);
  --map-area-fill-active: rgba(123, 30, 63, 0.20);
  --map-area-fill-quiet: rgba(123, 30, 63, 0.05);
  --map-scrim: rgba(30, 18, 32, 0.74);
  --shadow-sheet: 0 -6px 24px rgba(30, 18, 32, 0.14);
}
[data-theme="dark"] {
  --map-land: #1c141f;
  --map-water: #0e0a11;
  --map-road: #3a2d3f;
  --map-road-minor: #241a28;
  --map-place: #c2b4c4;
  --map-area-fill: rgba(242, 161, 189, 0.14);
  --map-area-fill-active: rgba(242, 161, 189, 0.26);
  --map-area-fill-quiet: rgba(242, 161, 189, 0.07);
  --map-scrim: rgba(0, 0, 0, 0.74);
  --shadow-sheet: 0 -6px 24px rgba(0, 0, 0, 0.5);
}

/* MapFrame */
.tl-map{position:relative;overflow:hidden;background:var(--map-land);border:1px solid var(--line);border-radius:var(--radius-lg);isolation:isolate}
.tl-map--bleed{border-radius:0;border-left:0;border-right:0}
.tl-map__base{position:absolute;max-width:none;pointer-events:none;user-select:none}
[data-theme="dark"] .tl-map__base--day,[data-theme="light"] .tl-map__base--night{display:none}
.tl-map__controls{position:absolute;top:var(--space-3);right:var(--space-3);z-index:3;display:flex;flex-direction:column;background:var(--surface-raised);border:1.5px solid var(--line-strong);border-radius:var(--radius-md);overflow:hidden;box-shadow:var(--shadow-card)}
.tl-map__ctrl{width:var(--tap-min);height:var(--tap-min);display:flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;color:var(--ink);cursor:pointer}
.tl-map__ctrl+.tl-map__ctrl{border-top:1px solid var(--line)}
.tl-map__ctrl:hover{background:var(--surface-sunken)}
.tl-map__attrib{position:absolute;right:var(--space-2);bottom:var(--space-2);z-index:3;padding:2px 8px;border-radius:var(--radius-pill);background:var(--surface-raised);color:var(--ink-muted);font:500 11px/16px var(--font-sans)}
.tl-map__place{position:absolute;transform:translate(-50%,-50%);white-space:nowrap;pointer-events:none;font:600 12px/16px var(--font-sans);letter-spacing:.01em;color:var(--map-place);text-shadow:0 0 2px var(--map-land),0 0 2px var(--map-land),0 0 4px var(--map-land)}
.tl-map__note{position:absolute;left:var(--space-3);top:var(--space-3);z-index:3;display:flex;align-items:center;gap:var(--space-2);max-width:calc(100% - 80px);padding:6px 12px 6px 10px;border-radius:var(--radius-pill);background:var(--surface-raised);color:var(--ink);border:1px solid var(--line);box-shadow:var(--shadow-card);font:600 13px/18px var(--font-sans)}
.tl-map__note .tl-ico{width:16px;height:16px;color:var(--court)}
.tl-map__hint{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-6);background:var(--map-scrim);color:#ffffff;text-align:center;font:600 16px/24px var(--font-sans)}

/* AreaCircle — an approximate area, never a point. One hue (brand) for every level. */
.tl-area{position:absolute;box-sizing:border-box;border-radius:50%;border:2px solid var(--brand);background:var(--map-area-fill)}
.tl-area--waitlist{border-style:dashed}
.tl-area--quiet{border-width:1.5px;background:var(--map-area-fill-quiet)}
.tl-area--hover{border-width:3px}
.tl-area--active{border-width:3px;background:var(--map-area-fill-active);box-shadow:0 0 0 2px var(--surface-raised)}

/* AreaLabel — the tappable status pill at a circle's centre (an HTML marker, so it is a real button). */
.tl-area-label{position:absolute;transform:translate(-50%,-50%);z-index:2;display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 12px;border:1.5px solid var(--brand);border-radius:var(--radius-pill);background:var(--surface-raised);color:var(--ink);font:700 13px/16px var(--font-sans);white-space:nowrap;cursor:pointer;box-shadow:0 1px 3px rgba(30,18,32,.18)}
.tl-area-label::after{content:"";position:absolute;inset:-6px -2px}
.tl-area-label:hover{background:var(--brand-tint)}
.tl-area-label[aria-expanded="true"]{background:var(--brand);color:var(--on-brand)}
.tl-area-label__lvl{color:var(--brand);font-weight:800}
.tl-area-label[aria-expanded="true"] .tl-area-label__lvl{color:var(--on-brand)}

/* VenueMarker — a partner tennis center: a public business, so an exact marker. */
.tl-venue{position:absolute;transform:translate(-50%,-50%);z-index:2;width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;border:2px solid var(--surface-raised);border-radius:var(--radius-sm);background:var(--ink);color:var(--surface);box-shadow:0 1px 3px rgba(30,18,32,.3);cursor:pointer}
.tl-venue::after{content:"";position:absolute;inset:-8px}
.tl-venue .tl-ico{width:18px;height:18px}
.tl-venue--sm{width:24px;height:24px}
.tl-venue--sm .tl-ico{width:14px;height:14px}
.tl-venue[aria-expanded="true"]{box-shadow:0 0 0 3px var(--surface-raised),0 0 0 6px var(--ink)}
.tl-venue__name{position:absolute;left:calc(100% + 6px);top:50%;transform:translateY(-50%);white-space:nowrap;padding:1px 8px;border-radius:var(--radius-pill);background:var(--surface-raised);color:var(--ink);font:600 12px/18px var(--font-sans);box-shadow:0 1px 2px rgba(30,18,32,.15)}

/* LevelPicker — "What's your level?" on first arrival; also the all-levels summary. */
.tl-levels{list-style:none;margin:0;padding:0;background:var(--surface-raised);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-card);overflow:hidden}
.tl-level{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:60px;padding:var(--space-2) var(--space-4);border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;text-align:left;text-decoration:none;cursor:pointer}
.tl-levels li:last-child .tl-level{border-bottom:0}
.tl-level:hover{background:var(--surface-sunken)}
.tl-level__main{flex:1;min-width:0;display:flex;flex-direction:column}
.tl-level__name{font:700 18px/24px var(--font-display)}
.tl-level__rating{font-size:14px;line-height:20px;color:var(--ink-muted)}
.tl-level__count{font-size:14px;line-height:20px;font-weight:600;text-align:right;white-space:nowrap}
.tl-level>.tl-ico{color:var(--ink-muted)}

/* AreaRow — the text twin of every circle and center. The list, not the map, is the full record. */
.tl-arearows{list-style:none;margin:0;padding:0}
.tl-arearow{display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:64px;padding:var(--space-2) 0;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.tl-arearows li:last-child .tl-arearow{border-bottom:0}
.tl-arearow__glyph{flex:none;width:32px;height:32px;box-sizing:border-box;border-radius:50%;border:2px solid var(--brand);background:var(--map-area-fill)}
.tl-arearow__glyph--waitlist{border-style:dashed}
.tl-arearow__glyph--venue{display:flex;align-items:center;justify-content:center;border:0;border-radius:var(--radius-sm);background:var(--ink);color:var(--surface)}
.tl-arearow__glyph--venue .tl-ico{width:18px;height:18px}
.tl-arearow__main{flex:1;min-width:0;display:flex;flex-direction:column}
.tl-arearow__title{font-weight:600}
.tl-arearow__sub{font-size:14px;line-height:20px;color:var(--ink-muted)}
.tl-arearow__status{font-size:14px;line-height:20px;font-weight:700;text-align:right;white-space:nowrap}
.tl-arearow>.tl-ico{color:var(--ink-muted)}
.tl-arearow[aria-expanded="true"]{border-bottom-color:transparent}

/* BottomSheet — what a tap on a circle or center opens. Non-modal: the map stays visible above. */
.tl-sheet{position:fixed;left:0;right:0;bottom:0;z-index:5;display:flex;flex-direction:column;gap:var(--space-3);max-height:80vh;overflow:auto;padding:var(--space-2) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));background:var(--surface-raised);border-top:1px solid var(--line);border-radius:var(--radius-lg) var(--radius-lg) 0 0;box-shadow:var(--shadow-sheet)}
.tl-sheet__grab{align-self:center;width:40px;height:5px;border-radius:3px;background:var(--line-strong)}
.tl-sheet__head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}
.tl-sheet__close{flex:none;width:var(--tap-min);height:var(--tap-min);margin-right:-10px;display:flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
.tl-sheet__close:hover{background:var(--surface-sunken)}
.tl-sheet__title{margin:0;font:800 30px/34px var(--font-display);letter-spacing:-.015em}
.tl-sheet__meta{margin:0;display:flex;align-items:center;gap:6px;font-size:14px;line-height:20px;color:var(--ink-muted)}
.tl-sheet__meta .tl-ico{width:16px;height:16px}
.tl-sheet__actions{display:flex;flex-direction:column;gap:var(--space-2)}
.tl-sheet__fine{margin:0;font-size:12px;line-height:16px;color:var(--ink-muted)}
.tl-sheet--docked{position:relative;max-height:none;border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-card);padding-bottom:var(--space-4)}

/* TeamSlots — teams in a division, as filled and empty places. Same colour at every count. */
.tl-slots{display:flex;flex-direction:column;gap:var(--space-2)}
.tl-slots__row{display:flex;align-items:center;gap:6px}
.tl-slot{width:26px;height:26px;box-sizing:border-box;border-radius:8px;border:2px dashed var(--line-strong);background:transparent}
.tl-slot--in{border:2px solid var(--on-optic);background:var(--optic)}
.tl-slots__label{margin-left:var(--space-2);font-size:14px;line-height:20px;font-weight:600}

/* Badge additions: neutral count and level tag (the map uses no scarcity colours). */
.tl-badge--outline{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--line-strong)}
.tl-badge--level{background:var(--brand-tint);color:var(--brand)}

/* ActionBar — keeps "Register your team" one tap away on phones. */
.tl-actionbar{position:sticky;bottom:0;z-index:4;display:flex;gap:var(--space-2);padding:var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));background:var(--surface-raised);border-top:1px solid var(--line)}
.tl-actionbar .tl-btn{flex:1 1 auto;padding:0 var(--space-4);white-space:nowrap}
