/* ==========================================================================
   Comic Studio by Tej — retro comic-book interface
   Built with Open-Source Web Technologies
   ========================================================================== */

/* --------------------------------- fonts --------------------------------- */
@font-face {
  font-family: 'Bangers';
  src: url('assets/fonts/bangers-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20A0-20CF, U+2122, U+2190-21BB;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20A0-20CF, U+2122, U+2190-21BB;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20A0-20CF, U+2122, U+2190-21BB;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20A0-20CF, U+2122, U+2190-21BB;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-devanagari-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-devanagari-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('assets/fonts/baloo-2-devanagari-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}

/* -------------------------------- tokens --------------------------------- */
:root {
  --ink: #17131c;
  --paper: #fdf6e3;
  --paper-2: #f6e9cb;
  --card: #fffdf6;
  --cream: #fff4d6;

  --red: #e63946;
  --red-dark: #b3242f;
  --yellow: #ffd23f;
  --yellow-dark: #e8b400;
  --blue: #1d6fe0;
  --cyan: #29c7e0;
  --green: #35c46b;
  --purple: #7b3fe4;
  --orange: #ff8b1f;
  --pink: #ff5d8f;

  --border-w: 4px;
  --line: var(--border-w) solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);

  --radius: 14px;
  --font-display: 'Bangers', 'Baloo 2', 'Segoe UI', system-ui,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --font-body: 'Baloo 2', 'Segoe UI', 'Nirmala UI', system-ui, -apple-system,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --shell: 1440px;
}

body.theme-news {
  --paper: #efe8d6;
  --paper-2: #e4dcc6;
  --card: #f8f3e6;
  --cream: #f4ecda;
  --ink: #1b1b1b;
  --red: #2c2c2c;
  --red-dark: #141414;
  --yellow: #dcd3ba;
  --yellow-dark: #b8ae94;
  --blue: #3a3a3a;
  --cyan: #4a4a4a;
  --green: #414141;
  --purple: #333;
  --orange: #565656;
  --pink: #4d4d4d;
  --shadow: 6px 6px 0 #1b1b1b;
  --shadow-sm: 3px 3px 0 #1b1b1b;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(23, 19, 28, 0.055) 1.5px, transparent 1.7px),
    radial-gradient(circle at 12% 8%, rgba(230, 57, 70, 0.10), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(29, 111, 224, 0.10), transparent 40%),
    radial-gradient(circle at 82% 96%, rgba(255, 210, 63, 0.22), transparent 45%),
    radial-gradient(circle at 6% 92%, rgba(53, 196, 107, 0.12), transparent 40%);
  background-size: 11px 11px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  line-height: 1.5;
  overflow-x: hidden;
}

body.theme-news {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(27, 27, 27, 0.07) 1.4px, transparent 1.6px),
    radial-gradient(circle at 12% 8%, rgba(27, 27, 27, 0.07), transparent 45%),
    radial-gradient(circle at 86% 8%, rgba(27, 27, 27, 0.06), transparent 42%),
    radial-gradient(circle at 80% 92%, rgba(27, 27, 27, 0.07), transparent 45%);
  background-size: 9px 9px, 100% 100%, 100% 100%, 100% 100%;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 4px dashed var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 50%; top: -120px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 22px;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.30;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(23, 19, 28, 0.10) 0.6px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(23, 19, 28, 0.08) 0.6px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(23, 19, 28, 0.08) 0.6px, transparent 1px);
  background-size: 37px 41px, 53px 47px, 61px 59px;
  mix-blend-mode: multiply;
}

/* ------------------------------- floating stickers ------------------------ */
.floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  display: none;
}
@media (min-width: 1720px) and (min-height: 720px) { .floaters { display: block; } }

.floater {
  position: absolute;
  display: block;
  width: 150px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  animation: wobble 6s ease-in-out infinite;
  opacity: 0.92;
}
.floater canvas { width: 100%; height: auto; display: block; }
.floater--1 { top: 16%; left: 1.2%; transform: rotate(-12deg); }
.floater--2 { top: 34%; right: 1.4%; animation-delay: -1.4s; transform: rotate(9deg); }
.floater--3 { top: 58%; left: 1.8%; animation-delay: -2.6s; transform: rotate(7deg); }
.floater--4 { top: 73%; right: 2%; animation-delay: -3.8s; transform: rotate(-8deg); font-size: 1.5rem; }
.floater--5 { top: 88%; left: 2.4%; animation-delay: -4.6s; transform: rotate(-5deg); font-size: 1.5rem; }
.floater--6 { top: 6%; right: 4%; animation-delay: -5.2s; transform: rotate(12deg); font-size: 1.4rem; }

@keyframes wobble {
  0%, 100% { translate: 0 0; rotate: -2deg; }
  50% { translate: 0 -10px; rotate: 3deg; }
}

/* --------------------------------- shell --------------------------------- */
.shell {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px clamp(12px, 3vw, 34px) 0;
}

/* -------------------------------- masthead -------------------------------- */
.masthead {
  position: relative;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px clamp(12px, 2.4vw, 30px) 18px;
  text-align: center;
  overflow: hidden;
}
.masthead::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  pointer-events: none;
  opacity: 0.55;
}

.masthead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  font-size: clamp(0.66rem, 1.6vw, 0.82rem);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  position: relative;
  z-index: 1;
}
.meta-tag {
  background: var(--red);
  color: #fff;
  padding: 3px 10px;
  border-radius: 5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.meta-dot { opacity: 0.5; }
.meta-issue, .meta-price { font-weight: 700; white-space: nowrap; }

.lang-toggle {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s;
}
.lang-toggle:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.lang-toggle:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.lang-toggle__globe { font-size: 0.95rem; }
.lang-toggle__hint {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 640px) { .lang-toggle__hint { display: none; } }

.masthead__name { padding: 6px 0 2px; }

.logo {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.22em;
  line-height: 0.9;
  font-family: var(--font-display);
  text-transform: uppercase;
}
.logo__comic {
  font-size: clamp(2.6rem, 10vw, 6.2rem);
  color: var(--yellow);
  -webkit-text-stroke: clamp(2px, 0.5vw, 4px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--red), 9px 9px 0 var(--ink);
  letter-spacing: 0.02em;
}
.logo__studio {
  font-size: clamp(2.6rem, 10vw, 6.2rem);
  color: var(--blue);
  -webkit-text-stroke: clamp(2px, 0.5vw, 4px) var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--cyan), 9px 9px 0 var(--ink);
  letter-spacing: 0.02em;
}
.logo__by {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(0.9rem, 2.4vw, 1.4rem);
  background: var(--ink);
  color: var(--paper);
  padding: 0.16em 0.7em;
  border-radius: 999px;
  transform: rotate(-4deg) translateY(-0.35em);
  box-shadow: 3px 3px 0 var(--red);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body.theme-news .logo__comic,
body.theme-news .logo__studio {
  color: var(--ink);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 3px 3px 0 rgba(27, 27, 27, 0.18);
}
body.theme-news .logo__by { box-shadow: 3px 3px 0 rgba(27, 27, 27, 0.35); }

.tagline {
  margin-top: 10px;
  font-size: clamp(0.92rem, 2.4vw, 1.22rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.beat-strip {
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 820px;
}
.beat-strip li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(0.62rem, 1.7vw, 0.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
}
.beat-strip li:nth-child(1) { background: var(--yellow); }
.beat-strip li:nth-child(2) { background: var(--orange); }
.beat-strip li:nth-child(3) { background: var(--cyan); }
.beat-strip li:nth-child(4) { background: var(--pink); color: #fff; }
body.theme-news .beat-strip li { background: var(--card); color: var(--ink); }
.beat-strip__num {
  display: inline-grid;
  place-items: center;
  width: 1.35em; height: 1.35em;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.95em;
  letter-spacing: 0;
  flex: none;
}

/* --------------------------------- studio -------------------------------- */
.studio {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(300px, 372px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
}

/* ---------------------------------- deck --------------------------------- */
.deck {
  position: sticky;
  top: 16px;
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 16px;
}
@media (max-width: 980px) { .deck { position: static; } }
@media (min-width: 981px) {
  .deck {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ink) transparent;
  }
  .deck::-webkit-scrollbar { width: 10px; }
  .deck::-webkit-scrollbar-thumb {
    background: var(--ink);
    border-radius: 999px;
    border: 3px solid var(--card);
  }
}

.deck__block { display: grid; gap: 9px; }

.deck__heading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.24rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  line-height: 1;
}
.chip-num {
  display: inline-grid;
  place-items: center;
  width: 1.55em; height: 1.55em;
  flex: none;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 0.78em;
  box-shadow: 2px 2px 0 var(--ink);
}
.deck__block:nth-child(2) .chip-num { background: var(--blue); }
.deck__block:nth-child(3) .chip-num { background: var(--green); }
.deck__block:nth-child(4) .chip-num { background: var(--purple); }
body.theme-news .chip-num { background: var(--ink); color: var(--paper); }

.pick-grid { display: grid; gap: 8px; }
.pick-grid--hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-grid--topic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-grid--hero .pick:last-child { grid-column: span 2; }

.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 10px;
  text-align: left;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 11px;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.15;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease;
}
.pick:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.pick:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pick__emoji {
  font-size: 1.6rem;
  line-height: 1;
  flex: none;
  filter: drop-shadow(1px 1px 0 rgba(23, 19, 28, 0.35));
}
.pick__label { flex: 1; }
.pick__tick {
  position: absolute;
  top: -8px; right: -8px;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  border: 2.5px solid var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.4) rotate(-30deg);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.pick[aria-pressed='true'] {
  background: var(--yellow);
  transform: rotate(-1.2deg);
  box-shadow: 4px 4px 0 var(--ink);
}
.pick[aria-pressed='true'] .pick__tick { opacity: 1; transform: scale(1) rotate(0); }
.pick[aria-pressed='true'] .pick__label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
body.theme-news .pick { background: var(--card); }
body.theme-news .pick[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
body.theme-news .pick[aria-pressed='true'] .pick__tick { background: var(--paper); color: var(--ink); }

.pick--wide { min-height: 56px; }

/* ---------------------------------- face --------------------------------- */
.face { display: grid; gap: 8px; }

.btn--upload {
  background: var(--cyan);
  width: 100%;
  justify-content: center;
}
.btn--upload:hover { background: var(--blue); color: #fff; }

.face__preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2.5px dashed var(--ink);
  border-radius: 11px;
  background: var(--cream);
}
.face__thumb-wrap { position: relative; flex: none; }
.face__thumb-wrap canvas {
  width: 58px; height: 58px;
  display: block;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}
.face__badge {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--red);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1.5px solid var(--ink);
}
.face__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.mini-btn {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.mini-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.mini-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.mini-btn--danger { background: #ffe3e5; color: var(--red-dark); }

.hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #5b5464;
  display: flex;
  gap: 5px;
}
body.theme-news .hint { color: #4a463d; }

/* --------------------------------- theme switch --------------------------- */
.theme-switch {
  display: grid;
  gap: 7px;
  padding: 7px;
  background: var(--paper-2);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
}
.theme-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.84rem;
  text-align: left;
  transition: background 0.18s, transform 0.12s, box-shadow 0.12s;
}
.theme-btn span[aria-hidden] { font-size: 1.1rem; }
.theme-btn:hover { transform: translateX(2px); }
.theme-btn[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 0 0 2px var(--card);
}
.theme-btn[aria-pressed='true']::after {
  content: '●';
  margin-left: auto;
  color: var(--yellow);
  font-size: 0.7rem;
}
body.theme-news .theme-btn[aria-pressed='true']::after { color: var(--card); }

/* --------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 3px solid var(--ink);
  border-radius: 11px;
  background: var(--yellow);
  font-family: var(--font-display);
  font-size: 1.14rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
  text-align: center;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); filter: brightness(1.03); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.65; cursor: progress; transform: none; box-shadow: var(--shadow-sm); }
.btn__spark { font-size: 1.25rem; }
.btn--sm { font-size: 0.98rem; padding: 8px 13px; }

.btn--primary {
  background: linear-gradient(135deg, var(--red) 0%, #ff6b3d 55%, var(--orange) 100%);
  color: #fff;
  font-size: 1.45rem;
  padding: 15px 18px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  animation: pulse-glow 3.6s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 6px 6px 0 var(--ink), 0 0 0 5px rgba(255, 210, 63, 0.45); }
}
.btn--secondary { background: var(--card); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #2b2436; }

.deck__actions { display: grid; gap: 9px; }
.deck__actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.deck__actions-row .btn { font-size: 1rem; padding: 11px 8px; }

.deck__note {
  display: flex;
  gap: 7px;
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 8px 10px;
  background: #fff7d6;
  border: 2px dashed var(--ink);
  border-radius: 9px;
  color: #5b5464;
}
body.theme-news .deck__note { background: var(--card); color: #4a463d; }

/* --------------------------------- stage --------------------------------- */
.stage {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.stage__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.stage__badges { display: flex; gap: 6px; }
.badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}
.badge--muted { background: var(--card); }
body.theme-news .badge { background: var(--card); }

.comic-frame {
  position: relative;
  background: var(--card);
  border: 5px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: clamp(8px, 1.6vw, 16px);
  transform: rotate(-0.35deg);
  transition: transform 0.4s ease;
}
.comic-frame::after {
  content: '';
  position: absolute;
  inset: -14px -14px auto auto;
  width: 74px; height: 24px;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 8px, #ffe98a 8px 16px);
  border: 2px solid var(--ink);
  transform: rotate(9deg);
  opacity: 0.95;
  pointer-events: none;
}
.comic-frame__tack {
  position: absolute;
  top: -13px;
  width: 56px; height: 22px;
  background: rgba(255, 210, 63, 0.85);
  border: 1.5px solid rgba(23, 19, 28, 0.35);
  box-shadow: 0 2px 4px rgba(23, 19, 28, 0.25);
  z-index: 2;
}
.comic-frame__tack--l { left: 22px; transform: rotate(-6deg); }
.comic-frame__tack--r { right: 22px; transform: rotate(5deg); }

#comic-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: #fffdf6;
  aspect-ratio: 1600 / 2080;
}
.comic-frame.is-drawing #comic-canvas { animation: comic-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes comic-pop {
  0% { opacity: 0.2; transform: scale(0.985) rotate(0.6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

body.theme-news .comic-frame { transform: rotate(0deg); }
body.theme-news .comic-frame::after { background: repeating-linear-gradient(45deg, #e8dfc9 0 8px, #f6efdd 8px 16px); }

/* --------------------------------- loading -------------------------------- */
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(253, 246, 227, 0.9);
  border-radius: 6px;
  z-index: 5;
}
.loading[hidden] { display: none; }
.loading__card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 20px 26px;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink);
  max-width: min(90%, 340px);
  text-align: center;
  animation: card-in 0.25s ease;
}
@keyframes card-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.loading__burst {
  font-size: 2rem;
  animation: spin-pop 1.1s ease-in-out infinite;
  display: block;
}
@keyframes spin-pop {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.15); }
}
.loading__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.loading__stage { font-size: 0.82rem; font-weight: 700; color: #5b5464; }
.loading__bar {
  width: 190px;
  height: 12px;
  background: var(--paper-2);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.loading__bar span {
  display: block;
  height: 100%;
  width: 8%;
  background: repeating-linear-gradient(45deg, var(--red) 0 7px, var(--yellow) 7px 14px);
  transition: width 0.35s ease;
}

.stage__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 0;
}
.stage__caption {
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: #5b5464;
  letter-spacing: 0.02em;
}
body.theme-news .stage__caption { color: #4a463d; }

/* --------------------------------- script -------------------------------- */
.script {
  margin-top: clamp(24px, 4vw, 40px);
  display: grid;
  gap: 12px;
}
.script__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) { .script__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .script__grid { grid-template-columns: 1fr; } }

.script-card {
  position: relative;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px 13px 14px;
  display: grid;
  gap: 7px;
  align-content: start;
  overflow: hidden;
}
.script-card__num {
  position: absolute;
  top: -10px; right: -6px;
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1;
  color: rgba(23, 19, 28, 0.09);
  pointer-events: none;
}
.script-card__beat {
  justify-self: start;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 5px;
  padding: 2px 7px;
}
.script-card:nth-child(2) .script-card__beat { background: var(--orange); }
.script-card:nth-child(3) .script-card__beat { background: var(--cyan); }
.script-card:nth-child(4) .script-card__beat { background: var(--pink); color: #fff; }
.script-card__cap { font-size: 0.78rem; line-height: 1.4; color: #4f485c; }
.script-card__say {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 8px 10px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 12px 12px 12px 3px;
}
.script-card__fx {
  justify-self: start;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 10px;
  transform: rotate(-2deg);
}
body.theme-news .script-card__beat,
body.theme-news .script-card__fx { background: var(--ink); color: var(--paper); }
body.theme-news .script-card__say { background: var(--paper-2); }

/* --------------------------------- footer -------------------------------- */
.site-footer {
  margin-top: clamp(28px, 5vw, 54px);
  background: var(--ink);
  color: #fdf6e3;
  border-top: 6px solid var(--ink);
  box-shadow: 0 -6px 0 var(--yellow), 0 -12px 0 var(--ink);
}
.site-footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) clamp(14px, 3vw, 34px) 26px;
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}
.site-footer__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.site-footer__logo { font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--yellow); }
.site-footer__logo--alt { color: var(--cyan); }
.site-footer__by {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--red);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  transform: rotate(-3deg);
}

.credits {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px 16px;
  max-width: 980px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px dashed rgba(253, 246, 227, 0.45);
  border-radius: 12px;
}
.credits__line {
  font-size: clamp(0.78rem, 2vw, 0.98rem);
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.credits__label { color: var(--yellow); font-weight: 800; letter-spacing: 0.03em; }
.credits__sep { opacity: 0.55; padding: 0 4px; }
.credits a {
  color: #a8e6ff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.credits a:hover { color: var(--yellow); }
.credits__line--tech {
  font-size: 0.76rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #ffe9a8;
  margin-top: 2px;
}
.site-footer__note {
  font-size: 0.76rem;
  opacity: 0.72;
  max-width: 560px;
}

/* ---------------------------------- modal --------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 19, 28, 0.68);
}
.modal__panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 18px;
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 10px 10px 0 rgba(23, 19, 28, 0.85);
  animation: card-in 0.22s ease;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}
.modal__hint { font-size: 0.76rem; color: #5b5464; text-align: center; }
.modal__canvas {
  width: min(320px, 76vw);
  height: auto;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 6px var(--yellow);
  touch-action: none;
  cursor: grab;
}
.modal__canvas:active { cursor: grabbing; }
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.crop-zoom input {
  flex: 1;
  accent-color: var(--red);
  height: 26px;
}
.modal__actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------- toast -------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  translate: -50% 140%;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  border: 3px solid var(--paper);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  transition: translate 0.32s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.3s;
  opacity: 0;
  max-width: min(92vw, 520px);
  text-align: center;
}
.toast.is-visible { translate: -50% 0; opacity: 1; }

/* -------------------------------- noscript ------------------------------- */
.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 70;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 14px;
  font-weight: 700;
  text-align: center;
}

/* ------------------------------ small screens ----------------------------- */
@media (max-width: 640px) {
  .credits__line { display: block; line-height: 1.75; }
  .credits__sep { display: block; height: 0; overflow: hidden; opacity: 0; }
  .credits__label { display: inline-block; }
  .shell { padding: 12px 10px 0; }
  .masthead { padding: 11px 10px 14px; }
  .masthead__meta { letter-spacing: 0.06em; gap: 4px 8px; }
  .meta-price { display: none; }
  .beat-strip { gap: 5px; }
  .beat-strip li { flex-direction: column; gap: 3px; padding: 5px 2px; font-size: 0.56rem; }
  .beat-strip__num { font-size: 0.72rem; }
  .pick { min-height: 54px; font-size: 0.78rem; padding: 8px; }
  .pick__emoji { font-size: 1.35rem; }
  .deck { padding: 13px; gap: 14px; }
  .deck__heading { font-size: 1.1rem; }
  .deck__actions-row { grid-template-columns: 1fr; }
  .btn--primary { font-size: 1.28rem; }
  .credits { padding: 12px 10px; }
  .site-footer__brand { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .floaters { display: none; }
}

/* -------------------------------- print ---------------------------------- */
@media print {
  body { background: #fff; }
  .deck, .masthead__meta, .stage__bar, .script, .site-footer__note, .floaters, .skip-link, .lang-toggle { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .masthead, .comic-frame, .deck { border: none; box-shadow: none; }
  .comic-frame { transform: none; }
  .comic-frame__tack, .comic-frame::after { display: none; }
  .site-footer { box-shadow: none; margin-top: 10px; }
  .site-footer__inner { padding-top: 10px; }
  .credits { border-color: rgba(255,255,255,0.4); }
}
