/* TIPS Runs — a departures board for Guild Wars runners.
   The Istan look: deep olive night, sage, aged gold and a little silk orange,
   with official loading-screen art behind the header and the runs. */

:root {
  --display: 'Cinzel', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --night: #131b17;
  --panel: #1b2621;
  --panel-raised: #222f29;
  --line: #35493f;
  --line-gold: rgba(220, 174, 85, 0.3);
  --bone: #efe9d4;
  --muted: #a9b9ae;
  --gold: #dcae55;
  --gold-dim: #8f7537;
  --silk: #e07a45;
  --jade: #5fb3a6;
  --live: #8fd18a;
  --full: #e0675b;
  --focus: #8fc7ff;

  --serif: 'Palatino Linotype', Palatino, 'Book Antiqua', 'URW Palladio L', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;

  color-scheme: dark;
}

/* Cinzel (SIL Open Font License), Latin subset, served from this site (the CSP only allows our own origin). */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/cinzel-latin.woff2') format('woff2');
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 var(--step-0)/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); text-underline-offset: 0.15em; }
a:hover { color: var(--jade); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; color: var(--gold); margin: 0 0 0.5em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: 70ch; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }

/* ---------- frame ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 26px 16px;
  min-height: 96px;
  align-items: center;
  border-bottom: 1px solid var(--line-gold);
  background:
    linear-gradient(90deg, rgba(19, 27, 23, 0.9) 0%, rgba(19, 27, 23, 0.5) 100%),
    url('/img/art/header.jpg') center / cover no-repeat,
    var(--panel);
}

.wordmark {
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--bone);
  text-decoration: none;
}
.wordmark__guild { color: var(--gold); letter-spacing: 0.08em; }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; background: rgba(19, 27, 23, 0.55); padding: 6px 14px; border-radius: 6px; }
.site-nav__account { display: inline-flex; gap: 18px; }
.site-nav__link { color: var(--muted); text-decoration: none; }
.site-nav__link:hover, .site-nav__link[aria-current='page'] { color: var(--bone); }
.site-nav__link[aria-current='page'] { border-bottom: 2px solid var(--gold); }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 16px 48px; }

.site-footer { border-top: 1px solid var(--line); padding: 16px; color: var(--muted); font-size: var(--step--1); text-align: center; }
.site-footer p { margin: 0 auto; }

.lede { color: var(--muted); font-size: var(--step-1); font-family: var(--serif); margin-bottom: 28px; }

/* ---------- board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  align-items: start;
}

.shop-card {
  background: var(--panel);
  border: 1px solid var(--line-gold);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 18px;
}
.shop-card--live { border-color: var(--live); }

.shop-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.shop-card__name { margin: 0; font-size: var(--step-1); }
.shop-card__name a { color: var(--gold); text-decoration: none; }
.shop-card__name a:hover { text-decoration: underline; }

.status { font-size: var(--step--1); font-weight: 600; color: var(--live); white-space: nowrap; }
.status::before { content: '●'; margin-right: 6px; }

.whisper { margin: 4px 0 14px; color: var(--muted); font-size: var(--step--1); }
.whisper strong { color: var(--bone); font-weight: 600; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.tag { border: 1px solid rgba(95, 179, 166, 0.45); border-radius: 999px; padding: 1px 10px; font-size: 0.8rem; color: var(--muted); }

.now {
  border-left: 3px solid var(--live);
  background: rgba(143, 209, 138, 0.08);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.now__title { font-weight: 600; }
.now__meta { color: var(--muted); font-size: var(--step--1); }

.runs-heading { font-family: var(--sans); font-size: var(--step--1); font-weight: 600; color: var(--muted); margin: 0 0 4px; }

/* Hero picture at the top of the login and join pages. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 200px;
  margin-bottom: 24px;
  padding: 56px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line-gold);
  border-radius: 8px;
  background: url('/img/art/hero.jpg') center / cover no-repeat, var(--panel);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(19, 27, 23, 0.92) 0%, rgba(19, 27, 23, 0.85) 45%, rgba(19, 27, 23, 0.25) 100%);
}
.hero h1 { margin: 0 0 4px; }
.hero p { margin: 0; color: var(--bone); font-family: var(--serif); font-size: var(--step-1); }
@media (max-width: 600px) { .hero::after { background: rgba(19, 27, 23, 0.82); } }

/* Banner art behind a run (board and shop pages; the dashboard's .run rows have none).
   The gradient keeps text on the left easy to read and lets the picture show on the right. */
.has-art { position: relative; overflow: hidden; isolation: isolate; }
.run__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.has-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Text can wrap to about 80% of a run row (the Sign up button takes the rest), so stay dark that far. */
  background: linear-gradient(90deg, rgba(19, 27, 23, 0.93) 0%, rgba(19, 27, 23, 0.85) 80%, rgba(19, 27, 23, 0.45) 100%);
}
.run.has-art { border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; margin-top: 8px; }
.run.has-art:last-child { padding-bottom: 12px; }
.now.has-art { border: 1px solid var(--live); border-left-width: 3px; border-radius: 5px; background: none; }
/* Controls and messages that appear inside a banner get their own backing so they never sit on bare art. */
.has-art button.quiet { background: rgba(19, 27, 23, 0.85); }
.has-art .notice { background: rgba(19, 27, 23, 0.9); }
@media (max-width: 600px) {
  .has-art::after { background: rgba(19, 27, 23, 0.82); }
}

/* A run row reads like a timetable line: when · where to · from · seats */
.run { border-top: 1px solid var(--line); padding: 12px 0; }
.run:last-child { padding-bottom: 0; }
.run__line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.run__when { font-variant-numeric: tabular-nums; color: var(--gold); font-size: var(--step--1); font-weight: 600; }
.run__title { font-weight: 600; }
.run__meta { color: var(--muted); font-size: var(--step--1); grid-column: 1; }
.run__action { grid-column: 2; grid-row: 1 / span 3; align-self: center; }

.seats { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; vertical-align: middle; }
.seat { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.seat--taken { background: transparent; box-shadow: inset 0 0 0 1px var(--gold-dim); }
.full { color: var(--full); font-weight: 600; }

.run__form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.run__form input { flex: 1 1 160px; }
.run__done { margin-top: 10px; padding: 8px 10px; background: var(--panel-raised); border-radius: 4px; font-size: var(--step--1); }

.empty { color: var(--muted); font-style: italic; }

/* ---------- forms and buttons ---------- */

button, .button {
  font: 600 var(--step--1)/1 var(--sans);
  background: linear-gradient(180deg, #e3b861, #b98a36);
  color: var(--night);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { background: linear-gradient(180deg, #f3d68f, #d4a64c); border-color: #f3d68f; color: var(--night); }
button.quiet { background: transparent; color: var(--gold); }
button.quiet:hover { color: var(--bone); background: transparent; border-color: var(--bone); }
button.danger { background: transparent; color: var(--full); border-color: var(--full); }
button:disabled { opacity: 0.5; cursor: default; }

label { display: block; font-size: var(--step--1); color: var(--muted); margin-bottom: 4px; }
input, textarea, select {
  font: inherit;
  color: var(--bone);
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.panel { background: var(--panel); border: 1px solid var(--line-gold); border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); padding: 20px; margin-bottom: 24px; }
.narrow { max-width: 520px; }

.notice { padding: 8px 12px; border-radius: 4px; font-size: var(--step--1); margin: 10px 0; }
.notice--error { background: rgba(224, 103, 91, 0.12); color: #f2a59d; border-left: 3px solid var(--full); }
.notice--ok { background: rgba(143, 209, 138, 0.1); color: var(--live); border-left: 3px solid var(--live); }

.secret {
  font: 600 var(--step-1)/1.4 var(--sans);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: var(--night);
  border: 1px dashed var(--gold);
  padding: 10px 14px;
  border-radius: 4px;
  word-break: break-all;
}

table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.group-row th { background: var(--panel-raised); border-left: 3px solid var(--silk); color: var(--gold); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- resources ---------- */

.route-maps { display: grid; gap: 24px; }
.route-maps figure { margin: 0; }
.route-maps img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.route-maps figcaption { color: var(--muted); font-size: var(--step--1); margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

main section { margin-bottom: 32px; }

details.add { margin-top: 16px; }
details.add > summary { cursor: pointer; font-family: var(--display); font-size: var(--step-1); color: var(--gold); margin-bottom: 12px; }
form.narrow { max-width: 560px; }

/* Live tracking */
.live { margin-top: 6px; }
.live__text { font-size: var(--step--1); color: var(--bone); }
.live--lost .live__text { color: var(--muted); }
.live__bar { display: block; width: 100%; max-width: 360px; height: 8px; margin-top: 6px; border: 0; border-radius: 4px; background: var(--line); accent-color: var(--live); }
.live__bar::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.live__bar::-webkit-progress-value { background: var(--live); border-radius: 4px; }
.live__bar::-moz-progress-bar { background: var(--live); border-radius: 4px; }
.live--lost .live__bar { opacity: 0.5; }
.map-list { list-style: none; margin: 8px 0; padding: 0; }
.map-list li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.map-list .num { color: var(--muted); min-width: 2ch; text-align: right; }

/* Map page */
.map-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .map-layout { grid-template-columns: 1fr; } }
.map-side .field { margin-bottom: 16px; }
.map-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.map-canvas { height: min(78vh, 900px); min-height: 420px; background: #000; border: 1px solid var(--line); border-radius: 6px; }
.map-live-list { list-style: none; margin: 0; padding: 0; }
.map-live-list li { border-top: 1px solid var(--line); }
.map-live-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; gap: 2px; padding: 8px 4px; }
.map-popup { color: #1b2733; font-family: var(--sans); }
.map-popup .run__meta { color: #4a5a68; }
.map-popup a { color: #1d4e89; }

/* place labels, shown by zoom like the original map */
.map-area, .map-loc { background: none; border: 0; width: 0; height: 0; }
.map-area .holder, .map-loc .holder { position: absolute; transform: translate(-50%, -50%); text-align: center; cursor: pointer; white-space: nowrap; }
.map-area .label, .map-loc .label { color: #ffeebb; font: 600 0.8rem/1.1 var(--sans); text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 3px #000; }
.map-area .label { color: #ffeedd; font-weight: 500; font-style: italic; }
.map-loc .holder { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.map-loc--small img { width: 22px; }
.map-loc--medium img { width: 30px; }
.map-loc--large img { width: 42px; }
.map-zoom-0 .map-area, .map-zoom-1 .map-area, .map-zoom-2 .map-area,
.map-zoom-0 .map-loc, .map-zoom-1 .map-loc { display: none; }
.map-zoom-2 .map-loc .label, .map-zoom-3 .map-loc .label { display: none; }
.map-zoom-2 .map-loc--small img { width: 14px; }
.map-zoom-2 .map-loc--medium img { width: 18px; }
.map-zoom-2 .map-loc--large img { width: 26px; }
.map-zoom-3 .map-loc--large img { width: 32px; }

/* live runners and their routes */
.map-runner-icon { background: none; border: 0; width: 0; height: 0; transition: transform 1s linear; } /* the dot glides between updates */
.map-zooming .map-runner-icon { transition: none; } /* but not while the map zooms */
.map-runner { position: absolute; left: 0; top: 0; width: 0; height: 0; cursor: pointer; } /* the anchor is the middle of the dot */
.map-runner__dot { width: 16px; height: 16px; border-radius: 50%; background: var(--live); border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(111, 207, 127, 0.45), 0 0 10px #000; }
.map-runner__dot { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.map-runner__name { position: absolute; left: 0; top: 14px; transform: translateX(-50%); white-space: nowrap; background: rgba(0, 0, 0, 0.75); color: #fff; font: 600 0.78rem/1 var(--sans); padding: 3px 6px; border-radius: 3px; }
.map-runner--lost .map-runner__dot { background: var(--muted); box-shadow: 0 0 10px #000; }
path.map-route { fill: none; stroke-width: 3; stroke-linecap: round; }
path.map-route--done { stroke: var(--live); }
path.map-trail { fill: none; stroke: var(--live); stroke-width: 3; stroke-opacity: 0.9; stroke-linecap: round; stroke-linejoin: round; }
path.map-route--todo { stroke: #fff; stroke-opacity: 0.75; stroke-dasharray: 2 8; }
path.map-stop { fill: #fff; stroke: #000; stroke-width: 1; fill-opacity: 0.9; }
path.map-stop--done { fill: var(--live); }
