/* EHC Fanclub PWA – App Shell Styles */
:root {
  --app-bg: #020a26;
  --app-card: #0a1638;
  --app-soft: #0f1c43;
  --app-border: rgba(255,255,255,.08);
  --app-border-hi: rgba(252,209,22,.45);
  --app-text: #f5f7ff;
  --app-muted: #8e9ab8;
  --app-yellow: #FCD116;
  --app-blue: #2949c0;
  --app-green: #16c784;
  --app-red: #ef4444;
  --app-shadow: 0 18px 50px rgba(0,0,0,.35);
}
html, body.app-body {
  background: var(--app-bg);
  color: var(--app-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}
body.app-body {
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top));
}

/* ==== Top App-Bar ==== */
.app-bar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(2,10,38,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--app-border);
}
.app-bar-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-top)) 18px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.app-bar-logo { width: 34px; height: 42px; }
.app-bar-title { flex: 1; min-width: 0; }
.app-bar-title .name {
  font-family: var(--display, Georgia, serif);
  font-size: 1.05rem; font-weight: 800; line-height: 1; color: #fff;
}
.app-bar-title .sub {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--app-yellow); margin-top: 4px;
}
.app-bar-action {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--app-soft); color: var(--app-text);
  border: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .15s ease;
}
.app-bar-action:hover { transform: scale(1.06); border-color: var(--app-border-hi); }
.app-bar-action svg { width: 18px; height: 18px; }

/* ==== Views (eine Seite, Tab-Switch via Hash) ==== */
.app-view { display: none; padding: 18px 18px 28px; max-width: 640px; margin: 0 auto; }
.app-view.is-active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==== Section Headings ==== */
.app-h {
  font-family: var(--display, Georgia, serif);
  font-size: 1.6rem; font-weight: 800;
  margin: 0 0 4px;
}
.app-h .accent { color: var(--app-yellow); }
.app-sub {
  font-size: .76rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--app-yellow); margin-bottom: 14px;
}

/* ==== Cards ==== */
.app-card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--app-shadow);
}
.app-card.glow {
  background: linear-gradient(160deg, rgba(252,209,22,.06), transparent 60%), var(--app-card);
  border-color: var(--app-border-hi);
}
.app-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.app-card .muted { color: var(--app-muted); font-size: .9rem; }

/* ==== Buttons ==== */
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px;
  background: var(--app-yellow); color: var(--app-bg);
  font-weight: 700; font-size: .92rem;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease;
}
.app-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(252,209,22,.3); }
.app-btn.ghost {
  background: transparent; color: var(--app-text);
  border: 1px solid var(--app-border-hi);
}
.app-btn.full { width: 100%; }
.app-btn.sm { padding: 8px 12px; font-size: .82rem; }
.app-btn.danger { background: var(--app-red); color: #fff; }

/* ==== Live-Score Hero ==== */
.live-hero {
  position: relative;
  background:
    radial-gradient(circle at 80% 0%, rgba(252,209,22,.18), transparent 60%),
    linear-gradient(180deg, var(--app-card), #050b1d);
  border: 1px solid var(--app-border-hi);
  border-radius: 22px; padding: 22px 18px;
  text-align: center; overflow: hidden;
  margin-bottom: 16px;
}
.live-hero .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(239,68,68,.15); color: #ff8a8a;
  padding: 4px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 14px;
}
.live-hero .pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--app-red);
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
.live-hero .pill.upcoming { background: rgba(252,209,22,.18); color: var(--app-yellow); }
.live-hero .pill.upcoming::before { background: var(--app-yellow); animation: none; }
.live-hero .pill.final { background: rgba(22,199,132,.18); color: var(--app-green); }
.live-hero .pill.final::before { background: var(--app-green); animation: none; }

.live-teams {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
  align-items: center; margin: 8px 0 14px;
}
.live-team { text-align: center; }
.live-team .logo {
  width: 64px; height: 64px; margin: 0 auto 8px;
  background: var(--app-soft); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--app-border-hi);
  font-family: var(--display, Georgia, serif); font-weight: 800; color: var(--app-yellow); font-size: 1.4rem;
}
.live-team .name { font-size: .82rem; font-weight: 700; line-height: 1.2; }
.live-team .name small { display:block; color: var(--app-muted); font-weight: 500; font-size: .72rem; margin-top: 2px; }
.live-score {
  font-family: var(--display, Georgia, serif);
  font-size: 2.6rem; font-weight: 900;
  letter-spacing: 2px; color: #fff;
}
.live-score .colon { color: var(--app-yellow); margin: 0 8px; }
.live-meta { color: var(--app-muted); font-size: .82rem; margin-top: 6px; }
.live-meta strong { color: #fff; }

/* ==== Quick-Stats ==== */
.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.app-stat {
  background: var(--app-card); border: 1px solid var(--app-border);
  border-radius: 14px; padding: 12px 8px; text-align: center;
}
.app-stat .num {
  font-family: var(--display, Georgia, serif);
  font-size: 1.4rem; font-weight: 800; color: var(--app-yellow);
  line-height: 1;
}
.app-stat .lbl {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--app-muted); margin-top: 6px;
}

/* ==== Mitgliederausweis ==== */
.member-card {
  position: relative; aspect-ratio: 1.586/1; max-width: 420px; margin: 0 auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(252,209,22,.4), transparent 50%),
    linear-gradient(135deg, #1a2a6e 0%, #0a1638 50%, #050b1d 100%);
  border-radius: 22px; padding: 20px;
  color: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  overflow: hidden; border: 1px solid var(--app-border-hi);
}
.member-card::before {
  content: ""; position: absolute; inset: -50% -50% auto auto;
  width: 220%; height: 60%;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent);
  transform: rotate(-12deg);
  pointer-events: none;
}
.member-card .mc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 2;
}
.member-card .mc-logo { display: flex; align-items: center; gap: 10px; }
.member-card .mc-logo img { width: 32px; height: 40px; }
.member-card .mc-logo span {
  font-family: var(--display, Georgia, serif); font-weight: 800; line-height: 1;
}
.member-card .mc-logo small { display:block; color: var(--app-yellow); font-size:.62rem; letter-spacing: .2em; margin-top: 3px; }
.member-card .mc-tier {
  font-family: var(--display, Georgia, serif);
  font-size: .82rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--app-yellow);
}
.member-card .mc-body { position: absolute; left: 20px; right: 110px; bottom: 18px; z-index: 2; }
.member-card .mc-name { font-family: var(--display, Georgia, serif); font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.member-card .mc-meta { display:flex; gap: 14px; margin-top: 10px; font-size: .68rem; color: rgba(255,255,255,.78); flex-wrap: wrap; }
.member-card .mc-meta span strong { display:block; color: #fff; font-size: .78rem; letter-spacing: .04em; }
.member-card .mc-qr {
  position: absolute; bottom: 18px; right: 20px;
  width: 80px; height: 80px;
  background: #fff; padding: 5px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  z-index: 2;
}
.member-card .mc-qr canvas, .member-card .mc-qr svg, .member-card .mc-qr img {
  width: 100% !important; height: 100% !important; display: block;
}

/* Profilfoto-Avatar auf dem Mitgliederausweis – top-right, oberhalb vom QR */
.member-card .mc-avatar {
  display: none;
  position: absolute; top: 18px; right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  border: 2.5px solid var(--app-yellow);
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
  z-index: 4;
}
/* Wenn Avatar sichtbar ist: Tier-Label nach unten verschieben */
.member-card.has-avatar .mc-tier {
  position: absolute; top: 82px; right: 20px;
  width: 56px; text-align: center;
  font-size: .62rem; letter-spacing: .18em; margin: 0;
}

/* Profilfoto-Vorschau in den Einstellungen */
.avatar-preview {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: 50%;
  background: var(--app-soft);
  border: 2px dashed var(--app-border-hi);
  background-size: cover; background-position: center;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.avatar-preview::before {
  content: ""; width: 36px; height: 36px;
  background: url('/assets/img/logo.png') center/contain no-repeat;
  opacity: .35;
  transition: opacity .2s ease;
}
.avatar-preview.has-photo {
  border-style: solid;
  border-color: var(--app-yellow);
}
.avatar-preview.has-photo::before { display: none; }

.member-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ==== Tipps & MVP-Voting ==== */
.tip-row {
  display: grid; grid-template-columns: 1fr 60px 60px 1fr; align-items: center;
  gap: 8px; padding: 12px 0;
  border-bottom: 1px solid var(--app-border);
}
.tip-row:last-child { border-bottom: none; }
.tip-team { font-size: .9rem; }
.tip-team.away { text-align: right; }
.tip-row input[type="number"] {
  width: 100%; padding: 10px 4px; text-align: center;
  background: var(--app-soft); border: 1px solid var(--app-border-hi);
  border-radius: 10px; color: #fff;
  font-family: var(--display, Georgia, serif);
  font-weight: 800; font-size: 1.15rem;
}
.tip-row input[type="number"]:focus { outline: none; border-color: var(--app-yellow); box-shadow: 0 0 0 3px rgba(252,209,22,.18); }
.tip-row.locked input { opacity: .5; cursor: not-allowed; }
.tip-meta {
  grid-column: 1 / -1;
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--app-muted); margin: -4px 0 0;
  display: flex; justify-content: space-between;
}

.mvp-list { display: grid; gap: 8px; }
.mvp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--app-soft); border: 1px solid var(--app-border);
  cursor: pointer; transition: all .15s ease;
}
.mvp-row:hover { border-color: var(--app-border-hi); }
.mvp-row.selected {
  border-color: var(--app-yellow);
  background: linear-gradient(90deg, rgba(252,209,22,.12), transparent), var(--app-soft);
}
.mvp-row .num { font-family: var(--display, Georgia, serif); font-weight: 800; color: var(--app-yellow); width: 30px; }
.mvp-row .nm  { flex: 1; font-weight: 600; }
.mvp-row .pos { font-size: .72rem; color: var(--app-muted); text-transform: uppercase; letter-spacing: .12em; }

/* ==== Foto-Wall ==== */
.wall-uploader {
  display: flex; gap: 10px; align-items: center;
  padding: 14px;
  background: var(--app-card); border: 1px dashed var(--app-border-hi);
  border-radius: 14px; margin-bottom: 14px;
}
.wall-uploader input { flex: 1; padding: 8px; background: transparent; color: #fff; border: none; outline: none; font-size: .9rem; }
.wall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wall-item {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--app-card); border: 1px solid var(--app-border);
  aspect-ratio: 1; display: flex; flex-direction: column;
}
.wall-item img { width: 100%; height: 100%; object-fit: cover; flex: 1; }
.wall-item .meta {
  padding: 8px 10px; background: rgba(2,10,38,.85);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .76rem;
}
.wall-item .like {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; color: var(--app-muted);
  background: none; border: none; padding: 0;
}
.wall-item .like.liked { color: var(--app-red); }
.wall-item .like svg { width: 14px; height: 14px; }
.wall-empty {
  text-align: center; padding: 30px 16px;
  color: var(--app-muted); font-size: .9rem;
  border: 1px dashed var(--app-border); border-radius: 14px;
}

/* ==== Bottom-Tab-Bar ==== */
.app-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(2,10,38,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--app-border);
  display: flex; justify-content: space-around;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
}
.app-tab {
  flex: 1; max-width: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; border-radius: 12px;
  background: none; border: none; color: var(--app-muted);
  font-size: .68rem; letter-spacing: .04em; cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.app-tab svg { width: 22px; height: 22px; }
.app-tab.is-active { color: var(--app-yellow); background: rgba(252,209,22,.08); }
.app-tab .label { font-weight: 700; }

/* ==== Install-Banner ==== */
.install-banner {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom));
  left: 14px; right: 14px;
  background: linear-gradient(135deg, #1a2a6e, #050b1d);
  border: 1px solid var(--app-border-hi);
  border-radius: 16px; padding: 14px;
  display: flex; gap: 12px; align-items: center;
  z-index: 60;
  box-shadow: 0 22px 50px rgba(0,0,0,.5);
  animation: slideUp .35s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.install-banner .icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  background: var(--app-yellow); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.install-banner .icon svg { width: 22px; height: 22px; color: var(--app-bg); }
.install-banner .text { flex: 1; min-width: 0; }
.install-banner .text strong { display:block; font-size: .9rem; }
.install-banner .text small { color: var(--app-muted); font-size: .76rem; }
.install-banner .actions { display: flex; gap: 6px; }
.install-banner .actions button {
  padding: 8px 12px; border-radius: 10px; border: none;
  font-weight: 700; cursor: pointer; font-size: .78rem;
}
.install-banner .install-yes { background: var(--app-yellow); color: var(--app-bg); }
.install-banner .install-no  { background: transparent; color: var(--app-muted); }

/* ==== Login-Gate ==== */
.gate {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  padding: 30px 20px;
}
.gate-card {
  max-width: 420px; width: 100%;
  background: var(--app-card); border: 1px solid var(--app-border-hi);
  border-radius: 20px; padding: 28px 22px;
  text-align: center;
}
.gate-card h2 { margin: 0 0 6px; font-family: var(--display, Georgia, serif); }
.gate-card p { color: var(--app-muted); font-size: .9rem; margin: 0 0 18px; }
.gate-card input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--app-soft); border: 1px solid var(--app-border);
  color: #fff; font-size: .95rem; margin-bottom: 10px;
  box-sizing: border-box;
}
.gate-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--app-border); }
.gate-tab {
  flex: 1; padding: 10px; cursor: pointer; background: none; border: none;
  color: var(--app-muted); font-weight: 700; font-size: .82rem;
  border-bottom: 2px solid transparent;
}
.gate-tab.is-active { color: var(--app-yellow); border-bottom-color: var(--app-yellow); }

/* ==== Toast ==== */
.toast {
  position: fixed; bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--app-card); color: #fff;
  border: 1px solid var(--app-border-hi); border-radius: 12px;
  padding: 12px 18px; z-index: 70;
  font-size: .9rem;
  box-shadow: var(--app-shadow);
  animation: slideUp .25s ease;
}
.toast.success { border-color: var(--app-green); }
.toast.error { border-color: var(--app-red); }

/* ==== Tor-Animation (Vollbild-Flash) ==== */
.goal-flash {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 200; pointer-events: none;
  background: radial-gradient(circle at center, rgba(2,10,38,.78), rgba(2,10,38,.94));
  opacity: 0; transition: opacity .25s ease;
}
.goal-flash.go { opacity: 1; }
.goal-flash .gf-card {
  text-align: center;
  transform: scale(.5) rotate(-6deg);
  transition: transform .35s cubic-bezier(.19,1.4,.4,.95);
}
.goal-flash.go .gf-card { transform: scale(1) rotate(-2deg); }
.goal-flash .gf-bolt {
  font-size: 6rem; line-height: 1; animation: shake .8s ease infinite;
  filter: drop-shadow(0 0 20px var(--app-yellow));
}
.goal-flash .gf-title {
  font-family: var(--display, Georgia, serif);
  font-size: 3rem; font-weight: 900;
  color: var(--app-yellow); letter-spacing: 4px;
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
  margin-top: 10px;
}
.goal-flash.ehc .gf-title { color: var(--app-yellow); }
.goal-flash:not(.ehc) .gf-title { color: #fff; font-size: 2.2rem; }
.goal-flash .gf-player {
  margin-top: 8px;
  font-size: 1.2rem; font-weight: 700; color: #fff;
}
@keyframes shake {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg) scale(1.05); }
}

/* Helper */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--app-muted); }
.tx-yellow { color: var(--app-yellow); }
.center { text-align: center; }
.hidden { display: none !important; }
