/* ============================================================
   St.Georgener Pokerrunde — modern design system
   Poker felt + gold, dark glassmorphism
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
  --felt-900: #0a1f17;
  --felt-800: #0d2a1d;
  --felt-700: #114030;
  --felt-600: #165340;
  --gold: #e9c46a;
  --gold-soft: #f4e0a8;
  --gold-deep: #c79b3b;
  --ink: #ecf3ee;
  --muted: #9db4a6;
  --danger: #e06c75;
  --success: #5fc88f;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(233, 196, 106, 0.18);
  --glass-blur: blur(14px);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.65);
  --shadow-gold: 0 8px 30px -8px rgba(233, 196, 106, 0.35);
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(22, 83, 64, 0.55), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, rgba(233, 196, 106, 0.10), transparent 55%),
    linear-gradient(160deg, var(--felt-900), #06140e 70%);
  background-attachment: fixed;
}

h1, h2, h3, .display { font-family: 'Sora', 'Inter', sans-serif; letter-spacing: -0.02em; }

a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-soft); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(8, 22, 16, 0.72);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--card-border);
}
.brand { display: flex; align-items: center; gap: .7rem; font-family: 'Sora'; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand .chip {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.1rem;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold-deep));
  color: #2a1d05; box-shadow: var(--shadow-gold);
  border: 2px dashed rgba(255,255,255,.55);
}
.brand small { display: block; font-family: 'Inter'; font-weight: 500; font-size: .72rem; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a.navlink {
  padding: .5rem .9rem; border-radius: 999px; color: var(--muted);
  font-weight: 600; font-size: .92rem; transition: all .18s;
}
.nav a.navlink:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.nav a.navlink.active { color: #20140a; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); box-shadow: var(--shadow-gold); }

.authbox { display: flex; align-items: center; gap: .6rem; }

/* ---------- Layout container ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2rem) 5rem; }
.page-head { margin: .5rem 0 1.8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.page-head .sub { color: var(--muted); font-size: .95rem; margin-top: .25rem; }

/* ---------- Cards ---------- */
.card-glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Event card */
.event-card { padding: 1.3rem 1.4rem; transition: transform .2s, border-color .2s; position: relative; overflow: hidden; }
.event-card::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background: linear-gradient(var(--gold), var(--gold-deep)); }
.event-card:hover { transform: translateY(-3px); border-color: rgba(233,196,106,.45); }
.event-card .when { font-family:'Sora'; font-weight:700; font-size:1.25rem; }
.event-card .where { color: var(--gold); font-weight:600; }
.event-card .players { color: var(--muted); font-size:.9rem; margin:.6rem 0; }

.badge-count { display:inline-flex; align-items:center; gap:.35rem; padding:.2rem .6rem; border-radius:999px; background:rgba(233,196,106,.14); color:var(--gold-soft); font-size:.8rem; font-weight:600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .92rem; font-family: inherit; transition: all .18s;
  text-decoration: none; line-height: 1;
}
.btn-gold { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #241a06; box-shadow: var(--shadow-gold); }
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); color:#241a06; }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--ink); border-color: rgba(255,255,255,.14); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.btn-danger { background: rgba(224,108,117,.16); color: var(--danger); border-color: rgba(224,108,117,.35); }
.btn-danger:hover { background: rgba(224,108,117,.28); color:#fff; }
.btn-sm { padding: .4rem .8rem; font-size: .82rem; }
.btn-icon { padding: .4rem; width: 34px; height: 34px; justify-content: center; border-radius: 50%; }

/* ---------- Tables / lists ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--gold); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; padding: .7rem .9rem; border-bottom: 1px solid var(--card-border); }
.tbl td { padding: .75rem .9rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.035); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-1 td:first-child, .rank-1 .rank-pill { color: var(--gold); font-weight: 800; }
.rank-pill { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.06); font-weight:700; font-variant-numeric: tabular-nums; }
.rank-1 .rank-pill { background: linear-gradient(180deg,var(--gold-soft),var(--gold)); color:#241a06; }
.rank-2 .rank-pill { background: linear-gradient(180deg,#e8edf0,#aab6bd); color:#22282b; }
.rank-3 .rank-pill { background: linear-gradient(180deg,#e6b98c,#b97f4e); color:#2a1a0c; }

/* ---------- Tabs (years) ---------- */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.tab-btn { padding: .45rem 1rem; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: var(--muted); font-weight: 700; cursor: pointer; transition: all .18s; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #241a06; border-color: transparent; box-shadow: var(--shadow-gold); }
.tab-panel { display: none; animation: fade .25s ease; }
.tab-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; font-weight: 600; }
.input, select.input {
  width: 100%; padding: .65rem .85rem; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.14); color: var(--ink);
  font-family: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus, select.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233,196,106,.18); }
select.input option { background: var(--felt-800); }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(4,12,8,.7); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 100; padding: 1rem; }
.modal-back.open { display: grid; }
.modal { width: min(460px, 100%); padding: 1.6rem; animation: pop .2s ease; }
@keyframes pop { from { opacity:0; transform: scale(.96) translateY(8px);} to {opacity:1; transform:none;} }
.modal h3 { margin: 0 0 1.2rem; }
.modal .close { float: right; cursor: pointer; color: var(--muted); background: none; border: none; font-size: 1.3rem; }

/* ---------- Misc ---------- */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); padding: .8rem 1.3rem; border-radius: 999px; background: rgba(0,0,0,.8); border: 1px solid var(--card-border); color: var(--ink); z-index: 200; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty .big { font-size: 3rem; opacity: .5; }
.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 2rem 1rem 1rem; border-top: 1px solid rgba(255,255,255,.06); margin-top: 2rem; }
.hero { text-align: center; padding: clamp(2rem, 8vw, 5rem) 1rem; }
.hero .ring { width: 110px; height: 110px; margin: 0 auto 1.5rem; border-radius: 50%; display:grid; place-items:center; font-size:3rem; background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold-deep)); color:#2a1d05; box-shadow: var(--shadow-gold); border: 3px dashed rgba(255,255,255,.5); }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.hero p { color: var(--muted); max-width: 460px; margin: .5rem auto 0; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flash { padding: .8rem 1.1rem; border-radius: var(--radius-sm); background: rgba(224,108,117,.14); border: 1px solid rgba(224,108,117,.3); color: #f3b6bb; margin-bottom: 1.2rem; }
.row-actions { display: inline-flex; gap: .35rem; }
.pill-link { color: var(--muted); cursor: pointer; }
.pill-link:hover { color: var(--gold); }

@media (max-width: 640px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(8,22,16,.97); padding: .8rem; border-bottom: 1px solid var(--card-border); }
  .nav.open { display: flex; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }

/* ============================================================
   Statistik-Seite
   ============================================================ */
.sec-title { font-family: 'Sora', sans-serif; font-size: 1.15rem; color: var(--gold); margin: 2rem 0 .9rem; }
.sec-title:first-of-type { margin-top: 1rem; }

/* KPI row */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: .6rem; }
.kpi { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); backdrop-filter: var(--glass-blur); padding: 1.2rem 1rem; text-align: center; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold-soft), var(--gold-deep)); opacity: .8; }
.kpi-num { font-family: 'Sora', sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-top: .4rem; }

/* Podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: end; max-width: 680px; margin: 0 auto 1rem; }
.podium-spot { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 1rem .8rem; text-align: center; backdrop-filter: var(--glass-blur); }
.podium-spot.place-1 { border-color: rgba(233,196,106,.5); box-shadow: var(--shadow-gold); padding-bottom: 2.2rem; transform: translateY(-10px); }
.podium-spot.place-2 { padding-bottom: 1.4rem; }
.podium-medal { font-size: 2.2rem; line-height: 1; }
.podium-name { font-weight: 700; margin-top: .4rem; }
.podium-pts { font-family: 'Sora', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--gold); margin-top: .2rem; }
.podium-pts span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.podium-bar { margin-top: .3rem; color: var(--muted); font-size: .76rem; }

/* Record cards */
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.record-card { display: flex; gap: .9rem; align-items: center; padding: 1.1rem; }
.record-icon { font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.record-title { color: var(--gold); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; }
.record-name { font-weight: 700; font-size: 1.05rem; margin: .15rem 0; }
.record-value { color: var(--gold-soft); font-weight: 700; font-size: .92rem; }
.record-sub { color: var(--muted); font-size: .78rem; }

/* Leaderboard bars */
.stats-tbl .lb-name { font-weight: 600; }
.stats-tbl .lb-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.06); margin-top: .35rem; overflow: hidden; max-width: 320px; }
.stats-tbl .lb-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); }

/* Year champions */
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.champ-card { text-align: center; padding: 1.1rem .8rem; position: relative; }
.champ-year { font-family: 'Sora', sans-serif; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.champ-crown { font-size: 1.7rem; margin: .2rem 0; }
.champ-name { font-weight: 700; font-size: 1.05rem; color: var(--gold); }
.champ-pts { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

/* ---------- Passwort anzeigen/verbergen ---------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 2.6rem; }
.pw-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: .3rem;
  font-size: 1.05rem; line-height: 1; color: var(--muted); border-radius: var(--radius-sm);
}
.pw-toggle:hover { background: rgba(255,255,255,.08); }

/* ---------- Logo (Pik-Ass-Bild, freigestellt – ohne Unterlage) ---------- */
.brand .brand-logo {
  height: 42px; width: auto; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)) drop-shadow(0 0 4px rgba(244,224,168,.3));
}
.hero .hero-logo {
  display: inline-grid; place-items: center; margin: 0 auto 1.5rem;
}
.hero .hero-logo img {
  width: clamp(120px, 30vw, 170px); height: auto; display: block;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.55)) drop-shadow(0 0 10px rgba(244,224,168,.35));
}
