:root {
  --bg: #ffffff;
  --ink: #101114;
  --muted: #61666d;
  --line: #e6e7ea;
  --soft: #f7f8fa;
  --gold: #f5bd16;
  --navy: #0b2246;
  --green: #e8f6df;
  --green-strong: #2f7d32;
  --one-bg: #e7f0ff;
  --one-ink: #174f9f;
  --two-bg: #fff0d9;
  --two-ink: #9a4f00;
  --base-bg: #e9f7df;
  --base-ink: #2f6f2f;
  --shadow: 0 14px 34px rgba(16, 17, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 16px 14px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 13px 0 6px;
}

.view-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.view-tab.active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 12px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.filter-chip.active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.team-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.team-filters::-webkit-scrollbar {
  display: none;
}

.team-filters.hidden {
  display: none;
}

.team-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 900;
}

.team-chip.team-one {
  border-color: #bcd5ff;
  background: var(--one-bg);
  color: var(--one-ink);
}

.team-chip.team-two {
  border-color: #ffd19a;
  background: var(--two-bg);
  color: var(--two-ink);
}

.team-chip.active {
  box-shadow: inset 0 0 0 2px currentColor;
}

.status-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.status-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.status-card span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-card strong {
  font-size: 1rem;
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.section-head span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 12px;
}

.content {
  display: grid;
  gap: 14px;
}

.generation-block {
  display: grid;
  gap: 9px;
}

.generation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.generation-head strong {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.generation-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.day-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfb;
}

.day-head strong,
.day-head span {
  display: block;
}

.day-head strong {
  font-size: 1.05rem;
}

.day-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.day-count {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.match-card {
  border-bottom: 1px solid var(--line);
}

.match-card:last-child {
  border-bottom: 0;
}

.match-card.next-match {
  scroll-margin-top: 10px;
}

.match-card.next-match .match-summary {
  background: linear-gradient(90deg, #f3fbef 0, #ffffff 44%);
  box-shadow:
    inset 5px 0 0 var(--green-strong),
    0 0 0 1px rgba(47, 125, 50, 0.2);
}

.match-card.next-match .match-summary::after {
  content: "SLIJEDI";
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1f7a35;
  color: #ffffff;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.match-card.match-one .match-summary {
  box-shadow: inset 4px 0 0 var(--one-ink);
}

.match-card.match-two .match-summary {
  box-shadow: inset 4px 0 0 var(--two-ink);
}

.match-card.next-match .match-summary {
  box-shadow:
    inset 5px 0 0 var(--green-strong),
    0 0 0 1px rgba(47, 125, 50, 0.2);
}

.match-summary {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: 66px 64px minmax(0, 1fr) 58px;
  align-items: stretch;
  min-height: 70px;
  cursor: pointer;
}

.match-summary::-webkit-details-marker {
  display: none;
}

.cell {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-right: 1px solid var(--line);
}

.cell:last-child {
  border-right: 0;
}

.cell-label {
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cell-value {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #07111f;
  font-size: 0.86rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-cell {
  background: var(--base-bg);
}

.team-cell .cell-value {
  color: #111111;
}

.team-cell.team-one {
  background: var(--one-bg);
}

.team-cell.team-two {
  background: var(--two-bg);
}

.team-cell.team-one .cell-value,
.match-one .opponent-cell .cell-label {
  color: var(--one-ink);
}

.team-cell.team-two .cell-value,
.match-two .opponent-cell .cell-label {
  color: var(--two-ink);
}

.opponent-cell {
  justify-items: start;
  padding-left: 10px;
}

.opponent-cell .cell-label,
.opponent-cell .cell-value {
  text-align: left;
}

.opponent-cell .cell-value {
  font-size: 0.8rem;
}

.match-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--green);
}

.match-details.details-one {
  background: var(--one-bg);
}

.match-details.details-two {
  background: var(--two-bg);
}

.detail {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border-right: 1px solid rgba(16, 17, 20, 0.12);
}

.detail:last-child {
  border-right: 0;
}

.detail span {
  color: #305a27;
  font-size: 0.52rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail strong,
.detail a {
  overflow: hidden;
  color: #111111;
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 9px;
  border-top: 1px solid var(--line);
  background: #fbfbfb;
}

.context-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.context-panel h4 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.context-match-list {
  display: grid;
}

.context-match-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 38px;
  gap: 7px;
  align-items: center;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}

.context-match-row:last-child {
  border-bottom: 0;
}

.context-match-row.current {
  background: var(--green);
  box-shadow: inset 3px 0 0 var(--green-strong);
}

.context-match-row time,
.context-match-row strong,
.context-match-row span {
  min-width: 0;
}

.context-match-row time strong,
.context-match-row time span {
  display: block;
}

.context-match-row time strong {
  font-size: 0.64rem;
}

.context-match-row time span {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
}

.context-match-row > strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-pill {
  justify-self: end;
  min-width: 28px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
}

.standings-table {
  display: grid;
}

.standings-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) repeat(4, 24px) 34px;
  gap: 4px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.67rem;
  font-weight: 800;
}

.standings-row:last-child {
  border-bottom: 0;
}

.standings-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-row span,
.standings-row b {
  text-align: center;
}

.standings-head {
  min-height: 28px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

.standings-row.own {
  background: var(--base-bg);
  font-weight: 900;
}

.standings-row.own.team-one {
  background: var(--one-bg);
  color: var(--one-ink);
}

.standings-row.own.team-two {
  background: var(--two-bg);
  color: var(--two-ink);
}

.standings-row.focus {
  box-shadow: inset 3px 0 0 currentColor;
}

.compact-empty {
  margin: 8px;
  padding: 10px;
  font-size: 0.72rem;
}

.team-schedules,
.groups {
  display: grid;
  gap: 10px;
}

.team-block,
.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.team-block h3,
.group-card h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 0.82rem;
}

.mini-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row time {
  font-size: 0.72rem;
  font-weight: 900;
}

.mini-row strong,
.mini-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row strong {
  font-size: 0.74rem;
}

.mini-row span {
  justify-self: end;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.group-teams {
  display: grid;
  gap: 0;
}

.group-team {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.73rem;
  font-weight: 800;
}

.group-team:last-child {
  border-bottom: 0;
}

.group-team.own {
  background: var(--base-bg);
  font-weight: 900;
}

.group-team.own.team-one {
  background: var(--one-bg);
  color: var(--one-ink);
}

.group-team.own.team-two {
  background: var(--two-bg);
  color: var(--two-ink);
}

.placement {
  display: grid;
  gap: 10px;
}

.placement-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.placement-card h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 0.82rem;
}

.placement-note,
.placement-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.placement-empty {
  display: grid;
  gap: 5px;
}

.placement-empty strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.placement-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: stretch;
  border-top: 1px solid var(--line);
}

.placement-row.own-path {
  background: #f2f9ed;
  box-shadow: inset 4px 0 0 var(--green-strong);
}

.placement-time {
  display: grid;
  place-items: center;
  padding: 8px 6px;
  border-right: 1px solid var(--line);
}

.placement-time strong,
.placement-time span {
  display: block;
}

.placement-time strong {
  font-size: 0.76rem;
}

.placement-time span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.placement-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  grid-template-areas:
    "stage stage stage"
    "home dash away";
  gap: 2px 6px;
  align-content: center;
  padding: 8px 9px;
}

.placement-main span {
  grid-area: stage;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

.placement-main strong,
.placement-main em {
  min-width: 0;
  overflow: hidden;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placement-main strong {
  grid-area: home;
  text-align: right;
}

.placement-main em {
  grid-area: away;
  text-align: left;
}

.placement-main::after {
  grid-area: dash;
  content: "-";
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.empty-state,
.error-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px 8px 28px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .filter-chip {
    min-height: 34px;
    padding: 0 13px;
    font-size: 0.78rem;
  }

  .match-summary {
    grid-template-columns: 56px 58px minmax(0, 1fr) 48px;
    min-height: 64px;
  }

  .cell {
    padding: 7px 4px;
  }

  .cell-label {
    font-size: 0.48rem;
  }

  .cell-value {
    font-size: 0.78rem;
  }

  .opponent-cell {
    padding-left: 8px;
  }

  .opponent-cell .cell-value {
    font-size: 0.72rem;
  }

  .match-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail:nth-child(2) {
    border-right: 0;
  }

  .detail:nth-child(1),
  .detail:nth-child(2) {
    border-bottom: 0;
  }

  .match-context {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 7px;
  }

  .context-match-row {
    grid-template-columns: 66px minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 7px 8px;
  }

  .standings-row {
    grid-template-columns: 22px minmax(0, 1fr) repeat(4, 22px) 31px;
    padding: 6px 7px;
    font-size: 0.62rem;
  }
}
