@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;700;800&family=Space+Mono:wght@400;700&display=swap");

:root {
  --bg: #f8f4ea;
  --bg-accent: #e6f4ec;
  --ink: #1f2430;
  --ink-soft: #4a5160;
  --primary: #07553b;
  --primary-strong: #033b29;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(7, 85, 59, 0.18);
  --good: #1f7a52;
  --warn: #8f5f00;
  --danger: #9f2032;
  --shadow: 0 18px 38px rgba(25, 40, 34, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 186, 66, 0.36), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(42, 140, 109, 0.24), transparent 35%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-accent) 100%);
  overflow-x: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 155, 59, 0.45), rgba(255, 155, 59, 0));
}

.orb-2 {
  width: 340px;
  height: 340px;
  bottom: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(21, 122, 86, 0.3), rgba(21, 122, 86, 0));
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  animation: slide-in 600ms ease-out;
}

.eyebrow {
  margin: 0;
  font-family: "Space Mono", "Courier New", monospace;
  letter-spacing: 0.08em;
  color: var(--primary);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.settings-wrap {
  position: relative;
}

.settings-button {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  z-index: 5;
}

.settings-panel[hidden] {
  display: none;
}

.setting-row {
  display: grid;
  gap: 6px;
}

.setting-row label {
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.setting-inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}

#timezone-select,
#team-highlight-select {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px;
}

.panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: fade-up 580ms ease both;
}

.panel-header {
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--ink-soft);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.group-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(7, 85, 59, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 255, 249, 0.95) 100%);
}

.group-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.group-progress {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, 12px);
  justify-content: end;
  gap: 6px;
}

.progress-square {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(31, 36, 48, 0.16);
}

.group-progress-popover {
  position: fixed;
  width: min(240px, calc(100vw - 16px));
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(31, 36, 48, 0.16);
  background: linear-gradient(145deg, #ffffff, #f6f3ee);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  z-index: 999;
  pointer-events: none;
}

.group-progress-popover__title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.group-progress-popover__kickoff {
  margin: 6px 0 0;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.group-progress-popover__result {
  margin: 6px 0 0;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.group-progress-popover__status {
  margin-top: 8px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(31, 36, 48, 0.12);
  color: #3b4453;
}

.group-progress-popover__status.played {
  background: rgba(85, 90, 99, 0.16);
  color: #474c55;
}

.group-progress-popover__status.today {
  background: rgba(241, 188, 18, 0.2);
  color: #7a5c00;
}

.group-progress-popover__status.live {
  background: rgba(31, 122, 82, 0.18);
  color: #17563b;
}

.progress-square.played {
  background: #555a63;
}

.progress-square.today {
  background: #f1bc12;
}

.progress-square.live {
  background: #1f7a52;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.78rem;
}

.group-table th,
.group-table td {
  text-align: right;
  padding: 4px 2px;
  border-bottom: 1px dashed rgba(31, 36, 48, 0.2);
}

.group-table th:first-child,
.group-table td:first-child,
.group-table th:nth-child(2),
.group-table td:nth-child(2) {
  text-align: left;
}

.group-table th.form-col,
.group-table td.form-col {
  text-align: center;
}

.team-name-cell {
  max-width: 110px;
}

.team-name-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.form-squares {
  display: inline-grid;
  grid-template-columns: repeat(3, 14px);
  gap: 4px;
}

.form-square {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(31, 36, 48, 0.2);
  color: #1f2430;
}

.form-square.win {
  background: rgba(31, 122, 82, 0.22);
  border-color: rgba(31, 122, 82, 0.35);
}

.form-square.draw {
  background: rgba(241, 188, 18, 0.24);
  border-color: rgba(241, 188, 18, 0.45);
}

.form-square.loss {
  background: rgba(159, 32, 50, 0.2);
  border-color: rgba(159, 32, 50, 0.35);
}

.form-square.empty {
  background: rgba(31, 36, 48, 0.06);
  border-color: rgba(31, 36, 48, 0.14);
  color: transparent;
}

.group-table tbody tr:nth-child(-n + 2) {
  color: var(--good);
  font-weight: 700;
}

.fixtures-columns {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 430px));
  justify-content: center;
  gap: 12px;
}

.fixtures-columns.with-highlight {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fixtures-panel {
  margin-top: 0;
}

.fixtures-panel[hidden] {
  display: none;
}

.matches-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.matchday-section {
  display: grid;
  gap: 8px;
}

.matchday-title {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  font-family: "Space Mono", "Courier New", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.matchday-date {
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
}

.match-card {
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  padding: 12px;
  background: linear-gradient(145deg, #ffffff, #f6f3ee);
}

.match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.match-time {
  font-weight: 700;
  color: var(--ink);
}

.match-timing {
  margin-left: auto;
  color: var(--good);
  font-weight: 700;
}

.teams-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.team {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.team-label {
  display: inline;
}

.team.away {
  text-align: right;
}

.score {
  font-family: "Space Mono", "Courier New", monospace;
  font-weight: 700;
  font-size: 1.1rem;
}

.meta {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.goals-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(31, 36, 48, 0.2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.goal-column {
  min-width: 0;
}

.goal-team {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.goal-list {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.goal-list li {
  margin: 3px 0;
}

.goal-empty {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.live-now {
  margin-top: 8px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(159, 32, 50, 0.14);
  color: var(--danger);
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.broadcast-icon-inline {
  display: inline-flex;
  align-items: center;
}

.broadcast-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.team-highlight {
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.75), rgba(255, 170, 0, 0.62));
  border-radius: 7px;
  padding: 2px 6px;
  box-shadow: inset 0 0 0 1px rgba(125, 72, 0, 0.45);
  color: #3d2700;
  font-weight: 800;
}

.team-highlight-inline {
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.75), rgba(255, 170, 0, 0.62));
  border-radius: 7px;
  padding: 2px 6px;
  box-shadow: inset 0 0 0 1px rgba(125, 72, 0, 0.45);
  color: #3d2700;
  font-weight: 800;
}

.status-message {
  margin-top: 14px;
  min-height: 1.2em;
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  color: var(--ink-soft);
  font-style: italic;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-wrap {
    align-self: flex-end;
  }

  .fixtures-columns {
    grid-template-columns: 1fr;
  }
}
