:root {
  --bg: #f4efe4;
  --surface: rgba(255, 251, 244, 0.86);
  --surface-strong: #fffaf1;
  --text: #1f1d1b;
  --muted: #655d52;
  --line: rgba(38, 32, 24, 0.12);
  --accent: #0e7a51;
  --accent-strong: #08573a;
  --accent-soft: rgba(14, 122, 81, 0.14);
  --danger: #b9442f;
  --gold: #d3a84d;
  --shadow: 0 18px 60px rgba(45, 34, 19, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(211, 168, 77, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 122, 81, 0.2), transparent 22%),
    linear-gradient(180deg, #f8f3e8 0%, #efe6d5 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  padding: 34px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(20, 68, 47, 0.98), rgba(16, 43, 33, 0.94)),
    linear-gradient(135deg, rgba(211, 168, 77, 0.22), transparent 60%);
  color: #fff8e8;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -120px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(211, 168, 77, 0.16);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: rgba(255, 248, 232, 0.76);
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.95;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.hero-text {
  max-width: 58ch;
  font-size: 1rem;
  color: rgba(255, 248, 232, 0.86);
}

.hero-panel,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 248, 232, 0.72);
  margin-bottom: 6px;
}

.hero-stat strong {
  font-size: 1.2rem;
}

.mini-status {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: rgba(255, 248, 232, 0.72);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin-top: 24px;
}

.panel {
  grid-column: span 6;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 24px;
}

.wide-panel {
  grid-column: span 12;
}

.rankings-panel {
  grid-column: span 7;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-kicker {
  color: var(--muted);
}

.panel-note {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 0.94rem;
}

.ranking-list,
.timeline,
.series-list,
.teams-grid,
.criteria-guide {
  display: grid;
  gap: 14px;
}

.ranking-row,
.timeline-item,
.series-card,
.team-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
}

.ranking-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 16px;
  align-items: center;
  position: relative;
}

.ranking-row.top-contender {
  border-color: rgba(211, 168, 77, 0.5);
  box-shadow: inset 0 0 0 1px rgba(211, 168, 77, 0.16);
}

.rank-pill {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.rank-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rank-name-line h3,
.team-name {
  margin: 0;
  font-size: 1.15rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 32, 28, 0.07);
  color: var(--muted);
  font-size: 0.78rem;
}

.tag.champion {
  background: rgba(211, 168, 77, 0.18);
  color: #7d5a0d;
}

.tag.eligible {
  background: rgba(14, 122, 81, 0.16);
  color: var(--accent-strong);
}

.rank-details,
.team-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.status-explainer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-chip {
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(15, 32, 28, 0.05);
  font-size: 0.84rem;
  color: var(--muted);
}

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

.score-block strong {
  display: block;
  font-size: 1.6rem;
}

.score-block span {
  color: var(--muted);
  font-size: 0.85rem;
}

.timeline-item,
.series-card,
.team-card {
  padding: 16px;
}

.timeline-item strong,
.series-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.timeline-item p,
.series-card p,
.team-notes,
.team-squad p {
  margin: 0;
  color: var(--muted);
}

.meta-line {
  font-size: 0.9rem;
}

.hint-text {
  margin-top: 10px !important;
  font-size: 0.82rem;
}

.criteria-card,
.player-board,
.entry-section {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.criteria-card strong,
.player-board h3,
.entry-section h3,
.stats-cluster h4 {
  margin: 0;
}

.criteria-card p,
.subsection-title,
.entry-section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.entry-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.player-board-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 32, 28, 0.08);
  border: 1px solid var(--line);
}

.segment-button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.segment-button.active {
  background: var(--accent);
  color: white;
}

.player-boards {
  grid-template-columns: 1fr;
}

.player-board {
  display: grid;
  gap: 12px;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-control select {
  width: auto;
  min-width: 160px;
  padding: 10px 12px;
}

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

.mini-table,
.editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

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

.mini-table th,
.editor-table th {
  color: var(--muted);
  font-weight: 700;
}

.editor-table td:last-child,
.editor-table th:last-child {
  width: 1%;
}

.cell-input,
.editor-table select {
  min-width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
}

.editor-table select {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.series-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.series-details summary {
  cursor: pointer;
  font-weight: 700;
}

.stats-cluster {
  margin-top: 14px;
}

.subsection-title {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.award-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.stats-entry-grid,
.player-boards {
  display: grid;
  gap: 14px;
}

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

.paste-target {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.paste-target:focus-within,
.paste-target:focus {
  outline: 2px solid rgba(14, 122, 81, 0.18);
  border-color: rgba(14, 122, 81, 0.35);
}

.import-count {
  font-weight: 700;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(6, 1fr);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(14, 122, 81, 0.18);
  border-color: rgba(14, 122, 81, 0.28);
}

.button-row,
.team-card-top,
.team-actions,
.item-head,
.item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.item-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.primary-button,
.ghost-button,
.mini-button {
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button,
.ghost-button {
  padding: 12px 16px;
  border-radius: 14px;
}

.mini-button {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 32, 28, 0.08);
}

.primary-button {
  background: var(--accent);
  color: white;
}

.ghost-button {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.danger {
  color: var(--danger);
}

.primary-button:hover,
.ghost-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

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

.team-card {
  display: grid;
  gap: 12px;
}

.team-manager {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-badges {
  margin: 0;
}

.team-squad {
  display: grid;
  gap: 8px;
}

.team-squad ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
}

@media (max-width: 1060px) {
  .hero,
  .panel,
  .rankings-panel {
    grid-column: 1 / -1;
  }

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

  .form-row,
  .stats-grid,
  .teams-grid,
  .import-grid,
  .stats-entry-grid,
  .player-boards {
    grid-template-columns: 1fr 1fr;
  }

  .player-boards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1320px);
    padding-top: 14px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .dashboard-grid,
  .panel-header,
  .form-row,
  .stats-grid,
  .teams-grid,
  .import-grid,
  .stats-entry-grid,
  .player-boards,
  .ranking-row {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    gap: 10px;
  }

  .score-block {
    text-align: left;
  }

  .entry-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .player-board-controls {
    justify-content: flex-start;
  }
}
