:root {
  --red: #e60012;
  --red-deep: #c40010;
  --ink: #1a1a1a;
  --muted: #5c6470;
  --line: #f0d4dc;
  --gold: #c9a227;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --display: "Zen Maru Gothic", "Zen Kaku Gothic New", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.7;
  background:
    radial-gradient(1200px 600px at 10% -5%, #ffd0e4 0%, transparent 55%),
    radial-gradient(900px 500px at 95% 20%, #ffc2d9 0%, transparent 50%),
    linear-gradient(165deg, #ffe0ec 0%, #fff0f6 40%, #ffc9dc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 236, 244, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 100, 140, .12);
}
.header-inner {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  min-height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
}
.logo-mark.sm { width: 28px; height: 28px; font-size: 14px; }
.nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--red); }

.hero {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 18px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 12px; color: var(--red); font-weight: 700; font-size: 14px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.3;
}
.lead { margin: 0 0 10px; color: var(--muted); max-width: 34em; }
.vote-status {
  display: inline-block;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.vote-status.ok { color: #0f7a45; }
.vote-status.used { color: #9a3412; }

.ranking-panel, .works-panel {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 40px;
}
.section-title {
  margin: 0 0 18px;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 30px);
}
.section-sub { text-align: center; color: var(--muted); margin: -8px 0 22px; font-size: 14px; }

.ranking-list { display: grid; gap: 10px; }
.rank-row {
  display: grid;
  grid-template-columns: 56px 72px 1fr auto auto;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.rank-row:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(180,60,100,.12); }
.rank-num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.rank-row.top1 .rank-num { color: #c9a227; }
.rank-row.top2 .rank-num { color: #8a95a8; }
.rank-row.top3 .rank-num { color: #b87333; }
.rank-thumb {
  width: 64px; height: 80px; border-radius: 10px; object-fit: cover;
}
.rank-name { font-weight: 700; font-size: 16px; }
.rank-sub { color: var(--muted); font-size: 12px; }
.rank-votes { font-weight: 700; color: var(--red); font-size: 15px; white-space: nowrap; }
.rank-open {
  border: none; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.work-card {
  margin: 0;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.work-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(180,60,100,.14); }
.work-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.work-card .cap { padding: 10px 12px 12px; }
.work-card .cap strong { display: block; font-size: 15px; }
.work-card .cap span { color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: none; cursor: pointer; font: inherit; font-weight: 700;
}
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 10px 28px rgba(230,0,18,.28);
  width: 100%;
}
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--red-deep); }

.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(40, 10, 25, .45);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.5); color: #fff;
  font-size: 22px; cursor: pointer;
}
.modal-gallery { background: #111; }
.modal-gallery > img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
}
.thumbs {
  display: flex; gap: 6px; padding: 8px; overflow-x: auto;
  background: #1a1a1a;
}
.thumbs button {
  border: 2px solid transparent; padding: 0; border-radius: 8px;
  overflow: hidden; cursor: pointer; background: none; flex: 0 0 auto;
}
.thumbs button.active { border-color: var(--red); }
.thumbs img { width: 56px; height: 72px; object-fit: cover; }
.modal-body { padding: 28px 24px 24px; }
.rank-badge {
  display: inline-block; margin: 0 0 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(230,0,18,.08); color: var(--red);
  font-size: 12px; font-weight: 700;
}
.modal-body h2 {
  margin: 0; font-family: var(--display); font-size: 28px;
}
.romaji { margin: 2px 0 12px; color: var(--muted); font-size: 13px; }
.intro { margin: 0 0 16px; color: #334155; font-size: 14px; }
.meta {
  margin: 0 0 18px; display: grid; gap: 10px;
}
.meta > div {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 8px; font-size: 14px;
  padding-bottom: 8px; border-bottom: 1px solid #f1e4ea;
}
.meta dt { color: var(--muted); margin: 0; }
.meta dd { margin: 0; font-weight: 600; }
.vote-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.vote-msg.ok { color: #0f7a45; }
.vote-msg.err { color: var(--red); }

.site-footer {
  background: #111827; color: #cbd5e1;
  padding: 36px 16px 48px; margin-top: 20px;
}
.footer-inner { width: min(1100px, 100%); margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 8px; }
.footer-inner p { margin: 0 0 6px; font-size: 13px; }
.copy { opacity: .65; margin-top: 14px !important; }

@media (max-width: 900px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-card { grid-template-columns: 1fr; }
  .modal-gallery > img { aspect-ratio: 3/3.4; max-height: 46vh; }
  .rank-row { grid-template-columns: 44px 56px 1fr auto; }
  .rank-open { display: none; }
}
@media (max-width: 560px) {
  .nav { gap: 12px; font-size: 13px; }
  .rank-row { grid-template-columns: 36px 48px 1fr; gap: 8px; }
  .rank-votes { grid-column: 2 / -1; }
}
