/* HelmsDeep dashboard - mobile first, dark */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Bold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0e1316; --card: #172025; --inner: #22303a; --line: #26343b; --line2: #2e404b; --field: #34454f;
  --text: #e9eff1; --muted: #9aabb2; --accent: #5cb3f0; --accent-ink: #0e1316; --link: #7cc4f5;
  --green: #3fb950; --green-text: #56d364; --yellow: #e3b341; --red: #f0625a; --red-text: #ff7b72;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.4; }
a { color: var(--link); }
h1, h2 { font-family: var(--display); margin: 0; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xsmall { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.big { font-size: 20px; letter-spacing: 0.04em; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.warn { color: var(--yellow); }
.pad8 { padding: 8px 0; margin: 0; }
.ring-text-green { color: var(--green-text); }
.ring-text-yellow { color: var(--yellow); }
.ring-text-red { color: var(--red-text); }

/* layout */
.page { max-width: 560px; margin: 0 auto; padding: 8px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 68px; padding: 12px 16px; max-width: 560px; margin: 0 auto; background: var(--bg); }
.top-title { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.iconbtn-sm { background: var(--card); border-color: var(--field); }
.iconbtn.copied { border-color: var(--green); color: var(--green-text); }
.iconbtn-spacer { width: 44px; flex: 0 0 44px; }

/* menu drawer, slides from the right */
.scrim { position: fixed; inset: 0; background: rgba(4, 6, 8, 0.72); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 86vw); z-index: 30; background: var(--card);
  border-left: 1px solid var(--line); border-radius: 24px 0 0 24px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; }
.drawer-close { display: flex; justify-content: flex-end; }
.drawer-me { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-name { font-family: var(--display); font-size: 20px; font-weight: 700; }
.navlink { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: 14px; color: var(--text);
  text-decoration: none; font-size: 16px; font-weight: 600; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.navlink.active { background: var(--inner); }
.navlink-danger { color: var(--red-text); }

/* cards */
[data-live] { display: flex; flex-direction: column; gap: 20px; }
#res-detail > .guest:first-child { border-top: 0; padding-top: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-title { font-size: 17px; font-weight: 700; }
.card-link { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; color: var(--text); padding: 14px 16px; }
.card-link > svg { color: var(--muted); flex: 0 0 auto; }
.card-list { padding: 6px 16px; gap: 0; }
.inner { background: var(--inner); border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid2 form { display: contents; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; min-height: 44px; }
.kv:last-child { border-bottom: 0; }
.section-h { font-size: 18px; margin: 10px 4px 0; }
.page-h { font-size: 24px; margin: 4px 4px 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.name-lg { font-family: var(--display); font-size: 21px; font-weight: 700; }
.name-md { font-size: 17px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--inner); color: var(--muted); vertical-align: middle; }
.tag-game { color: var(--text); }
.tag-admin { color: var(--yellow); }

/* rings */
.ring { width: var(--s); height: var(--s); flex: 0 0 var(--s); border-radius: 50%; border: var(--b, 3px) solid var(--red);
  padding: var(--b, 3px); display: inline-flex; }
.ring img, .ring .ini { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ring .ini { display: flex; align-items: center; justify-content: center; font-weight: 600; font-family: var(--display); color: var(--text); }
.ring .ini-generic { background: #34424a; color: var(--muted); }
.ring-green { border-color: var(--green); }
.ring-yellow { border-color: var(--yellow); }
.ring-red { border-color: var(--red); }

/* server cards */
.srv-head { display: flex; gap: 16px; align-items: flex-start; }
.srv-meta { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }
.srv-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.srv-title h2 { font-size: 19px; }
.st { font-size: 14px; font-weight: 600; }
.st-on { color: var(--green-text); }
.st-off { color: var(--red-text); }
.inner-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px 12px;
  font-size: 14px; text-align: left; cursor: pointer; color: var(--text); }
.inner-btn:disabled { color: var(--muted); cursor: default; }
.inner-btn svg { transition: transform 0.15s; flex: 0 0 auto; }
.inner-btn.open svg { transform: rotate(180deg); }
.plist { padding: 4px 12px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); color: var(--text); text-decoration: none; }
.prow:last-child { border-bottom: 0; }
.prow-text { display: flex; flex-direction: column; min-width: 0; }
.prow-name { font-size: 15px; font-weight: 600; }
.prow-sub { font-size: 12px; color: var(--muted); }
.card > .prow { border-bottom-color: var(--line); }
.more { font-size: 14px; text-decoration: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; }
.orow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.orow:last-child { border-bottom: 0; }

/* resources */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-row { display: flex; justify-content: space-between; font-size: 14px; }
.bar { height: 8px; border-radius: 4px; background: var(--card); overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; background: var(--accent); }
.bar-thin { height: 6px; border-radius: 3px; background: var(--line); }
.bar-thin > div { border-radius: 3px; }
.guest { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.guest-head { display: flex; align-items: center; gap: 10px; }
.mini { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* hero on game and user pages */
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; text-align: center; }
.hero h1 { font-size: 28px; margin-top: 4px; }

/* forms and buttons */
.form { gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=password], select { height: 48px; border-radius: 12px; background: var(--bg); border: 1px solid var(--field);
  padding: 0 14px; font-size: 16px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { min-height: 48px; border-radius: 14px; background: var(--inner); border: 1px solid var(--field); color: var(--text); font-size: 15px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; padding: 0 16px; width: 100%; }
.btn:disabled { background: #1b2429; border-color: var(--line); color: #6d7d85; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { color: var(--red-text); border-color: var(--red); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: var(--accent-ink); font-weight: 700; }
.btn-ctl { min-height: 56px; }
.btn-big { min-height: 52px; font-size: 16px; }
.btn-inline { width: auto; flex: 0 0 auto; }
.filebtn { position: relative; }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; font-weight: 600; min-height: 44px; padding: 0 12px; }
.linkbtn-danger { color: var(--red-text); }
.copyrow { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; }
.copyrow .grow { display: flex; flex-direction: column; }
.names { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.names legend { padding: 0; margin-bottom: 4px; }
.names + .names { border-top: 1px solid var(--line); padding-top: 10px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.alert { margin: 0; padding: 10px 12px; border-radius: 12px; background: #3a1f1f; border: 1px solid var(--red); color: #ffd7d3; font-size: 14px; }
.notice { margin: 0; padding: 10px 12px; border-radius: 12px; background: #1c2f24; border: 1px solid var(--green); color: #d5f5dc; font-size: 14px; }

/* login and set password */
.center-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 24px 0; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand h1 { font-size: 28px; }
.brand p { margin: 0; }
.brand-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--link);
  display: flex; align-items: center; justify-content: center; }
.intro { padding: 0 4px; }
.intro h1 { font-size: 26px; }
.intro p { margin: 8px 0 0; line-height: 1.5; }
.center-link { text-align: center; }

.dialog { margin-top: 24vh; }
.dialog-title { font-size: 22px; }
