:root {
  color-scheme: dark;
  --bg: #11100e;
  --panel: #1a1814;
  --text: #efe8da;
  --muted: #bcb2a1;
  --gold: #dfc394;
  --green: #abd1ac;
  --line: #49402f;
  --radius: 16px;
  font-family: "Inter", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 12px max(6vw, 20px);
  border-bottom: 1px solid #2e281f;
  color: var(--muted);
  font-size: .875rem;
}
.brand { color: var(--text); font-size: 1.15rem; font-weight: 650; letter-spacing: .22em; }
main { width: min(100% - 40px, 1220px); margin: 0 auto; padding: clamp(32px, 6vw, 76px) 0 56px; }
.heading { margin-bottom: 24px; }
h1 { margin: 0 0 10px; font-size: clamp(36px, 5.5vw, 69px); font-weight: 540; letter-spacing: -.035em; }
p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.65; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 345px); gap: 18px; align-items: start; }
.map { position: relative; overflow: hidden; min-height: clamp(540px, 68vh, 740px); isolation: isolate; border: 1px solid var(--line); border-radius: 26px; background: #edf2f1; }
#cityMap { position: absolute; inset: 0; }
.map-notice, .map-load, .map-marker b, #resetMapView, #mapPerspective {
  position: absolute; border: 1px solid #d5e2e5; background: #fafffff5; padding: 8px 12px;
  border-radius: 999px; color: #364d57; font-size: .75rem; box-shadow: 0 2px 10px #304b5814;
}
#resetMapView { top: 12px; left: 12px; min-height: 38px; }
#mapPerspective { top: 90px; right: 12px; min-width: 44px; min-height: 44px; font-weight: 650; }
#mapPerspective[aria-pressed="true"] { color: #2c6156; background: #e0f0e9; border-color: #b9d8ca; }
#resetMapView:hover, #mapPerspective:hover { background: #dfeff3; color: #263d48; }
.status span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 2px; }
.map-notice { bottom: 38px; left: 12px; right: 12px; width: fit-content; line-height: 1.5; pointer-events: none; }
.map-load { top: 50%; left: 50%; transform: translate(-50%,-50%); width: max-content; max-width: calc(100% - 36px); text-align: center; pointer-events: none; }
.map-marker { --pin:#a4cfee; --pin-text:#17426b; pointer-events: none; }
.map-marker.friend { --pin:#a8d8c4; --pin-text:#224f43; }
.pin { display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid #faffff; border-radius: 50%; background: var(--pin); color:var(--pin-text); font-size:.8rem; font-weight:650; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin), transparent 40%), 0 3px 11px #304b5855; }
.map-marker b { left: 43px; top: 3px; width: max-content; max-width: min(180px, 48vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; line-height: 1.2; }
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 12px 12px 0 0; }
.maplibregl-ctrl-top-right .maplibregl-ctrl-group { border-radius: 16px; background: #faffff; }
.maplibregl-ctrl-top-right .maplibregl-ctrl-group button { width: 38px; height: 34px; }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale { margin: 0 0 8px 8px; }
.maplibregl-ctrl-attrib a { text-decoration: underline; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel section { padding: 22px; }
.panel section + section { border-top: 1px solid var(--line); }
.panel h2 { margin: 0 0 8px; font-weight: 600; font-size: 1rem; }
.action { display: block; width: 100%; min-height: 44px; margin-top: 14px; padding: 8px 11px; border: 1px solid var(--gold); border-radius: 9px; background: var(--gold); color: var(--bg); font-weight: 620; font-size: .85rem; }
.action.secondary { background: transparent; color: var(--gold); border-color: var(--line); }
.action:not(:disabled):hover, .action.secondary:hover { background: #f3d9a9; color: var(--bg); }
.action:disabled { opacity: .55; cursor: default; }
.status { margin-top: 16px; font-size: .8rem; color: var(--muted); }
.status.active { color: var(--green); }
.status b { font-weight: 500; }
.invite { display: flex; align-items: start; gap: 10px; margin-top: 13px; }
.invite code {
  min-width: 0; flex: 1; color: var(--gold); font-size: .85rem; font-weight: 600;
  overflow-wrap: anywhere; line-height: 1.5; user-select: all;
}
.quiet { min-height: 38px; padding: 4px; border: 0; background: none; color: var(--gold); font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; }
.quiet:disabled { opacity: .55; cursor: default; }
.redeem { margin-top: 18px; }
.redeem label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .86rem; }
.redeem input, #friendSelect {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); color: var(--text); font: inherit;
}
#shareRecipient, #inviteStatus { overflow-wrap: anywhere; }
.hint { margin-top: 8px; font-size: .8rem; }
.hint:empty { display: none; }
.map-privacy { margin-top: 16px; }
.login-panel { max-width: 500px; padding: 22px; }
.login-panel .action { text-align: center; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .map { min-height: 470px; border-radius: 20px; }
  .map-marker b { left: 50%; top: 43px; transform: translateX(-50%); }
  .map-marker.friend b { left: auto; right: 0; transform: none; }
}
