:root {
  --bg: #f7f1e4;
  --bg-strong: #efe3c6;
  --panel: rgba(255, 251, 243, 0.88);
  --panel-strong: #fff8ee;
  --ink: #112033;
  --muted: #5f6b77;
  --line: rgba(17, 32, 51, 0.1);
  --accent: #f36f21;
  --accent-deep: #d45100;
  --navy: #16324f;
  --mint: #bfd8cb;
  --shadow: 0 24px 60px rgba(26, 40, 55, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(243, 111, 33, 0.18), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(22, 50, 79, 0.18), transparent 26%),
    linear-gradient(180deg, #faf5e7 0%, #f2e7cf 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 46vw;
  height: 46vw;
  border: 2px solid rgba(195, 4, 82, 0.08);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -18vw;
  left: -12vw;
}

body::after {
  right: -16vw;
  bottom: -24vw;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: auto;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
}

.backdrop-one {
  width: 360px;
  height: 360px;
  top: 12%;
  right: -80px;
  background: rgba(243, 111, 33, 0.18);
}

.backdrop-two {
  width: 320px;
  height: 320px;
  bottom: 8%;
  left: -60px;
  background: rgba(49, 82, 136, 0.16);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 34px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(243, 111, 33, 0.08), transparent 38%),
    linear-gradient(310deg, rgba(22, 50, 79, 0.08), transparent 42%);
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.hero-panel h1,
.section-head h2,
.auth-card h2 {
  margin: 8px 0 0;
  font-family: "Black Han Sans", sans-serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.hero-panel h1 {
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 1.02;
}

.hero-description {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  gap: 12px;
  align-content: start;
}

.meta-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 32, 51, 0.06);
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.controls-panel {
  margin-top: 20px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.controls-main {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.controls-stack {
  display: grid;
  gap: 8px;
}

.controls-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.segment-group {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: rgba(17, 32, 51, 0.06);
  border-radius: 999px;
}

.segment-button,
.ghost-button,
.primary-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.segment-button {
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.segment-button.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 24px rgba(22, 50, 79, 0.22);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button {
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border: 1px solid rgba(17, 32, 51, 0.08);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(243, 111, 33, 0.28);
}

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

.highlights-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.highlight-card {
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 238, 0.92));
  border: 1px solid rgba(17, 32, 51, 0.08);
  box-shadow: 0 16px 36px rgba(17, 32, 51, 0.08);
}

.highlight-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.16rem;
}

.highlight-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.content-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
}

.lower-grid {
  grid-template-columns: 1.05fr 1.1fr;
}

.chart-panel,
.leaderboard-panel,
.standings-panel,
.insights-panel,
.predictions-panel,
.credit-panel {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 2rem;
}

.section-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
  text-align: right;
}

.chart-wrap,
.insight-chart-wrap {
  position: relative;
  min-height: 360px;
}

.leaderboard-list,
.standings-list,
.insight-list,
.prediction-grid {
  display: grid;
  gap: 12px;
}

.leader-row,
.standing-row,
.insight-row,
.prediction-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.leader-row {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.leader-rank {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(243, 111, 33, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.leader-main strong {
  display: block;
  font-size: 1.02rem;
}

.leader-name-line,
.prediction-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.leader-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

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

.delta-up,
.delta-flat {
  display: inline-flex;
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.delta-up {
  background: rgba(0, 131, 98, 0.12);
  color: #00664c;
}

.delta-flat {
  background: rgba(17, 32, 51, 0.08);
  color: var(--muted);
}

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

.standing-row {
  padding: 16px;
}

.standing-top,
.insight-top,
.prediction-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.team-color {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.standing-title strong,
.insight-title strong {
  display: block;
}

.standing-title span,
.insight-title span {
  color: var(--muted);
  font-size: 0.86rem;
}

.standing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric-chip {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(17, 32, 51, 0.05);
}

.metric-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.metric-chip strong {
  display: block;
  margin-top: 4px;
}

.insight-list {
  margin-top: 16px;
}

.insight-row {
  padding: 15px 16px;
}

.insight-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 32, 51, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(243, 111, 33, 0.12);
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 700;
}

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

.credit-panel {
  margin-top: 20px;
  background:
    linear-gradient(135deg, rgba(22, 50, 79, 0.96), rgba(9, 21, 35, 0.96)),
    rgba(22, 50, 79, 0.96);
  color: #f7f1e4;
}

.credit-panel .section-kicker {
  color: rgba(243, 111, 33, 0.9);
}

.credit-panel h2 {
  margin: 8px 0 0;
  font-size: 2rem;
}

.credit-copy {
  margin: 14px 0 0;
  color: rgba(247, 241, 228, 0.82);
  line-height: 1.7;
}

.credit-copy a {
  color: #ffd7b8;
  font-weight: 700;
}

.prediction-card {
  padding: 16px;
}

.prediction-order {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 32, 51, 0.06);
  font-size: 0.86rem;
  font-weight: 600;
}

.neutral-badge {
  background: rgba(243, 111, 33, 0.12);
  color: var(--accent-deep);
}

.rank-badge b {
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-modal,
.loading-layer {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 20;
}

.auth-modal.is-visible,
.loading-layer.is-visible {
  display: grid;
}

.auth-modal {
  background: rgba(17, 32, 51, 0.52);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 28px;
  background: #fff8ee;
  box-shadow: 0 30px 80px rgba(17, 32, 51, 0.26);
}

.auth-copy {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.auth-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(17, 32, 51, 0.14);
  background: rgba(255, 255, 255, 0.85);
}

.auth-error {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: #9b1c1c;
  font-size: 0.92rem;
}

.loading-layer {
  background: rgba(247, 241, 228, 0.7);
  backdrop-filter: blur(10px);
  gap: 14px;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(22, 50, 79, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .content-grid,
  .lower-grid,
  .prediction-grid,
  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .content-grid,
  .highlights-grid {
    gap: 16px;
  }

  .standings-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px 10px 24px;
  }

  .hero-panel,
  .controls-panel,
  .chart-panel,
  .leaderboard-panel,
  .standings-panel,
  .insights-panel,
  .predictions-panel,
  .credit-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .hero-panel {
    gap: 16px;
  }

  .meta-card,
  .highlight-card,
  .leader-row,
  .standing-row,
  .insight-row,
  .prediction-card {
    border-radius: 14px;
  }

  .meta-card,
  .highlight-card,
  .standing-row,
  .insight-row,
  .prediction-card {
    padding: 12px;
  }

  .controls-panel,
  .content-grid,
  .lower-grid,
  .highlights-grid,
  .predictions-panel,
  .credit-panel {
    margin-top: 14px;
  }

  .content-grid,
  .lower-grid,
  .highlights-grid,
  .prediction-grid,
  .leaderboard-list,
  .standings-list,
  .insight-list {
    gap: 10px;
  }

  .controls-panel,
  .section-head,
  .leader-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .controls-main,
  .controls-stack {
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button,
  .segment-group {
    width: 100%;
  }

  .segment-group {
    justify-content: stretch;
  }

  .segment-button {
    flex: 1 1 0;
    padding: 9px 12px;
    font-size: 0.92rem;
  }

  .leader-row {
    gap: 10px;
    padding: 12px;
  }

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

  .chart-wrap,
  .insight-chart-wrap {
    min-height: 240px;
  }

  .hero-panel h1 {
    font-size: 2rem;
  }

  .hero-description,
  .credit-copy {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .section-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .section-head h2,
  .credit-panel h2 {
    font-size: 1.55rem;
  }

  .section-note {
    text-align: left;
    font-size: 0.84rem;
  }

  .standing-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .metric-chip {
    padding: 8px 10px;
  }

  .prediction-order,
  .insight-stats {
    gap: 6px;
    margin-top: 10px;
  }

  .rank-badge,
  .tag,
  .mini-badge,
  .delta-up,
  .delta-flat {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .leader-rank {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .leader-score strong,
  .meta-card strong {
    font-size: 1.06rem;
  }

  .highlight-card strong {
    margin-top: 10px;
    font-size: 1.04rem;
  }

  .highlight-card p,
  .leader-sub,
  .standing-title span,
  .insight-title span {
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 10px 8px 20px;
  }

  .hero-panel,
  .controls-panel,
  .chart-panel,
  .leaderboard-panel,
  .standings-panel,
  .insights-panel,
  .predictions-panel,
  .credit-panel {
    padding: 12px;
  }

  .hero-panel h1 {
    font-size: 1.78rem;
  }

  .meta-card {
    padding: 10px 12px;
  }

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

  .toolbar-actions {
    gap: 8px;
  }

  .standing-metrics {
    grid-template-columns: 1fr;
  }

  .chart-wrap,
  .insight-chart-wrap {
    min-height: 220px;
  }
}
