/* === F1 TIPPSPIEL — FORMULA 1 INSPIRED DESIGN ========================= */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Titillium+Web:ital,wght@0,300;0,400;0,600;0,700;0,900;1,400;1,700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------------ */
/*  DESIGN TOKENS                                                       */
/* ------------------------------------------------------------------ */
:root {
  /* Backgrounds — dark navy like F1 site */
  --bg-0: #15151e;
  --bg-1: #1e1e2d;
  --bg-2: #26263a;
  --bg-3: #2e2e44;

  /* Borders */
  --line:   rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.16);

  /* Text */
  --ink-0: #ffffff;
  --ink-1: #e8e8f0;
  --ink-2: #9999bb;
  --ink-3: #55556e;

  /* Brand */
  --accent:      #e10600;
  --accent-deep: #b00500;
  --accent-glow: rgba(225, 6, 0, 0.35);

  /* Status */
  --warn: #ffd000;
  --good: #00d2be;   /* F1 teal */
  --bad:  #e10600;

  /* Fonts */
  --font-display: "Bebas Neue", "Arial Narrow", Arial, sans-serif;
  --font-ui:      "Titillium Web", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Misc */
  --shadow-1:  0 2px 8px rgba(0,0,0,0.5);
  --shadow-2:  0 8px 32px rgba(0,0,0,0.6);
  --transition: 0.14s ease;
}

/* ------------------------------------------------------------------ */
/*  RESET + BASE                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  overflow-x: hidden;
  font-family: var(--font-ui);
  background: var(--bg-0);
  color: var(--ink-0);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Subtle red ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 500px at 100% 0%,   rgba(225,6,0,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 700px 400px at 0%   100%, rgba(225,6,0,0.04) 0%, transparent 70%);
}

/* ------------------------------------------------------------------ */
/*  TYPOGRAPHY                                                          */
/* ------------------------------------------------------------------ */

/* Display — Bebas Neue, condensed, all-caps */
.h-display {
  font-family: var(--font-display);
  font-weight: 400;       /* Bebas Neue has one weight */
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

/* Monospace */
.h-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Small eyebrow / label */
.h-tag {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.muted { color: var(--ink-2); }
.faded { color: var(--ink-3); }
.tnum  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/*  SCROLLBAR                                                           */
/* ------------------------------------------------------------------ */
::-webkit-scrollbar          { width: 6px; height: 6px; }
::-webkit-scrollbar-track    { background: var(--bg-0); }
::-webkit-scrollbar-thumb    { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ------------------------------------------------------------------ */
/*  LAYOUT HELPERS                                                      */
/* ------------------------------------------------------------------ */
.row    { display: flex; align-items: center; gap: 12px; }
.col    { display: flex; flex-direction: column; gap: 12px; }
.grid   { display: grid; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.two-col-cards { display: grid; gap: 16px; }
@media (min-width: 761px) {
  .two-col-cards { grid-template-columns: 1fr 1fr; }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}
@media (min-width: 761px) {
  .container { padding: 24px 32px; }
}

/* ------------------------------------------------------------------ */
/*  APP SHELL                                                           */
/* ------------------------------------------------------------------ */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* AppBar — wie formula1.com: dunkel, sauber, roter Top-Stripe */
.appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 21, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* Roter 3px Stripe ganz oben */
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

/* Nav tabs */
.tabbar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 14px 20px 13px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-0); }
.tab.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* BottomNav — always hidden, nav is in AppBar */
.bottom-nav { display: none !important; }

/* ------------------------------------------------------------------ */
/*  CARDS — wie formula1.com: abgerundet, kein linker Stripe           */
/* ------------------------------------------------------------------ */
.card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

/* Nur explizit angefordert: roter Top-Stripe */
.card.accent-top::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}

.card.no-accent { /* Alias, bleibt kompatibel */ }

/* Textures */
.carbon {
  background-image:
    repeating-linear-gradient( 45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 4px);
}
.speedlines {
  background-image: repeating-linear-gradient(
    -20deg, transparent 0 8px,
    rgba(255,255,255,0.025) 8px 9px,
    transparent 9px 18px
  );
}

/* Bevel alias — no visual change needed */
.bevel { }

/* Top red strip (placed inside cards with position:absolute) */
.top-strip {
  height: 3px;
  background: var(--accent);
  position: absolute;
  top: 0; left: 0; right: 0;
}
.top-strip-grad {
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 70%, transparent 100%);
  position: absolute;
  top: 0; left: 0; right: 0;
}

/* ------------------------------------------------------------------ */
/*  SECTION HEADER — wie formula1.com "FEATURED VIDEO" style           */
/* ------------------------------------------------------------------ */
.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 36px 0 16px;
  gap: 16px;
}
.section-h h2 {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.03em;
  color: var(--ink-0);
  text-transform: uppercase;
  line-height: 1;
  flex: 1;
}

/* ------------------------------------------------------------------ */
/*  BUTTONS                                                             */
/* ------------------------------------------------------------------ */
.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 20px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--ink-1);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  background: var(--bg-3);
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Primary — solid red */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: #ff1a0c;
  border-color: #ff1a0c;
  color: #fff;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  background: transparent;
}

/* ------------------------------------------------------------------ */
/*  STATUS CHIPS                                                        */
/* ------------------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-good {
  color: var(--good);
  border-color: rgba(0,210,190,0.35);
  background: rgba(0,210,190,0.07);
}
.chip-warn {
  color: var(--warn);
  border-color: rgba(255,208,0,0.35);
  background: rgba(255,208,0,0.06);
}
.chip-bad {
  color: var(--bad);
  border-color: rgba(225,6,0,0.35);
  background: rgba(225,6,0,0.07);
}
.chip-cyan {
  color: var(--good);
  border-color: rgba(0,210,190,0.35);
  background: rgba(0,210,190,0.07);
}
.chip-red {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ------------------------------------------------------------------ */
/*  PULSE DOT                                                           */
/* ------------------------------------------------------------------ */
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0   currentColor; }
  60%  { box-shadow: 0 0 0 6px transparent;  }
  100% { box-shadow: 0 0 0 0   transparent;  }
}

/* ------------------------------------------------------------------ */
/*  INPUTS                                                              */
/* ------------------------------------------------------------------ */
.input, select.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink-0);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--ink-3); }

/* ------------------------------------------------------------------ */
/*  DRIVER / TEAM PICKS                                                 */
/* ------------------------------------------------------------------ */
.pick {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
  color: var(--ink-0);
  font-family: var(--font-ui);
  overflow: hidden;
}
.pick:hover:not(:disabled) {
  background: var(--bg-2);
  border-left-color: var(--ink-2);
}
.pick.selected {
  border-left-color: var(--accent);
  border-left-width: 4px;
  background: rgba(225,6,0,0.08);
}
.pick:disabled { opacity: 0.4; cursor: not-allowed; }
.pick .num {
  font-family: var(--font-display);
  font-size: 26px;
  width: 34px;
  text-align: center;
  color: var(--ink-3);
  line-height: 1;
}
.pick.selected .num { color: var(--accent); }

/* ------------------------------------------------------------------ */
/*  AVATAR                                                              */
/* ------------------------------------------------------------------ */
.avatar {
  width: 32px; height: 32px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/*  RACE ROW                                                            */
/* ------------------------------------------------------------------ */
.race-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: transparent;
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.race-row:hover { background: rgba(255,255,255,0.04); }
.race-row .rn {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  color: var(--ink-3);
  text-align: center;
}

/* ------------------------------------------------------------------ */
/*  LEADERBOARD ROW                                                     */
/* ------------------------------------------------------------------ */
.lb-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background var(--transition);
}
.lb-row.you {
  background: rgba(225,6,0,0.07);
}
.lb-row .rk {
  font-family: var(--font-display);
  font-size: 26px;
  text-align: center;
  color: var(--ink-3);
  line-height: 1;
}
.lb-row .rk.top1 { color: var(--accent); }

/* ------------------------------------------------------------------ */
/*  COUNTDOWN                                                           */
/* ------------------------------------------------------------------ */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.countdown .box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 16px 8px 12px;
  text-align: center;
}
.countdown .num {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: var(--ink-0);
  letter-spacing: 0.02em;
}
.countdown .lbl {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ------------------------------------------------------------------ */
/*  DECORATORS                                                          */
/* ------------------------------------------------------------------ */
.dot    { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.swatch { width: 4px; align-self: stretch; flex-shrink: 0; }

/* Lock overlay */
.locked {
  position: relative;
  pointer-events: none;
  opacity: 0.5;
}
.locked::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,200,50,0.05) 0 10px,
    transparent 10px 20px
  );
  pointer-events: none;
}
.lock-tape {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,200,50,0.08) 0 12px,
    rgba(0,0,0,0.18) 12px 24px
  );
}

/* Loading shimmer */
.shimmer { position: relative; overflow: hidden; }
.shimmer::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  animation: shimmerAnim 1.8s linear infinite;
}
@keyframes shimmerAnim {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ------------------------------------------------------------------ */
/*  RESPONSIVE                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .container    { padding-left: 14px; padding-right: 14px; }
  .tab          { padding: 12px 14px; font-size: 10px; }
  .mobile-only .tab { flex: 1; text-align: center; padding: 12px 6px; }
  .countdown .num { font-size: 36px; }
  /* iOS Safari zoomt bei Input-Fokus wenn font-size < 16px */
  .input, select.input { font-size: 16px; }
}

@media (min-width: 761px) {
  .mobile-only { display: none !important; }
  .appbar-logo { height: 52px; width: auto; }
}
@media (max-width: 760px) {
  .appbar-logo { height: 36px; width: auto; }
}
