/* ===== Gakuran Wiki — shared styles ===== */
:root {
  /* === Sakura Dusk theme — warm plum base + 樱花粉/桃色 accents === */
  --bg: #17121a;            /* warm near-black plum */
  --bg-soft: #1f1822;
  --bg-card: #251c2a;
  --bg-card-hover: #2e2334;
  --border: #3d3043;
  --border-soft: #2d2433;
  --text: #f5edf0;
  --text-soft: #c9b7c1;
  --text-dim: #93808c;
  --accent: #f06384;       /* sakura coral-rose */
  --accent-soft: #ff9cb4;
  --accent-dim: #7e2f47;
  --gold: #f0c469;         /* warm peach-gold */
  --purple: #b083ff;
  --blue: #6bb0ff;
  --green: #57cf9a;
  --radius: 14px;
  --maxw: 1180px;
  --sidebar-w: 256px;
  --font: "Hiragino Sans", "PingFang SC", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* Site-wide fixed background image with dark overlay for readability */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: url("../assets/bg-concert.png") center center / cover no-repeat;
  background-attachment: fixed;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% -8%, rgba(240,99,132,.20), transparent 48%),
    radial-gradient(circle at 88% 4%, rgba(255,178,150,.12), transparent 42%),
    linear-gradient(180deg, rgba(28,20,30,.82), rgba(23,18,26,.92) 55%, rgba(20,15,23,.97));
}

a { color: var(--accent-soft); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(28,21,31,.90);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px 40px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}
.brand .logo {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: url("../assets/favicon.png") center / cover no-repeat;
  font-size: 0; color: transparent;
  box-shadow: 0 4px 14px rgba(240,99,132,.35);
}
.brand .brand-txt b { font-size: 16px; letter-spacing: .5px; display: block; }
.brand .brand-txt span { font-size: 11.5px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; }

.nav-group { margin-bottom: 18px; }
.nav-group h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-dim); padding: 0 10px 8px; font-weight: 700;
}
.nav-group a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--text-soft); font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-group a .ic { font-size: 15px; width: 18px; text-align: center; opacity: .9; }
.nav-group a:hover { background: var(--bg-card); color: var(--text); }
.nav-group a.active {
  background: linear-gradient(90deg, rgba(240,99,132,.18), rgba(240,99,132,.03));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ===== Main ===== */
.main { flex: 1; min-width: 0; }
.content { max-width: 880px; margin: 0 auto; padding: 40px 32px 90px; }

/* topbar (mobile) */
.topbar {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--border-soft);
  background: rgba(23,18,26,.9); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.topbar .t-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .t-brand .logo { width: 30px; height: 30px; font-size: 0; color: transparent; border-radius: 8px;
  background: url("../assets/favicon.png") center / cover no-repeat; }
.menu-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  font-size: 20px; padding: 4px 12px; border-radius: 8px; cursor: pointer; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 58px 42px;
  background:
    linear-gradient(105deg, rgba(28,18,28,.92) 0%, rgba(40,22,38,.78) 42%, rgba(60,30,48,.45) 100%),
    url("../assets/shot-courtyard.png") center 30% / cover no-repeat;
  border: 1px solid var(--border);
  margin-bottom: 36px;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.hero::after {
  content: "学乱"; position: absolute; right: -8px; bottom: -34px;
  font-size: 175px; font-weight: 900; color: rgba(255,255,255,.06);
  letter-spacing: -8px; pointer-events: none;
  text-shadow: 0 2px 30px rgba(240,99,132,.2);
}
.hero .kanji-badge {
  display: inline-block; font-size: 13px; letter-spacing: 3px;
  color: var(--accent-soft); border: 1px solid var(--accent-dim);
  padding: 5px 14px; border-radius: 30px; margin-bottom: 18px;
  background: rgba(240,99,132,.08); text-transform: uppercase;
}
.hero h1 { font-size: 46px; line-height: 1.1; margin-bottom: 14px; letter-spacing: -.5px; }
.hero p { font-size: 17px; color: var(--text-soft); max-width: 560px; position: relative; z-index: 1; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(240,99,132,.32); }
.btn-primary:hover { background: var(--accent-soft); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); color: #fff; transform: translateY(-2px); }

/* ===== Typography ===== */
.section-title {
  font-size: 26px; margin: 44px 0 6px; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 12px;
  font-weight: 700;
}
h1.section-title:first-of-type { margin-top: 8px; }
.section-title::before {
  content: ""; width: 4px; height: 26px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-dim));
}
.section-sub { color: var(--text-dim); margin-bottom: 22px; font-size: 14.5px; }
h3 { font-size: 19px; margin: 28px 0 10px; }
p { margin-bottom: 14px; color: var(--text-soft); }
.content ul, .content ol { margin: 0 0 16px 22px; color: var(--text-soft); }
.content li { margin-bottom: 7px; }
strong { color: var(--text); font-weight: 650; }
code.k {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 6px; font-size: 13px;
  color: var(--gold); font-family: "SF Mono", "Cascadia Code", monospace;
  font-weight: 600;
}

/* ===== Cards ===== */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px;
  transition: transform .15s, border-color .15s, background .15s;
}
.card:hover { border-color: var(--border); background: var(--bg-card-hover); transform: translateY(-3px); }
.card .card-ic { font-size: 26px; margin-bottom: 10px; display: block; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { font-size: 14px; margin: 0; color: var(--text-dim); }
a.card { color: inherit; display: block; }
a.card h3 { color: var(--text); }
a.card:hover h3 { color: var(--accent-soft); }

/* ===== Callout ===== */
.callout {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px;
  margin: 20px 0; border: 1px solid var(--border); background: var(--bg-soft);
}
.callout .c-ic { font-size: 20px; flex-shrink: 0; }
.callout p { margin: 0; font-size: 14px; }
.callout.tip { border-color: rgba(70,201,126,.35); background: rgba(70,201,126,.06); }
.callout.warn { border-color: rgba(243,196,75,.35); background: rgba(243,196,75,.06); }
.callout.info { border-color: rgba(74,163,255,.35); background: rgba(74,163,255,.06); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border-soft); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { background: var(--bg-soft); color: var(--text); font-weight: 650; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
td { color: var(--text-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; }
.b-common   { background: rgba(164,168,182,.15); color: #c7cad4; }
.b-uncommon { background: rgba(70,201,126,.16); color: var(--green); }
.b-rare     { background: rgba(74,163,255,.16); color: var(--blue); }
.b-epic     { background: rgba(155,107,255,.18); color: var(--purple); }
.b-legend   { background: rgba(243,196,75,.18); color: var(--gold); }
.b-zone-green { background: rgba(70,201,126,.16); color: var(--green); }
.b-zone-red { background: rgba(240,99,132,.16); color: var(--accent-soft); }
.b-zone-neutral { background: rgba(164,168,182,.15); color: #c7cad4; }

/* ===== Key controls ===== */
.keys { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.keycap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 14px;
}
.keycap kbd {
  background: linear-gradient(180deg,#2b2f3a,#1c1f28);
  border: 1px solid #3a3f4d; border-bottom-width: 2px;
  border-radius: 6px; padding: 3px 9px; font-size: 12.5px;
  font-family: "SF Mono", monospace; font-weight: 700; color: var(--text);
}
.keycap span { color: var(--text-soft); }

/* ===== Stat compare ===== */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.compare .col { border: 1px solid var(--border-soft); border-radius: 12px; padding: 18px; background: var(--bg-card); }
.compare .col h4 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.compare .tall h4 { color: var(--accent-soft); }
.compare .short h4 { color: var(--blue); }
.compare ul { margin: 0 0 0 18px; }
.compare li { font-size: 13.5px; }
.pro::marker { content: "+ "; color: var(--green); }
.con::marker { content: "− "; color: var(--accent); }

/* ===== Steps ===== */
.steps { counter-reset: step; margin: 22px 0; }
.step { position: relative; padding: 0 0 22px 52px; }
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 17px; top: 8px; bottom: -6px; width: 2px; background: var(--border);
}
.step::after {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 36px; height: 36px;
  background: var(--bg-card); border: 1px solid var(--accent-dim);
  color: var(--accent-soft); border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.step h3 { margin: 4px 0 6px; font-size: 16.5px; }
.step p { margin: 0; font-size: 14px; }

/* ===== Source video cards ===== */
.video-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; margin: 20px 0; }
.vcard { display: flex; gap: 14px; background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 14px; transition: border-color .15s, transform .15s; }
.vcard:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.vcard .vthumb { width: 92px; height: 60px; border-radius: 8px; flex-shrink: 0; overflow: hidden; background: var(--bg-soft); }
.vcard .vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard .vmeta b { font-size: 14px; color: var(--text); display: block; line-height: 1.35; margin-bottom: 4px; }
.vcard .vmeta span { font-size: 12px; color: var(--text-dim); }

/* ===== Responsive video embed ===== */
.video-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  border-radius: 14px; overflow: hidden; margin: 6px 0 8px;
  border: 1px solid var(--border); background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed.vertical { padding-top: 0; height: 0; padding-bottom: 0; }
.media-cap { font-size: 12.5px; color: var(--text-dim); margin: 0 0 22px; }
.media-cap a { color: var(--text-soft); }

/* featured video (hero side) */
.featured {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 18px; margin: 8px 0 10px;
}
.featured .video-embed { margin: 0; }
.featured .f-txt h3 { margin: 0 0 8px; font-size: 18px; }
.featured .f-txt p { font-size: 13.5px; margin: 0 0 8px; }
.featured .f-txt .by { font-size: 12px; color: var(--text-dim); }

/* ===== Figure / image ===== */
figure.shot { margin: 18px 0 6px; }
figure.shot img {
  width: 100%; border-radius: 14px; border: 1px solid var(--border);
  display: block; box-shadow: 0 8px 22px rgba(0,0,0,.3);
  aspect-ratio: 16/9; object-fit: cover; background: var(--bg-soft);
}
figure.shot figcaption { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }

/* image gallery */
.gallery { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0 6px; }
.gallery a { position: relative; display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border-soft); aspect-ratio: 16/9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.07); }
.gallery a .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.55));
  opacity: 0; transition: opacity .2s;
}
.gallery a:hover .play { opacity: 1; }
.gallery a .play::after { content: "▶"; color: #fff; font-size: 22px;
  background: rgba(240,99,132,.9); width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 3px; }
.gallery a .cap { position: absolute; left: 8px; bottom: 7px; right: 8px; z-index: 2;
  font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8);
  opacity: 0; transition: opacity .2s; }
.gallery a:hover .cap { opacity: 1; }

/* screenshot gallery: real images, caption always visible, no play icon */
.gallery.shots a .play { display: none; }
.gallery.shots a .cap {
  opacity: 1; padding: 14px 10px 8px;
  background: linear-gradient(transparent, rgba(15,10,16,.85));
  font-size: 11.5px; font-weight: 500;
}
.gallery.shots a::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,156,180,.0);
  transition: box-shadow .2s; pointer-events: none;
}
.gallery.shots a:hover::after { box-shadow: inset 0 0 0 2px rgba(255,156,180,.55); }

@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
}

/* ===== FAQ accordion ===== */
.faq { margin: 18px 0; }
.faq details {
  border: 1px solid var(--border-soft); border-radius: 12px;
  background: var(--bg-card); margin-bottom: 12px; overflow: hidden;
  transition: border-color .15s;
}
.faq details[open] { border-color: var(--accent-dim); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  font-weight: 600; font-size: 15.5px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-soft); font-size: 22px; font-weight: 400; flex-shrink: 0; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent-soft); }
.faq .faq-body { padding: 0 18px 16px; color: var(--text-soft); font-size: 14px; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ===== Codes status box ===== */
.status-box {
  display: flex; align-items: center; gap: 16px; padding: 22px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card);
  margin: 18px 0;
}
.status-box .s-ic { font-size: 38px; flex-shrink: 0; }
.status-box h3 { margin: 0 0 4px; font-size: 18px; }
.status-box p { margin: 0; font-size: 14px; }
.status-pill { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: rgba(243,196,75,.16); color: var(--gold); margin-left: 8px; }

/* ===== Light (Sakura Daytime) theme ===== */
html[data-theme="light"] {
  --bg: #fdf2f5;
  --bg-soft: #fbe8ee;
  --bg-card: #ffffff;
  --bg-card-hover: #fdeff3;
  --border: #f0d2dc;
  --border-soft: #f5dee6;
  --text: #3a2530;
  --text-soft: #6b5460;
  --text-dim: #9a8590;
  --accent: #e3496a;
  --accent-soft: #ee7a93;
  --accent-dim: #f7c8d4;
  --gold: #b07a16;
  --purple: #8a4fe0;
  --blue: #2f7fd6;
  --green: #1f9d6b;
}
html[data-theme="light"] body::before { display: none; }
html[data-theme="light"] body::after {
  background:
    radial-gradient(circle at 12% -8%, rgba(240,99,132,.16), transparent 50%),
    radial-gradient(circle at 88% 4%, rgba(255,178,150,.16), transparent 45%),
    linear-gradient(180deg, #fff6f8, #fdeef2 60%, #fbe6ec);
}
html[data-theme="light"] .sidebar { background: rgba(255,255,255,.9); }
html[data-theme="light"] .topbar { background: rgba(255,250,252,.92); }
html[data-theme="light"] .hero {
  background:
    linear-gradient(105deg, rgba(255,247,250,.93) 0%, rgba(255,227,237,.72) 45%, rgba(255,212,226,.42) 100%),
    url("../assets/shot-courtyard.png") center 30% / cover no-repeat;
  box-shadow: 0 18px 50px rgba(227,73,106,.16);
}
html[data-theme="light"] .hero::after { color: rgba(80,30,50,.06); text-shadow: none; }
html[data-theme="light"] .keycap kbd {
  background: linear-gradient(180deg,#ffffff,#f6e8ee);
  border-color: #e9cdd7; color: var(--text);
}
html[data-theme="light"] .b-common,
html[data-theme="light"] .b-zone-neutral { background: rgba(120,110,120,.13); color: #5c5560; }
html[data-theme="light"] tbody tr:hover { background: rgba(227,73,106,.04); }
html[data-theme="light"] .card,
html[data-theme="light"] .vcard,
html[data-theme="light"] .featured,
html[data-theme="light"] .faq details,
html[data-theme="light"] .compare .col,
html[data-theme="light"] .status-box,
html[data-theme="light"] .pagenav a { box-shadow: 0 4px 16px rgba(190,120,140,.09); }
html[data-theme="light"] figure.shot img,
html[data-theme="light"] .video-embed { box-shadow: 0 10px 26px rgba(190,120,140,.16); }

/* ===== Theme toggle (floating) ===== */
.theme-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--accent); font-size: 22px; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 6px 22px rgba(0,0,0,.3);
  transition: transform .15s, background .15s, box-shadow .15s;
}
.theme-toggle:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 10px 26px rgba(240,99,132,.35); }
.theme-toggle:active { transform: scale(.96); }

/* ===== Lightbox ===== */
img.zoomable { cursor: zoom-in; }
.gallery.shots a { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,6,12,.9); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 36px;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92%; max-height: 82vh; border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12);
  transform: scale(.96); transition: transform .22s;
}
.lightbox.open img { transform: scale(1); }
.lightbox .lb-cap { color: #eee; font-size: 14px; max-width: 720px; text-align: center; line-height: 1.5; }
.lightbox .lb-close {
  position: absolute; top: 16px; right: 22px; font-size: 30px; color: #fff;
  background: none; border: none; cursor: pointer; line-height: 1; opacity: .85;
}
.lightbox .lb-close:hover { opacity: 1; }

/* ===== Sakura petals ===== */
#sakura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#sakura .petal {
  position: absolute; top: -8%;
  background: linear-gradient(135deg, #ffd6e0, #f48fb1);
  border-radius: 100% 0 100% 0;
  opacity: .7; will-change: transform;
  animation: petal-fall linear infinite;
}
@keyframes petal-fall {
  0%   { transform: translateY(-12vh) translateX(0) rotate(0deg); }
  100% { transform: translateY(112vh) translateX(60px) rotate(420deg); }
}
@media (prefers-reduced-motion: reduce) { #sakura { display: none; } }

/* ===== Cursor sakura trail ===== */
.cursor-petal {
  position: fixed; z-index: 150; pointer-events: none; top: 0; left: 0;
  background: linear-gradient(135deg, #ffd6e0, #f48fb1);
  border-radius: 100% 0 100% 0;
  box-shadow: 0 1px 4px rgba(240,99,132,.25);
  will-change: transform, opacity;
}

/* ===== Footer ===== */
.foot { border-top: 1px solid var(--border-soft); margin-top: 60px; padding-top: 24px;
  color: var(--text-dim); font-size: 13px; }
.foot a { color: var(--text-soft); }

/* ===== Page nav (prev/next) ===== */
.pagenav { display: flex; justify-content: space-between; gap: 14px; margin-top: 40px; }
.pagenav a { flex: 1; border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 18px;
  background: var(--bg-card); transition: border-color .15s, background .15s; }
.pagenav a:hover { border-color: var(--accent-dim); background: var(--bg-card-hover); }
.pagenav span { display: block; font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.pagenav b { color: var(--text); font-size: 15px; }
.pagenav .next { text-align: right; }

/* ===== Overlay for mobile sidebar ===== */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 45; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .content { padding: 26px 18px 70px; }
  .hero { padding: 36px 24px; }
  .hero h1 { font-size: 34px; }
  .hero::after { font-size: 110px; }
  .grid-2, .grid-3, .compare { grid-template-columns: 1fr; }
  .pagenav { flex-direction: column; }
}

/* ===== Cross-device hardening (three-end adaptation) ===== */
/* Media never overflows its container */
img, iframe, video, svg { max-width: 100%; }
/* Long URLs / tokens wrap instead of forcing horizontal scroll */
.content { overflow-wrap: anywhere; word-break: break-word; }
.vcard .vmeta b, .vcard .vmeta span, .faq summary { overflow-wrap: anywhere; }

/* Tablet (portrait-ish): keep two-column galleries readable */
@media (min-width: 761px) and (max-width: 1024px) {
  .content { padding: 36px 26px 80px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* Small phones: tighten type and spacing, give thumbs room */
@media (max-width: 480px) {
  .content { padding: 22px 14px 64px; }
  .hero { padding: 30px 18px; border-radius: 16px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15.5px; }
  .hero .kanji-badge { font-size: 11.5px; letter-spacing: 2px; }
  .hero::after { font-size: 84px; bottom: -20px; }
  .hero .cta .btn { flex: 1; justify-content: center; }
  .section-title { font-size: 22px; }
  h3 { font-size: 17.5px; }
  .gallery { grid-template-columns: 1fr; }
  .vcard { flex-direction: column; }
  .vcard .vthumb { width: 100%; height: 150px; }
  .status-box { flex-direction: column; text-align: center; }
  .theme-toggle { right: 14px; bottom: 14px; width: 46px; height: 46px; font-size: 20px; }
  .lightbox { padding: 20px; }
  .lightbox .lb-close { top: 10px; right: 14px; }
}

/* Respect users who reduce motion: calm hover transforms too */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .card:hover, .btn:hover, .vcard:hover, .pagenav a:hover { transform: none; }
}
