/* Theme: deep violet + magenta, flowing "currents" lines. --green is the accent
   (kept under its old name so every rule picks the new colour up). */
:root {
  --bg: #120a22;
  --bg-rgb: 18, 10, 34;
  --accent-rgb: 229, 123, 255;
  --panel: #1b1033;
  --line: #34205a;
  --text: #ece2ff;
  --dim: #9c88c4;
  --green: #e57bff;
  --cyan: #9fb4ff;
  --red: #ff6f91;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
/* Paint the canvas too, so iOS shows the theme behind its status bar and toolbar instead of white. */
html { background: var(--bg); }
html:has(body.landing) { background: #0a0516; }

body {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800' fill='none' stroke-width='1.4'%3E%3Cg stroke='%23d86bff' stroke-opacity='.10'%3E%3Cpath d='M-50 120 C 250 40, 450 260, 700 160 S 1100 60, 1250 180'/%3E%3Cpath d='M-50 170 C 250 90, 450 310, 700 210 S 1100 110, 1250 230'/%3E%3Cpath d='M-50 220 C 250 140, 450 360, 700 260 S 1100 160, 1250 280'/%3E%3Cpath d='M-50 270 C 250 190, 450 410, 700 310 S 1100 210, 1250 330'/%3E%3C/g%3E%3Cg stroke='%238f7bff' stroke-opacity='.09'%3E%3Cpath d='M-50 480 C 200 600, 500 380, 760 520 S 1080 660, 1250 540'/%3E%3Cpath d='M-50 530 C 200 650, 500 430, 760 570 S 1080 710, 1250 590'/%3E%3Cpath d='M-50 580 C 200 700, 500 480, 760 620 S 1080 760, 1250 640'/%3E%3Cpath d='M-50 630 C 200 750, 500 530, 760 670 S 1080 810, 1250 690'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat fixed,
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 95%, rgba(111, 76, 255, 0.18), transparent 70%),
    linear-gradient(160deg, #1a0d33 0%, #120a22 55%, #0d0719 100%) fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* faint CRT scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.10) 0 1px, transparent 1px 3px);
}

.term {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(var(--accent-rgb), 0.04);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

.term-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; margin-right: auto; padding-right: 50px; }

.term-body { padding: 28px 26px 30px; }

.prompt { color: var(--dim); margin: 0 0 6px; }
.prompt b { color: var(--green); font-weight: 600; }
.prompt em { color: var(--cyan); font-style: normal; }

.hello {
  font-size: clamp(56px, 16vw, 96px);
  font-weight: 700;
  color: var(--green);
  margin: 6px 0 28px;
  letter-spacing: -2px;
  text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.35);
}

.comment { color: var(--dim); margin: 0 0 28px; }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--green);
  vertical-align: -0.12em;
  margin-left: 4px;
  animation: blink 1.1s steps(1) infinite;
}
.hello .cursor { width: 0.45em; height: 0.8em; vertical-align: 0; }

@keyframes blink { 50% { opacity: 0; } }

.btn {
  display: inline-block;
  font: inherit;
  color: var(--bg);
  background: var(--green);
  border: 0;
  border-radius: 6px;
  padding: 11px 20px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.btn:hover { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-ghost {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); box-shadow: none; border-color: var(--dim); }

form { display: grid; gap: 14px; }

label { display: grid; gap: 6px; color: var(--dim); font-size: 13px; }
label::before { content: '$ '; color: var(--green); display: none; }

input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  outline: none;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }

.msg { min-height: 1.4em; margin: 0; font-size: 13px; }
.msg.error { color: var(--red); }
.msg.error::before { content: 'error: '; font-weight: 600; }

.hint { color: var(--dim); font-size: 12px; margin: -6px 0 0; }

h1 { font-size: 20px; margin: 0 0 18px; color: var(--text); }
h1::before { content: '> '; color: var(--green); }

/* signed-in page */
.dash {
  width: 100%;
  max-width: 640px;
  display: grid;
  gap: 28px;
  justify-items: center;
}
.dash .user { color: var(--green); font-size: 18px; }
.dash .user::before { content: '~/'; color: var(--dim); }

.launcher {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
}
.launcher a {
  display: grid;
  gap: 6px;
  padding: 16px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.launcher a:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
  transform: translateY(-1px);
}
.launcher .key { color: var(--green); font-size: 12px; }
.launcher .name { font-weight: 600; }

/* Buttons are a fixed size and centred, up to 3 a row, so any number of them sits nicely. */
.launcher, .launcher.cols-2, .launcher.cols-3 {
  display: flex; flex-wrap: wrap; justify-content: center;
  max-width: 660px; margin: 0 auto;
}
.launcher a { flex: 0 1 204px; padding: 22px 14px; text-align: center; }
/* phones: one full-width button per row */
@media (max-width: 620px) { .launcher a { flex-basis: 100%; } }

/* app pages (notes, dump, users, ...) */
body.app { display: block; padding: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: rgba(var(--bg-rgb), 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.crumb { color: var(--dim); text-decoration: none; }
.crumb b { color: var(--green); font-weight: 600; }
.crumb:hover b { text-decoration: underline; }
.topbar .spacer { flex: 1; }
.topbar .btn { padding: 7px 12px; font-size: 13px; }

.page { max-width: 960px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) calc(60px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.page.wide { max-width: 1240px; }
.page h1 { margin-bottom: 8px; }
.page .comment { margin-bottom: 22px; }

.status { color: var(--dim); font-size: 12px; }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 14px; margin: 0 0 14px; color: var(--dim); font-weight: 600; }
.card h2::before { content: '# '; color: var(--green); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 180px; }
.row .full { flex-basis: 100%; }
.row.check { color: var(--dim); font-size: 13px; }
.row.check input { padding: 0; accent-color: var(--green); flex: none; }
.hl { color: var(--green); }
.gap-top { margin: 10px 0 0; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(255, 111, 145, 0.4); }
.btn-danger:hover { box-shadow: 0 0 0 3px rgba(255, 111, 145, 0.15); }

/* notes */
.notepad {
  width: 100%;
  min-height: calc(100vh - 210px);
  resize: vertical;
  font: inherit;
  line-height: 1.6;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  outline: none;
  tab-size: 2;
}
.notepad:focus { border-color: var(--green); }

/* tables (dump, users) */
.table-wrap { overflow-x: auto; }
.table-wrap.visible { overflow: visible; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; color: var(--dim); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.actions { white-space: nowrap; text-align: right; }
table.list td.actions .btn + .btn { margin-left: 6px; }
table.list .name { word-break: break-all; }
table.list a { color: var(--cyan); text-decoration: none; }
table.list a:hover { text-decoration: underline; }
.empty { color: var(--dim); text-align: center; padding: 28px 0; }

.dropzone {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 26px;
  text-align: center;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--green); background: rgba(var(--accent-rgb), 0.04); color: var(--text); }
.dropzone input { display: none; }

.access { display: flex; gap: 4px; flex-wrap: nowrap; }
table.list td.who, table.list td.when { white-space: nowrap; }
.tag { display: inline-block; white-space: nowrap; }
.access label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--dim);
  cursor: pointer;
}
.access input { padding: 0; margin: 0; accent-color: var(--green); }
.access label:has(input:checked) { color: var(--green); border-color: rgba(var(--accent-rgb), 0.4); }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(254, 188, 46, 0.4); color: #febc2e; margin-left: 6px; }
.tag.you { border-color: rgba(159, 180, 255, 0.4); color: var(--cyan); }

/* file explorer (dump, route learning) */
.ex-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ex-toolbar .spacer { flex: 1; }
.ex-toolbar label.btn { display: inline-block; cursor: pointer; }
.ex-path { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.ex-path button {
  font: inherit; color: var(--cyan); background: none; border: 0; padding: 2px 4px; cursor: pointer; border-radius: 4px;
}
.ex-path button:hover { background: rgba(159, 180, 255, 0.1); }
.ex-path .ex-sep { color: var(--dim); }
.ex-path .ex-here { color: var(--text); font-weight: 600; padding: 2px 4px; }

.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  min-height: 200px;
  align-content: start;
}
.ex-empty { grid-column: 1 / -1; padding: 60px 0; }
.ex-item { position: relative; }
.ex-open {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 10px 14px;
  font: inherit;
  color: var(--text);
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.ex-open:hover, .ex-open:focus-visible { background: var(--panel); border-color: var(--line); outline: none; }
.ex-name { font-size: 13px; line-height: 1.35; word-break: break-word; }
.ex-open small { color: var(--dim); font-size: 11px; }

.ex-icon { position: relative; display: block; width: 64px; height: 50px; margin-bottom: 4px; }
.ex-icon.folder {
  margin-top: 6px;
  border-radius: 4px 8px 8px 8px;
  background: linear-gradient(180deg, #c58bff, #8b4fe0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ex-icon.folder::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 0;
  width: 26px;
  height: 10px;
  border-radius: 4px 6px 0 0;
  background: #a86cf0;
}
.ex-icon.file {
  width: 44px;
  height: 56px;
  border-radius: 4px 14px 4px 4px;
  background: #e8edf3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.ex-icon.file b { font-size: 9px; font-weight: 700; color: #0a0e14; letter-spacing: 0.5px; }

.ex-menu { position: absolute; top: 6px; right: 6px; }
.ex-menu summary {
  padding: 2px 8px;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  background: var(--panel);
}
.ex-item:hover .ex-menu summary, .ex-menu[open] summary, .ex-menu summary:focus-visible { opacity: 1; }
@media (hover: none) { .ex-menu summary { opacity: 1; } }
.ex-menu summary::after { content: none; }
.ex-menu .dropdown-menu { left: auto; right: 0; min-width: 140px; }
.dropdown-menu button {
  font: inherit; font-size: 13px; text-align: left; color: var(--text);
  background: none; border: 0; padding: 8px 10px; border-radius: 5px; cursor: pointer;
}
.dropdown-menu button:hover { background: rgba(var(--accent-rgb), 0.07); }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button.danger:hover { background: rgba(255, 111, 145, 0.08); }

.ex-uploads { display: grid; gap: 6px; margin-bottom: 14px; }
.ex-uploads[hidden] { display: none; }
.ex-upload {
  display: grid;
  grid-template-columns: 1fr 200px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.ex-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-upload.failed { border-color: rgba(255, 111, 145, 0.4); }
.ex-upload-err { grid-column: 1 / -1; color: var(--red); }
.ex-upload progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.ex-upload progress::-webkit-progress-bar { background: var(--line); }
.ex-upload progress::-webkit-progress-value { background: var(--green); }
.ex-upload progress::-moz-progress-bar { background: var(--green); }
.ex-hint { color: var(--dim); font-size: 12px; margin-top: 18px; }

.ex-drop {
  position: fixed;
  inset: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--green);
  border-radius: 14px;
  background: rgba(var(--bg-rgb), 0.85);
  color: var(--green);
  font-size: 18px;
  pointer-events: none;
}
.ex-drop[hidden] { display: none; }

/* dashboard */
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.games .card + .card { margin-top: 0; }
.stat { display: grid; gap: 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.game .stat { background: var(--bg); }
.stat-label { color: var(--dim); font-size: 11px; }
.stat-value { color: var(--text); font-size: 22px; font-weight: 700; }
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.game-icon { width: 56px; height: 56px; border-radius: 10px; background: var(--line); flex: none; }
.game-name { display: block; color: var(--text); font-weight: 600; text-decoration: none; }
.game-name:hover { color: var(--green); }
.game-head small { color: var(--dim); font-size: 11px; }
.live { margin-left: auto; font-size: 11px; color: var(--dim); white-space: nowrap; }
.live::before { content: '● '; }
.live.on { color: var(--green); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats .stat-value { font-size: 17px; }
.chart { margin-top: 16px; }
.chart-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.chart-readout { color: var(--text); }
.chart-svg { display: block; width: 100%; height: 120px; overflow: visible; touch-action: none; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-area { fill: rgba(var(--accent-rgb), 0.08); stroke: none; }
.chart-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart-cross { stroke: var(--dim); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--green); stroke: var(--panel); stroke-width: 2; }
.chart-label { fill: var(--dim); font-size: 10px; font-family: var(--mono); }
.chart-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-top: 4px; }
.chart-empty { color: var(--dim); font-size: 12px; margin: 8px 0 0; }
@media (max-width: 720px) {
  .totals, .stats { grid-template-columns: repeat(2, 1fr); }
  .games { grid-template-columns: 1fr; }
}

/* access dropdown (user management) */
details.dropdown { position: relative; display: inline-block; }
details.dropdown summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  user-select: none;
}
details.dropdown summary::-webkit-details-marker { display: none; }
details.dropdown summary::after { content: '▾'; color: var(--dim); }
details.dropdown[open] summary { border-color: var(--green); }
.dropdown-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  display: grid;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.dropdown-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-menu label:hover { background: rgba(var(--accent-rgb), 0.07); }
.dropdown-menu input { padding: 0; accent-color: var(--green); }

/* notes */
.notes-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.note-side { position: sticky; top: 70px; display: grid; gap: 10px; }
.note-new { width: 100%; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: calc(100vh - 160px); overflow-y: auto; }
.note-list button {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  font: inherit;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.note-list button:hover { background: var(--panel); border-color: var(--line); }
.note-list button.active { background: var(--panel); border-color: rgba(var(--accent-rgb), 0.45); }
.note-list .note-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-list button.active .note-name { color: var(--green); }
.note-list small { color: var(--dim); font-size: 11px; }
.note-list .empty { padding: 12px 0; }
.note-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.note-title {
  flex: 1 1 200px;
  font-size: 16px;
  font-weight: 600;
  background: transparent;
  border-color: transparent;
  padding: 8px 6px;
}
.note-title:hover { border-color: var(--line); }
.note-empty { text-align: center; padding: 40px 18px; }
.notes-layout .notepad { min-height: calc(100vh - 200px); }
@media (max-width: 720px) {
  .notes-layout { grid-template-columns: 1fr; }
  .note-side { position: static; }
  .note-list { max-height: 220px; }
}

/* home "log in" button: a polished chrome sphere, no text */
.chrome-ball {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(120px, 22vmin, 200px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 27%, #ffffff 0 5%, rgba(255, 255, 255, 0.9) 8%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 68% 80%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 40% 35%, #fbfbfd 0%, #dcdde3 18%, #aeb0b8 40%, #7b7d86 62%, #45464e 82%, #1e1f24 100%);
  box-shadow:
    inset -12px -16px 30px rgba(0, 0, 0, 0.55),
    inset 8px 10px 22px rgba(255, 255, 255, 0.35),
    0 26px 40px rgba(5, 0, 18, 0.7),
    0 0 70px rgba(var(--accent-rgb), 0.25);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s;
  animation: float 6s ease-in-out infinite alternate;
}
@keyframes float { from { translate: 0 -6px; } to { translate: 0 6px; } }
.chrome-ball:hover, .chrome-ball:focus-visible {
  outline: none;
  transform: scale(1.06);
  box-shadow:
    inset -12px -16px 30px rgba(0, 0, 0, 0.5),
    inset 8px 10px 22px rgba(255, 255, 255, 0.45),
    0 30px 50px rgba(5, 0, 18, 0.75),
    0 0 100px rgba(var(--accent-rgb), 0.55);
}
.chrome-ball:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .chrome-ball { animation: none; } }

/* home page: just a login button over the op-art */
body.landing { overflow: hidden; background: radial-gradient(ellipse at 50% 50%, #2a1150 0%, #150a2b 55%, #0a0516 100%); }
body.landing::after { display: none; }
.flow { position: fixed; inset: -4%; }
.flow svg { width: 100%; height: 100%; display: block; }
.flow-line {
  fill: none;
  stroke: url(#fl);
  stroke-width: 2.2;
  stroke-opacity: 0.55;
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(-14px); }
  to { transform: translateY(14px); }
}
.glow {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 46vmin;
  height: 46vmin;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, rgba(255, 190, 250, 0.55), rgba(166, 107, 255, 0.25) 45%, transparent 70%);
  filter: blur(18px);
  animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { opacity: 0.7; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}
.glass-submit { justify-self: center; margin-top: 6px; padding: 11px 28px; }
@media (prefers-reduced-motion: reduce) { .flow-line, .glow { animation: none; } }

/* login: frosted-glass card over the flowing lines */
.glass {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 18px 30px 32px;
  border-radius: 22px;
  background: rgba(30, 14, 58, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 90px rgba(5, 0, 20, 0.6), 0 0 0 1px rgba(var(--accent-rgb), 0.08) inset;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.glass-bar { display: flex; gap: 8px; margin-bottom: 18px; }
.dot, .dot-close { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.dot-close { position: relative; background: #ff5f57; cursor: pointer; }
.dot-close::after {
  content: '×';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: rgba(80, 0, 0, 0.85);
  opacity: 0;
}
.glass-bar:hover .dot-close::after, .dot-close:focus-visible::after { opacity: 1; }
.glass-title {
  margin: 0 0 24px;
  text-align: center;
  font-family: 'Microgramma', 'Microgramma D Extended', 'Eurostile Extended', 'Michroma', sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 1px;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, 0) 0 4px, rgba(255, 255, 255, 0.18) 4px 6px),
    linear-gradient(110deg, #ff8fe9, #c06bff 30%, #7a63ff 55%, #ff7ad1 80%, #ff8fe9);
  background-size: 120% 100%, 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.35));
  animation: flowtext 12s linear infinite;
}
@keyframes flowtext {
  from { background-position: 0 0, 0% 0; }
  to { background-position: 60px 0, 300% 0; }
}
.mini-ball {
  display: block;
  width: 46px;
  height: 46px;
  margin: -4px auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 27%, #ffffff 0 5%, rgba(255, 255, 255, 0.9) 8%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(circle at 40% 35%, #fbfbfd 0%, #dcdde3 18%, #aeb0b8 40%, #7b7d86 62%, #45464e 82%, #1e1f24 100%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.5), 0 10px 18px rgba(5, 0, 18, 0.6), 0 0 30px rgba(var(--accent-rgb), 0.3);
  animation: float 6s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) { .glass-title, .mini-ball { animation: none; } }
.glass-title::before { content: none; }
.glass-form { display: grid; gap: 12px; }
.glass-form input {
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(14, 6, 30, 0.85), rgba(14, 6, 30, 0.85)) padding-box,
    linear-gradient(110deg, rgba(255, 143, 233, 0.55), rgba(122, 99, 255, 0.55)) border-box;
  color: var(--text);
}
.glass-form input::placeholder { color: rgba(236, 226, 255, 0.45); }
.glass-form input:focus { border-color: rgba(var(--accent-rgb), 0.7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15); }
.glass-form .msg { text-align: center; }

/* toasts (replace alert) */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  justify-items: end;
}
.toast {
  background: var(--panel);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-left-width: 3px;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.18s ease-out;
  transition: opacity 0.4s, transform 0.4s;
}
.toast::before { content: '✓ '; color: var(--green); }
.toast.err { border-color: rgba(255, 111, 145, 0.5); }
.toast.err::before { content: '✗ '; color: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* dialogs (replace confirm / prompt) */
dialog.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  font-family: var(--mono);
}
dialog.modal::backdrop { background: rgba(10, 5, 20, 0.7); backdrop-filter: blur(2px); }
dialog.modal form { display: grid; gap: 14px; padding: 22px; }
dialog.modal h3 { margin: 0; font-size: 16px; }
dialog.modal h3::before { content: '> '; color: var(--green); }
.modal-text { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-danger-solid { background: var(--red); color: var(--bg); }
.btn-danger-solid:hover { box-shadow: 0 0 0 3px rgba(255, 111, 145, 0.25); }

.corner { position: fixed; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 2; }
.corner .btn { padding: 7px 12px; font-size: 13px; }


/* ---- theme: the slow rush (terracotta walls, drifting sand, a patch of sky) ---- */
[data-theme="slowrush"] {
  --bg: #2a0d08;
  --bg-rgb: 42, 13, 8;
  --accent-rgb: 242, 185, 141;
  --panel: #3a130c;
  --line: #6b2a1c;
  --text: #fbe7d6;
  --dim: #d9a58a;
  --green: #f2b98d;
  --cyan: #8cc4dc;
  --red: #ff5a3c;
}
[data-theme="slowrush"] body {
  background:
    radial-gradient(ellipse 70% 55% at 80% 10%, rgba(140, 196, 220, 0.12), transparent 70%),
    radial-gradient(ellipse 80% 50% at 30% 100%, rgba(242, 185, 141, 0.18), transparent 70%),
    linear-gradient(170deg, #5a1a0e 0%, #2a0d08 60%, #1c0805 100%) fixed,
    var(--bg);
}

/* user management: per-account theme */
.theme-select { font: inherit; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.theme-select:hover, .theme-select:focus { border-color: var(--green); outline: none; }

/* login: the mini ball swaps the song title */
button.mini-ball { padding: 0; border: 0; cursor: pointer; transition: transform .2s ease; }
button.mini-ball:hover { transform: scale(1.08); }
button.mini-ball:active { transform: scale(.94); }
button.mini-ball:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .6); outline-offset: 4px; }
.glass-title { transition: opacity .45s ease, transform .45s ease; }
.glass-title.song-out { opacity: 0; transform: translateY(6px) scale(.97); }

/* platform lengths */
.door-picks.lengths-pick { grid-template-columns: minmax(0, 420px); }
table.lengths { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.lengths th, table.lengths td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; }
table.lengths thead th { color: var(--green); font-size: 12px; }
table.lengths tbody th { text-align: left; }
table.lengths td.none { opacity: 0.45; }
.card:has(> table.lengths) { overflow-x: auto; }
table.lengths td.np { color: #ff6b6b; font-weight: 600; background: rgba(255, 80, 80, 0.08); }

/* services */
.svc-search { display: flex; gap: 12px; align-items: end; max-width: 420px; }
.svc-search label { flex: 1; }
.svc-search input { text-transform: uppercase; }
.svc-list { display: grid; gap: 8px; }
.svc-list a { display: flex; gap: 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.svc-list a:hover { border-color: var(--green); }
.svc-time { color: var(--green); font-weight: 700; }
.svc-status { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.svc-status.ok { color: var(--green); }
.svc-status.late { color: #ffb347; }
.svc-status.bad { color: #ff6b6b; }
.svc-table th, .svc-table td { text-align: left; }
.svc-table tr.pass { opacity: 0.6; font-style: italic; }
.svc-table tr.done th { color: var(--green); }
.svc-table tr.cxl { text-decoration: line-through; opacity: 0.5; }
.svc-real { color: #ffb347; }
.svc-exp { opacity: 0.7; }
.svc-plat-ok { font-weight: 700; }

/* door positions */
.door-picks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.combo { position: relative; }
.combo-input { width: 100%; box-sizing: border-box; }
.combo-input:disabled { opacity: 0.4; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.combo-list li { padding: 8px 10px; border-radius: 4px; cursor: pointer; color: var(--text); }
.combo-list li.on, .combo-list li:hover { background: rgba(var(--accent-rgb), 0.15); }
.combo-list li.picked { background: rgba(var(--accent-rgb), 0.3); color: var(--green); font-weight: 600; }
.door-spot { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.combo-list[hidden], #door-info[hidden] { display: none; }
.door-select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; outline: none; cursor: pointer; }
.door-select:focus { border-color: var(--green); }
.door-select:disabled { opacity: 0.4; cursor: default; }
.door-picks .door-clear { align-self: end; width: auto; padding: 11px 12px; font-size: 12px; line-height: inherit; }
@media (min-width: 700px) { .door-picks { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; } }
.door-short { margin: 0 0 14px; padding: 8px 12px; border: 1px solid rgba(var(--accent-rgb), 0.5); border-radius: 6px; background: rgba(var(--accent-rgb), 0.12); color: var(--text); font-weight: 600; }

/* per-point lateness on the service page */
.svc-table .svc-late { color: #f0a050; font-weight: 700; }
.svc-table .svc-ok { color: #7fd27f; font-weight: 700; }
.svc-table .svc-fc { opacity: .6; font-weight: 400; }


/* tick sheet details on the service page */
.svc-table tr.svc-has-tick { cursor: pointer; }
.svc-table tr.svc-has-tick:hover th { text-decoration: underline; }
.svc-table tr.svc-detail td { text-align: left; padding: 8px 12px 14px; background: rgba(0,0,0,.18); }
.svc-tick { display: grid; gap: 10px; }
.svc-tick h4 { margin: 0 0 4px; font-size: .85em; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.svc-tick-item { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; font-size: .9em; line-height: 1.45; white-space: normal; }
.svc-tick-label { opacity: .65; }
@media (max-width: 600px) { .svc-tick-item { grid-template-columns: 1fr; gap: 0; } }

.svc-stepfree { color: #4cd964; font-weight: 700; }


.svc-stepfree { font-size: 1.3em; }
.svc-not-sf { color: #e05050; font-weight: 700; font-size: 1.3em; }


/* station details slide open/closed */
.svc-slide { overflow: hidden; }
.svc-slide.in { animation: svc-open .5s cubic-bezier(.4,0,.2,1) both; }
.svc-slide.out { animation: svc-close .4s cubic-bezier(.4,0,.2,1) both; }
@keyframes svc-open { from { height: 0; opacity: 0; } to { height: var(--h, auto); opacity: 1; } }
@keyframes svc-close { from { height: var(--h, auto); opacity: 1; } to { height: 0; opacity: 0; } }
.svc-table tr.svc-detail td { transition: padding .2s; }
.svc-table tr.svc-has-tick th { transition: color .15s; }
@media (prefers-reduced-motion: reduce) { .svc-slide.in, .svc-slide.out { animation: none; } }

/* padding lives inside the sliding panel so the row doesn't jump at the end */
.svc-table tr.svc-detail td { padding: 0 !important; }
.svc-slide > .svc-tick { padding: 8px 12px 14px; }


.svc-count { font-size: .7em; font-weight: 700; }


.svc-mandatory { color: #4cd964; font-weight: 700; font-size: .9em; margin-top: 2px; }


/* short platform warning */
.svc-short-mark { color: #ffd23f; font-weight: 800; }
.svc-short { background: rgba(255, 210, 63, .14); border: 1px solid #ffd23f; color: #ffe27a; border-radius: 8px; padding: 8px 12px; line-height: 1.45; }
.svc-short strong { display: block; color: #ffd23f; text-transform: uppercase; letter-spacing: .04em; font-size: .85em; margin-bottom: 2px; }

/* short platform: little pulsing yellow triangle next to the station name */
.svc-short-mark { display: inline-block; width: 1em; height: .92em; margin-left: .45em; vertical-align: -0.08em; line-height: 0; }
.svc-short-mark svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 60%; animation: svc-pulse 1.4s ease-in-out infinite; }
@keyframes svc-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,210,63,0)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 5px rgba(255,210,63,.9)); }
}
@media (prefers-reduced-motion: reduce) { .svc-short-mark svg { animation: none; } }
/* MAS shown as a signal picture */
.svc-signals { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc-signal { width: 22px; height: 40px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }


/* OFF indicator / banner repeater pictures */
.svc-sigpic { display: inline-flex; align-items: center; gap: 3px; }
.svc-sigpic img.svc-off { height: 18px; width: auto; border-radius: 3px; }
.svc-sigpic img.svc-br { height: 22px; width: 22px; background: #fff; border-radius: 50%; }


.svc-signal-rows { display: grid; gap: 6px; }
.svc-dir { min-width: 2.2em; font-size: .8em; font-weight: 700; opacity: .7; }
.svc-sigtext { font-size: .9em; }


.svc-sigpic img.svc-pls { height: 24px; width: auto; }


/* links inside // comment lines match the comment text */
.comment a, .comment a:visited { color: inherit; text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; opacity: .85; }
.comment a:hover { opacity: 1; text-decoration-thickness: 2px; }


.svc-sigpic img.svc-trts { height: 26px; width: auto; }


.svc-sigpic img.svc-ri { height: 24px; width: 24px; }


/* no unit allocated */
.svc-nounit { background: rgba(224, 64, 64, .15); border: 1px solid #e04848; color: #ffb3b3; border-radius: 8px; padding: 8px 12px; margin: 6px 0 12px; display: inline-block; }
.svc-nounit strong { color: #ff6b6b; text-transform: uppercase; letter-spacing: .04em; }
.svc-sigwarn { color: #ff8a8a; font-weight: 700; font-size: .9em; }


/* platform taken from yesterday's run */
.svc-table td.svc-plat-yday { opacity: .6; font-style: italic; }
.svc-table td.svc-plat-yday sup { font-size: .65em; margin-left: 1px; }


/* yesterday's platform in yellow; platform alterations flagged */
.svc-table td.svc-plat-yday { color: #ffd23f; opacity: 1; font-style: normal; }
.svc-table td.svc-plat-changed { color: #ff6b6b; font-weight: 800; animation: svc-pulse-text 1.6s ease-in-out infinite; }
.svc-plat-was { display: block; font-size: .7em; font-weight: 400; color: #ffb3b3; text-decoration: line-through; opacity: .85; }
@keyframes svc-pulse-text { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .svc-table td.svc-plat-changed { animation: none; } }


/* platform change: new platform flashes in the normal colour, old one shown plainly underneath */
.svc-table td.svc-plat-changed { color: inherit; font-weight: 700; animation: svc-flash 1.2s ease-in-out infinite; }
.svc-table td.svc-plat-changed .svc-plat-was { color: inherit; opacity: 1; animation: svc-noflash 1.2s ease-in-out infinite; }
@keyframes svc-flash { 50% { opacity: .2; } }
@keyframes svc-noflash { 50% { opacity: 5; } }


.svc-table td.svc-plat-changed { animation: none; }
.svc-table td.svc-plat-changed .svc-plat-was { animation: none; opacity: 1; color: inherit; }
.svc-plat-new { display: inline-block; animation: svc-flash 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .svc-plat-new { animation: none; } }


/* final: old platform red + struck through (steady), new platform normal colour, flashing */
.svc-table td.svc-plat-changed { color: inherit; animation: none; }
.svc-table td.svc-plat-changed .svc-plat-was { color: #ff5c5c; text-decoration: line-through; opacity: 1; animation: none; }
.svc-plat-new { display: inline-block; animation: svc-flash 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .svc-plat-new { animation: none; } }


/* Pick a platform yourself where none is booked */
.svc-plat-pick { font: inherit; font-weight: 700; color: inherit; background: transparent; border: 1px dashed currentColor; border-radius: 4px; padding: 1px 2px; cursor: pointer; opacity: .9; }
.svc-plat-pick option { color: #f5d0b0; background: #2a0e08; }

/* My services: saved list + add buttons on search results */
.svc-h2 { font-size: 1rem; margin: 28px 0 10px; color: var(--muted, inherit); }
#my-services { margin-bottom: 8px; }
.svc-row { display: flex; gap: 8px; align-items: stretch; }
.svc-row > a { flex: 1; min-width: 0; }
.svc-hc { font-weight: 700; color: var(--green); }
.svc-add { white-space: nowrap; }
.svc-del { padding: 0 14px; }
.svc-added { display: flex; align-items: center; padding: 0 12px; color: var(--green); white-space: nowrap; font-weight: 700; }
#svc-results { margin-top: 12px; }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.svc-top .svc-status { margin: 0; }

/* Stations page: one card per platform */
.stn-plat { display: block; margin-top: 14px; padding: 16px 18px; }
/* MAS with a junction indicator: same signal size, extra room for the feather */
.svc-signal.svc-signal-ji { width: 42px; height: 60px; }
.svc-signal.svc-ji-only { width: 22px; height: 22px; }

/* Activity history */
.act-filter select { display: block; margin-top: 6px; font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.act-filter option { background: #2a0e08; }
#act-list { margin-top: 16px; overflow-x: auto; }
.act-table th, .act-table td { text-align: left; white-space: nowrap; }
.act-table td:nth-child(3) { white-space: normal; }
.act-table .act-ip { opacity: .6; font-size: .85em; }
.act-table tr.act-bad td { color: #ff6b5b; }
/* next service button */
.svc-foot{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}.svc-foot > :last-child{margin-left:auto}

/* user options menu */
.opt-wrap{position:relative;display:inline-block}
.opt-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:20;display:flex;flex-direction:column;gap:4px;min-width:160px;padding:6px;background:var(--panel,var(--bg));border:1px solid var(--line,rgba(255,255,255,.15));border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.4)}
.opt-menu[hidden]{display:none}
.opt-menu .btn{width:100%;text-align:left;justify-content:flex-start}

