:root {
  color-scheme: dark;
  font-family: "Barlow", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg-left: #9c3c13;
  --bg-right: #482a87;
  --panel-bg: rgba(14, 17, 34, 0.82);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-muted: rgba(255, 255, 255, 0.65);
  --primary: #ff7b00;
  --primary-strong: #ff5300;
  --accent: #ffe6d3;
  --radius: 18px;
  --board-row: rgba(255, 255, 255, 0.16);
  --board-row-alt: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(110deg, var(--bg-left), var(--bg-right));
  color: #fff;
  display: flex;
  justify-content: center;
  padding: 2rem clamp(1rem, 5vw, 4rem);
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(1100px, 100%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app-shell.points-view-active {
  width: 100%;
  max-width: none;
  margin: 0;
}

.view-switcher {
  display: flex;
  gap: 0.75rem;
}

.view-button {
  border: 1px solid var(--panel-border);
  background: transparent;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.view-button.is-active,
.view-button:hover {
  background: var(--primary);
  border-color: transparent;
}

main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.app-shell.points-view-active main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 500px);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: flex-start;
  justify-content: stretch;
}

.app-shell.points-view-active .panel.ranking-panel {
  width: 100%;
}

.app-shell.points-view-active .panel[data-view="points"] {
  width: 100%;
  justify-self: flex-end;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.panel.ranking-panel {
  padding: 0;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.45);
}

.panel-heading {
  margin-bottom: 1.25rem;
}

.panel-kicker {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.board-banner {
  background: linear-gradient(120deg, #d5530d, #a138bd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  flex-wrap: wrap;
}

.board-banner__mark {
  flex: 0 0 auto;
  max-width: 340px;
  width: 100%;
  height: 70px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.board-banner__switcher {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.board-banner__switcher .view-button {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.board-banner__switcher .view-button.is-active,
.board-banner__switcher .view-button:hover {
  background: #fff;
  color: #1f1525;
  border-color: transparent;
}

.board-title-bar {
  background: #040404;
  text-align: center;
  padding: 1.5rem;
}

.board-title-bar h2 {
  margin: 0;
  font-size: 1.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.board-table {
  list-style: none;
  margin: 0;
  padding: 0;
}

.board-row {
  display: grid;
  grid-template-columns: 95px 1fr 180px;
  min-height: 78px;
  align-items: stretch;
  background: var(--board-row);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.board-row:nth-child(odd) {
  background: var(--board-row-alt);
}

.board-row:last-child {
  border-bottom: none;
}

.row-position {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.9);
  color: #141414;
}

.team-cell {
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
}

.team-cell img {
  max-height: 62px;
  width: auto;
  max-width: 90%;
  height: auto;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

.team-cell span,
.team-fallback {
  font-weight: 700;
  font-size: 1.2rem;
  color: #1c1c1c;
  text-transform: uppercase;
}

.points-cell {
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1f0900;
}

.score-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.field select,
.field input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: #fff;
  font-size: 1rem;
}

.field select {
  background: rgba(255, 255, 255, 0.9);
  color: #181818;
  border-color: rgba(255, 255, 255, 0.35);
}

.field select option {
  color: #181818;
  background: #fff;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.primary {
  background: var(--primary);
  border: none;
  color: #1b0f02;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.primary:hover {
  transform: translateY(-2px);
}

.ghost {
  margin-top: 1.25rem;
  width: 100%;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 999px;
  padding: 0.65rem;
  cursor: pointer;
}

.divider {
  margin: 1.25rem 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.score-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  overflow: hidden;
}

.score-table-head,
.score-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  padding: 0.85rem 1.1rem;
}

.score-table-head {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.score-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.score-row span:last-child {
  text-align: right;
  font-weight: 700;
}

@media (max-width: 720px) {
  body {
    padding: 1.25rem;
  }

  .board-row {
    grid-template-columns: 80px 1fr 140px;
  }
}

@media (max-width: 520px) {
  .board-row {
    grid-template-columns: 65px 1fr;
  }

  .points-cell {
    grid-column: 1 / -1;
  }
}
