:root {
  --bg-color: #f8f5ff;
  --paper-color: #ffffff;
  --text-main: #374151;
  --text-muted: #6b7280;
  --brand: #8b5cf6;
  --brand-light: #ddd6fe;
  --accent: #4c1d95;
  --rule-line: #e8e2ff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg-color);
  background-image:
    linear-gradient(transparent 95%, rgba(139, 92, 246, 0.06) 5%),
    linear-gradient(90deg, transparent 95%, rgba(139, 92, 246, 0.06) 5%);
  background-size: 20px 20px;
  color: var(--text-main);
  font-family: "Quicksand", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  line-height: 1.6;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: relative;
  z-index: 10;
  padding: 8px 16px;
  border-bottom: 3px solid var(--brand);
  background: var(--paper-color);
  text-align: center;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.14);
}

.home-link {
  display: inline-block;
  text-decoration: none;
}

.site-title {
  margin: 0;
  color: var(--accent);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.2;
}

.page-affiliate-note {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
}

.layout-shell {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1280px;
  margin: 14px auto 24px;
  padding: 0 16px;
}

.main-content {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 24px 22px;
  border-radius: 8px 16px 16px 8px;
  background: var(--paper-color);
  box-shadow: 0 8px 30px rgba(42, 33, 73, 0.07);
}

@media (min-width: 851px) {
  .main-content {
    padding-left: 56px;
  }

  .main-content::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 16px;
    width: 14px;
    background-image: radial-gradient(circle, var(--bg-color) 40%, transparent 45%);
    background-size: 14px 36px;
    background-repeat: repeat-y;
  }
}

.panel {
  margin-bottom: 0;
}

.home-description {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.home-card {
  --site-accent: var(--brand);
  display: grid;
  min-width: 0;
  padding: 18px 16px;
  border: 2px solid color-mix(in srgb, var(--site-accent) 42%, white);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbf9ff 0%, #fff 100%);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(42, 33, 73, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-card:hover,
.home-card:focus-visible {
  border-color: var(--site-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(42, 33, 73, 0.11);
  outline: none;
}

.home-card-title {
  min-width: 0;
  margin: 0;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-footer {
  padding: 8px 16px 10px;
  border-top: 3px solid var(--brand);
  background: var(--paper-color);
  text-align: center;
}

.copyright {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.footer-disclaimer {
  display: block;
  margin-top: 2px;
}

.right-ad {
  position: sticky;
  top: 24px;
  width: 300px;
  flex: 0 0 300px;
  padding: 14px 16px 16px;
  border: 1px dashed var(--brand-light);
  border-radius: 12px;
  background: var(--paper-color);
  text-align: center;
}

.ad-disclosure {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.ad-slot {
  position: relative;
  margin-bottom: 24px;
}

.ad-slot:last-child {
  margin-bottom: 0;
}

.right-ad .ad-slot > .pr-label,
.sp-ad-card > .pr-label {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border: 1px solid rgba(244, 114, 182, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(190, 24, 93, 0.12);
}

.right-ad .ad-slot > .pr-label {
  top: -0.35rem;
  right: 0.25rem;
}

.ad-image-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.ad-image-slot > a {
  display: block;
  margin: 0;
}

.ad-image-slot > a > img {
  display: block;
  margin: 0 auto !important;
}

.ad-image-slot a {
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.ad-image-slot img,
.ad-code-area img,
.sp-ad-viewport img,
.ad-product-unit iframe,
.ad-product-unit table,
.ad-product-unit td {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
}

.ad-image-slot img[width="1"][height="1"],
.ad-code-area img[width="1"][height="1"] {
  display: none !important;
}

.ad-buy-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.ad-buy-link {
  padding: 7px 12px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--paper-color);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.ad-buy-link:hover,
.ad-buy-link:focus-visible {
  background: var(--brand);
  color: var(--paper-color);
  outline: none;
}

.ad-creative-sp,
.mobile-ad-slot {
  display: none;
}

.mobile-ad-slot:empty {
  display: none;
}

@media (max-width: 850px) {
  .layout-shell {
    display: block;
    margin-top: 10px;
    padding: 0 8px;
  }

  .main-content {
    padding: 10px;
  }

  .page-affiliate-note {
    margin-top: 6px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .right-ad {
    display: none !important;
  }

  .mobile-ad-slot {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    overflow: hidden;
  }

  .mobile-ad-slot[data-mobile-ad-slot="bottom"] {
    margin: 12px 0 0;
  }

  .sp-ad-viewport {
    display: block;
    width: 100%;
  }

  .sp-ad-card {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 1.45rem 8px 8px;
    border: 1px solid rgba(244, 114, 182, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
  }

  .sp-ad-card > .pr-label {
    top: 5px;
    right: 6px;
  }

  .sp-ad-card > .ad-product-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
  }

  .sp-ad-card .ad-image-slot {
    width: 100%;
    min-width: 0;
  }

  .sp-ad-card .ad-image-slot > a,
  .sp-ad-card .ad-image-slot a {
    display: block;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-wrap: anywhere !important;
    word-break: break-word;
    line-break: anywhere;
    white-space: normal !important;
  }

  .sp-ad-card .ad-product-unit[data-ad-id="AD01"] .ad-image-slot a {
    font-size: 0.62rem;
  }

  .sp-ad-card .ad-buy-links {
    gap: 4px;
    margin-top: 4px;
  }

  .sp-ad-card .ad-buy-link {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 0.76rem;
  }

}

@media (max-width: 520px) {
  .site-title {
    font-size: 1.55rem;
  }

  .home-card {
    padding: 14px 12px;
  }

  .home-description {
    font-size: 0.82rem;
  }

  .home-card-title {
    font-size: 0.96rem;
  }
}

@media (max-width: 360px) {
  .layout-shell {
    padding: 0 2px;
  }

  .main-content {
    padding: 6px;
  }

  .home-description {
    font-size: 0.66rem;
  }

  .home-card {
    padding: 10px;
  }

  .home-card-title {
    font-size: 0.9rem;
  }
}
