:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #162033;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, #2563eb 0%, #0f766e 46%, #0f172a 100%) fixed,
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  color: white;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.96) 0%, rgba(15, 118, 110, 0.96) 58%, rgba(15, 23, 42, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 10px 0 34px rgba(15, 23, 42, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 800;
}

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

.brand strong {
  font-size: 16px;
  color: white;
}

.brand small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  margin-top: 2px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 650;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.17);
  color: white;
}

.side-nav .nav-prediction {
  color: #111827;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 52%, #22c55e 100%);
  border: 0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

.side-nav .nav-prediction:hover {
  color: #0f172a;
  background: linear-gradient(135deg, #fde047 0%, #fb923c 50%, #14b8a6 100%);
}

.main-shell {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 118px;
  padding: 24px 28px 42px;
  color: white;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

.topbar h1:empty {
  display: none;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.content {
  min-height: calc(100vh - 166px);
  margin-top: -24px;
  padding: 0 6px 44px;
}

.message-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: #78350f;
  border: 1px solid #fde68a;
  box-shadow: var(--shadow);
}

.page-hero,
.card,
.stat-card,
.section-card,
.table-card {
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.page-hero {
  padding: 28px;
  margin-bottom: 22px;
}

.page-hero h1,
.card h1,
.section-card h1,
h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
}

.page-hero p,
.card p,
.section-card p {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px;
  min-height: 128px;
}

.stat-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  margin: 0;
  font-size: 28px;
  font-weight: 850;
}

.stat-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.section-card {
  padding: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 20px;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.action-card {
  display: block;
  min-height: 128px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.action-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.action-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.progress-row {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.bar-list {
  display: grid;
  gap: 13px;
}

.mini-bars {
  display: grid;
  gap: 10px;
}

.mini-bar {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.notice {
  padding: 14px 16px;
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #78350f;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.success-notice {
  border-color: #99f6e4;
  background: var(--accent-soft);
  color: #134e4a;
}

.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary,
button[type="submit"],
input[type="submit"] {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-dark {
  color: white;
  background: rgba(15, 23, 42, 0.78);
}

.btn-ghost {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

input,
select,
textarea {
  width: auto;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 10px;
  background: white;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--primary-soft);
  border-color: var(--primary);
}

.table-card {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

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

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.max-w-md {
  max-width: 448px;
}

.max-w-xl {
  max-width: 576px;
}

.max-w-2xl {
  max-width: 672px;
}

.max-w-3xl {
  max-width: 1120px;
}

.leader-name {
  font-weight: 850;
}

.rank-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
}

.form-panel,
.rounded-lg,
.card {
  border-radius: var(--radius);
}

.max-w-3xl,
.max-w-2xl,
.mx-auto,
main > form,
main > .grid,
main > .overflow-hidden,
.mb-6 {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

main > form section {
  margin-bottom: 16px;
}

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

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

.space-y-4 > * + *,
.space-y-5 > * + * {
  margin-top: 14px;
}

.divide-y > * + * {
  border-top: 1px solid var(--line);
}

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

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.py-3 {
  padding-top: 12px;
  padding-bottom: 12px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.mt-8 {
  margin-top: 24px;
}

.mb-6 {
  margin-bottom: 18px;
}

.rules-card {
  width: min(100%, 1120px);
}

.rules-card h1 {
  margin-bottom: 24px;
  font-size: 32px;
}

.rules-list {
  display: grid;
  gap: 19px;
  margin: 0;
  padding-left: 26px;
  font-size: 18px;
  line-height: 1.7;
}

.rules-list li::marker {
  color: var(--primary);
  font-weight: 900;
}

.prediction-form {
  display: grid;
  gap: 18px;
}

.group-card {
  padding: 0;
  overflow: hidden;
}

.group-card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.group-card-header h2,
.playoff-round-card h2,
.other-tips-grid h2 {
  margin: 0;
  font-size: 24px;
}

.match-list {
  display: grid;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 300px 172px;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

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

.match-info p {
  margin: 0 0 9px;
  font-size: 20px;
  font-weight: 750;
}

.match-info span {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.outcome-select {
  width: 300px !important;
  height: 52px;
  padding: 0 16px;
}

.group-form select,
.score-pickers select {
  min-height: 52px;
  font-size: 18px;
  font-weight: 700;
}

.score-pickers {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 850;
}

.score-pickers select {
  width: 70px !important;
  padding-left: 12px;
  padding-right: 12px;
  text-align: center;
}

.extra-form {
  display: grid;
  gap: 22px;
}

.extra-row {
  display: grid;
  grid-template-columns: minmax(360px, 560px) minmax(360px, 560px);
  gap: 24px;
  align-items: center;
}

.extra-row label {
  color: var(--text);
  font-size: 19px;
  line-height: 1.45;
  font-weight: 750;
}

.extra-row input,
.extra-row select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.playoff-form {
  display: grid;
  gap: 18px;
}

.playoff-round-card {
  padding: 28px;
}

.playoff-round-card h2 {
  margin-bottom: 22px;
}

.playoff-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
}

.playoff-tile {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  min-height: 68px;
  padding: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.playoff-tile span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
  text-transform: uppercase;
}

.playoff-tile select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.other-tips-grid {
  display: grid;
  gap: 18px;
}

.other-tips-grid section {
  padding: 22px;
}

.scroll-table {
  max-height: 340px;
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.scroll-table table {
  min-width: 760px;
}

.scroll-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.scroll-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.scroll-table td {
  vertical-align: top;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .stats-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-shell {
    padding: 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px 38px;
  }

  .side-nav,
  .action-grid,
  .stats-grid,
  .extra-row,
  .match-row,
  .playoff-tile-grid {
    grid-template-columns: 1fr;
  }

  .outcome-select {
    width: 100% !important;
  }

  .score-pickers {
    width: 100%;
  }

  .playoff-tile {
    grid-template-columns: 1fr;
  }

  .mini-bar {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 10px 8px;
  }
}
