:root {
  color-scheme: light;
  --bg: #f4faf5;
  --surface: #ffffff;
  --surface-soft: #edf8f0;
  --text: #172026;
  --muted: #667085;
  --line: #d9e8dc;
  --brand: #159447;
  --brand-dark: #0b7135;
  --shadow: 0 18px 45px rgba(21, 148, 71, 0.08);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.55;
}

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

.links-header {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.links-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1200px, calc(100% - 32px));
  min-width: 0;
  min-height: 62px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  line-height: 1;
}

.brand img {
  display: block;
  width: auto;
  height: 48px;
  max-width: min(320px, 58vw);
}

.back-link {
  flex: 0 1 auto;
  border: 1px solid rgba(21, 148, 71, 0.24);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.links-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 950;
}

.links-hero h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.12;
}

.links-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.links-summary {
  display: grid;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.links-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.links-summary span:first-child {
  border-top: 0;
}

.links-summary b {
  color: var(--brand);
  font-size: 18px;
  line-height: 1;
}

.links-category-nav {
  display: flex;
  gap: 8px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-color: rgba(21, 148, 71, 0.48) rgba(217, 232, 220, 0.7);
  scrollbar-width: thin;
}

.links-category-nav::-webkit-scrollbar {
  height: 6px;
}

.links-category-nav::-webkit-scrollbar-track {
  background: rgba(217, 232, 220, 0.7);
}

.links-category-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(21, 148, 71, 0.48);
}

.links-category-nav a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.links-category-nav a:hover,
.links-category-nav a:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.links-contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid rgba(21, 148, 71, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(237, 248, 240, 0.95), rgba(255, 255, 255, 0.98));
  padding: 12px;
  box-shadow: 0 12px 30px rgba(21, 148, 71, 0.08);
}

.links-contact-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.links-contact-copy strong {
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 950;
  line-height: 1.1;
}

.links-contact-copy span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.links-contact-actions {
  display: flex;
  gap: 8px;
}

.links-contact-button {
  display: inline-flex;
  min-width: 112px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(21, 148, 71, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 8px 18px rgba(21, 148, 71, 0.08);
}

.links-contact-button--banner {
  border-color: rgba(224, 167, 46, 0.42);
  color: #8a5b00;
  box-shadow: 0 12px 26px rgba(224, 167, 46, 0.12);
}

.links-contact-button:hover,
.links-contact-button:focus-visible {
  border-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.links-contact-button--banner:hover,
.links-contact-button--banner:focus-visible {
  border-color: rgba(224, 167, 46, 0.62);
  background: #fff8e6;
  color: #7a4d00;
}

.links-main {
  display: grid;
  gap: 18px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.category-rank {
  border: 1px solid var(--line);
  border-top: 4px solid var(--category-accent, var(--brand));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 24, 24, 0.05);
  overflow: hidden;
}

.category-rank__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 18px 14px;
}

.category-rank__head p {
  margin: 0 0 5px;
  color: var(--category-accent, var(--brand));
  font-size: 12px;
  font-weight: 950;
}

.category-rank__head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
}

.category-rank__head span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbf7;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
}

.rank-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  min-height: 250px;
  margin: 0;
  background: #fff;
  padding: 14px;
}

.rank-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--category-accent, var(--brand));
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.rank-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  border: 1px solid #e6eee8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.rank-logo img {
  display: block;
  max-width: 92%;
  max-height: 32px;
  object-fit: contain;
}

#toto-casino .rank-logo {
  grid-column: 1 / -1;
  height: auto;
  aspect-ratio: 1600 / 433;
  border-radius: 6px;
}

#toto-casino .rank-logo img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.rank-body {
  grid-column: 1 / -1;
  min-width: 0;
}

.rank-body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rank-disclosure {
  flex: 0 0 auto;
  border: 1px solid rgba(224, 167, 46, 0.38);
  border-radius: 4px;
  background: #fffaf0;
  color: #8a5b00;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}

.rank-body small {
  display: block;
  margin-top: 10px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.rank-open {
  grid-column: 1 / -1;
  align-self: end;
  border: 1px solid rgba(21, 148, 71, 0.2);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  padding: 10px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 950;
}

.rank-open:hover,
.rank-open:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.links-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.links-footer p {
  margin: 0;
}

.links-footer a {
  color: var(--brand-dark);
  font-weight: 950;
}

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

  .rank-item {
    min-height: 210px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 20px;
  }

  .links-header__top {
    min-height: 54px;
  }

  .brand {
    align-items: center;
  }

  .brand img {
    height: 38px;
    max-width: min(180px, 46vw);
  }

  .back-link {
    max-width: 138px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .links-hero {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0 12px;
  }

  .links-summary {
    min-width: 0;
  }

  .links-category-nav {
    padding-bottom: 10px;
  }

  .links-contact-panel {
    grid-template-columns: 1fr;
    gap: 9px;
    width: min(1200px, calc(100% - 20px));
    padding: 10px;
  }

  .links-contact-copy {
    justify-items: center;
    text-align: center;
  }

  .links-contact-copy strong {
    font-size: 15px;
  }

  .links-contact-copy span {
    font-size: 12px;
  }

  .links-contact-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .links-contact-button {
    min-width: 0;
    min-height: 40px;
    padding: 9px 6px;
    font-size: 13px;
  }

  .links-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(1200px, calc(100% - 20px));
    padding-top: 14px;
  }

  .category-rank__head {
    align-items: start;
    flex-direction: column;
    gap: 7px;
    padding: 12px 10px 10px;
  }

  .category-rank__head p {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .category-rank__head h2 {
    font-size: 18px;
    line-height: 1.12;
  }

  .category-rank__head span {
    padding: 5px 8px;
    font-size: 10px;
  }

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

  .rank-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    min-height: 0;
    padding: 8px;
  }

  .rank-number {
    grid-column: 1;
    grid-row: 2;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 10px;
  }

  .rank-logo {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    height: 36px;
    border-radius: 7px;
    overflow: visible;
  }

  .rank-logo img {
    width: auto;
    max-width: calc(100% - 8px);
    max-height: 30px;
  }

  #toto-casino .rank-logo {
    grid-column: 1 / -1;
    height: 36px;
    aspect-ratio: auto;
  }

  #toto-casino .rank-logo img {
    width: auto;
    height: auto;
    max-width: calc(100% - 8px);
    max-height: 30px;
    object-fit: contain;
  }

  .rank-body {
    grid-column: 2;
    grid-row: 2;
  }

  .rank-body h3 {
    font-size: 13px;
    line-height: 1.18;
  }

  .rank-body small {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.15;
  }

  .rank-open {
    min-height: 30px;
    padding: 7px 8px;
    font-size: 12px;
  }
}

@media (max-width: 340px) {
  .links-main {
    grid-template-columns: 1fr;
  }
}
