/* ============================================================================
   PJSK Viewer — UI styled after Project Sekai: Colorful Stage
   ----------------------------------------------------------------------------
   Design DNA (derived from the official app + colorfulstage.com + pjsekai.sega.jp):
     · Bright, light background — soft sky/cream gradients with confetti motifs
     · Pop-flat surfaces: white cards with very soft shadows + rounded corners
     · Pill-shaped buttons, white with a colored leading icon
     · Triangle (▲) confetti background pattern in pink/cyan/mint
     · Rounded gothic typography (M PLUS Rounded 1c / Zen Maru Gothic)
     · Pink accent (#ff5fb1-ish) used sparingly for emphasis
     · Unit identity via colored "seal" chips on the side of each card
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&family=Zen+Maru+Gothic:wght@500;700;900&display=swap');

:root {
  /* base palette — light, like the official app */
  --bg-1: #eaf5ff;          /* sky top */
  --bg-2: #fbeaf5;          /* pink bottom */
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --ink: #1a2240;
  --ink-soft: #58608a;
  --muted: #8b94bb;
  --line: #e2e8f5;
  --line-strong: #cfd6ef;

  --accent: #ff5fb1;        /* PJSK pink */
  --accent-2: #33d1e6;      /* miku cyan */
  --accent-3: #88dd44;      /* fresh green */
  --accent-4: #ffd166;      /* highlight yellow */
  --accent-violet: #884cc2;

  /* official-leaning unit colors */
  --u-light_sound:    #4455dd;  /* Leo/need cobalt */
  --u-idol:           #88dd44;  /* MMJ leaf green */
  --u-street:         #ee1166;  /* VBS hot red */
  --u-theme_park:     #ff9900;  /* WxS goldenrod */
  --u-school_refusal: #884cc2;  /* 25-ji violet */
  --u-piapro:         #33d1e6;  /* VS Miku cyan */
  --u-none:           #8b94bb;

  /* shadows */
  --shadow-sm: 0 1px 3px rgba(34, 44, 90, 0.08), 0 1px 2px rgba(34, 44, 90, 0.04);
  --shadow-md: 0 6px 18px rgba(34, 44, 90, 0.10), 0 2px 5px rgba(34, 44, 90, 0.06);
  --shadow-lg: 0 18px 38px rgba(34, 44, 90, 0.14), 0 6px 12px rgba(34, 44, 90, 0.08);
  --shadow-pop: 0 8px 0 rgba(34, 44, 90, 0.10); /* slight chunky-shadow for pill buttons */

  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-ui: "M PLUS Rounded 1c", "Zen Maru Gothic", "Hiragino Maru Gothic ProN",
             -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}

/* ---------- reset & globals ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 80% -10%, #d8efff 0%, transparent 60%),
    radial-gradient(900px 700px at -10% 110%, #ffe0f0 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

/* Triangle confetti motif drawn with CSS — multiple layered SVG data URIs */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    /* pink triangle small */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><polygon points='14,4 25,24 3,24' fill='%23ff8fc4' opacity='0.32'/></svg>"),
    /* cyan triangle medium */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'><polygon points='22,6 40,38 4,38' fill='%2333d1e6' opacity='0.22'/></svg>"),
    /* mint triangle large */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'><polygon points='30,8 54,52 6,52' fill='%2388dd44' opacity='0.18'/></svg>");
  background-position: 6% 12%, 84% 28%, 22% 78%;
  background-repeat: no-repeat;
  background-size: 28px, 44px, 60px;
}
/* second sprinkle layer for richness */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><polygon points='10,3 18,17 2,17' fill='%23ffb74d' opacity='0.25'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><polygon points='18,5 33,31 3,31' fill='%23ff5fb1' opacity='0.18'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><polygon points='7,2 13,12 1,12' fill='%23884cc2' opacity='0.22'/></svg>");
  background-position: 92% 8%, 14% 42%, 68% 88%;
  background-repeat: no-repeat;
  background-size: 20px, 36px, 14px;
}

a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: #e23f96; }
img { display: block; max-width: 100%; }

code {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", monospace;
  background: #eef2fb; color: #36406b;
  padding: 1px 6px; border-radius: 6px;
  font-size: 0.88em; font-weight: 500;
}

/* ---------- layout ---------- */
body {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  position: relative;
}

/* ---------- top header pills (rank/coins style) ---------- */
.top-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.header-pill {
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 16px 6px 8px;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}
.header-pill .ico {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: white; font-size: 14px;
}
.header-pill .label { color: var(--muted); font-size: 11px; font-weight: 600; margin-right: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.header-pill .val { color: var(--ink); font-weight: 800; }

/* ---------- sidebar ---------- */
#nav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex; flex-direction: column;
  box-shadow: 2px 0 18px rgba(34, 44, 90, 0.04);
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  padding: 6px 4px;
}
.brand .brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900; font-size: 18px;
  box-shadow: 0 4px 14px rgba(255, 95, 177, 0.32);
  letter-spacing: -1px;
}
.brand .brand-text { line-height: 1.1; }
.brand .logo {
  font-family: var(--font-display);
  font-weight: 900; font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.brand .brand-sub {
  font-size: 10px; color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 700;
}

#nav nav { display: flex; flex-direction: column; gap: 4px; }
#nav nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft);
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
#nav nav a:hover { background: var(--surface-2); color: var(--ink); }
#nav nav a.active {
  background: linear-gradient(95deg, rgba(255,95,177,0.12), rgba(51,209,230,0.10));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255,95,177,0.18);
}
#nav nav a .nico {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
#nav nav a.active .nico { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }

.region {
  margin-top: 18px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.region label {
  font-size: 10px; color: var(--muted);
  display: block; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 700;
}
.region select {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px; font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
}
.region select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#nav footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  padding-top: 18px;
  font-weight: 500;
}
#nav footer a { color: var(--ink-soft); }

/* ---------- main ---------- */
#app {
  padding: 28px 36px 80px;
  max-width: 1320px;
  position: relative;
  z-index: 1;
}
#view.loading::after {
  content: ""; display: block;
  width: 36px; height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  margin: 100px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { margin: 0 0 6px; font-size: 30px; font-weight: 900; }
h2 { margin: 30px 0 14px; font-size: 20px; font-weight: 800; }
h2 .accent-bar {
  display: inline-block;
  width: 6px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  vertical-align: -4px;
  margin-right: 10px;
}
h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
p.lead { color: var(--ink-soft); margin: 0 0 22px; max-width: 760px; font-weight: 500; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(500px 280px at 90% 10%, rgba(51,209,230,0.18), transparent 60%),
    radial-gradient(420px 280px at 10% 110%, rgba(255,95,177,0.20), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; top: -10px; right: -10px;
  width: 200px; height: 200px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><polygon points='30,30 60,80 0,80' fill='%23ff5fb1' opacity='0.18'/><polygon points='130,20 170,90 90,90' fill='%2333d1e6' opacity='0.18'/><polygon points='60,120 90,170 30,170' fill='%2388dd44' opacity='0.18'/><polygon points='140,130 180,180 100,180' fill='%23ffd166' opacity='0.18'/></svg>") center/contain no-repeat;
  pointer-events: none;
}
.hero h1 {
  position: relative;
  font-size: 34px;
  background: linear-gradient(95deg, var(--accent), var(--accent-2) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { position: relative; color: var(--ink-soft); margin: 10px 0 0; max-width: 720px; font-weight: 500; }

/* ---------- grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  display: block;
  color: var(--ink);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--ink);
}
.card h3 { font-size: 15px; font-weight: 800; color: var(--ink); margin: 6px 0 4px; line-height: 1.3; }
.card .tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(255,95,177,0.30);
}
.card .meta {
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}
.card.unit-stripe::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--stripe, var(--u-none));
}
.card.unit-stripe {
  padding-left: 20px;
}

/* unit color helpers */
.u-light_sound { --stripe: var(--u-light_sound); }
.u-idol { --stripe: var(--u-idol); }
.u-street { --stripe: var(--u-street); }
.u-theme_park { --stripe: var(--u-theme_park); }
.u-school_refusal { --stripe: var(--u-school_refusal); }
.u-piapro { --stripe: var(--u-piapro); }
.u-none { --stripe: var(--u-none); }

/* unit "seal" — like the in-game round chip */
.unit-seal {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 4px;
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 800;
  color: var(--ink);
}
.unit-seal .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--stripe);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
  display: grid; place-items: center;
  color: white; font-size: 12px; font-weight: 900;
}

/* breadcrumbs */
.crumbs { color: var(--ink-soft); margin-bottom: 18px; font-size: 13px; font-weight: 600; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent); }

/* ---------- inputs / search ---------- */
.search-row { display: flex; gap: 10px; margin: 8px 0 22px; flex-wrap: wrap; }
.search-row input, .search-row select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  font-family: var(--font-ui);
  min-width: 180px;
  box-shadow: var(--shadow-sm);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.search-row input:focus, .search-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,95,177,0.18);
}
.search-row input::placeholder { color: var(--muted); }

/* ---------- empty / messages ---------- */
.empty {
  color: var(--ink-soft);
  padding: 50px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  font-weight: 600;
}

/* ---------- buttons ---------- */
.btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-ui);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .14s ease, border-color .14s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(255,95,177,0.30);
}
.btn.primary:hover { box-shadow: 0 10px 22px rgba(255,95,177,0.40); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* The "big action" pill button used on the home for the four hero CTAs,
   inspired by the in-game bottom action bar (Gacha/Characters/Story/Show). */
.action-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 0 0 28px;
}
.action-pill {
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 10px 18px 10px 10px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .14s ease;
  color: var(--ink);
  text-decoration: none;
}
.action-pill:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.action-pill .ap-ico {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 20px;
  color: white;
  background: linear-gradient(135deg, var(--ap-c1, var(--accent)), var(--ap-c2, var(--accent-2)));
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(34,44,90,0.18);
}
.action-pill .ap-text { line-height: 1.15; }
.action-pill .ap-title { font-weight: 800; font-size: 15px; color: var(--ink); }
.action-pill .ap-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; font-weight: 500; }

.action-pill.c-stories  { --ap-c1: #ff7eb6; --ap-c2: #ff5fb1; }
.action-pill.c-events   { --ap-c1: #ffb74d; --ap-c2: #ff9900; }
.action-pill.c-chars    { --ap-c1: #88dd44; --ap-c2: #4caf50; }
.action-pill.c-music    { --ap-c1: #33d1e6; --ap-c2: #4455dd; }
.action-pill.c-assets   { --ap-c1: #b388e0; --ap-c2: #884cc2; }

/* ---------- character grid ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.char-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 14px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
  position: relative;
  overflow: hidden;
}
.char-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.char-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(180deg, var(--stripe, var(--u-none)) 0%, transparent 100%);
  opacity: 0.18;
  pointer-events: none;
}
.char-avatar {
  width: 84px; height: 84px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: var(--stripe, #cfd6ef);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  font-family: var(--font-display);
  font-weight: 900;
  color: white;
  box-shadow:
    inset 0 -4px 0 rgba(0,0,0,0.12),
    0 6px 16px rgba(34,44,90,0.16);
  border: 3px solid white;
  position: relative;
  z-index: 1;
}
.char-name { font-weight: 800; font-size: 14px; color: var(--ink); }
.char-name-en {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase;
}
.char-unit-label {
  color: var(--ink-soft);
  font-size: 11px;
  margin-top: 8px;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  display: inline-block;
}

/* ---------- reader ---------- */
.reader {
  display: grid; grid-template-columns: 1fr; gap: 18px;
  max-width: 940px; margin: 0 auto;
}
.reader-stage {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  aspect-ratio: 16/9;
  background-image: var(--bg-img, none);
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.reader-stage::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(255,255,255,0.85) 95%);
  pointer-events: none;
}
/* If no background image we want a soft fallback gradient */
.reader-stage:not([style*="--bg-img"])::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(135deg, #d8efff 0%, #ffe0f0 100%);
  pointer-events: none;
}
.reader-stage > * { position: relative; z-index: 2; }

/* Speaker portrait — lightweight "character on stage" using member_cutout.
   Full Live2D rendering would require shipping the Cubism SDK (~1MB JS)
   plus loading .moc3 models from sekai-live2d-assets, so we use this
   static-but-real game-asset approach instead. */
.reader-stage .stage-portrait {
  position: absolute;
  right: 4%;
  bottom: 0;
  max-height: 92%;
  max-width: 48%;
  object-fit: contain;
  object-position: bottom right;
  z-index: 2;
  filter: drop-shadow(0 8px 24px rgba(34,44,90,0.18));
  transition: opacity 0.25s ease, transform 0.35s ease;
  opacity: 1;
  pointer-events: none;
}
.reader-stage .stage-portrait.hidden { opacity: 0; }

/* Live2D canvas overlay — lives in the same stacking slot as the cutout but
   spans the full stage so the model's bottom-anchor positioning matches the
   in-game framing (feet near the bottom edge, head 95% up). The canvas is
   `position: absolute` so it doesn't claim layout space when hidden. */
.reader-stage .stage-live2d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  /* Slight drop shadow under the character to anchor them visually on the
     scene background, similar to the cutout's filter. */
  filter: drop-shadow(0 8px 24px rgba(34,44,90,0.22));
}
.reader-stage .stage-live2d[hidden] { display: none; }

.reader-stage .info-pills {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; gap: 8px; flex-wrap: wrap; z-index: 3;
}
.pill {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.pill strong { color: var(--ink); font-weight: 800; margin-left: 4px; }

/* dialogue box — like the in-game story bubble */
.dialogue-box {
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(34,44,90,0.18);
  border: 2px solid rgba(255,255,255,0.8);
  position: relative;
}
/* When a secondary language is loaded, split the bubble into two columns
   with a soft vertical divider between them. Mobile/narrow falls back to
   stacked rows. */
.reader.has-secondary .dialogue-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.reader.has-secondary .dialogue-box .bubble-col + .bubble-col {
  border-left: 1px solid rgba(34,44,90,0.10);
  padding-left: 18px;
}
.reader.has-secondary .bubble-col.secondary .speaker { color: var(--accent-2, #33d1e6); }
@media (max-width: 720px) {
  .reader.has-secondary .dialogue-box {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .reader.has-secondary .dialogue-box .bubble-col + .bubble-col {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(34,44,90,0.10);
    padding-top: 10px;
  }
}
.dialogue-box::before {
  /* small triangle pointer (top-left, like in-game) */
  content: ""; position: absolute; top: -8px; left: 28px;
  width: 16px; height: 16px;
  background: rgba(255,255,255,0.96);
  border-top: 2px solid rgba(255,255,255,0.8);
  border-left: 2px solid rgba(255,255,255,0.8);
  transform: rotate(45deg);
  border-radius: 3px;
}
.speaker {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
  font-size: 17px;
  margin-bottom: 6px;
}
.line {
  font-size: 17px;
  line-height: 1.65;
  min-height: 60px;
  color: var(--ink);
  font-weight: 500;
  white-space: pre-wrap;
}

.reader-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 4px;
}

/* Audio control strip below the main playback row */
.reader-audio {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 14px;
  margin: -4px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--ink-soft);
}
.reader-audio .audio-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.reader-audio .audio-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px;
}
.reader-audio .audio-toggle.vol { gap: 10px; flex: 1; min-width: 160px; max-width: 280px; }
.reader-audio .audio-toggle.vol input[type="range"] {
  flex: 1; accent-color: var(--accent);
}
.reader-audio .now-playing {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.progress {
  flex: 1; min-width: 140px;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(34,44,90,0.06);
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .18s ease;
  border-radius: 999px;
}
.counter {
  color: var(--ink-soft);
  font-size: 13px;
  min-width: 80px;
  text-align: right;
  font-weight: 700;
}

.appear { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; padding: 0 4px; }
.appear .chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.script-trail {
  margin-top: 6px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  padding: 10px;
  max-height: 420px;
  overflow-y: auto;
}
.script-trail .entry {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 4px;
  cursor: pointer;
  border-left: 4px solid transparent;
  opacity: 0.6;
  transition: background .12s ease, opacity .12s ease;
}
.script-trail .entry:hover { background: var(--surface-2); opacity: 1; }
.script-trail .entry.current {
  opacity: 1;
  background: linear-gradient(90deg, rgba(255,95,177,0.10), rgba(51,209,230,0.06));
  border-left-color: var(--accent);
}
.script-trail .entry .who {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 2px;
}
.script-trail .entry .what {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.script-trail .entry.current .what { color: var(--ink); }

/* Hide the secondary entry column by default so single-language layout is
   unaffected. When .has-secondary is on, both columns render side-by-side. */
.script-trail .entry .entry-col.secondary { display: none; }
.reader.has-secondary .script-trail .entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.reader.has-secondary .script-trail .entry .entry-col.secondary {
  display: block;
  border-left: 1px solid rgba(34,44,90,0.08);
  padding-left: 14px;
}
.reader.has-secondary .script-trail .entry .entry-col.secondary .who {
  color: var(--accent-2, #33d1e6);
}
@media (max-width: 720px) {
  .reader.has-secondary .script-trail .entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .reader.has-secondary .script-trail .entry .entry-col.secondary {
    border-left: 0;
    border-top: 1px solid rgba(34,44,90,0.08);
    padding-left: 0;
    padding-top: 6px;
  }
}

/* Secondary-language dropdown in the audio strip */
.reader-audio .secondary-lang select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  max-width: 200px;
}

/* ---------- asset viewer ---------- */
.asset-viewer {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}
.asset-viewer .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.asset-viewer .panel label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.asset-viewer input {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-weight: 500;
}
.asset-viewer input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,95,177,0.18);
}
.asset-viewer .preset-list { display: grid; gap: 6px; }
.asset-viewer .preset-list .btn {
  text-align: left;
  justify-content: flex-start;
  font-size: 13px;
  padding: 9px 14px;
  font-weight: 600;
}
.asset-viewer .preview {
  min-height: 460px;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(45deg, #f0f4ff 25%, transparent 25%),
    linear-gradient(-45deg, #f0f4ff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f4ff 75%),
    linear-gradient(-45deg, transparent 75%, #f0f4ff 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: #fbfcff;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--line);
}
.asset-viewer .preview img {
  max-height: 60vh;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: white;
}

/* ---------- song cards ---------- */
.song-card-art {
  aspect-ratio: 1;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card .tag.tag-soft {
  background: var(--surface-2);
  color: var(--ink-soft);
  margin-right: 4px;
  margin-bottom: 4px;
  box-shadow: none;
  border: 1px solid var(--line);
  font-size: 10px;
  padding: 2px 8px;
}

/* ================================================================
   ASSET-DRIVEN COMPONENTS
   ================================================================ */

/* When a CDN image 404s, hide it cleanly so the layout still flows. */
img.img-broken {
  visibility: hidden;
}

/* ---------- Featured banner (home page hero) ---------- */
.featured-banner {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 21 / 9;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
  color: white;
  isolation: isolate;
}
.featured-banner:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(20,30,80,0.18); }
.featured-banner-art {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
}
.featured-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(95deg,
    rgba(20, 26, 60, 0.78) 0%,
    rgba(20, 26, 60, 0.55) 36%,
    rgba(20, 26, 60, 0.05) 70%,
    rgba(20, 26, 60, 0)    100%);
  z-index: 2;
}
.featured-banner-content {
  position: absolute;
  left: 36px;
  bottom: 30px;
  z-index: 4;
  max-width: 55%;
}
.featured-banner-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: white;
  font-weight: 700; font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.featured-banner-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,95,177,0.35);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,95,177,0); } }
.featured-banner-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
  margin: 0 0 8px;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  line-height: 1.1;
}
.featured-banner-outline {
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  margin: 0 0 14px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
  font-weight: 500;
  max-width: 540px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-banner-cta { display: flex; align-items: center; gap: 14px; }
.featured-banner-cta .meta { color: rgba(255,255,255,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.featured-banner-logo {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28%;
  max-width: 320px;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.32));
}
.featured-banner-logo img {
  width: 100%; height: auto;
  display: block;
}
@media (max-width: 720px) {
  .featured-banner { aspect-ratio: 16/10; }
  .featured-banner-content { left: 18px; bottom: 16px; max-width: 80%; }
  .featured-banner-logo { display: none; }
}

/* ---------- Song strip (latest songs scroller) ---------- */
.song-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.song-strip-item {
  display: block;
  transition: transform .14s ease;
}
.song-strip-item:hover { transform: translateY(-3px); }
.song-strip-art {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.song-strip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.song-strip-title {
  font-weight: 800; color: var(--ink); font-size: 13px;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.song-strip-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- Cast strip (circular character bubbles) ---------- */
.cast-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 14px;
}
.cast-bubble {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .14s ease;
}
.cast-bubble:hover { transform: translateY(-3px); }
.cast-bubble-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--stripe, var(--accent)), var(--surface));
  padding: 3px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.cast-bubble-ring::before {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: white;
}
.cast-bubble-ring img,
.cast-bubble-letter {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: grid; place-items: center;
  font-weight: 900; color: var(--ink); font-size: 22px;
}
.cast-bubble-name {
  font-size: 11px; color: var(--ink-soft); font-weight: 700;
  text-align: center;
  line-height: 1.2;
  max-width: 90px;
}

/* ---------- Event strip (smaller event cards in home) ---------- */
.event-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.event-strip-item {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
.event-strip-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.event-strip-art {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  overflow: hidden;
}
.event-strip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-strip-meta { padding: 10px 12px; }
.event-strip-meta h3 { font-size: 13px; margin: 0 0 2px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-strip-meta .meta { font-size: 11px; }

/* ---------- Event grid (event-stories page) ---------- */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.event-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.event-card-art {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-2);
  overflow: hidden;
}
.event-card-art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card-logo {
  position: absolute;
  left: 12px; bottom: 10px;
  width: 40%; max-width: 130px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}
.event-card-logo img { width: 100%; display: block; }
.event-card-body { padding: 12px 14px 14px; }
.event-card-body h3 { font-size: 14px; margin: 6px 0 2px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Event detail hero ---------- */
.event-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 18px;
}
.event-detail-banner {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.event-detail-banner > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-detail-logo {
  position: absolute;
  left: 20px; bottom: 18px;
  width: 40%; max-width: 200px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.event-detail-logo img { width: 100%; }
.event-detail-info h1 { font-size: clamp(22px, 2.6vw, 32px); margin-top: 8px; }
@media (max-width: 880px) {
  .event-detail-hero { grid-template-columns: 1fr; }
}

.pill-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.pill-row .pill {
  background: var(--surface-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center;
}

/* ---------- Character tile (with portrait) ---------- */
.char-tile {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  isolation: isolate;
}
.char-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.char-tile-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--stripe) 18%, transparent), transparent 65%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  z-index: 1;
}
.char-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--stripe), color-mix(in srgb, var(--stripe) 50%, white));
  z-index: 5;
}
.char-tile-portrait {
  position: absolute;
  inset: 0 0 65px 0;
  z-index: 2;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.char-tile-portrait img {
  max-height: 110%;
  max-width: 130%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(20, 30, 80, 0.18));
  transform: translateY(8%);
}
.char-tile-icon {
  position: absolute;
  left: 12px; top: 12px;
  z-index: 4;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: white;
  border: 2px solid var(--stripe);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: grid; place-items: center;
}
.char-tile-icon img { width: 100%; height: 100%; object-fit: cover; }
.char-tile-icon span { font-weight: 900; color: var(--ink); font-size: 18px; }
.char-tile-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.96) 32%);
  text-align: left;
}
.char-tile-name-jp { font-weight: 800; color: var(--ink); font-size: 14px; line-height: 1.15; }
.char-tile-name-en {
  color: var(--muted); font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}

/* Override the old char-grid to be a bit bigger now that we have portraits */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* Unit-coloured accent bar (per-unit gradient) */
.accent-bar-unit {
  background: linear-gradient(180deg, var(--stripe), color-mix(in srgb, var(--stripe) 50%, white)) !important;
}

/* ---------- Music card (with real jacket) ---------- */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.music-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.music-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.music-card-art {
  aspect-ratio: 1;
  background: var(--surface-2);
  overflow: hidden;
}
.music-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-card-body { padding: 12px 14px 14px; }
.music-card-body h3 { font-size: 14px; line-height: 1.3; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.music-card-tags { margin-top: 6px; }

/* ---------- Music detail ---------- */
.music-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}
.music-detail-art {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.music-detail-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 720px) {
  .music-detail { grid-template-columns: 1fr; }
  .music-detail-art { width: 100%; max-width: 320px; }
}

/* ---------- Difficulty chips (PJSK-style coloured badges) ---------- */
.diff-row { display: flex; flex-wrap: wrap; gap: 10px; }
.diff-chip {
  border-radius: 14px;
  padding: 12px 18px;
  color: white;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  background: linear-gradient(135deg, var(--diff-c1, #888), var(--diff-c2, #555));
}
.diff-chip-label { font-size: 11px; letter-spacing: 0.12em; opacity: 0.85; }
.diff-chip-level { font-family: var(--font-display); font-size: 28px; font-weight: 900; line-height: 1; margin: 4px 0; }
.diff-chip-notes { font-size: 11px; opacity: 0.85; font-weight: 600; }
.diff-chip.diff-easy    { --diff-c1: #74d6c0; --diff-c2: #34b8a0; }
.diff-chip.diff-normal  { --diff-c1: #6dc5ff; --diff-c2: #3a8fe6; }
.diff-chip.diff-hard    { --diff-c1: #ffd55a; --diff-c2: #ff9a23; }
.diff-chip.diff-expert  { --diff-c1: #ff7790; --diff-c2: #ee2255; }
.diff-chip.diff-master  { --diff-c1: #c280ff; --diff-c2: #7a3ed1; }
.diff-chip.diff-append  { --diff-c1: #ffb6e6; --diff-c2: #ff5fb1; }

/* ---------- responsive ---------- */

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  #nav {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 14px;
    gap: 10px;
  }
  .brand { margin-bottom: 0; }
  #nav nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; gap: 4px; }
  #nav nav a { padding: 8px 12px; font-size: 13px; }
  #nav nav a .nico { width: 22px; height: 22px; font-size: 11px; }
  #nav .region { width: 100%; margin: 0; }
  #nav footer { display: none; }
  #app { padding: 18px; }
  .asset-viewer { grid-template-columns: 1fr; }
  .reader-stage { aspect-ratio: 4/3; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 26px; }
}
