/* Layout and small helpers on top of NES.css (nes.min.css, built from
   jockofcode/NES.css-1). Components — containers, buttons, inputs, tables —
   come from NES.css classes in the views; this file only covers what it
   doesn't. NES.css is a light theme, so the page is light-only. */

@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/press-start-2p-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #212529;
  --muted: #6b6b6b;
  --surface: #f2f2f2;
}

html, body, pre, code, kbd, samp {
  font-family: "Press Start 2P", ui-monospace, monospace;
}

html { font-size: 14px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 16px;
  border-bottom: 4px solid var(--fg);
}

.brand {
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}

header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
}

header nav a { color: var(--fg); }

main {
  max-width: 560px;
  margin: 2rem auto;
  padding: 0 16px;
}

main.wide { max-width: 960px; }

.nes-container { margin-bottom: 2rem; }
.nes-container > :last-child { margin-bottom: 0; }

h1, h2 { line-height: 1.5; }
h1 { font-size: 1.2rem; margin-top: 0; }
h2 { font-size: 1rem; }
.nes-container.with-title > .title { font-size: 1rem; }

.muted { color: var(--muted); font-size: 0.8rem; }

.nes-field { margin-bottom: 1.25rem; }
.nes-field > label, .field-label { display: block; font-size: 0.8rem; margin: 0 0 0.4rem; }
.nes-field > label:has(.nes-checkbox) { margin: 0; }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* A destructive action rendered as text, used inside lists and tables. */
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

form.inline { display: inline; margin: 0; }

.error {
  border: 4px solid #e76e55;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 4px;
  background: var(--fg);
}

ul.plain { list-style: none; padding: 0; margin: 0 0 1.5rem; }
ul.plain li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 2px dashed var(--fg);
  font-size: 0.85rem;
}
ul.plain li:last-child { border-bottom: none; }

.nes-container form { margin-bottom: 1.5rem; }
.nes-container form:last-child { margin-bottom: 0; }

.nes-table-responsive { margin-bottom: 1.5rem; }
/* NES.css fixes column widths; auto sizes them to their content. */
.nes-table { width: 100%; table-layout: auto; font-size: 0.75rem; }
/* Keep emails and timestamps whole; .nes-table-responsive scrolls instead. */
.nes-table th, .nes-table td { white-space: nowrap; }
.nes-table td.wrap { white-space: normal; min-width: 10rem; overflow-wrap: anywhere; }

code, .secret {
  font-size: 0.8rem;
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  word-break: break-all;
}

code.secret {
  display: block;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1.25rem;
}

.qr {
  background: #fff;
  padding: 1rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.scope-list { margin: 0.5rem 0 1.5rem; }
