/* B-Side house style (style guide v1). The game commits to its own look: white panels by day,
   dark neon panels at night, whatever the device theme. */
:root {
  --bg: #f2f4ee; --panel: #ffffff; --ink: #1f2521; --muted: #5c655e; --line: #e2e6dc; --tile: #eef1e8;
  --orange: #e8562a; --green: #2f7d4f; --amber: #e8b84a; --red: #c4433a;
  --night: #10141f; --night-panel: #161b28; --night-line: #2c3350; --night-ink: #eef0ff; --night-muted: #9aa2c4;
  --pink: #ff5fa2; --pink-soft: #ff79b4; --cyan: #7fe3ff; --up: #6ee7a0; --down: #ff8a7a;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --neon: "Bungee", "Plus Jakarta Sans", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* top bar */
.bar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(10px, env(safe-area-inset-top, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand b { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs { display: flex; gap: 2px; background: var(--tile); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.tabs button:disabled { opacity: 0.45; cursor: default; }
.stats { display: flex; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.stats > div { display: flex; flex-direction: column; line-height: 1.2; }
.stats span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stats b { font-weight: 800; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.soft { background: var(--tile); color: var(--ink); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--tile); display: grid; place-items: center; cursor: pointer; }

/* body layout */
.body { flex: 1; display: flex; min-height: 0; }
.mapcol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.map { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #92cde0; touch-action: none; }
.map canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.town-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: #fff; color: var(--muted); padding: 4px 10px 4px 8px; border-radius: 999px; font: 600 12px var(--font); white-space: nowrap; box-shadow: 0 2px 8px rgb(0 0 0 / 0.16); }
.town-label i { width: 8px; height: 8px; border-radius: 50%; display: block; background: #d6d0c2; }
.town-label.known { color: var(--ink); font-weight: 700; }
.town-label.booked { box-shadow: 0 0 0 2px var(--orange), 0 2px 8px rgb(0 0 0 / 0.16); }
.town-label.selected { background: var(--ink); color: #fff; z-index: 2; }
.pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #232a26; color: #f4f6f1; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.18); max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { position: absolute; left: max(14px, env(safe-area-inset-left, 0px)); bottom: 14px; display: flex; flex-direction: column; gap: 4px; background: #fff; padding: 10px 12px; border-radius: 12px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); font-size: 12px; }
.legend .lh { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.zoom { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 6px; }
.zoom button { width: 44px; height: 44px; border: 0; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.16); font-weight: 700; font-size: 20px; cursor: pointer; }

/* the week strip */
.week { flex-shrink: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.week-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rehearse { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 32px; }
.rehearse input { width: 18px; height: 18px; accent-color: var(--orange); }
.nights { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.slot { min-height: 62px; border-radius: 10px; padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; background: #fff; border: 2px dashed #d4d9cd; color: var(--muted); }
.slot b { font-size: 12px; color: var(--ink); }
.slot.gig { border: 1px solid #f5cfc0; background: #fdeee8; color: var(--ink); }
.slot.gig .v { font-weight: 700; font-size: 12px; line-height: 1.25; }
.slot.gig .x { margin-top: auto; align-self: flex-start; border: 0; background: transparent; color: #b8441f; font-weight: 700; font-size: 12px; padding: 0; cursor: pointer; }
.week-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-sum b { color: var(--ink); }

/* side panel */
.panel { width: 380px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); margin: 0; }
.panel h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.sub { color: var(--muted); font-size: 13px; }
.lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meter { height: 8px; background: var(--tile); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sect { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.venue { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--tile); }
.venue:last-child { border-bottom: 0; }
.venue .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.venue .nm { font-weight: 700; }
.venue .meta { color: var(--muted); font-size: 12px; }
.venue .est { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.venue .locked { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; max-width: 120px; }
.nightpick { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.nightpick button { min-width: 44px; min-height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }
.nightpick button:disabled { opacity: 0.35; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tile); color: #4f5751; }
.chip.good { background: #e6f2ea; color: var(--green); }
.chip.warn { background: #fbf0d6; color: #8a5c00; }
.chip.bad { background: #fbe9e7; color: #b23a31; }
.member { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 34px); gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--tile); font-size: 13px; font-variant-numeric: tabular-nums; }
.member .n { font-weight: 700; }
.member small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.member .h { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; }
.member span.v { text-align: center; font-weight: 800; }
.goal { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.goal i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c9cfc0; display: grid; place-items: center; flex-shrink: 0; font-style: normal; font-size: 11px; color: #fff; }
.goal.done i { background: var(--green); border-color: var(--green); }
.empty { color: var(--muted); font-size: 13px; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgb(16 20 31 / 0.6); display: grid; place-items: center; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.card { width: min(980px, 100%); background: var(--panel); border-radius: 16px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.3); padding: 22px; display: flex; flex-direction: column; gap: 16px; max-height: 100%; overflow-y: auto; }
.card h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.card p { margin: 0; max-width: 66ch; }
.bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bandcard { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.bandcard h3 { margin: 0; font-size: 18px; font-weight: 800; }
.bandcard .who { font-size: 12px; color: var(--muted); }
.bandcard ul { margin: 0; padding: 0; list-style: none; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.bandcard .btn { margin-top: auto; }

.card.night { background: var(--night-panel); color: var(--night-ink); border: 1px solid var(--night-line); box-shadow: 0 20px 60px rgb(255 95 162 / 0.15); }
.card.night h2 { font-family: var(--neon); font-weight: 400; color: var(--pink-soft); letter-spacing: 0.02em; text-shadow: 0 0 14px rgb(255 95 162 / 0.6); }
.card.night .sub, .card.night .lbl { color: var(--night-muted); }
.gigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.gigcard { background: var(--night); border: 1px solid var(--night-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.gigcard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gigcard .top b { font-size: 15px; }
.gigcard .sub { font-size: 12px; }
.gigcard .bar2 { height: 6px; background: #232a40; border-radius: 999px; overflow: hidden; }
.gigcard .bar2 i { display: block; height: 100%; background: var(--pink); }
.react { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.react.Great { background: var(--pink); color: #161b28; }
.react.Good { background: #1e3a2c; color: var(--up); }
.react.Okay { background: #232a40; color: var(--night-ink); }
.react.Poor { background: #3a1e22; color: var(--down); }
.notes { font-size: 12px; color: #ff9ccb; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 24px; border-top: 1px solid var(--night-line); padding-top: 12px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; flex-direction: column; }
.totals b { font-size: 20px; }
.ev { font-size: 13px; display: flex; gap: 8px; }
.ev i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.goalsmet { background: #2a1c33; box-shadow: inset 0 0 0 1px var(--pink); border-radius: 12px; padding: 12px 14px; font-weight: 700; }
.card.night .btn.primary { background: var(--pink); color: #161b28; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; background: #232a26; color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); max-width: calc(100% - 32px); }

/* phone: the panel becomes a sheet, the week strip scrolls sideways */
@media (max-width: 760px) {
  .bar { gap: 8px 10px; padding-block: 8px; }
  .brand, .stats > div:nth-child(3) span { display: none; }
  .stats { width: 100%; justify-content: space-between; }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1; }
  .stats { gap: 10px; }
  .stats .btn { padding: 8px 14px; min-height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  .body { flex-direction: column; }
  .panel { width: auto; flex-shrink: 0; border-left: 0; border-top: 1px solid var(--line); height: 32vh; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px rgb(0 0 0 / 0.12); margin-top: -14px; position: relative; z-index: 3; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .panel h1 { font-size: 22px; }
  .legend { display: none; }
  .week { padding: 8px 12px 18px; gap: 6px; }
  .rehearse { font-size: 12px; }
  .nights { grid-template-columns: repeat(7, 84px); overflow-x: auto; padding-bottom: 2px; }
  .slot { min-height: 44px; padding: 5px 7px; }
  .slot .t { display: none; }
  .week-sum { font-size: 12px; gap: 2px 12px; }
  .pill { font-size: 12px; top: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* First Gig: the asset library's film, full screen over the game, with a night-style Skip button */
.movie { position: fixed; inset: 0; z-index: 50; background: #000; }
.movie iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.movie .skip { position: absolute; top: max(14px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); min-height: 44px; min-width: 76px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--night-line); background: rgb(22 27 40 / 0.85); color: var(--pink-soft); font-family: var(--neon); font-size: 15px; letter-spacing: 0.04em; cursor: pointer; }
.movie .skip:hover, .movie .skip:focus-visible { background: var(--night-panel); outline: 2px solid var(--pink); outline-offset: 2px; }
