/* Herouette — FULL COMIC-BOOK identity. Paper panels, halftone Ben-Day dots,
   thick ink outlines with hard offset shadows, speed-line arenas, speech
   bubbles, and starburst "POW!" sound-effect blurbs (built by
   NB.herouette.comicBurst). Scoped to .game-herouette (host stage) and
   .pgame-herouette (phones). */

:root {
  --hr-paper: #f8eed6;
  --hr-paper2: #f3e2b8;
  --hr-ink: #170d26;
  --hr-red: #e5312b;
  --hr-yellow: #ffd51e;
  --hr-blue: #1f9de0;
  --hr-pink: #ff2e97;
}

/* ================= shared comic ingredients ================= */

/* halftone paper */
.game-herouette, .pgame-herouette {
  background:
    radial-gradient(circle, rgba(23, 13, 38, 0.16) 1.4px, transparent 1.6px) 0 0 / 15px 15px,
    radial-gradient(900px 620px at 50% 0%, var(--hr-paper), var(--hr-paper2));
  color: var(--hr-ink);
  position: relative;
  overflow: hidden;
}

/* starburst sound-effect blurbs */
.hr-burst {
  position: absolute;
  z-index: 40;
  width: 150px; height: 150px;
  margin: -75px 0 0 -75px;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(var(--rot, 0deg));
  animation: burstPop 1.1s cubic-bezier(0.2, 1.8, 0.4, 1) forwards;
}
.hr-burst.is-big { width: 260px; height: 260px; margin: -130px 0 0 -130px; animation-duration: 1.65s; }
@keyframes burstPop {
  0% { opacity: 0; transform: rotate(var(--rot)) scale(0.1); }
  14% { opacity: 1; transform: rotate(var(--rot)) scale(1.18); }
  24% { transform: rotate(var(--rot)) scale(0.96); }
  32% { transform: rotate(var(--rot)) scale(1.04); }
  78% { opacity: 1; transform: rotate(var(--rot)) scale(1); }
  100% { opacity: 0; transform: rotate(var(--rot)) scale(1.12); }
}
.hr-burst-star {
  position: absolute; inset: 0;
  background: var(--hr-yellow);
  clip-path: polygon(50% 0%, 59% 17%, 76% 6%, 74% 26%, 94% 22%, 82% 39%, 100% 50%,
    82% 61%, 94% 78%, 74% 74%, 76% 94%, 59% 83%, 50% 100%, 41% 83%, 24% 94%,
    26% 74%, 6% 78%, 18% 61%, 0% 50%, 18% 39%, 6% 22%, 26% 26%, 24% 6%, 41% 17%);
  filter: drop-shadow(3px 4px 0 var(--hr-ink));
}
.hr-burst-star.is-back {
  background: var(--hr-red);
  transform: scale(1.14) rotate(12deg);
  z-index: -1;
}
.hr-burst-word {
  position: relative;
  font-family: var(--display);
  font-style: italic;
  font-size: 24px;
  color: var(--hr-ink);
  text-shadow: 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff;
  transform: rotate(-6deg);
  max-width: 86%;
  text-align: center;
  line-height: 0.95;
}
.hr-burst.is-big .hr-burst-word { font-size: 40px; }

/* comic caption banner (phase headers) */
.hr-roundtag {
  background: var(--hr-red); color: #fff;
  font-family: var(--display);
  letter-spacing: 0.1em; font-size: 15px;
  border: 3px solid var(--hr-ink);
  border-radius: 4px;
  padding: 6px 18px;
  transform: rotate(-2deg) skewX(-6deg);
  box-shadow: 4px 4px 0 var(--hr-ink);
}
.hr-phasename, .hr-silname {
  font-family: var(--display);
  font-size: clamp(22px, 3.6vw, 38px);
  color: var(--hr-ink);
  text-shadow: 3px 3px 0 var(--hr-yellow);
}
.hr-silname { color: var(--hr-red); }

/* ================= host stage ================= */
.hr-stagewrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center; position: relative;
}
.hr-phasehead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* silhouette display = a comic panel */
.hr-silstage {
  background: #fff;
  border: 5px solid var(--hr-ink);
  border-radius: 6px;
  padding: 12px;
  transform: rotate(-1deg);
  box-shadow: 10px 10px 0 var(--hr-ink), 10px 10px 0 2px var(--hr-yellow);
  animation: panelIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
@keyframes panelIn { from { opacity: 0; transform: rotate(-6deg) scale(0.5); } }
.hr-silstage::before {
  content: "EXHIBIT A";
  position: absolute; top: -14px; left: 14px;
  background: var(--hr-blue); color: #fff;
  font-weight: 900; font-size: 11px; letter-spacing: 0.2em;
  border: 2.5px solid var(--hr-ink);
  padding: 2px 10px;
  transform: rotate(-3deg);
}
.hr-bigsil { display: block; height: min(44dvh, 400px); width: auto; }
.hr-hint {
  background: #fff;
  border: 3px solid var(--hr-ink);
  border-radius: 18px;
  color: var(--hr-ink);
  font-weight: 900;
  padding: 10px 22px;
  position: relative;
  box-shadow: 4px 4px 0 rgba(23, 13, 38, 0.25);
}
.hr-hint::after { /* speech-bubble tail */
  content: "";
  position: absolute; left: 38px; bottom: -14px;
  border: 8px solid transparent;
  border-top: 10px solid var(--hr-ink);
}

/* progress strip */
.hr-progress {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  background: var(--hr-yellow);
  border: 3px solid var(--hr-ink);
  padding: 10px 20px;
  transform: rotate(0.6deg);
  box-shadow: 5px 5px 0 var(--hr-ink);
}
.hr-prog-chip { opacity: 0.3; filter: grayscale(0.9); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hr-prog-chip.is-done { opacity: 1; filter: none; transform: scale(1.18) rotate(-4deg); }

/* text bins = speech bubbles */
.hr-bins { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.hr-bin {
  background: #fff;
  border: 4px solid var(--hr-ink);
  border-radius: 22px;
  padding: 20px 30px;
  min-width: 200px;
  position: relative;
  box-shadow: 7px 7px 0 var(--binc, var(--hr-red));
  transform: rotate(-1deg);
}
.hr-bin:nth-child(2) { transform: rotate(1.2deg); }
.hr-bin:nth-child(3) { transform: rotate(-0.5deg); }
.hr-bin::after {
  content: "";
  position: absolute; left: 30px; bottom: -18px;
  border: 10px solid transparent;
  border-top: 12px solid var(--hr-ink);
}
.hr-bin-title { font-weight: 900; letter-spacing: 0.06em; font-size: 15px; margin-bottom: 6px; color: var(--hr-ink); }
.hr-bin-count { font-family: var(--display); font-size: 56px; color: var(--hr-red); text-shadow: 3px 3px 0 var(--hr-yellow); }
.hr-bin-count.is-bump { animation: binBump 0.3s ease; }
@keyframes binBump { 40% { transform: scale(1.35) rotate(-5deg); } }

/* build screen */
.hr-buildanim { display: flex; align-items: center; gap: 18px; }
.hr-gear { font-size: 60px; animation: gearSpin 3s linear infinite; }
.hr-gear.is-rev { animation-direction: reverse; }
@keyframes gearSpin { to { transform: rotate(360deg); } }
.hr-buildtxt {
  font-family: var(--display); font-style: italic;
  font-size: clamp(22px, 3.6vw, 38px);
  color: var(--hr-ink);
  text-shadow: 3px 3px 0 var(--hr-yellow);
  animation: fadePulse 1.2s infinite;
}

/* ================= arena: speed lines + panels ================= */
.hr-arena {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 18px; text-align: center; position: relative;
}
.hr-arena::before { /* manga speed lines */
  content: "";
  position: absolute; inset: -20%;
  background: repeating-conic-gradient(from 0deg at 50% 46%,
    rgba(23, 13, 38, 0.10) 0deg 2.2deg, transparent 2.2deg 9deg);
  animation: speedSpin 30s linear infinite;
  pointer-events: none;
}
@keyframes speedSpin { to { transform: rotate(360deg); } }
.hr-vs { display: flex; align-items: center; gap: 24px; position: relative; }
.hr-vs-flash {
  font-family: var(--display); font-style: italic;
  font-size: clamp(40px, 7vw, 76px);
  color: var(--hr-red);
  text-shadow: 3px 3px 0 var(--hr-ink), 6px 6px 0 var(--hr-yellow);
  animation: vsPulse 0.8s ease-in-out infinite;
  position: relative; z-index: 2;
}
@keyframes vsPulse { 50% { transform: scale(1.2) rotate(-5deg); } }

.hr-card {
  width: min(30vw, 300px);
  background: #fff;
  border: 5px solid var(--hr-ink);
  border-radius: 8px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 7px;
  position: relative;
  box-shadow: 9px 9px 0 hsl(var(--hue, 280) 85% 55%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease, filter 0.5s ease;
}
.hr-card-a { transform: rotate(-1.6deg); animation: slideInL 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hr-card-b { transform: rotate(1.6deg); animation: slideInR 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes slideInL { from { transform: translateX(-70vw) rotate(-12deg); } }
@keyframes slideInR { from { transform: translateX(70vw) rotate(12deg); } }
.hr-card.is-winner {
  transform: scale(1.07) rotate(0deg);
  box-shadow: 0 0 0 4px var(--hr-yellow), 12px 12px 0 var(--hr-ink);
  animation: winnerShake 0.5s ease;
}
@keyframes winnerShake { 25% { transform: scale(1.1) rotate(2deg); } 60% { transform: scale(1.05) rotate(-2deg); } }
.hr-card.is-ko {
  transform: rotate(10deg) translateY(44px) scale(0.9);
  opacity: 0.55; filter: grayscale(0.9) contrast(0.8);
  animation: koShake 0.4s ease;
}
@keyframes koShake { 20% { transform: translateX(-14px) rotate(-4deg); } 55% { transform: translateX(12px) rotate(7deg); } }
.hr-card-art {
  width: 100%; display: block;
  border: 3px solid var(--hr-ink);
  border-radius: 4px;
}
.hr-card-art.is-blank {
  aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center;
  font-size: 70px; background: #efe3c4;
}
.hr-card-name {
  font-family: var(--display); font-style: italic;
  font-size: 20px; line-height: 1.1;
  color: var(--hr-red);
  text-shadow: 2px 2px 0 var(--hr-yellow);
}
.hr-card-power { font-size: 13px; font-weight: 900; text-align: left; color: var(--hr-ink); }
.hr-card-weak { font-size: 12px; font-weight: 900; color: var(--hr-red); text-align: left; }
.hr-card-by {
  font-size: 10.5px; font-weight: 700; color: #6b5f4a;
  background: var(--hr-paper2);
  border-top: 2px dashed rgba(23, 13, 38, 0.3);
  margin: 0 -12px; padding: 4px 12px 0;
}
.hr-card-hp { height: 12px; background: var(--hr-paper2); border: 2.5px solid var(--hr-ink); border-radius: 999px; overflow: hidden; }
.hr-card-hpfill {
  height: 100%; width: 100%;
  background: repeating-linear-gradient(-45deg, #23c063 0 8px, #1da354 8px 16px);
  transition: width 1.1s cubic-bezier(0.6, 0, 0.3, 1);
}
.hr-card-hpfill.is-losing { background: repeating-linear-gradient(-45deg, var(--hr-red) 0 8px, #b81f1a 8px 16px); }
.hr-votecount {
  font-weight: 900; font-size: 18px; color: var(--hr-ink);
  background: #fff; border: 3px solid var(--hr-ink); border-radius: 999px;
  padding: 6px 22px;
  box-shadow: 4px 4px 0 rgba(23, 13, 38, 0.25);
  position: relative; z-index: 2;
}

/* champion */
.hr-champ { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 2; }
.hr-champ-label {
  font-family: var(--display); font-style: italic;
  font-size: clamp(24px, 4.4vw, 44px);
  color: var(--hr-red);
  text-shadow: 3px 3px 0 var(--hr-ink), 6px 6px 0 var(--hr-yellow);
}
.hr-champ-art {
  width: min(30vw, 240px);
  border: 5px solid var(--hr-ink); border-radius: 6px;
  box-shadow: 10px 10px 0 var(--hr-yellow), 10px 10px 0 3px var(--hr-ink);
  transform: rotate(-2deg);
  animation: winnerPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hr-champ-name { font-family: var(--display); font-size: 30px; color: var(--hr-ink); text-shadow: 2px 2px 0 var(--hr-yellow); }
.hr-champ-by { font-weight: 900; color: hsl(var(--hue, 280) 75% 40%); }
/* host score rows sit on paper — keep them legible */
.game-herouette .score-rows { position: relative; z-index: 2; }
.game-herouette .score-row { background: #fff; border: 3px solid var(--hr-ink); box-shadow: 5px 5px 0 rgba(23, 13, 38, 0.25); color: var(--hr-ink); }
.game-herouette .score-rank { color: #8a7a5c; }
.game-herouette .score-row.rank-1 { border-color: var(--hr-ink); box-shadow: 5px 5px 0 var(--hr-yellow); }
.game-herouette .score-val { color: var(--hr-red); }

/* ================= phone: drawing pad ================= */
.hrp-draw { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); min-height: 0; position: relative; }
.hrp-draw-head {
  text-align: center; font-weight: 900; font-size: 15px; color: var(--hr-ink);
  background: var(--hr-yellow);
  border: 3px solid var(--hr-ink);
  box-shadow: 3px 3px 0 var(--hr-ink);
  transform: rotate(-0.8deg);
  padding: 6px 10px;
  margin: 2px 6px;
}
.hrd { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.hrd-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.hrd-stage canvas {
  position: absolute;
  height: 100%; max-width: 100%;
  aspect-ratio: 4 / 5;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 4px;
  touch-action: none;
}
.hrd-base { z-index: 0; border: 4px solid var(--hr-ink); box-shadow: 6px 6px 0 rgba(23, 13, 38, 0.35); }
.hrd-paint { z-index: 1; }
.hrd-tools { display: flex; flex-direction: column; gap: 6px; }
.hrd-swatches { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.hrd-swatch {
  aspect-ratio: 1; border-radius: 6px;
  border: 2.5px solid var(--hr-ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(23, 13, 38, 0.35);
}
.hrd-swatch.is-sel { outline: 3px solid var(--hr-red); transform: scale(1.15) rotate(-4deg); }
.hrd-toolrow { display: flex; gap: 8px; align-items: center; }
.hrd-sizes { display: flex; gap: 6px; flex: 1; }
.hrd-size {
  flex: 1; height: 40px; border-radius: 8px;
  border: 2.5px solid var(--hr-ink);
  background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 2px 2px 0 rgba(23, 13, 38, 0.35);
}
.hrd-size.is-sel { background: var(--hr-yellow); }
.hrd-size-dot { background: var(--hr-ink); border-radius: 50%; display: block; }
.hrd-tool {
  width: 52px; height: 40px; border-radius: 8px;
  border: 2.5px solid var(--hr-ink);
  background: #fff; font-size: 19px; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(23, 13, 38, 0.35);
}
.hrd-tool.is-sel { background: var(--hr-blue); }

/* ================= phone: everything else ================= */
.pgame-herouette .hrp-wait { color: var(--hr-ink); }
.hrp-wait {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 28px; position: relative;
}
.hrp-wait-emoji { font-size: 64px; animation: introEmoji 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hrp-wait-msg {
  font-family: var(--display); font-style: italic; font-size: 22px;
  color: var(--hr-ink); text-shadow: 2px 2px 0 var(--hr-yellow);
}
.hrp-wait-sub { color: #6b5f4a; font-weight: 900; font-size: 14px; }

.hrp-write { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); overflow: auto; position: relative; }
.hrp-write-head {
  text-align: center; font-family: var(--display); font-style: italic; font-size: 17px;
  color: var(--hr-ink); text-shadow: 2px 2px 0 var(--hr-yellow);
}
.hrp-lanes { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hrp-txt-lane {
  background: #fff; border: 3px solid var(--hr-ink); border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 4px 4px 0 rgba(23, 13, 38, 0.3);
}
.hrp-txt-lane:nth-child(1) { transform: rotate(-0.6deg); }
.hrp-txt-lane:nth-child(2) { transform: rotate(0.5deg); }
.hrp-txt-lane:nth-child(3) { transform: rotate(-0.4deg); }
.hrp-txt-label { display: flex; justify-content: space-between; font-weight: 900; font-size: 13px; margin-bottom: 6px; color: var(--hr-ink); }
.hrp-txt-count { background: var(--hr-yellow); border: 2px solid var(--hr-ink); border-radius: 999px; padding: 1px 10px; color: var(--hr-ink); }
.hrp-txt-row { display: flex; gap: 8px; }
.hrp-txt-in {
  flex: 1;
  background: var(--hr-paper); border: 2.5px solid var(--hr-ink); border-radius: 10px;
  color: var(--hr-ink); padding: 12px 14px;
  font-family: var(--body); font-weight: 700; font-size: 15px;
  outline: none; min-width: 0;
}
.hrp-txt-in:focus { background: #fff; box-shadow: 0 0 0 3px var(--hr-yellow); }
.hrp-txt-in::placeholder { color: #9c8d6e; }
.hrp-txt-add { font-size: 22px; padding: 8px 18px; }
.pgame-herouette .btn { border: 3px solid var(--hr-ink); box-shadow: 4px 4px 0 var(--hr-ink); }
.pgame-herouette .btn:active { box-shadow: 1px 1px 0 var(--hr-ink); }

.hrp-build { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); overflow: auto; position: relative; }
.hrp-build-head {
  text-align: center; font-family: var(--display); font-style: italic; font-size: 18px;
  color: var(--hr-red); text-shadow: 2px 2px 0 var(--hr-yellow);
}
.hrp-kit-art { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hrp-kit-art img {
  height: 130px; border: 3px solid var(--hr-ink); border-radius: 4px;
  box-shadow: 5px 5px 0 rgba(23, 13, 38, 0.3);
  transform: rotate(-1.5deg);
}
.hrp-kit-noart { font-size: 56px; }
.hrp-kit-artby { font-size: 11px; font-weight: 900; color: #6b5f4a; }
.hrp-build-lab { font-size: 11px; font-weight: 900; letter-spacing: 0.18em; color: #6b5f4a; margin-top: 4px; }
.hrp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.hrp-chip {
  background: #fff; color: var(--hr-ink);
  border: 2.5px solid var(--hr-ink); border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--body); font-weight: 900; font-size: 13.5px;
  cursor: pointer; text-align: left;
  box-shadow: 2.5px 2.5px 0 rgba(23, 13, 38, 0.3);
}
.hrp-chip.is-sel { background: var(--hr-yellow); transform: rotate(-1deg) scale(1.03); }
.is-powers .hrp-chip.is-sel { background: #9fdcf5; }
.is-weaks .hrp-chip.is-sel { background: #ffb3ad; }

.hrp-vote { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); position: relative; }
.hrp-vote-head { text-align: center; font-weight: 900; color: #6b5f4a; font-size: 13px; }
.hrp-votebtn {
  flex: 1; border: 4px solid var(--hr-ink); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--body); color: #fff;
  box-shadow: 6px 6px 0 var(--hr-ink); cursor: pointer;
  padding: 12px;
  transition: transform 0.08s ease;
}
.hrp-votebtn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--hr-ink); }
.hrp-votebtn.is-a { background: var(--hr-red); transform: rotate(-1deg); }
.hrp-votebtn.is-b { background: var(--hr-blue); transform: rotate(1deg); }
.hrp-votebtn-name { font-family: var(--display); font-style: italic; font-size: 23px; line-height: 1.15; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }
.hrp-votebtn-by { font-size: 12px; opacity: 0.9; font-weight: 900; }
.hrp-vote-vs {
  text-align: center; font-family: var(--display); font-style: italic; font-size: 24px;
  color: var(--hr-red); text-shadow: 2px 2px 0 var(--hr-yellow);
}

/* phone header/timers keep the dark chrome — only the stage goes comic */
