/* Layout: single centered column on a night-sea ground; cards for forms and tables. Single dark theme matching the game. */
:root {
  --abyss: #051c25;
  --sea: #0b3a4a;
  --panel: #0c2e3a;
  --line: #1d4b5a;
  --paper: #f1ead6;
  --muted: #9fb7bd;
  --brass: #e8b04a;
  --brass-ink: #1a1405;
  --signal: #c8372d;
  --ok: #6fc28a;
  --font-display: "Black Ops One", Impact, "Arial Black", sans-serif;
  --font-body: "Chakra Petch", "Trebuchet MS", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--abyss); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse 120% 60% at 50% 0%, var(--sea) 0%, var(--abyss) 70%) fixed, var(--abyss);
  color: var(--paper); font: 500 16px/1.55 var(--font-body);
}
a { color: var(--brass); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; background: rgba(255,255,255,.07); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 6vw, 2.4rem); letter-spacing: .02em; }
h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4em; }
h3 { font-size: 1rem; font-weight: 700; margin-top: 1.2em; }
.card > h2:first-child { margin-top: 0; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { color: var(--brass); text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; margin-bottom: .4em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { border-bottom: 1px solid var(--line); background: rgba(5,28,37,.7); }
.top-inner, .wrap, .foot-inner {
  max-width: 920px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 12px; }
.brand { font-family: var(--font-display); color: var(--paper); text-decoration: none; font-size: 1.3rem; letter-spacing: .03em; }
.brand span { color: var(--brass); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-weight: 700; font-size: .95rem; }
.nav a { color: var(--paper); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"], .nav a:hover { border-color: var(--brass); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkbtn:hover { color: var(--paper); }

/* main */
.wrap { flex: 1; width: 100%; padding-block: 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: clamp(18px, 4vw, 28px); min-width: 0; }
.narrow { max-width: 440px; width: 100%; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }

/* hero on start page */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-block: 8px 12px; border-bottom: 2px solid var(--brass); }
.hero > div { min-width: 0; flex: 1 1 280px; }
.display { font-size: clamp(2.2rem, 9vw, 3.4rem); margin: 0 0 .2em; }

/* login */
.login { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 4vh; }
.login-hero { color: #6c7d41; width: 120px; filter: drop-shadow(14px 18px 0 rgba(0,0,0,.35)); animation: bob 4s ease-in-out infinite; }
.plane { width: 100%; height: auto; display: block; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .login-hero { animation: none; } }

/* forms */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 700; font-size: .9rem; margin-top: 8px; }
.form input[type=text], .form input[type=password], .form input:not([type]) {
  width: 100%; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--abyss); color: var(--paper); font: 500 1rem var(--font-body);
}
.form input:focus { border-color: var(--brass); outline: none; }
.form .btn { margin-top: 16px; }
.form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.form-row .field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 180px; min-width: 0; }
.form-row .field label { margin-top: 0; }
.form-row .btn { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--brass); }

.btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--brass); color: var(--brass-ink); border: 0; border-radius: 6px;
  padding: 12px 22px; font: 1.05rem var(--font-display); letter-spacing: .04em;
  box-shadow: 0 3px 0 #9b7120;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #9b7120; }
.btn-big { font-size: 1.35rem; padding: 16px 30px; }
.btn-sm { background: transparent; color: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 5px 10px; font: 700 .8rem var(--font-body); cursor: pointer; }
.btn-sm:hover { border-color: var(--paper); }
.btn-danger { color: #ff9c92; border-color: rgba(200,55,45,.6); }
.btn-danger:hover { border-color: #ff9c92; }

/* flash */
.flash { border-radius: 6px; padding: 12px 14px; border-left: 4px solid; background: rgba(255,255,255,.05); }
.flash-ok { border-color: var(--ok); }
.flash-err { border-color: var(--signal); background: rgba(200,55,45,.12); }
.secret { font-size: 1.05em; background: var(--paper); color: var(--abyss); padding: .15em .5em; user-select: all; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid rgba(29,75,90,.6); vertical-align: middle; }
.num { text-align: right; }
.board tr.me td { color: var(--brass); font-weight: 700; }
.board tbody tr:first-child td:nth-child(2)::after { content: " ★"; color: var(--brass); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill-admin { border-color: var(--brass); color: var(--brass); }
.runs { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.runs li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(29,75,90,.6); }
.runs li span:first-child { color: var(--muted); }

/* legal text */
.prose { max-width: 70ch; margin: 0 auto; width: 100%; }
.prose .lead { font-size: 1.05rem; }
.prose address { font-style: normal; }

/* footer */
.foot { border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.foot-inner { padding-block: 16px 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot p { margin: 0; max-width: 60ch; }
.foot a { color: var(--paper); }

.btn-sm { white-space: nowrap; }
/* user table becomes stacked cards on phones */
@media (max-width: 640px) {
  table.users thead { display: none; }
  table.users, table.users tbody { display: block; }
  table.users tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.users td { border: 0; padding: 0; }
  table.users td:nth-child(3) { font-size: .85rem; }
  table.users td:nth-child(3)::before { content: "Letzter Login: "; }
  table.users td:nth-child(4) { font-size: .85rem; }
  table.users td:nth-child(4)::before { content: "Rekord "; color: var(--muted); }
  table.users td.actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: 6px; }
}
