:root {
  --bg-top: #1f3a34;
  --bg-mid: #2f554c;
  --bg-bottom: #e8efe9;
  --ink: #1b2421;
  --muted: #5c6a64;
  --accent: #c45c26;
  --line: rgba(27, 36, 33, 0.12);
  --surface: rgba(255, 252, 247, 0.94);
  --shadow: 0 12px 28px rgba(18, 32, 28, 0.1);
  --font-display: "Zen Maru Gothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
  --tap: 2.75rem;
  --gutter: 0.85rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 32%, #7f9a8d 58%, var(--bg-bottom) 100%);
  background-attachment: scroll;
}

.page-shell {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.85rem var(--gutter) 2.5rem;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.site-header {
  display: none;
}

.site-disclaimer-top {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(248, 244, 235, 0.18);
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.12);
  color: rgba(248, 244, 235, 0.55);
  font-size: 0.68rem;
  line-height: 1.45;
  font-weight: 400;
}

.hero {
  padding: 1.1rem 0 1rem;
  color: #f8f4eb;
  animation: rise 0.55s ease-out both;
}

.hero-brand {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 8vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.hero h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
}

.hero .cat-name {
  color: #8ef0c2;
  font-weight: 700;
  text-shadow: 0 0 0.55rem rgba(142, 240, 194, 0.28);
}

.ranking-source {
  color: rgba(248, 244, 235, 0.86);
  font-weight: 500;
}

.hero-lead .cat-name {
  color: #8ef0c2;
  font-weight: 700;
  text-shadow: 0 0 0.55rem rgba(142, 240, 194, 0.28);
}

.lead-sep {
  margin: 0 0.25rem;
  opacity: 0.7;
}

.hero-lead {
  margin: 0.55rem 0 0;
  color: rgba(248, 244, 235, 0.86);
  font-size: 0.88rem;
  line-height: 1.55;
}

.updated-at {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0.12rem 0.45rem;
  border-radius: 0.3rem;
  background: rgba(224, 138, 79, 0.22);
  color: #ffd7b0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.acquired-label {
  color: #ffd7b0;
  font-weight: 600;
}

.filters,
.genre-nav,
.ranking-section,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.filters {
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  animation: rise 0.6s ease-out 0.05s both;
}

.filter-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.filter-form select,
.filter-form button {
  font: inherit;
  width: 100%;
  min-height: var(--tap);
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  background: #fff;
  color: var(--ink);
}

.filter-form button {
  grid-column: 1 / -1;
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.filter-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.genre-nav {
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  animation: rise 0.65s ease-out 0.08s both;
}

.genre-nav h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.genre-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
  margin: 0 0 0.85rem;
}

.genre-combo label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.genre-combo select,
.genre-combo button {
  font: inherit;
  min-height: var(--tap);
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: var(--ink);
}

.genre-combo button {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.genre-or {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.breadcrumb .cat-name {
  color: #1f7a62;
  font-weight: 600;
}

.breadcrumb a.cat-name:hover,
.breadcrumb a.cat-name:active {
  color: var(--accent);
}

.breadcrumb .cat-current {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: rgba(31, 122, 98, 0.12);
  color: #176554;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--muted);
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.genre-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: #fff;
  font-size: 0.84rem;
}

.genre-list a,
.breadcrumb a,
.pager a,
.item-link {
  color: #245248;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.genre-list a:active,
.breadcrumb a:active,
.pager a:active,
.item-link:active .item-name {
  color: var(--accent);
}

.notice {
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.notice-error {
  border-color: rgba(180, 60, 40, 0.35);
  color: #8a2f1d;
}

.notice-info {
  border-color: rgba(36, 82, 72, 0.28);
  color: #245248;
  background: rgba(36, 82, 72, 0.05);
}

.ranking-section {
  padding: 0.15rem 0 0.85rem;
  animation: rise 0.7s ease-out 0.1s both;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ranking-item + .ranking-item {
  border-top: 1px solid var(--line);
}

.item-link {
  display: grid;
  grid-template-columns: 2rem 4.5rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.75rem 0.65rem;
  min-height: 5.5rem;
}

.rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  padding-top: 0.05rem;
}

.rank-crown {
  font-size: 0.85rem;
  line-height: 1;
}

.rank-num {
  line-height: 1;
}

.rank-1 {
  color: #8a6a12;
}

.rank-1 .rank-crown {
  color: #d4a017;
  text-shadow: 0 0 0.35rem rgba(212, 160, 23, 0.45);
}

.rank-1 .rank-num {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe9a0, #e0b125 55%, #b8860b);
  color: #4a3408;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.rank-2 {
  color: #5c6570;
}

.rank-2 .rank-crown {
  color: #9aa3ad;
  text-shadow: 0 0 0.35rem rgba(154, 163, 173, 0.4);
}

.rank-2 .rank-num {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f2f4f6, #c5ccd3 55%, #8e97a1);
  color: #2f363e;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rank-3 {
  color: #7a4e2a;
}

.rank-3 .rank-crown {
  color: #c47a3a;
  text-shadow: 0 0 0.35rem rgba(196, 122, 58, 0.4);
}

.rank-3 .rank-num {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0c49a, #d08a4a 55%, #a05c28);
  color: #3f2612;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.thumb {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(36, 82, 72, 0.08), rgba(196, 92, 38, 0.08));
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-fallback {
  color: var(--muted);
  font-size: 0.7rem;
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.item-catch {
  display: none;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.item-meta strong {
  color: var(--accent);
  font-size: 0.98rem;
}

.item-meta .shop {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.65rem 0.25rem;
  font-size: 0.9rem;
}

.pager a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #fff;
  font-weight: 500;
}

.pager a[href].prev {
  justify-self: start;
}

.pager a[href].next,
.pager .next {
  justify-self: end;
}

.pager .page-status {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  margin-top: 1.1rem;
  color: rgba(27, 36, 33, 0.75);
  font-size: 0.75rem;
  line-height: 1.5;
}

.footer-disclaimer {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(196, 92, 38, 0.35);
  border-radius: 0.35rem;
  background: rgba(196, 92, 38, 0.08);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.65;
}

.pr-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  vertical-align: middle;
}

.affiliate-note {
  margin: 0;
  padding: 0.75rem 0.65rem 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.price-note {
  margin: 0;
  padding: 0.35rem 0.65rem 0.65rem;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}

.price-note-after {
  padding: 0.75rem 0.65rem 0.35rem;
  border-bottom: none;
  border-top: 1px solid var(--line);
}

.footer-links {
  margin: 0.55rem 0 0;
}

.footer-links a {
  color: #245248;
  text-decoration: underline;
}

.legal-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem 0.9rem 1.25rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.92rem;
}

.legal-doc h2 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1rem;
}

.legal-doc ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.legal-doc li + li {
  margin-top: 0.25rem;
}

.legal-updated {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.contact-mail {
  margin: 0.65rem 0 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.contact-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.legal-back {
  margin: 1.4rem 0 0;
}

.legal-back a {
  color: #245248;
}

.page-jump {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.page-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: var(--tap);
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: var(--shadow);
  color: #245248;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.page-jump-btn:active {
  color: var(--accent);
}

.bookmark-btn {
  position: fixed;
  top: max(0.7rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: var(--tap);
  padding: 0 0.7rem;
  border: 1px solid rgba(244, 239, 230, 0.35);
  border-radius: 999px;
  background: rgba(27, 36, 33, 0.72);
  box-shadow: var(--shadow);
  color: #ffd7b0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
}

.bookmark-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.bookmark-btn:active {
  color: #fff;
}

.bookmark-backdrop {
  position: fixed;
  inset: 0;
  z-index: 46;
  background: rgba(18, 28, 24, 0.45);
}

.bookmark-panel {
  position: fixed;
  left: 50%;
  top: max(4.5rem, calc(env(safe-area-inset-top) + 3.8rem));
  right: auto;
  z-index: 47;
  width: min(calc(100% - 1.5rem), 22rem);
  transform: translateX(-50%);
  padding: 0.95rem 0.9rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.bookmark-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.bookmark-panel-body {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.bookmark-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.bookmark-panel-share,
.bookmark-panel-close {
  font: inherit;
  min-height: var(--tap);
  padding: 0.4rem 0.85rem;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}

.bookmark-panel-share {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.bookmark-panel-close {
  background: #fff;
  color: #245248;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .page-shell {
    max-width: 48rem;
    padding: 1.25rem 1.25rem 3rem;
  }

  .site-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    color: #f7f3ea;
  }

  .brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
  }

  .brand-tag {
    margin: 0;
    opacity: 0.86;
    font-size: 0.9rem;
  }

  .hero {
    padding: 1.6rem 0 1.25rem;
  }

  .hero-brand {
    font-size: clamp(2.4rem, 5vw, 3.4rem);
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
  }

  .filter-form label {
    min-width: 8rem;
  }

  .filter-form select,
  .filter-form button {
    width: auto;
  }

  .filter-form button {
    grid-column: auto;
  }

  .item-link {
    grid-template-columns: 2.6rem 5.5rem minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.9rem 0.85rem;
  }

  .thumb {
    width: 5.5rem;
    height: 5.5rem;
  }

  .item-name {
    -webkit-line-clamp: 3;
    font-size: 1rem;
  }

  .item-catch {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }

  .item-meta {
    font-size: 0.84rem;
  }
}

@media (min-width: 900px) {
  .page-shell {
    max-width: 58rem;
  }

  .item-link {
    grid-template-columns: 3rem 6.5rem minmax(0, 1fr);
  }

  .thumb {
    width: 6.5rem;
    height: 6.5rem;
  }

  .item-link:hover {
    background: rgba(36, 82, 72, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero,
  .filters,
  .genre-nav,
  .ranking-section {
    animation: none;
  }
}

.admin-stats {
  padding: 1rem 0.9rem 1.35rem;
  margin: 0.35rem 0 1.25rem;
  background: #fffdf8;
  border: 1px solid rgba(27, 36, 33, 0.16);
  border-radius: 0.45rem;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.admin-stats .section-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.admin-meta {
  margin: 0.4rem 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.admin-meta code {
  display: inline-block;
  margin: 0.05rem 0;
  padding: 0.08rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(31, 58, 52, 0.1);
  color: #1f3a34;
  font-size: 0.86em;
}

.admin-day {
  margin-top: 0.95rem;
  padding: 0.75rem 0.7rem 0.55rem;
  background: #ffffff;
  border: 1px solid rgba(27, 36, 33, 0.14);
  border-radius: 0.4rem;
}

.admin-day-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.admin-day-total {
  margin-left: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid rgba(27, 36, 33, 0.12);
  text-align: left;
  vertical-align: top;
}

.admin-table thead th {
  background: #1f3a34;
  color: #f8f4eb;
  font-weight: 600;
  border-bottom: none;
}

.admin-table thead th:first-child {
  border-radius: 0.3rem 0 0 0.3rem;
}

.admin-table thead th:last-child {
  border-radius: 0 0.3rem 0.3rem 0;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(31, 58, 52, 0.06);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1f3a34;
  white-space: nowrap;
}
