/* ==========================================================================
   HOCKEY GUARD THEME - LIIRI HOCKEY 2026/2027
   Minimalistic, Clean, Dark Navy with Mint Accent & Fixed App Bottom Tabs
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Hockey Guard Color Scheme */
  --bg: #080b10;
  --bg-gradient: radial-gradient(circle at top, #101a28 0, #080b10 42%);
  --card: #10161f;
  --card2: #141c27;
  --card-glass: rgba(16, 22, 31, 0.95);
  --line: #243044;
  --line-subtle: rgba(36, 48, 68, 0.65);
  
  --text: #f3f7fb;
  --muted: #8fa0b7;
  --accent: #38bdf8; /* Vibrant Ice Blue */
  --accent-bg: rgba(56, 189, 248, 0.12);
  --accent-border: rgba(56, 189, 248, 0.35);
  
  --warn: #f2b84b;
  --warn-bg: rgba(242, 184, 75, 0.1);
  --bad: #ff6b7a;
  --bad-bg: rgba(255, 107, 122, 0.1);
  --blue: #38bdf8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.45 var(--font);
  min-height: 100%;
  min-height: 100dvh;
  padding-bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 84px)); /* Garantiert Raum für feste Bottom-Navigation */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Container */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Topbar - Safe Area for iPhone Notch & Dynamic Island */
.topbar {
  max-width: 760px;
  margin: 0 auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #07130d;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn.ghost {
  background: #0b1119;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}

.btn.ghost:hover {
  border-color: var(--muted);
}

.icon-btn {
  background: #0b1119;
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Card */
.card {
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.95), rgba(14, 20, 29, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Hero / Stats Grid */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.metric-card {
  background: #0b1119;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}

.metric-card span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.metric-card strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.metric-card strong.accent {
  color: var(--accent);
}

/* Section Header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.pill {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pill.good {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.pill.bad {
  color: var(--bad);
  border-color: rgba(255, 107, 122, 0.35);
  background: var(--bad-bg);
}

/* Winner / Loser Strip */
.highlight-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.highlight-box {
  background: #0b1119;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.highlight-box.win {
  border-color: var(--accent-border);
}

.highlight-box.lose {
  border-color: rgba(255, 107, 122, 0.3);
}

.highlight-box b {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Leaderboard List */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leader-row {
  display: grid;
  grid-template-columns: 28px 32px 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: #0b1119;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  transition: all 0.15s ease;
}

.leader-row:hover {
  background: #0e1620;
  border-color: rgba(56, 189, 248, 0.3);
}

.leader-row.rank-1 {
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.08), #0b1119);
}

.rank-num {
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.rank-1 .rank-num {
  color: var(--accent);
}

/* Monochromatic Avatar Pill */
.avatar-pill {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #141d29;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.user-name-box {
  min-width: 0;
}

.user-name-box b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diff-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  color: var(--muted);
}

.diff-tag.up {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.diff-tag.down {
  color: var(--bad);
  border-color: rgba(255, 107, 122, 0.3);
  background: var(--bad-bg);
}

.diff-tag.same {
  color: var(--muted);
  border-color: var(--line-subtle);
  background: rgba(143, 160, 183, 0.08);
}

.points-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-align: right;
}

.points-val small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}

/* Standings Table */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.standings-table th.num, .standings-table td.num {
  text-align: right;
}

.standings-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(36, 48, 68, 0.4);
}

.standings-table tr:last-child td {
  border-bottom: 0;
}

.standings-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

.row-playoff td:first-child {
  border-left: 3px solid var(--accent);
}
.row-playin td:first-child {
  border-left: 3px solid var(--warn);
}
.row-playout td:first-child {
  border-left: 3px solid var(--bad);
}

.team-flex {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.team-flex img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* User Bets List */
.bet-card {
  background: #0b1119;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.bet-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: #0d141e;
  border-bottom: 1px solid var(--line-subtle);
  gap: 8px;
  min-width: 0;
}

.bet-card-head:hover {
  background: #111a26;
}

.bet-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  padding: 10px 12px;
}

.bet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #080c12;
  border: 1px solid rgba(36, 48, 68, 0.5);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 11px;
}

.bet-item.hit-15 {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.bet-item.hit-7 {
  border-color: rgba(108, 169, 255, 0.3);
}

.bet-pts {
  font-weight: 800;
  font-size: 11px;
}

.bet-pts.p15 { color: var(--accent); }
.bet-pts.p7  { color: var(--blue); }
.bet-pts.p3  { color: var(--muted); }
.bet-pts.p0  { color: rgba(143, 160, 183, 0.4); }

/* ==========================================================================
   APP-STYLE ALWAYS VISIBLE FIXED BOTTOM TAB BAR
   ========================================================================== */
.app-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 99999;
  background: rgba(8, 11, 16, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding-top: 6px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) + 6px));
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  touch-action: manipulation;
}

.bottom-tab-container {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.app-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
  border: none;
}

.app-tab-btn .tab-icon {
  font-size: 16px;
  line-height: 1;
}

.app-tab-btn:hover {
  color: var(--text);
}

.app-tab-btn.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
}

.app-tab-btn.active .tab-icon {
  transform: scale(1.1);
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(10px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Mobile Adjustments */
@media (max-width: 560px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .metric-card {
    padding: 8px 6px;
  }
  .metric-card span {
    font-size: 9px;
  }
  .metric-card strong {
    font-size: 14px;
  }
  .highlight-strip {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .leader-row {
    grid-template-columns: 24px 28px 1fr auto auto;
    gap: 8px;
    padding: 8px 10px;
  }
  .avatar-pill {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
}
