/* RESET (licht) */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Source Sans Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background: #0f172a; /* donker blauw/grijs */
  color: #f8fafc;
}

/* LAYOUT */
#app,
#live {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 12px;
}

#screen {
  padding: 12px;           /* ← hier hoort het */
}

/* HEADER / STATUSBAR */
.statusbar,
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #020617;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  opacity: 1;
}

/* Default hub (running / break) */
.statusbar {
  padding: 22px 12px 0px;
}

/* Live hub */
.statusbar--live {
  padding: 10px 12px;
}

/* Finished / message */
.statusbar--finished {
  padding: 12px 12px;
}

.statusbar--live .statusbar-inner {
  align-items: center;
}

.statusbar-inner {
  display: flex;
  align-items: baseline;      /* lijn teksten onderling uit */
  width: 100%;
  justify-content: space-between;
}

.statusbar--center .statusbar-inner {
  align-items: center;
}

#clock,
#period {
  font-size: 14px;   /* exact gelijk aan statusbar */
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

header h1 {
  font-size: 1.4rem;   /* wat je nu ook gebruikt */
  line-height: 1;
}

header #status .period-live {
  margin-right: 0.40em;
}

#status {
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.35em;
  opacity: 0.85;
}

.statusbar .time {
  font-weight: 600;
}

@keyframes score-breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.score-breathe {
  animation: score-breathe 550ms ease-in-out;
}

.score {
  font-size: 60px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25em;
  color: #f1f5f9;
}

.score-sep {
  opacity: 0.7;
  font-weight: 400;
}

/* SECTIONS */
h2, h3 {
  margin: 12px 0 8px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.last-events,
.goals-list {
  background: #020617;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  margin-top: 8px;
}

.last-events div,
.goals-list div,
.event {
  font-size: 14px;
  margin: 4px 0;
  opacity: 0.95;
}

.context-center {
  transition: opacity 160ms ease;
}

.context-center.is-transitioning {
  opacity: 0.4;
}

/* GOAL GRID */
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

/* BUTTONS */
button,
a.primary {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

/* BUTTON VARIANTS */
button.primary,
a.primary {
  background: #2563eb;
  color: white;
}

button.secondary {
  background: #334155;
  color: #e5e7eb;
}

button.danger {
  background: #dc2626;
  color: white;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary:disabled {
  background: #334155;           /* zelfde knop */
  color: #64748b;                /* dichter bij achtergrond */
}

/* GOAL BUTTONS */
.goal-grid button {
  background: #1e293b;
  color: #f8fafc;
  border-radius: 14px;
  font-size: 15px;
}

/* LINKS */
a {
  text-decoration: none;
}

/* LIVE BLOG */
#events {
  margin-top: 12px;
}

.event {
  background: #020617;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 14px;
}

/* Periode-blok */
.period {
  margin-bottom: 1.5rem;
}

/* Periode-header */
.period-header {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  opacity: 0.8;
  margin-bottom: 6px;
}

.period-header span.live {
  font-weight: normal;
  font-size: 0.85em;
  opacity: 0.6;
}

/* Algemene eventregel */
.event {
  padding-left: 0.5rem;
  margin: 0.15rem 0;
}

/* Goal voor */
.event-goal {
  color: #f8fafc;
}

/* Tegengoal */
.event-goal-against {
  color: #f8fafc;
}

/* Afsluiter van periode */
.period-end {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.75em;
  opacity: 0.4;
}

@keyframes livePulse {
  0% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  50% {
    opacity: 1.2;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.5;
    transform: scale(0.9);
  }
}

.period-live {
  font-size: 1em;              /* zoals jij al deed */
  color: #FF6A2A;            /* pulse kleur */
  line-height: 1;
  animation: livePulse 2.1s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(255, 106, 42, 0.35);
}

.period-note {
  font-size: 0.85em;
  opacity: 0.55;
  margin: 0.3rem 0 0.6rem;
  padding-left: 0.5rem;
}

.period-status {
  display: flex;
  align-items: center;
  gap: 9px;   /* was 6px */
  font-size: 13px;
  margin-bottom: 18px;
  margin-top: 18px;
}

.period-label {
  font-weight: 600;
  opacity: 0.85;
  font-size: 1.2em;
  color: #f8fafc;
  line-height: 1;
}

.period-status.hidden {
  display: none;
}

.period-live {
  animation: livePulse 2.1s ease-in-out infinite;
  font-size: 1.2em;
  display: flex;          /* 🔑 */
  align-items: center;    /* 🔑 */
  line-height: 1; 
}

/* =========================
   CONTEXT SCORE BUG (v2)
   ========================= */

.context-bug {
  display: grid;
  grid-template-columns: 1fr min-content 1fr;
  align-items: center;

  background: #020617;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* TEAMS */
.context-bug .team {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.team--left {
  text-align: left;
}

.team--right {
  text-align: right;
}

.context-bug .club {
  font-size: 17px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.context-bug .team-name {
  font-size: 12px;
  color: #cbd5e1;
  opacity: 0.85;
  line-height: 1.2;
}

.context-bug .team--left {
  text-align: left;
  justify-self: start;
}

.context-bug .team--right {
  text-align: right;
  justify-self: end;
}

/* MIDDEN */
.context-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 0 8px;
}

.context-primary {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.context-secondary {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.02em;
  margin-top: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

/* LIVE DOT */
.context-live-dot {
  color: #ff6a2a;
  margin-right: 0.35em;
  animation: livePulse 2.1s ease-in-out infinite;
}

/* Mobile safety */
@media (max-width: 360px) {
  .context-bug {
    gap: 8px;
  }

  .context-bug .team-name {
    font-size: 11px;
  }
}

header {
  display: block;       /* ⛔ override flex */
  padding: 0;           /* padding zit nu in .context-bug */
  background: none;     /* context-bug draagt de achtergrond */
}

header#appHeader {
  display: block;
  padding: 0;
  margin: 0 auto;
  min-height: 0;
  height: auto;
  background: none;
  border-radius: 0;
  max-width: 420px;
}

header#appHeader > .context-bug {
  margin-bottom: 12px; /* spacing onder de bug, niet van header */
}

.event {
  padding: 4px 14px;
  margin: 6px 0;
  z-index: 0;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-main {
  flex: 1;
  font-weight: 600;
}

.event-time {
  font-size: 13px;
  opacity: 0.7;
  min-width: 48px;
}

.event-score {
  font-size: 13px;
  font-weight: 600;
  color: #2DE2E6;
  min-width: 36px;
  text-align: right;
  opacity: 0.9;
}

.event-assist {
  font-size: 13px;
  opacity: 0.6;
  margin-left: 56px;
  margin-top: 2px;
}

.event-goal {
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-goal-against {
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-goal-against .event-main {
  font-weight: normal;
  opacity: 0.75;
}

.goal-ball {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-right: 5px;
  transform: translateY(1px);
}

.event-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 33px;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-main {
  flex: 1;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.event-assist {
  font-size: 13px;
  opacity: 0.6;
  margin-left: 52px;
  height: 16px;   /* 🔥 vaste hoogte voor consistentie */
}

.scorer {
  font-weight: 600;
}

.assist-sep {
  margin: 0 6px;
  opacity: 0.4;
}

.assist-name {
  opacity: 0.65;
  font-weight: 400;
}

.event.new-goal {
  animation: goalBorderFade 1700ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes goalBorderFade {
  0% {
    box-shadow: 0 0 0 0 rgba(45,226,230,0);
  }
  30% {
    box-shadow: 0 0 0 1px rgba(45,226,230,0.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45,226,230,0);
  }
}

.match-card {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-card.win {
  border-left: 4px solid #22c55e;
}

.match-card.loss {
  border-left: 4px solid #ef4444;
}

.match-card.draw {
  border-left: 4px solid #64748b;
}

.match-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.team-portal {
  max-width: 720px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.portal-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.portal-header p {
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 28px;
}

/* =========================
   HERO TILE (Team Portal)
   ========================= */

.hero-match {
  position: relative;
  padding: 26px 22px;
  border-radius: 22px;
  margin: 25px 0;

  background:
    radial-gradient(120% 120% at 50% 0%, rgba(45,226,230,0.05), transparent 65%),
    linear-gradient(180deg, #0e1a30 0%, #0b1424 100%);

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 8px 22px rgba(0,0,0,0.35),
    0 0 40px rgba(45,226,230,0.04);
}

/* --- Top status row --- */

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.hero-meta {
  font-size: 13px;
  opacity: 0.6;
}

.hero-live-badge {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Score row --- */

.hero-score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.hero-score-row .team.home {
  text-align: left;
  font-size: 14px;
}

.hero-score-row .team.away {
  text-align: right;
  font-size: 14px;
}

.hero-score {
  font-size: 44px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 7px;
  height: 7px;
  color: #ff6a2a;
  margin-right: 0.35em;
  animation: livePulse 2.1s ease-in-out infinite;
}

.upcoming,
.played {
  margin-top: 40px;
}

.upcoming h2,
.played h2 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 16px;
  position: relative;
}

.upcoming h2 {
  opacity: 0.65;
}

.upcoming h2::after,
.played h2::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.1),
    rgba(255,255,255,0.07)
  );
}

.played .match-block {
  padding-bottom: 14px;
}

.played .match-block + .match-block {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 18px;
}

.match-block {
  margin-bottom: 22px;
}

.match-date {
  font-size: 12px;
  opacity: 0.5;
  margin-bottom: 6px;
}

.match-row {
  display: flex;
  align-items: left;
  justify-content: left;
  gap: 18px;
}

.match-row .team {
  flex: 1;
  text-align: center;
}

.match-row .score,
.match-row .vs {
  min-width: 60px;
  text-align: center;
}

.match-row .team {
  width: 38%;
  font-size: 14px;
}

.match-row .team.home {
  text-align: left;
}

.match-row .team.away {
  text-align: right;
}

.match-row .score,
.match-row .vs {
  text-align: center;
}

.match-row .score {
  width: 24%;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.played-item.win .score {
  text-shadow: 0 0 8px rgba(45,226,230,0.7);
}

.played-item.loss .score {
  opacity: 0.6;
}

.played-item.draw .score {
  opacity: 0.85;
}

.vs {
  opacity: 0.5;
  font-weight: 500;
}