:root {
  --ink: #17202a;
  --muted: #5d6b7a;
  --line: #d8dee6;
  --panel: #ffffff;
  --page: #eef3f0;
  --accent: #08785f;
  --accent-dark: #075944;
  --brand: #101827;
  --gold: #f2b705;
  --silver: #b9c2cf;
  --bronze: #c1773d;
  --danger: #a33a32;
  --success: #0b6b5f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8, 120, 95, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(8, 120, 95, 0.06) 1px, transparent 1px),
    var(--page);
  background-size: 34px 34px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.narrow-shell {
  width: min(520px, calc(100% - 32px));
}

.topbar,
.panel,
.summary-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(8, 120, 95, 0.95), rgba(16, 24, 39, 0.98)),
    var(--brand);
  border-color: rgba(255, 255, 255, 0.12);
}

.eyebrow {
  margin: 0 0 6px;
  color: #b9f2df;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

.subtle-text {
  margin-top: 6px;
  color: #d9f8ee;
  font-size: 13px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-cell {
  padding: 16px;
  border-top: 3px solid var(--accent);
}

.metric,
.label {
  display: block;
}

.metric {
  font-size: 25px;
  font-weight: 850;
}

.label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-weight: 700;
}

.alert.error {
  color: var(--danger);
  border-color: rgba(163, 58, 50, 0.35);
}

.alert.success {
  color: var(--success);
  border-color: rgba(11, 107, 95, 0.35);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.host-grid {
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.8fr);
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.prediction-panel,
.login-panel,
.results-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 10px;
}

button,
.link-button,
.secondary-button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(8, 120, 95, 0.22);
}

button:hover,
button:focus {
  background: var(--accent-dark);
}

.secondary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: #ffffff;
  text-decoration: none;
  font-size: 13px;
}

.topbar .link-button,
.topbar .secondary-button {
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button:hover,
.secondary-button:focus,
.link-button:hover,
.link-button:focus {
  background: #f8fafb;
}

.fixtures-list,
.results-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.match-row {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 120, 95, 0.08), transparent 38%),
    #fbfcfd;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.match-row:focus-within,
.match-row:hover {
  border-color: rgba(8, 120, 95, 0.35);
  box-shadow: 0 10px 22px rgba(23, 32, 42, 0.08);
  transform: translateY(-1px);
}

.match-row legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.match-row legend strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.match-meta {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.team-name,
.pick-teams span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flag {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 42, 0.08), 0 5px 12px rgba(23, 32, 42, 0.08);
  font-size: 19px;
  line-height: 1;
}

.score-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-inputs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.player-link {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.player-link:hover,
.player-link:focus {
  color: var(--accent-dark);
  text-decoration: underline;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef2f4;
  color: var(--ink);
  font-weight: 900;
}

.rank-1 {
  background: rgba(242, 183, 5, 0.2);
}

.rank-2 {
  background: rgba(185, 194, 207, 0.28);
}

.rank-3 {
  background: rgba(193, 119, 61, 0.22);
}

.player-summary {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.status-pill,
.points-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 900;
}

.status-pill {
  color: var(--accent-dark);
  background: rgba(8, 120, 95, 0.12);
}

.picks-panel {
  margin-top: 18px;
}

.picks-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pick-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.pick-card.exact_score {
  border-color: rgba(8, 120, 95, 0.45);
  background: rgba(8, 120, 95, 0.07);
}

.pick-card.wrong_outcome {
  border-color: rgba(163, 58, 50, 0.3);
}

.pick-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.pick-teams {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-weight: 850;
}

.pick-teams strong {
  padding: 6px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
}

.points-pill {
  align-self: flex-start;
  color: var(--brand);
  background: #eef2f4;
  white-space: nowrap;
}

.pick-result {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .nav-actions,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .player-summary,
  .panel-grid,
  .host-grid,
  .score-inputs,
  .result-inputs,
  .picks-list {
    grid-template-columns: 1fr;
  }
}
