:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  --ink: #121926;
  --muted: #697386;
  --line: #dfe5ef;
  --surface: #ffffff;
  --canvas: #f4f7fc;
  --blue: #2f6fec;
  --blue-dark: #235bd0;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.rank-card {
  width: min(100%, 760px);
  padding: clamp(28px, 7vw, 64px);
  border: 1px solid rgba(178, 190, 211, 0.55);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(37, 58, 92, 0.10);
}

.hero { text-align: center; }

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 510px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.7;
  word-break: keep-all;
}

.copy-all {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  margin-top: 34px;
}

.copy-all:hover:not(:disabled) { transform: translateY(-1px); background: #263248; }
.copy-all:disabled { cursor: wait; opacity: 0.55; }

.manual-refresh {
  width: 100%;
  margin-top: 10px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.manual-refresh:hover:not(:disabled) { border-color: #adc4ed; background: #edf4ff; }
.manual-refresh:disabled { cursor: wait; opacity: 0.55; }

.league-section { margin-top: 44px; }
.league-section h2 { margin: 0 0 18px; font-size: 22px; letter-spacing: -0.035em; }

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

.league-button {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 93, 207, 0.18);
  border-radius: 19px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 9px 20px rgba(47, 111, 236, 0.18);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.league-button:hover { transform: translateY(-2px); background: var(--blue-dark); box-shadow: 0 13px 26px rgba(47, 111, 236, 0.24); }
.league-button:active { transform: translateY(0); }
.league-button:focus-visible,
.copy-all:focus-visible,
.manual-refresh:focus-visible { outline: 3px solid #9dc0ff; outline-offset: 3px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 20px);
  padding: 12px 17px;
  border-radius: 12px;
  background: #121926;
  color: white;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 12px 35px rgba(18, 25, 38, 0.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .page-shell { padding: 0; align-items: start; }
  .rank-card { min-height: 100vh; border: 0; border-radius: 0; padding: 42px 20px 30px; box-shadow: none; }
  .league-grid { gap: 9px; }
  .league-button { min-height: 78px; border-radius: 16px; }
}

@media (max-width: 370px) {
  .league-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
