/*
Theme Name: FC Baden Matchcenter
Theme URI: https://example.invalid/fc-baden-matchcenter
Author: OpenAI
Description: Mobile-first Onepage für FC Baden 1897 mit serverseitig gespeicherten Matchcenter-Daten, Tabelle, Saisonspielen und Torschützenrangliste.
Version: 1.0.10
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: fc-baden-matchcenter
*/

:root {
  --fcb-red: #d90429;
  --fcb-red-dark: #a6001f;
  --fcb-black: #111217;
  --fcb-ink: #191b22;
  --fcb-muted: #6f7380;
  --fcb-line: #e8e9ee;
  --fcb-soft: #f5f6f8;
  --fcb-white: #ffffff;
  --fcb-success: #14804a;
  --fcb-radius: 18px;
  --fcb-shadow: 0 18px 50px rgba(16, 20, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fcb-ink);
  background: #f0f1f4;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.fcb-shell { min-height: 100vh; }
.fcb-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% -20%, rgba(255,255,255,.16), transparent 36%),
    linear-gradient(140deg, #111217 0%, #201318 54%, #8b001a 100%);
  color: var(--fcb-white);
  padding: 24px 18px 34px;
}
.fcb-hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -150px auto;
  width: 300px;
  height: 300px;
  border: 56px solid rgba(255,255,255,.055);
  border-radius: 50%;
  pointer-events: none;
}
.fcb-wrap { width: min(1160px, 100%); margin: 0 auto; }
.fcb-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.fcb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fcb-mark {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 14px;
  background: var(--fcb-red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
}
.fcb-brand-copy { min-width: 0; }
.fcb-brand-copy strong { display: block; font-size: 15px; line-height: 1.1; }
.fcb-brand-copy span { display: block; margin-top: 4px; color: rgba(255,255,255,.64); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fcb-refresh {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: .2s ease;
}
.fcb-refresh:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.fcb-refresh:disabled { opacity: .65; cursor: wait; transform: none; }
.fcb-refresh svg { width: 17px; height: 17px; }
.fcb-refresh.is-loading svg { animation: fcb-spin .8s linear infinite; }
@keyframes fcb-spin { to { transform: rotate(360deg); } }

.fcb-hero-copy { position: relative; z-index: 2; padding-top: 48px; }
.fcb-kicker { margin: 0 0 10px; color: #ff9aaa; font-weight: 900; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.fcb-title { margin: 0; max-width: 760px; font-size: clamp(34px, 8vw, 68px); line-height: .98; letter-spacing: -.045em; }
.fcb-subtitle { margin: 16px 0 0; max-width: 660px; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.55; }
.fcb-updated { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: rgba(255,255,255,.62); font-size: 12px; }
.fcb-dot { width: 8px; height: 8px; border-radius: 50%; background: #58d68d; box-shadow: 0 0 0 5px rgba(88,214,141,.12); }

.fcb-main { width: min(1160px, calc(100% - 24px)); margin: -16px auto 0; position: relative; z-index: 3; padding-bottom: 54px; }
.fcb-grid { display: grid; gap: 16px; }
.fcb-card {
  background: var(--fcb-white);
  border: 1px solid rgba(17,18,23,.055);
  border-radius: var(--fcb-radius);
  box-shadow: var(--fcb-shadow);
  overflow: hidden;
}
.fcb-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 18px 15px; }
.fcb-card-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.fcb-card-head p { margin: 5px 0 0; color: var(--fcb-muted); font-size: 12px; }
.fcb-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--fcb-soft); color: var(--fcb-muted); font-size: 11px; font-weight: 800; white-space: nowrap; }

.fcb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.fcb-stat { padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(16,20,31,.06); }
.fcb-stat span { display: block; color: var(--fcb-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.fcb-stat strong { display: block; margin-top: 5px; font-size: 25px; letter-spacing: -.04em; }

.fcb-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fcb-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.fcb-table th { padding: 11px 9px; border-top: 1px solid var(--fcb-line); border-bottom: 1px solid var(--fcb-line); color: var(--fcb-muted); background: #fafafd; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: center; }
.fcb-table th:nth-child(2) { text-align: left; }
.fcb-table td { padding: 12px 9px; border-bottom: 1px solid var(--fcb-line); text-align: center; font-size: 13px; }
.fcb-table tr:last-child td { border-bottom: 0; }
.fcb-table .fcb-team-cell { text-align: left; min-width: 190px; }
.fcb-team-button { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font-weight: 800; text-align: left; }
.fcb-team-button:hover { color: var(--fcb-red); }
.fcb-team-dot { width: 9px; height: 9px; border-radius: 50%; background: #d8d9df; }
.fcb-baden-row td { background: #fff4f6; font-weight: 800; }
.fcb-baden-row .fcb-team-dot { background: var(--fcb-red); box-shadow: 0 0 0 4px rgba(217,4,41,.10); }
.fcb-rank { color: var(--fcb-muted); font-weight: 900; }
.fcb-points { font-weight: 900; font-size: 14px !important; }

.fcb-scorer-list { list-style: none; padding: 0 18px 18px; margin: 0; }
.fcb-scorer { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--fcb-line); }
.fcb-scorer-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--fcb-soft); color: var(--fcb-muted); font-size: 11px; font-weight: 900; }
.fcb-scorer-name { min-width: 0; }
.fcb-scorer-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fcb-scorer-name span { display: block; margin-top: 2px; color: var(--fcb-muted); font-size: 11px; }
.fcb-goals { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 950; font-size: 22px; letter-spacing: -.04em; color: var(--fcb-red); }
.fcb-goals small { color: var(--fcb-muted); font-size: 10px; font-weight: 800; letter-spacing: 0; }

.fcb-empty { padding: 30px 18px; color: var(--fcb-muted); text-align: center; }
.fcb-empty strong { display: block; color: var(--fcb-ink); margin-bottom: 6px; }
.fcb-message { display: none; position: fixed; left: 50%; bottom: 20px; z-index: 10000; transform: translateX(-50%); max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 12px; color: #fff; background: var(--fcb-black); box-shadow: 0 18px 50px rgba(0,0,0,.22); font-size: 13px; font-weight: 700; }
.fcb-message.is-visible { display: block; }
.fcb-message.is-error { background: #8d1027; }

.fcb-footer { padding: 6px 18px 26px; text-align: center; color: var(--fcb-muted); font-size: 11px; line-height: 1.5; }
.fcb-footer a { text-decoration: underline; text-underline-offset: 2px; }

.fcb-drawer-backdrop { position: fixed; inset: 0; z-index: 9990; background: rgba(10,11,14,.52); opacity: 0; visibility: hidden; transition: .22s ease; }
.fcb-drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9995; max-height: min(88vh, 820px); border-radius: 24px 24px 0 0; background: #fff; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 60px rgba(0,0,0,.18); overflow: hidden; }
body.fcb-drawer-open { overflow: hidden; }
body.fcb-drawer-open .fcb-drawer-backdrop { opacity: 1; visibility: visible; }
body.fcb-drawer-open .fcb-drawer { transform: translateY(0); }
.fcb-drawer-handle { width: 42px; height: 5px; border-radius: 999px; background: #d9dae0; margin: 9px auto 0; }
.fcb-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 13px; border-bottom: 1px solid var(--fcb-line); }
.fcb-drawer-head h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.fcb-close { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--fcb-soft); cursor: pointer; font-size: 22px; line-height: 1; }
.fcb-drawer-body { overflow-y: auto; max-height: calc(min(88vh, 820px) - 74px); padding: 0 18px 28px; }
.fcb-match-section-title { position: sticky; top: 0; z-index: 2; margin: 0 -18px; padding: 15px 18px 9px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); color: var(--fcb-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 900; }
.fcb-match { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--fcb-line); }
.fcb-match:first-of-type { border-top: 0; }
.fcb-match-date { color: var(--fcb-muted); font-size: 10px; line-height: 1.35; font-weight: 800; }
.fcb-match-teams { min-width: 0; }
.fcb-match-teams span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fcb-match-teams span + span { margin-top: 3px; }
.fcb-match-teams .is-selected { font-weight: 900; }
.fcb-score { min-width: 48px; text-align: right; font-size: 16px; font-weight: 950; letter-spacing: -.03em; }
.fcb-score.is-open { color: var(--fcb-muted); font-size: 13px; }
.fcb-detail-link { display: block; margin-top: 4px; color: var(--fcb-red); font-size: 9px; font-weight: 900; text-decoration: none; text-transform: uppercase; letter-spacing: .06em; }

@media (min-width: 760px) {
  .fcb-hero { padding: 30px 28px 52px; }
  .fcb-main { width: min(1160px, calc(100% - 48px)); margin-top: -24px; }
  .fcb-card-head { padding: 26px 26px 18px; }
  .fcb-table th, .fcb-table td { padding-left: 14px; padding-right: 14px; }
  .fcb-scorer-list { padding-left: 26px; padding-right: 26px; padding-bottom: 26px; }
  .fcb-bottom-grid { grid-template-columns: 1fr 1fr; }
  .fcb-drawer { left: 50%; right: auto; width: min(720px, calc(100vw - 48px)); transform: translate(-50%, 105%); border-radius: 24px 24px 0 0; }
  body.fcb-drawer-open .fcb-drawer { transform: translate(-50%, 0); }
}

@media (max-width: 620px) {
  .fcb-brand-copy span { max-width: 145px; }
  .fcb-refresh .fcb-refresh-label { display: none; }
  .fcb-refresh { width: 44px; padding: 0; }
  .fcb-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .fcb-stat { padding: 13px 11px; }
  .fcb-stat strong { font-size: 21px; }
  .fcb-table { min-width: 470px; }
  .fcb-table .fcb-col-detail { display: none; }
  .fcb-table .fcb-team-cell { min-width: 178px; }
}
