﻿@font-face {
  font-family: "Silkscreen";
  src: url("/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/fonts/VT323-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  --page: #f3efe4;
  --paper: #f7f4ec;
  --card: #fffdf8;
  --ink: #243028;
  --muted: #5c675c;
  --line: #d9d0bc;
  --border: #cfc6b2;
  --gold: #e7c56a;
  --gold-deep: #8f6a2a;
  --gold-soft: #fff8e8;
  --frame: #c4a15a;
  --link: #8a5a12;
  --rule: #e4dcc8;
  --live: #2f7d4a;
  --lagging: #8a5a12;
  --down: #a33b32;
  --gold-ink: #243028;
  --font-title: "Silkscreen", Consolas, monospace;
  --font-body: "Silkscreen", Consolas, monospace;
}
html, body { height: 100%; }
img, a, button { -webkit-user-drag: none; }
input, textarea {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: clamp(18px, 1.15vw, 24px);
  line-height: 1.35;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  background-color: var(--page);
  background-image: url("/brand/meadow.png?v=13");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  overflow: hidden;
}
header, main { position: relative; z-index: 1; }
header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  min-height: 96px;
  box-sizing: border-box;
  background: var(--paper);
  border-bottom: 3px solid var(--line);
}
.brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.logo {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  text-align: left;
}
.logo img {
  display: block;
  height: clamp(48px, 7vh, 84px);
  width: auto;
  max-width: min(100%, 540px);
}
.note { color: var(--muted); margin: 0; font-family: var(--font-body); }
nav { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
nav button, #account-tab, .discord {
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--border);
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: clamp(13px, 1.1vw, 18px);
  line-height: 1.4;
  height: auto;
  white-space: normal;
}
nav button.active, #account-tab.active { border-color: var(--gold-deep); color: var(--gold-deep); background: var(--gold-soft); }
nav button:hover, #account-tab:hover, .discord:hover, .form-tab:hover, .logo:hover, .admin-sub button:hover, .tree-row:hover, .tree-toggle:hover {
  background: var(--gold-soft);
  border-color: var(--gold-deep);
  color: var(--gold-deep);
}
.account-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.discord svg { width: 22px; height: 22px; flex: 0 0 auto; display: block; }
main {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 40px 36px;
  box-sizing: border-box;
}
h2, .action { font-family: var(--font-title); }
h2 { font-size: clamp(16px, 1.4vw, 26px); line-height: 1.4; margin: 0 0 14px; }
p, li, td, th, label, a { overflow-wrap: anywhere; margin-top: 0; }
.panel {
  display: none;
  width: min(1080px, 100%);
  max-height: calc(100vh - 150px);
  overflow: auto;
  border: 3px solid var(--frame);
  padding: 28px 36px;
  background: var(--card);
  box-sizing: border-box;
}
.panel.active { display: block; }
#notes.panel.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#notes-body {
  min-height: 0;
  max-height: min(42vh, 320px);
  margin-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
a { color: var(--link); }
.form-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.form-tab {
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  height: auto;
  white-space: normal;
}
.form-tab.active { border-color: var(--gold-deep); color: var(--gold-deep); background: var(--gold-soft); }
label { display: block; margin: 12px 0 6px; }
input, select {
  width: min(100%, 420px);
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--border);
  font: inherit;
  height: auto;
}
.action {
  margin: 14px 10px 0 0;
  background: var(--gold);
  color: var(--gold-ink);
  border: 3px solid var(--gold-deep);
  padding: 10px 16px;
  cursor: pointer;
  font-size: clamp(13px, 1.1vw, 18px);
  line-height: 1.4;
  height: auto;
  white-space: normal;
}
a.action { display: inline-block; text-decoration: none; color: var(--gold-ink); }
.action:hover, a.action:hover {
  background: var(--gold-deep);
  color: var(--gold-ink);
  border-color: var(--gold-deep);
}
body.admin-open main {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
body.admin-open #admin.panel.active {
  width: 100%;
  max-width: none;
  max-height: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding: 8px 12px 12px;
  font-size: 14px;
}
.admin-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.admin-sub { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.admin-sub button {
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--border);
  padding: 6px 12px;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.4;
  height: auto;
  cursor: pointer;
}
.admin-sub button.active { border-color: var(--gold-deep); background: var(--gold-soft); }
.tree-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  box-sizing: border-box;
}
.tree-row.open { background: var(--paper); }
.tree-toggle {
  flex: 1;
  min-width: 8rem;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  height: auto;
  white-space: nowrap;
}
.tree-value { flex: 0 0 auto; color: var(--muted); }
.env-line {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(10rem, 1fr) 16rem auto;
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
}
.env-name { font-family: var(--font-title); }
.env-now { color: var(--muted); }
#admin select.choice-select {
  width: 16rem;
  max-width: 100%;
  min-height: 2.2rem;
  padding: 6px 8px;
  font-family: Consolas, monospace;
  font-size: 16px;
  line-height: 1.4;
  background: var(--card);
  color: var(--ink);
}
#admin .report { font-size: 15px; }
#admin .report th, #admin .report td { padding: 8px 10px; }
#admin h3 {
  font-family: var(--font-title);
  font-size: 16px;
  line-height: 1.4;
  margin: 16px 0 6px;
}
.swatch { display: flex; gap: 4px; }
.swatch span {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 2px solid var(--border);
}
.not-coded { color: var(--down); white-space: normal; }
.service-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.9fr);
  gap: 16px;
  align-items: start;
}
.service-bucket {
  border: 3px solid var(--line);
  background: var(--paper);
  padding: 12px;
  margin: 0 0 12px;
}
.service-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-family: var(--font-title);
}
.service-row, .add-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px;
  border: 3px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  height: auto;
  cursor: pointer;
  box-sizing: border-box;
}
.service-row.open { border-color: var(--gold-deep); background: var(--gold-soft); }
.add-slot { background: transparent; border-style: dashed; color: var(--muted); }
.service-nest { margin-left: 20px; }
.service-tab label, .service-tab p, .service-tab input, .service-tab select { display: block; width: 100%; margin: 8px 0; white-space: normal; }
.choice-list { margin: 0 0 8px; }
@media (max-width: 800px) {
  .service-layout { grid-template-columns: 1fr; }
}
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 3px solid var(--line);
}
#admin .apply-bar .action {
  margin-top: 6px;
  padding: 6px 12px;
  font-size: 14px;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0;
}
.choice input { width: auto; }
#apply-changes, #apply-tag, #apply-pending, #apply-notice, #apply-message { white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 3px solid var(--rule); vertical-align: top; }
.live { color: var(--live); }
.lagging { color: var(--lagging); }
.down { color: var(--down); }
@media (max-width: 800px) {
  body { overflow: auto; }
  header { grid-template-columns: 1fr; }
  #account-tab, .account-tools { justify-self: start; }
  main { min-height: 60vh; }
  .env-line { grid-template-columns: 1fr; }
}
