/* AG Games – Liquid Glass (neutral) */
:root {
  --bg: #0a0c11;
  --text: #f2f4f8;
  --muted: #a7b0c0;
  --soft: #c9d1de;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.22);
  --ok: #a8e3c9;
  --ok-bg: rgba(143, 211, 182, 0.14);
  --ok-line: rgba(143, 211, 182, 0.35);
  --bad: #ffb4b4;
  --bad-bg: rgba(255, 120, 120, 0.12);
  --info: #bcd3ff;
  --info-bg: rgba(140, 175, 255, 0.14);
  --radius: 24px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-head: "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--soft); }
a:hover { color: #fff; }
code { font-size: 0.92em; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.08); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.inline { display: inline; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.hidden-form { display: none; }

/* Hintergrund */
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blobs span { position: absolute; border-radius: 50%; }
.blobs .b1 { top: -180px; left: -140px; width: 620px; height: 620px; background: #3b4a6b; filter: blur(140px); opacity: .7; animation: drift1 26s ease-in-out infinite alternate; }
.blobs .b2 { top: 35%; right: -180px; width: 560px; height: 560px; background: #4b5563; filter: blur(150px); opacity: .55; animation: drift2 30s ease-in-out infinite alternate; }
.blobs .b3 { bottom: -160px; left: 25%; width: 640px; height: 520px; background: #2c4a55; filter: blur(160px); opacity: .5; animation: drift3 34s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(120px, 80px); } }
@keyframes drift2 { to { transform: translate(-100px, -60px); } }
@keyframes drift3 { to { transform: translate(-80px, -100px); } }
@media (prefers-reduced-motion: reduce) { .blobs span { animation: none; } html { scroll-behavior: auto; } }

.wrap {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px 40px;
  display: flex; flex-direction: column; gap: 28px;
  min-height: 100vh;
}
.main { display: flex; flex-direction: column; gap: 64px; flex: 1; }

/* Glas */
.glass, .glass-strong {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 20px 50px rgba(0,0,0,0.32);
}
.glass-strong {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.18);
  backdrop-filter: blur(34px) saturate(170%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 30px 70px rgba(0,0,0,0.4);
}

/* Kopfleiste */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 22px;
  position: sticky; top: 12px; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(255,255,255,0.28), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.25);
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
}
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 19px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--soft); font-size: 15px; }
.nav-link.is-active, .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-user { display: inline-flex; align-items: center; gap: 7px; padding: 0 8px; color: var(--soft); font-size: 15px; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 15px;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible, a:focus-visible, input:focus-visible, .switch input:focus-visible + .knob { outline: 2px solid #bcd3ff; outline-offset: 2px; }
.btn-primary { background: #f2f4f8; color: #0a0c11; }
.btn-primary:hover { background: #ffffff; color: #0a0c11; }
.btn-ghost { background: rgba(255,255,255,0.07); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.13); color: #fff; }
.btn-danger { background: var(--bad-bg); border-color: rgba(255,140,140,0.35); color: var(--bad); }
.btn-danger:hover { background: rgba(255,120,120,0.2); color: #ffd0d0; }
.btn-sm { min-height: 44px; padding: 0 16px; border-radius: 14px; }
.btn-xs { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; font-weight: 500; }
.btn-lg { min-height: 52px; padding: 0 24px; border-radius: 16px; font-size: 16px; }
.btn-block { width: 100%; }

/* Startseite */
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding-top: 36px; }
.hero h1 { font-weight: 700; font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.03em; max-width: 900px; }
.lead { max-width: 680px; color: #b4bccb; font-size: clamp(17px, 2.2vw, 19px); }
.lead strong { color: var(--text); font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--line); color: var(--soft); font-size: 14px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8fd3b6; box-shadow: 0 0 10px rgba(143,211,182,0.8); }

.section { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 110px; }
.section-head { display: flex; flex-direction: column; gap: 6px; }
.section-head h2 { font-weight: 600; font-size: clamp(24px, 3.4vw, 30px); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 26px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.card h3 { font-weight: 600; font-size: 22px; margin-top: 4px; }
.card p { font-size: 15px; }
.card .btn { margin-top: auto; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.icon-tile {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(255,255,255,0.22), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.2); color: var(--text);
}
.icon-tile.sm { width: 46px; height: 46px; border-radius: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line-strong); color: #d3d9e4; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.badge-off { background: var(--bad-bg); border-color: rgba(255,140,140,0.35); color: var(--bad); margin-left: 6px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; text-decoration: none; color: var(--text); transition: transform .2s ease, border-color .2s ease; }
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--text); }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tile-name { font-weight: 600; }
.tile-desc { font-size: 14px; color: var(--muted); }
.tile-go { color: var(--muted); }

.info { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 24px; }
.info > div:not(.row) { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.info h3 { font-size: 18px; font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(24px, 4vw, 36px); border-radius: 30px; }
.cta > div { display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.cta h2 { font-weight: 600; font-size: 28px; }
.cta p { color: #c2c9d6; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 8px; color: #8f98a9; font-size: 14px; }
.footer a { color: var(--muted); }

/* Meldungen */
.flash { padding: 14px 18px; border-radius: 16px; font-size: 15px; }
.flash-ok { border-color: var(--ok-line); color: var(--ok); }
.flash-error { border-color: rgba(255,140,140,0.4); color: var(--bad); }
.flash-info { border-color: rgba(140,175,255,0.45); color: var(--info); background: var(--info-bg); user-select: all; }
.alert { padding: 12px 14px; border-radius: 14px; background: var(--bad-bg); border: 1px solid rgba(255,140,140,0.35); color: var(--bad); font-size: 14px; }

/* Formulare */
.auth { width: 100%; max-width: 460px; margin: 40px auto 0; padding: clamp(24px, 4vw, 34px); border-radius: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth h1 { font-size: 30px; font-weight: 700; }
.auth h2 { font-size: 24px; font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.form label { font-size: 14px; font-weight: 500; color: var(--soft); margin-top: 6px; }
.form .btn { margin-top: 14px; }
input[type=text], input[type=password], input[type=search] {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line-strong); color: var(--text);
  font: inherit; font-size: 16px;
}
input::placeholder { color: #8f98a9; }
input:focus { border-color: rgba(188,211,255,0.6); outline: none; }

/* Admin */
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 16px; }
.admin-head h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 700; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { padding: 10px 14px; border-radius: 14px; font-size: 14px; color: var(--soft); }
.stat strong { color: var(--text); font-size: 16px; margin-right: 4px; }
.main:has(.admin-head) { gap: 28px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-radius: 18px; align-self: flex-start; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 13px; text-decoration: none; color: var(--soft); font-weight: 500; font-size: 15px; }
.tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.tab.is-active { background: #f2f4f8; color: #0a0c11; }
.count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: #ffb86b; color: #1a1206; font-size: 12px; font-weight: 700; }

.empty { padding: 28px; border-radius: 22px; text-align: center; color: var(--muted); }

.requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.request { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 24px; }
.request-who { display: flex; align-items: center; gap: 14px; }
.request-who h3 { font-size: 18px; font-weight: 600; }
.request-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.checks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.checks legend { padding: 0; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #f2f4f8; }

.toolbar { display: flex; }
.search { max-width: 340px; }
.table-box { border-radius: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.matrix th, .matrix td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: middle; }
.matrix thead th { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; background: rgba(255,255,255,0.03); }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover { background: rgba(255,255,255,0.03); }
.matrix .c { text-align: center; }
.matrix .r { text-align: right; }
.matrix tbody th { font-weight: 400; }
.matrix tr.is-disabled .acc-name { color: var(--muted); text-decoration: line-through; }
.th-game { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.matrix tbody .th-game { font-weight: 600; color: var(--text); }
.acc-name { font-weight: 600; }
.acc-meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.url a { font-size: 14px; word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.knob { width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.12); border: 1px solid var(--line-strong); position: relative; transition: background .2s ease; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #c9d1de; transition: transform .2s ease, background .2s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.switch input:checked + .sr-only + .knob { background: rgba(143,211,182,0.45); border-color: var(--ok-line); }
.switch input:checked + .sr-only + .knob::after { transform: translateX(20px); background: #ffffff; }

.savebar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 16px; }
#matrix-form.is-dirty .savebar .btn { box-shadow: 0 0 0 4px rgba(242,244,248,0.18), 0 12px 30px rgba(0,0,0,0.5); }

@media (max-width: 640px) {
  .wrap { padding-left: 14px; padding-right: 14px; gap: 22px; }
  .main { gap: 48px; }
  .topbar { top: 8px; padding: 10px; border-radius: 18px; }
  .brand-name { font-size: 17px; }
  .nav { width: 100%; justify-content: flex-end; }
  .nav-user { margin-right: auto; padding-left: 2px; }
  .hero { padding-top: 12px; }
  .cta .btn { width: 100%; }
  .tabs { align-self: stretch; }
  .tab { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .savebar .btn { width: 100%; }
}
