/* LD Companion: styled after FFXI's own menus (framed navy windows, white text with
   drop shadows, the white hand cursor, elemental day colours). */

:root {
  --bg: #0b1024;
  --win-top: rgba(46, 56, 104, 0.94);
  --win-bottom: rgba(14, 18, 42, 0.95);
  --frame: #aeb6d0;
  --frame-dark: #11152a;
  --text: #f3f4f8;
  --muted: #a7b0c8;
  --select: #9fd4ff;
  --gold: #f2d27c;
  --green: #73e09a;
  --red: #ff8578;
  --radius: 7px;
  --shadow: 1px 1px 0 #000, 0 0 2px rgba(0, 0, 0, 0.6);

  --fire: #ff6a55; --earth: #e3bd57; --water: #58a8ff; --wind: #59df8a;
  --ice: #9ee8ff; --lightning: #cf8bff; --light: #fffbe6; --dark: #9a88d6;

  --hand: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><g fill='%23fff' stroke='%231d2340' stroke-width='1.1' stroke-linejoin='round'><rect x='0.8' y='4.8' width='4.4' height='11' rx='1.2' fill='%23d9deea'/><rect x='4.6' y='3.2' width='11' height='14.6' rx='4'/><rect x='11.5' y='13.6' width='7.2' height='3.6' rx='1.8'/><rect x='11.5' y='10.4' width='8.6' height='3.6' rx='1.8'/><rect x='11.5' y='7.4' width='9.6' height='3.4' rx='1.7'/><rect x='11.5' y='2.4' width='17.4' height='5.4' rx='2.7'/></g></svg>");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; max-width: 100%; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(80, 104, 190, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(40, 60, 120, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-shadow: var(--shadow);
  padding-bottom: env(safe-area-inset-bottom);
}

body.with-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

a { color: var(--select); text-decoration: none; }
button { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.pad { padding: 16px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.gap { justify-content: flex-start; flex-wrap: wrap; margin-top: 10px; }
.gil { color: var(--gold); }
.ok { color: var(--green); }
.short { color: var(--red); }
.error-text { color: var(--red); }
.error-text:empty { display: none; }

/* ---------- top bar / bottom menu ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: linear-gradient(var(--win-top), var(--win-bottom));
  border-bottom: 1px solid var(--frame);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.brand { color: var(--text); font-weight: 700; letter-spacing: 0.04em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.gm-link { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; color: #1b1405; background: var(--gold); text-shadow: none; }
.badge.gm { color: var(--gold); margin-left: 6px; }
.gm-note { color: var(--gold); margin-top: 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pager .btn { margin-top: 0; }
.var-name { overflow-wrap: anywhere; }
.mini-clock { color: var(--text); font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(var(--win-top), var(--win-bottom));
  border-top: 1px solid var(--frame);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

.bottomnav a {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 11px;
  border-radius: 6px;
}

.bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(1px 1px 0 #000); }
.bottomnav a.active { color: var(--text); background: rgba(159, 212, 255, 0.12); }

main { max-width: 720px; margin: 0 auto; padding: 12px 12px 20px; }

/* ---------- windows ---------- */

.win {
  position: relative;
  margin: 0 0 12px;
  background: linear-gradient(180deg, var(--win-top), var(--win-bottom));
  border: 1px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--frame-dark), inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 4px 14px rgba(0, 0, 0, 0.55);
}

.win-title {
  margin: 0;
  padding: 7px 12px 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(174, 182, 208, 0.35);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 70%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.win-body { padding: 10px 12px 12px; }

h1, h2, h3 { margin: 0 0 6px; line-height: 1.2; }

/* ---------- menus with the hand cursor ---------- */

.menu { display: grid; gap: 2px; }

.menu-item, .item-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px 7px 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.menu-item::before, .item-row::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 24px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--hand) no-repeat center / contain;
  opacity: 0;
  transition: opacity 0.1s;
}

.menu-item:hover, .menu-item:focus-visible, .item-row:hover, .item-row:focus-visible {
  background: rgba(159, 212, 255, 0.1);
  outline: none;
}

.menu-item:hover::before, .menu-item:focus-visible::before, .menu-item:active::before,
.item-row:hover::before, .item-row:focus-visible::before, .item-row:active::before { opacity: 1; }

.char-item strong { font-size: 16px; }
.jobs { color: var(--gold); font-weight: 700; }
td.jobs { white-space: nowrap; font-size: 13px; }
.jobs.big { font-size: 17px; margin: 6px 0 2px; }

.list { display: grid; gap: 1px; }
.item-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qty { color: var(--muted); font-size: 13px; }
.slot-tag { min-width: 44px; text-align: right; }
.bazaar-meta { display: grid; justify-items: end; text-align: right; }
.item-meta { text-align: right; white-space: nowrap; }

.icon { width: 32px; height: 32px; flex: none; image-rendering: auto; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.7)); }
.icon.missing { visibility: hidden; }

/* ---------- forms & buttons ---------- */

.field { display: grid; gap: 4px; margin: 10px 0; font-size: 13px; color: var(--muted); }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin-top: 0; }

input, select {
  width: 100%;
  padding: 10px 11px;
  border-radius: 5px;
  border: 1px solid #6c7698;
  background: rgba(5, 8, 22, 0.75);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* iOS zooms into inputs under 16px and stays zoomed */
  text-shadow: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

input:focus, select:focus { outline: 2px solid var(--select); outline-offset: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--frame);
  border-radius: 6px;
  background: linear-gradient(#4a5a9a, #262f5c);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  text-shadow: var(--shadow);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn.primary { background: linear-gradient(#6a86d8, #33478f); }
.btn.danger { background: linear-gradient(#8f3a42, #551d25); }
.btn.small { padding: 6px 12px; font-size: 13px; margin-top: 10px; }
.btn.wide { display: flex; width: 100%; margin: 6px 0 12px; }
.btn:disabled { opacity: 0.6; }

.search { display: flex; gap: 8px; }
.search .btn { flex: none; }
.filter { margin-bottom: 10px; }

.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.check input { width: 20px; height: 20px; flex: none; }

/* ---------- login ---------- */

.login-wrap { max-width: 400px; margin: 7vh auto 0; }
.logo {
  text-align: center;
  font-size: 30px;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 0 12px rgba(120, 170, 255, 0.7), 2px 2px 0 #000;
  margin-bottom: 4px;
}

/* ---------- character page ---------- */

.back { display: inline-block; margin: 0 0 8px; font-size: 14px; }
.char-name { font-size: 24px; margin: 0; }
.char-title { color: var(--select); font-size: 13px; }

.status { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--muted); color: var(--muted); }
.status.on { color: var(--green); border-color: var(--green); }

.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; vertical-align: middle; border: 1px solid currentColor; font-weight: 700; }
.badge.cap75 { color: var(--select); }
.badge.cap99 { color: var(--gold); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: #3a4366; flex: none; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; margin: 10px 0 0; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.four dt { font-size: 10px; }
.stat {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(174, 182, 208, 0.25);
  border-radius: 5px;
  padding: 6px 9px;
  text-align: center;
  min-width: 0;
}
.stat dt { font-size: 11px; color: var(--muted); }
.stat dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Character header: Gil gets its own full-width line, then HP / MP / Played share one row. */
.char-head .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.char-head .stat:has(> dd.gil) { grid-column: 1 / -1; }
.char-head .stat dd.gil { font-size: 17px; }
.stat dd.hp { color: #ff9b9b; }
.stat dd.mp { color: #9bc6ff; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px 12px; padding: 2px 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none;
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid rgba(174, 182, 208, 0.45);
  background: linear-gradient(var(--win-top), var(--win-bottom));
  color: var(--muted);
  font-size: 13px;
}
.tabs a.active { color: var(--text); border-color: var(--frame); box-shadow: inset 0 -2px 0 var(--select); }

.model {
  height: 330px;
  margin: 8px -12px;
  background: radial-gradient(ellipse at 50% 45%, rgba(110, 140, 230, 0.35), transparent 70%);
  display: grid;
  place-items: center;
}
.model model-viewer { width: 100%; height: 100%; --poster-color: transparent; }

/* Equipment screen: 4 x 4 slots like the game */
.equip-grid { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; justify-content: center; }
.equip-slot {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid #6a7396;
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.55), rgba(40, 50, 92, 0.6));
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  padding: 0;
}
.equip-slot .icon { width: 40px; height: 40px; }
.equip-slot.empty { cursor: default; }
.equip-slot:not(.empty):hover { border-color: var(--select); }
.slot-label { font-size: 10px; color: #6f7aa0; text-shadow: none; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 400; font-size: 12px; }
.table td, .table th { overflow-wrap: anywhere; padding: 6px 4px; border-bottom: 1px solid rgba(174, 182, 208, 0.18); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.current td { color: var(--gold); }
.num { text-align: right; white-space: nowrap; }

.bar { height: 3px; margin-top: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #5c86ff, #9fd4ff); }

.bag > summary { cursor: pointer; list-style: none; }
.bag > summary::-webkit-details-marker { display: none; }
.bag > summary::after { content: "▾"; float: right; color: var(--muted); }
.bag:not([open]) > summary { border-bottom: 0; border-radius: var(--radius); }
.bag:not([open]) > summary::after { content: "▸"; }

.big-number { font-size: 24px; font-weight: 700; margin: 0; }

.current { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.sub-list { margin-top: 8px; }
.sub-list summary { cursor: pointer; color: var(--select); font-size: 13px; }
.names { margin: 6px 0 0; padding-left: 18px; }
.names li { padding: 2px 0; }
.names.ki { list-style: none; padding: 0; columns: 2 220px; column-gap: 16px; }
.names.ki li { break-inside: avoid; display: flex; gap: 7px; align-items: baseline; }
.ki-dot { width: 7px; height: 7px; border-radius: 1px; background: var(--gold); transform: rotate(45deg); flex: none; }

/* ---------- item help window ---------- */

.help-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 4, 12, 0.55);
}

.help { width: min(380px, 100%); margin: 0; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.help-src summary { cursor: pointer; color: var(--select); font-size: 14px; font-weight: 700; padding: 4px 0; }
.src-body { display: grid; gap: 10px; padding-top: 4px; }
.src-group { display: grid; gap: 4px; }
.src-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); }
.src-line { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; font-size: 14px; border-bottom: 1px solid rgba(174, 182, 208, 0.1); padding-bottom: 3px; }
.src-main { min-width: 0; overflow-wrap: anywhere; }
.src-right { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; color: #dfe4f2; }
.src-right .pill { font-size: 10px; padding: 0 6px; }
.help-body { padding: 14px 14px 12px; display: grid; gap: 8px; }
.help-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.help-head { display: flex; gap: 12px; align-items: center; padding-right: 22px; }
.help-head .icon { width: 40px; height: 40px; }
.help-name { font-weight: 700; font-size: 16px; }
.help-tags { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 0.05em; }
.help-sub { color: #dfe4f2; font-size: 14px; }
.help-il { color: var(--select); }
.help-desc { font-size: 14px; display: grid; gap: 1px; }
.help-aug { display: grid; gap: 1px; font-size: 14px; color: #b9f3c8; }
.help-aug-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.help-aug-rank { color: var(--gold); }
.aug-mark { margin-left: 6px; color: #b9f3c8; font-size: 12px; }
.help-id { font-size: 12px; color: var(--muted); border-top: 1px solid rgba(174, 182, 208, 0.2); padding-top: 6px; font-family: ui-monospace, Consolas, monospace; }

.item-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }

/* ---------- market ---------- */

.seg { display: inline-flex; margin-top: 10px; border: 1px solid var(--frame); border-radius: 6px; overflow: hidden; }
.seg a { padding: 5px 14px; color: var(--muted); font-size: 13px; }
.seg a.active { background: rgba(159, 212, 255, 0.18); color: var(--text); }

.chart-wrap { margin: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2; }
.chart-dot { fill: var(--text); }

/* ---------- Vana'diel ---------- */

.clock { text-align: center; display: grid; gap: 4px; justify-items: center; }
.clock-time { font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; }
.clock-day { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.day-strip { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.day-chip { font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: 0.45; }
.day-chip.today { opacity: 1; background: rgba(255, 255, 255, 0.08); }

.el-fire { color: var(--fire); } .el-earth { color: var(--earth); } .el-water { color: var(--water); } .el-wind { color: var(--wind); }
.el-ice { color: var(--ice); } .el-lightning { color: var(--lightning); } .el-light { color: var(--light); } .el-dark { color: var(--dark); }
.el-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; display: inline-block; }

.moon-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.moon { width: 64px; height: 64px; flex: none; }
.moon-dark { fill: #1c2240; stroke: #4c5680; stroke-width: 2; }
.moon-lit { fill: #f6f1d8; filter: drop-shadow(0 0 4px rgba(255, 250, 220, 0.6)); }

.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; font-weight: 700; white-space: nowrap; }
.pill.open { color: var(--green); }
.pill.closed { color: var(--muted); }
.pill.warn { color: var(--gold); }

.di-state { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.di-countdown, .di-wave, .di-boss_pending, .di-boss { color: var(--fire); }
.di-idle { color: var(--select); }

/* ---------- notification bell + inbox ---------- */

.bell { position: relative; display: grid; place-items: center; width: 30px; height: 30px; color: var(--text); }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; filter: drop-shadow(1px 1px 0 #000); }
.bell-count {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e0473a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  text-shadow: none;
  box-shadow: 0 0 0 2px #1a2140;
}

.inbox { display: grid; gap: 4px; }
.inbox-item { border-radius: 6px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(174, 182, 208, 0.18); }
.inbox-item.open { border-color: rgba(159, 212, 255, 0.5); }
.inbox-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "kind time" "title title" "preview preview";
  gap: 2px 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.inbox-row.unread .inbox-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #e0473a; vertical-align: middle; }
.inbox-kind { grid-area: kind; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.inbox-time { grid-area: time; font-size: 12px; color: var(--muted); }
.inbox-title { grid-area: title; font-weight: 700; }
.inbox-preview { grid-area: preview; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item.open .inbox-preview { display: none; }
.inbox-full { padding: 0 10px 10px; font-size: 14px; }
.inbox-full p { margin: 4px 0; overflow-wrap: anywhere; }
.k-sales { color: var(--gold); } .k-mail { color: var(--select); } .k-di { color: var(--fire); }
.k-security { color: var(--red); } .k-gm { color: var(--green); } .k-other { color: var(--muted); }

textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 5px;
  border: 1px solid #6c7698;
  background: rgba(5, 8, 22, 0.75);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-shadow: none;
  resize: vertical;
}

/* ---------- Items: Bags / Online Storage ---------- */

.wide-seg { display: flex; width: 100%; margin: 0 0 12px; }
.wide-seg button { flex: 1; padding: 8px; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.wide-seg button.active { background: rgba(159, 212, 255, 0.18); color: var(--text); }
.construction { text-align: center; padding: 10px 6px 4px; }
.construction-sign { font-size: 42px; line-height: 1; margin-bottom: 6px; }
.construction h3 { color: var(--gold); }

/* ---------- who's online ---------- */

.server-status { display: flex; align-items: center; gap: 14px; }
.status-light { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.status-light.up { background: var(--green); box-shadow: 0 0 12px var(--green); }
.status-light.down { background: var(--red); box-shadow: 0 0 12px var(--red); }
.anon { font-style: italic; font-weight: 400; }

/* ---------- crafting ---------- */

.skills-req { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(174, 182, 208, 0.5); }
.chip.ok { color: var(--green); border-color: currentColor; }
.chip.short { color: var(--red); border-color: currentColor; }
.hq { margin-top: 6px; }

/* ---------- character line-up ---------- */

.lineup {
  position: relative;
  margin: -12px -12px 12px;
  background: #0b1024 center 60% / cover no-repeat; /* image set from app.js with the asset key */
  border-bottom: 1px solid var(--frame);
}

.lineup-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.lineup-stage { position: relative; height: min(56vh, 460px); min-width: 100%; }
.lineup-canvas { display: block; height: 100%; cursor: pointer; }
.lineup-labels { position: absolute; inset: 0; pointer-events: none; }
.lineup-label {
  position: absolute;
  transform: translate(-50%, 16px);
  display: grid;
  justify-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background: linear-gradient(var(--win-top), var(--win-bottom));
  border: 1px solid var(--frame);
  color: var(--text);
  white-space: nowrap;
  pointer-events: auto;
  font-size: 12px;
}
.lineup-label strong { font-size: 14px; }
.lineup-label span { color: var(--gold); font-weight: 700; font-size: 11px; }
.lineup-label .dot { position: absolute; top: 5px; right: -4px; width: 8px; height: 8px; }

@media (max-width: 380px) {
  .equip-grid { grid-template-columns: repeat(4, 50px); }
  .equip-slot { width: 50px; height: 50px; }
  .clock-time { font-size: 40px; }
}

/* ---------- legal ---------- */
.legal-note { margin: 18px 6px 0; font-size: 11px; line-height: 1.4; color: var(--muted); text-align: center; text-shadow: none; }
.legal-note a { white-space: nowrap; }

/* ---------- GM app bans ---------- */
.ban-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(174, 182, 208, 0.18); }
.ban-row:last-child { border-bottom: 0; }
.ban-row .btn { margin-top: 0; }
.sub-head { margin-top: 14px; }

/* ---------- linkshells ---------- */
.ls-head { display: flex; gap: 12px; align-items: center; }
.ls-pearl { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset -4px -5px 8px rgba(0, 0, 0, 0.45), inset 3px 3px 6px rgba(255, 255, 255, 0.6), 0 0 8px rgba(255, 255, 255, 0.2); }
.ls-name { font-weight: 700; font-size: 18px; }
.ls-msg { border-left: 3px solid var(--gold); padding: 6px 10px; background: rgba(0, 0, 0, 0.18); font-size: 14px; display: grid; gap: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- world: events, conquest, weather ---------- */
.event { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid rgba(174, 182, 208, 0.12); }
.event:last-child { border-bottom: 0; }
.event-title { font-weight: 700; display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.event-body { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nation { font-weight: 700; }
.nation-0 { color: #ff8a8a; }
.nation-1 { color: #8ab8ff; }
.nation-2 { color: #9cf09c; }
.nation-3 { color: #d6a3ff; }
.nation-5, .nation-4 { color: var(--muted); }
.inf-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.08); margin-top: 3px; }
.inf-bar span:nth-child(1) { background: #ff8a8a; }
.inf-bar span:nth-child(2) { background: #8ab8ff; }
.inf-bar span:nth-child(3) { background: #9cf09c; }
.wx { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.wx-el-Fire { color: #ff8a6a; } .wx-el-Water { color: #6ab4ff; } .wx-el-Earth { color: #e0c070; }
.wx-el-Wind { color: #7be38f; } .wx-el-Ice { color: #9fe8ff; } .wx-el-Thunder { color: #d79bff; }
.wx-el-Light { color: #fff2a8; } .wx-el-Dark { color: #a59bc0; }

/* ---------- online storage ---------- */
.vault-row { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid rgba(174, 182, 208, 0.12); padding: 2px 0; }
.vault-row:last-child { border-bottom: 0; }
.vault-item { flex: 1; min-width: 0; }
.vault-item .item-row { width: 100%; border-bottom: 0; }
.vault-reason { padding: 0 0 4px 44px; }
.vault-state { text-align: right; }
.vault-row > .btn { flex: none; }
.vault-notice { color: var(--green); font-weight: 700; }
