:root {
  --bg: #f6eada;
  --card: #f9f2e9;
  --card2: #fbf7ef;
  --border: #d8d3c8;
  --text: #141414;
  --muted: #5c564c;
  --accent: #c1121f;
  --live: #c1121f;
  --gold: #b45309;
  --glow: rgba(193, 18, 31, 0.28);
}

body.pageHome {
  background-color: #f6eada;
  background-image: none;
  color: var(--text);
}

.homePageShell {
  width: min(100%, 1580px);
  max-width: 1580px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 1180px) {
  .homePageShell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    padding: 0 18px 40px;
    box-sizing: border-box;
    justify-items: stretch;
  }
  .homeMainColumn {
    min-width: 0;
    max-width: none;
  }
  .homePageShell > .homeSideAd,
  .homePageShell > .fbSideAdDesktop {
    display: block !important;
    position: static;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    height: auto !important;
    overflow: visible !important;
    justify-self: end;
  }
  .homeSideAd {
    display: block !important;
    position: static;
    width: 300px;
    max-width: 300px;
  }
  .homeSideAdInner {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .homeSideAdUnit {
    width: 300px;
    max-width: 100%;
    min-height: 250px;
  }
  .homeSideAdUnit .adsbygoogle,
  .homeSideAdUnit iframe {
    display: block;
    width: 300px;
    max-width: 100%;
    min-height: 250px;
  }
}
@media (max-width: 1179px) {
  .homePageShell {
    padding: 0 18px 40px;
  }
}

.hero.lrHero {
  background: #f3ead8 url("https://fotbollsbilagan.se/img/heroback.jpg") center/cover no-repeat;
}
.hero.lrHero::before {
  display: none;
}
.lrHero .heroInner {
  width: min(100%, 1580px);
  max-width: 1580px;
  padding: 22px 18px 0;
  text-align: left;
}
.lrHero .heroPhoto {
  min-height: 0;
}
.lrHero .heroKicker {
  font-size: 11px;
  margin-bottom: 4px;
}
.lrHero .heroTitle {
  margin: 0 0 6px;
  padding-top: 6px;
  font-family: "Abril Fatface", "Times New Roman", Times, Georgia, serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -.03em;
  color: #111;
}
.lrHero .heroSub {
  margin: 0 0 10px;
  max-width: 36em;
  font-size: 16px;
  line-height: 1.35;
  color: #1a1610;
  font-style: italic;
}
.lrHero .heroSelect,
.lrHero .filters {
  margin-top: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}
.lrHero .heroRow {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
}
.lrHero .heroField label {
  font-size: 10px;
}
.lrHero .heroField select {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid #1a1610;
  background: #fbf7ef;
  color: #14110c;
  outline: none;
  font: inherit;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}
.lrHero .heroField select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.lrHero .heroGo {
  display: flex;
  align-items: end;
  gap: 8px;
  grid-column: -1;
}
.lrHero .heroGo button,
.lrHero .fetch-btn {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid #0b0f14;
  background: #0b0f14;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
}
.lrHero .fetch-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.lrHero .fetch-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.lrHero .fetch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lrHero .filter-hint,
.lrHero .heroHint {
  grid-column: 1 / -1;
  margin: 8px 0 12px;
  font-size: 13px;
  color: #5a5146;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.dot.ok { background: #15803d; animation: lrPulse 2s infinite; }
.dot.live { background: var(--live); animation: lrPulse 1s infinite; }
.dot.error { background: var(--live); animation: none; }
@keyframes lrPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}

.grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .full { grid-column: 1 / -1; }
}

.lrGrid > section {
  background: #f9f2e9;
  border: 1px solid #1a1610;
  border-radius: 4px;
  padding: 16px 18px;
}
.lrGrid > section h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -.02em;
  text-transform: none;
  color: #111;
  font-weight: 800;
  margin: 0 0 14px;
}

.section-live-focus {
  border-color: rgba(193, 18, 31, .45);
  background: linear-gradient(180deg, rgba(193, 18, 31, .08) 0%, #f9f2e9 45%);
  box-shadow: none;
}
.section-live-focus h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--live);
  font-size: 22px;
  font-weight: 800;
}
.section-live-focus h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: lrPulse 1s infinite;
  flex-shrink: 0;
}
.section-live-focus .match.live .score { font-size: 2rem; }
.section-live-focus .empty { font-style: italic; }

.section-table .lrTableBlock + .lrTableBlock {
  margin-top: 18px;
}
.section-table .lrTableName {
  margin: 0 0 10px;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.section-table .lrTableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #f6eada;
}
.section-table .lrTableWrap table {
  width: 100%;
  max-width: 100%;
}

.match {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 12px;
  background: transparent;
  transition: border-color .3s, box-shadow .3s, background .2s;
}
.match:last-child { margin-bottom: 0; }
.match.live {
  border-color: var(--live);
  box-shadow: 0 0 0 1px rgba(193, 18, 31, .18);
}
.match.goal-celebration { animation: lrCardGlow 1.1s ease-out; }
@keyframes lrCardGlow {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  40% { box-shadow: 0 0 28px 6px var(--glow); border-color: var(--gold); }
  100% { box-shadow: none; }
}
.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: #efe7d9;
  color: #5c564c;
}
.badge.live { background: var(--live); color: #fff; }
.badge.finished { background: #14532d; color: #d1fae5; }
.badge.upcoming { background: #efe7d9; color: #5c564c; }
.scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}
.team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.away { flex-direction: row-reverse; text-align: right; }
.team img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 5.5rem;
  color: #111;
}
.score-sep { color: var(--muted); font-weight: 500; font-size: 1.2rem; }
.score-part {
  display: inline-block;
  min-width: 1.2ch;
  text-align: center;
}
.score-part.goal-flash { animation: lrGoalPop .9s cubic-bezier(.22, 1, .36, 1); }
@keyframes lrGoalPop {
  0% { transform: scale(1); color: var(--text); filter: none; }
  20% { transform: scale(1.55); color: var(--gold); filter: drop-shadow(0 0 10px var(--gold)); }
  45% { transform: scale(1.25); color: var(--accent); }
  100% { transform: scale(1); color: var(--text); filter: none; }
}
.meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.match.expandable { cursor: pointer; user-select: none; }
.match.expandable:hover { background: rgba(193, 18, 31, .05); }
.section-live-focus .match.expandable:hover { background: rgba(193, 18, 31, .07); }
.match.expandable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.expand-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.match.expandable.expanded .expand-hint { color: var(--text); }
.match-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.match.expandable.expanded .match-details { display: block; }
.events-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.event {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  color: var(--muted);
}
.event-minute {
  color: var(--text);
  font-weight: 700;
  min-width: 2.2rem;
  font-variant-numeric: tabular-nums;
}
.event-icon { flex-shrink: 0; width: 1.1rem; text-align: center; }
.event-body { min-width: 0; }
.event-body strong { color: var(--text); font-weight: 600; }
.event.goal .event-body strong { color: var(--gold); }
.event.card-yellow .event-body strong { color: #ca8a04; }
.event.card-red .event-body strong { color: var(--accent); }
.event-team {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.events-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.events-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 2px;
}
.events-loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(26, 22, 16, .15);
  border-top-color: var(--accent);
  animation: lrSpin .85s linear infinite;
  flex-shrink: 0;
}
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

.data-loading {
  display: flex;
  justify-content: flex-start;
  padding: 4px 0 14px;
}
.loader-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid #1a1610;
  background: #f9f2e9;
}
.loader-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(26, 22, 16, .15);
  border-top-color: var(--accent);
  animation: lrSpin .9s linear infinite;
  flex-shrink: 0;
}
.loader-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.loader-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.loader-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: lrDot 1.1s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: .15s; background: #15803d; }
.loader-dots span:nth-child(3) { animation-delay: .3s; background: rgba(193, 18, 31, .85); }
.loader-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
@keyframes lrSpin { to { transform: rotate(360deg); } }
@keyframes lrDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.lrInlineAd { margin-top: 4px; text-align: center; }
.lrDesktopAdOnly { display: block; }
.lrDesktopAdSlot {
  width: 100%;
  text-align: center;
  line-height: normal;
}
.lrDesktopAdSlot .adsbygoogle {
  display: inline-block !important;
  width: 728px !important;
  height: 90px !important;
  max-width: 100%;
}
.lrMobileAdOnly {
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 14px 0;
}
.lrMobileAdSlot {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
}
.lrMobileAd--banner .adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 320px !important;
  height: 50px !important;
  margin: 0 auto !important;
}
.lrMobileAd--bottom .lrMobileAdSlot { max-width: 100%; }
.lrMobileAd--bottom .adsbygoogle {
  display: block !important;
  width: 100% !important;
  min-height: 50px;
  margin: 0 auto !important;
}

.install-banner {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  background: #f9f2e9;
  border: 1px solid #d8d3c8;
  color: var(--text);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  gap: 10px;
  align-items: center;
}
.install-banner.show { display: flex; }
.install-banner-text {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  min-width: 0;
}
.install-banner-text strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 2px;
}
.install-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.install-btn {
  appearance: none;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #c1121f;
  color: #fff;
}
.install-dismiss {
  appearance: none;
  border: 1px solid #d8d3c8;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 900px) {
  .lrHero .heroRow {
    grid-template-columns: 1fr 1fr;
  }
  .lrHero .heroGo { grid-column: 1 / -1; }
  .lrHero .heroGo button,
  .lrHero .fetch-btn { width: 100%; }
  .lrHero .heroTitle { font-size: clamp(26px, 7vw, 36px); }
  .lrHero .heroSub { font-size: 15px; }
}

@media (max-width: 768px) {
  .lrDesktopAdOnly { display: none !important; }
  .lrMobileAdOnly { display: block; width: 100%; }
  .lrMobileAdSlot { max-width: 100%; }
  .grid .lrMobileAdOnly { grid-column: 1 / -1; }
  body.install-banner-visible { padding-bottom: 5.5rem; }
}
