/* Vellocet Panel — status-board console styling */

:root {
  --ink:      #131922;
  --panel:    #1A222E;
  --raised:   #212C3A;
  --line:     #2C3A4B;
  --text:     #DCE4EF;
  --dim:      #8695A9;
  --faint:    #5C6B7F;
  --mint:     #57D3B6;
  --amber:    #E9A63C;
  --rose:     #E36A78;
  --iris:     #9A8DEB;
  --radius:   3px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 15px/1.5 "IBM Plex Sans", system-ui, sans-serif;
}

a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.mono, td.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- chrome ---------- */

.topbar {
  display: flex;
  align-items: baseline;
  gap: 28px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.brand span { color: var(--amber); }

.topnav { display: flex; gap: 4px; margin-right: auto; }

.topnav a {
  padding: 5px 12px;
  border-radius: var(--radius);
  color: var(--dim);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.topnav a.on { background: var(--raised); color: var(--amber); }

.clock { color: var(--faint); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 28px 80px; }

/* ---------- headings ---------- */

.pagehead {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow {
  color: var(--faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- readout strip (the fleet summary) ---------- */

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
}

.readout div {
  flex: 1 1 130px;
  padding: 12px 16px;
  background: var(--panel);
}

.readout b {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.readout small {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.v-mint  b { color: var(--mint); }
.v-amber b { color: var(--amber); }
.v-rose  b { color: var(--rose); }
.v-iris  b { color: var(--iris); }

/* ---------- tables ---------- */

.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.board th {
  padding: 9px 14px;
  text-align: left;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.board td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.board tbody tr:last-child td { border-bottom: 0; }
.board tbody tr:hover { background: #1E2836; }

.name { font-weight: 500; }
.sub { display: block; color: var(--faint); font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.empty p { margin: 0 0 14px; }

/* ---------- signature: heartbeat pulse ---------- */

.pulse {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: 1px;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
}

.st-online  .pulse { background: var(--mint); color: var(--mint); }
.st-stale   .pulse { background: var(--amber); color: var(--amber); }
.st-offline .pulse { background: var(--rose); color: var(--rose); }
.st-unknown .pulse { background: var(--faint); color: var(--faint); }

.st-online .pulse::after { animation: ping 2.4s ease-out infinite; }

@keyframes ping {
  0%   { opacity: 0.9; transform: scale(0.6); }
  70%  { opacity: 0;   transform: scale(1.5); }
  100% { opacity: 0; }
}

.state-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.st-online  .state-label { color: var(--mint); }
.st-stale   .state-label { color: var(--amber); }
.st-offline .state-label { color: var(--rose); }
.st-unknown .state-label { color: var(--faint); }

/* ---------- meters (population, rot, token life) ---------- */

.meter {
  position: relative;
  width: 108px;
  height: 6px;
  background: #101720;
  border-radius: 99px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--iris);
}

.meter.rot i { background: linear-gradient(90deg, #6E7F55, var(--amber)); }
.meter.life i { background: var(--mint); }
.meter.life.low i { background: var(--amber); }
.meter.life.out i { background: var(--rose); }

.meterrow { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--text);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }

.btn.primary { background: var(--amber); border-color: var(--amber); color: #17202B; font-weight: 600; }
.btn.primary:hover { background: #F3B85A; border-color: #F3B85A; }
.btn.danger { color: var(--rose); }
.btn.danger:hover { border-color: var(--rose); }
.btn.small { padding: 4px 9px; font-size: 13px; }

.btnrow { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

form.inline { display: inline; }

/* ---------- forms ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px 20px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }

.field label {
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.filters input,
.filters select {
  padding: 8px 10px;
  background: #101720;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: 14px/1.4 "IBM Plex Mono", monospace;
}

.field input:focus,
.field textarea:focus { border-color: var(--amber); outline: none; }

.field textarea { resize: vertical; min-height: 76px; }

.hint { color: var(--faint); font-size: 12px; }

.formfoot {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.formfoot .spacer { margin-left: auto; }

/* ---------- filters ---------- */

.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.filters input { min-width: 250px; }

.tabs { display: flex; gap: 2px; }
.tabs a {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dim);
  font-size: 13px;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  letter-spacing: 0.05em;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--raised); color: var(--amber); border-color: var(--faint); }

/* ---------- flashes ---------- */

.flash {
  padding: 11px 15px;
  border-left: 3px solid var(--mint);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 14px;
  font-size: 14px;
}
.flash.error { border-left-color: var(--rose); }

/* ---------- pager ---------- */

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  color: var(--faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

/* ---------- login ---------- */

.gate {
  max-width: 380px;
  margin: 15vh auto;
  padding: 0 20px;
}
.gate .card { margin-top: 18px; }
.gate .btn { width: 100%; text-align: center; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .wrap, .topbar { padding-left: 16px; padding-right: 16px; }
  .board thead { display: none; }
  .board, .board tbody, .board tr, .board td { display: block; width: 100%; }
  .board tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .board td { border: 0; padding: 5px 14px; }
  .board td.right { text-align: left; }
  .board td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--faint);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-online .pulse::after { animation: none; opacity: 0.5; }
  * { transition: none !important; }
}

/* ---------- added for players, addresses and workers ---------- */

.sectionhead {
  margin: 32px 0 12px;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--raised);
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.tag.amber { color: var(--amber); border-color: #57431C; }
.tag.rose  { color: var(--rose);  border-color: #5A2A31; }

.tokenreveal {
  padding: 18px 20px;
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
}
.tokenreveal code {
  display: block;
  margin-top: 8px;
  padding: 11px 13px;
  background: #101720;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--amber);
  font-size: 14px;
  word-break: break-all;
}

.field select {
  padding: 8px 10px;
  background: #101720;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: 14px/1.4 "IBM Plex Mono", monospace;
}
.field select:focus { border-color: var(--amber); outline: none; }

label.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
label.check input { width: 15px; height: 15px; accent-color: var(--amber); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); }

td .sub a { color: var(--dim); }
