@font-face { font-family: 'Arame'; font-weight: 700; src: url(fonts/Arame-Bold.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Gilroy'; font-weight: 400; src: url(fonts/Gilroy-Regular.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Gilroy'; font-weight: 500; src: url(fonts/Gilroy-Medium.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Gilroy'; font-weight: 600; src: url(fonts/Gilroy-Semibold.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Gilroy'; font-weight: 700; src: url(fonts/Gilroy-Bold.woff2) format('woff2'); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #060608;
  --panel: #101015;
  --panel-2: #16161c;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f3f3f5;
  --muted: rgba(243, 243, 245, .68);
  --dim: rgba(243, 243, 245, .5);
  --red: #ff2d4d;
  --red-deep: #c41f3a;
  --red-soft: rgba(255, 45, 77, .14);
  --gold: #ffb21a;
  --gold-soft: rgba(255, 178, 26, .13);
  --ok: #3ddc84;
  --ok-soft: rgba(61, 220, 132, .12);
  --discord: #5865f2;
  --display: 'Arame', 'Arial Narrow', Impact, sans-serif;
  --body: 'Gilroy', 'Segoe UI', system-ui, sans-serif;
  --r: 12px;
  --r-sm: 8px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .button, .nav a, .row-button, .chip { transition: background-color .15s, border-color .15s, color .15s; }
}

/* Anmeldung */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem var(--gutter);
  background: radial-gradient(60rem 30rem at 50% -10%, rgba(255, 45, 77, .2), transparent 70%);
}
.login-card { width: min(100%, 24rem); text-align: center; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 1.5rem; border-radius: 22px; box-shadow: 0 0 60px rgba(255, 45, 77, .35); }
.login h1 { font: 700 2.25rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.login p { margin: .75rem 0 2rem; color: var(--muted); }
.login .button { width: 100%; }
.login-error {
  margin-bottom: 1rem; padding: .75rem 1rem; text-align: left;
  background: var(--red-soft); border: 1px solid rgba(255, 45, 77, .4); border-radius: var(--r-sm);
}

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(6, 6, 8, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 72rem; margin: 0 auto; padding: .625rem var(--gutter);
  display: flex; align-items: center; gap: 1rem 2rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font: 700 1.125rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.nav { display: flex; gap: .25rem; order: 3; width: 100%; margin: 0 -.75rem; }
.nav a {
  padding: .4rem .75rem; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a[aria-current='page'] { color: var(--text); background: var(--red-soft); box-shadow: inset 0 -2px 0 var(--red); }
.account { margin-left: auto; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.account-link { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .2rem .4rem; border-radius: var(--r-sm); }
.account-link:hover { background: var(--panel-2); }
.account-link span { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (min-width: 46rem) {
  .nav { order: 0; width: auto; margin: 0; }
}

/* Seite */
main { max-width: 72rem; margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
h1.title { font: 700 clamp(1.75rem, 5vw, 2.5rem)/1.05 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.lead { color: var(--muted); margin-top: .25rem; }
h2.section { font-size: 1.0625rem; font-weight: 700; margin-bottom: .75rem; }
.count { color: var(--dim); font-weight: 500; margin-left: .35rem; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px; margin-bottom: 1.5rem;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.stat { background: var(--panel); padding: .875rem 1.125rem; }
.stat b { display: block; font: 700 1.875rem/1.1 var(--display); }
.stat span { color: var(--muted); font-size: .9375rem; }

.status {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.125rem; margin-bottom: 1.5rem;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: var(--r);
}
.status.away { border-left-color: var(--gold); }
.status strong { display: block; font-weight: 700; }
.status span { color: var(--muted); }

.columns { display: grid; gap: 1.5rem; }
@media (min-width: 56rem) { .columns { grid-template-columns: 1fr 1fr; } }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .25rem .75rem;
  padding: .75rem 1rem; border-top: 1px solid var(--line); width: 100%; text-align: left;
}
.row:first-child { border-top: 0; }
.row-button:hover { background: var(--panel-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); object-fit: cover; }
.avatar.small { width: 30px; height: 30px; }
.avatar.large { width: 56px; height: 56px; }
.row-main { min-width: 0; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; }
.row-note { grid-column: 2 / -1; color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.row-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.empty { padding: 1.5rem 1rem; color: var(--muted); text-align: center; }
.group-title {
  padding: .5rem 1rem; font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--panel-2); border-top: 1px solid var(--line);
}
.group-title:first-child { border-top: 0; }

.chip {
  display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.away { color: var(--gold); background: var(--gold-soft); }
.chip.warn { color: #ff7a8d; background: var(--red-soft); }
.chip.off { color: var(--dim); border-color: var(--line); }

.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { padding: .4rem .875rem; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; border: 1px solid var(--line); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); background: var(--red-soft); border-color: rgba(255, 45, 77, .5); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.5rem; padding: .5rem 1rem; border-radius: var(--r-sm);
  font-weight: 700; text-decoration: none; background: var(--red-deep); color: #fff; border: 1px solid transparent;
}
.button:hover { background: var(--red); }
.button:disabled { opacity: .55; cursor: wait; }
.button.discord { background: var(--discord); }
.button.discord:hover { background: #4752c4; }
.button.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.button.ghost:hover { background: var(--panel-2); }
.button.tiny { min-height: 2rem; padding: .2rem .625rem; font-size: .875rem; font-weight: 600; }
.icon-button { min-height: 2.25rem; padding: .25rem .625rem; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; font-size: .9375rem; }
.icon-button:hover { background: var(--panel-2); color: var(--text); }

.search {
  width: 100%; margin-bottom: 1rem; padding: .625rem .875rem;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}

/* Dialoge */
dialog {
  margin: auto; width: min(calc(100vw - 2rem), 34rem); max-height: calc(100dvh - 2rem);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 1.25rem;
}
dialog.wide { width: min(calc(100vw - 2rem), 42rem); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dialog-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.dialog-head h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.dialog-head .icon-button { margin-left: auto; align-self: flex-start; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

.field { display: block; margin-bottom: .875rem; }
.field > span { display: block; margin-bottom: .25rem; font-weight: 600; font-size: .9375rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .55rem .75rem;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.field textarea { min-height: 5rem; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 .75rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: -.25rem 0 .875rem; color: var(--muted); }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--red); }
.form-error { margin-top: .5rem; color: #ff7a8d; font-weight: 600; }
.hint { color: var(--dim); font-size: .875rem; margin-top: -.5rem; margin-bottom: .875rem; }

.record-section { margin-top: 1.25rem; }
.record-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.entry { padding: .75rem 0; border-top: 1px solid var(--line); }
.entry-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.entry-meta { color: var(--dim); font-size: .875rem; }
.entry-body { margin-top: .25rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.entry-head .icon-button { margin-left: auto; }
details.add { margin-top: .5rem; }
details.add summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: .25rem 0; }
details.add summary:hover { color: var(--text); }
details.add form { margin-top: .625rem; }

.skeleton { padding: 3rem 1rem; text-align: center; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 100; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 2rem);
  padding: .625rem 1rem; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.toast.bad { border-color: rgba(255, 45, 77, .6); }

@media (max-width: 30rem) {
  .topbar-inner { column-gap: .75rem; }
  .account-link span { display: none; }
  .row { grid-template-columns: auto minmax(0, 1fr); }
  .row-side { grid-column: 2; justify-content: flex-start; }
  .row-note { grid-column: 2; }
}
