:root {
  color-scheme: dark;
  --ink: #201510;
  --paper: #fff4d6;
  --paper-soft: #ffe7ac;
  --red: #ef3e37;
  --blue: #1e82ff;
  --green: #52e36c;
  --black: #14110f;
  --panel: rgba(255, 244, 214, 0.92);
  --shadow: 0 18px 0 rgba(32, 21, 16, 0.35);
  --radius: 8px;
  font-family: "Trebuchet MS", "Avenir Next Condensed", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(20, 17, 15, 0.08) 25%, transparent 25%) 0 0 / 26px 26px,
    linear-gradient(225deg, rgba(20, 17, 15, 0.08) 25%, transparent 25%) 0 0 / 26px 26px,
    #f6c53b;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 12px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.86;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--paper);
}

h2 {
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.92;
  letter-spacing: 0;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.privacy-pill,
.round-chip {
  border: 3px solid var(--ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--ink);
}

.round-chip {
  min-width: 132px;
  text-align: center;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero-grid,
.editor-layout,
.result-layout,
.capture-layout,
.permission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 22px;
  align-items: stretch;
}

#homeScreen .hero-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: 18px;
  min-height: min(72vh, 620px);
  align-items: stretch;
}

.hero-copy,
.tool-panel,
.command-panel,
.capture-controls {
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(22px, 5vw, 46px);
}

.lede {
  max-width: 680px;
  font-size: 1.1rem;
  line-height: 1.55;
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 18px;
}

.mode-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  color: white;
  text-align: left;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.mode-card:hover {
  transform: translate(3px, 3px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.mode-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -38px;
  width: 142px;
  height: 142px;
  border: 6px solid var(--ink);
  background: var(--paper);
  transform: rotate(18deg);
}

.mode-card span,
.mode-card strong,
.mode-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.mode-card span {
  font-size: 0.88rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mode-card strong {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.9;
}

.mode-card small {
  max-width: 190px;
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 900;
}

.mode-card.campaign {
  background: linear-gradient(135deg, #ef3e37 0 52%, #201510 52% 100%);
}

.mode-card.sticker-duel {
  background: linear-gradient(135deg, #1e82ff 0 52%, #52e36c 52% 100%);
  color: var(--ink);
}

#freeDuelUploadScreen .free-duel-head h2 {
  margin-bottom: 0;
}

.free-duel-upload {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.free-duel-lede {
  margin: 0;
  line-height: 1.5;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
}

.free-duel-preset-panel {
  display: grid;
  gap: 10px;
}

.free-duel-choice-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  color: var(--ink);
}

.free-duel-choice-head strong {
  font-size: 1.04rem;
  font-weight: 1000;
}

.free-duel-choice-head span {
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0.72;
}

.free-duel-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: min(42vh, 360px);
  overflow: auto;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  box-shadow: 5px 5px 0 rgba(32, 21, 16, 0.26);
}

.free-duel-preset-card {
  display: grid;
  gap: 5px;
  min-height: 132px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 6px;
  color: var(--ink);
  background: #fff4d6;
  box-shadow: 3px 3px 0 rgba(32, 21, 16, 0.24);
  font-weight: 1000;
  text-align: center;
  cursor: pointer;
}

.free-duel-preset-card img {
  justify-self: center;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(4px 5px 0 rgba(32, 21, 16, 0.22));
}

.free-duel-preset-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.free-duel-preset-card small {
  overflow: hidden;
  color: #6b7280;
  font-size: 0.66rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.free-duel-preset-card.is-selected,
.free-duel-preview-card.is-selected {
  background: #f6c53b;
  box-shadow: 5px 5px 0 var(--red);
  transform: translate(-2px, -2px);
}

.free-duel-preview-card {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 38%, #fff4d6 0 16%, transparent 17%),
    repeating-radial-gradient(circle at 50% 38%, #1e82ff 0 12px, #f6c53b 13px 28px);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.free-duel-preview-card:hover,
.free-duel-preview-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
  outline: none;
}

.free-duel-preview-card.has-sticker {
  background:
    radial-gradient(circle at 50% 38%, #fff4d6 0 16%, transparent 17%),
    repeating-radial-gradient(circle at 50% 38%, #ef3e37 0 12px, #f6c53b 13px 28px);
}

.free-duel-preview-media {
  display: grid;
  place-items: center;
  min-height: min(52vw, 280px);
  padding: 8px;
}

.free-duel-preview-card img {
  width: min(100%, 260px);
  max-height: min(52vw, 260px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(10px 12px 0 rgba(32, 21, 16, 0.35));
}

.free-duel-preview-name {
  margin: 0;
  justify-self: center;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 8px 14px;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 1000;
  font-size: 1.05rem;
}

.free-duel-preview-hint {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.4;
  opacity: 0.88;
}

.preview-placeholder {
  margin: 0;
  max-width: 240px;
  font-weight: 900;
  line-height: 1.45;
}

.free-duel-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.free-duel-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

label.button.free-duel-tool-btn {
  cursor: pointer;
}

.free-duel-tool-wide {
  grid-column: 1 / -1;
}

.free-duel-name-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.free-duel-name-field input {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
  font-weight: 800;
}

.free-duel-submit-btn {
  width: 100%;
  min-height: 54px;
  font-size: 1.08rem;
}

.free-duel-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 5px 5px 0 var(--ink);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  min-height: 46px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 15px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 950;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.button.primary {
  background: var(--red);
  color: white;
}

.button.secondary {
  background: var(--blue);
  color: white;
}

.button.ghost {
  background: var(--paper);
}

.button.bark {
  background: var(--green);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
  text-decoration: underline;
}

.home-stage {
  position: relative;
  min-height: min(68vh, 520px);
  height: 100%;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 45%, #fff4d6 0 18%, transparent 19%),
    repeating-radial-gradient(circle at 50% 45%, #ef3e37 0 14px, #f6c53b 15px 32px);
  box-shadow: 10px 10px 0 var(--ink);
}

.home-stage-label {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 4;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 8px 10px;
  font-weight: 1000;
  box-shadow: 5px 5px 0 var(--ink);
}

.permission-preview {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 520px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 36%, var(--paper) 0 18%, transparent 19%),
    repeating-radial-gradient(circle at 50% 36%, #1e82ff 0 12px, #f6c53b 13px 30px);
  box-shadow: var(--shadow);
}

.permission-preview img {
  width: min(76%, 420px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(14px 18px 0 rgba(32, 21, 16, 0.38));
}

.permission-preview strong {
  border: 4px solid var(--ink);
  background: var(--paper);
  padding: 10px 18px;
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 1.3rem;
}

.permission-panel {
  display: grid;
  gap: 14px;
}

.permission-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
}

.permission-card h3 {
  margin-bottom: 6px;
}

.permission-card p {
  margin-bottom: 0;
  line-height: 1.45;
  font-weight: 800;
}

.campaign-screen {
  position: relative;
  min-height: calc(100vh - 118px);
  width: 100%;
  max-width: 100%;
  margin: -4px auto 0;
  padding: 46px clamp(12px, 4vw, 48px) 34px;
  border: 4px solid #31415d;
  border-radius: 28px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 18% 0%, rgba(30, 130, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(239, 62, 55, 0.14), transparent 28%),
    #080b10;
  box-shadow: 0 28px 0 rgba(0, 0, 0, 0.34);
  box-sizing: border-box;
  overflow-x: hidden;
}

.campaign-screen h2 {
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  line-height: 0.95;
  text-shadow: none;
}

.campaign-subtitle {
  margin: 18px 0 34px;
  color: #9fb0ca;
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  font-weight: 850;
}

.back-tab {
  position: absolute;
  top: 14px;
  left: 18px;
  min-height: 38px;
  border: 2px solid #31415d;
  border-radius: 999px;
  padding: 6px 12px;
  color: #dce7f8;
  background: #162235;
  font-weight: 900;
}

.campaign-player {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 26px;
  gap: 10px;
  align-items: center;
  border: 2px solid #31415d;
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  background: #101824;
  color: #dce7f8;
  font-weight: 950;
}

.campaign-player img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.campaign-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 24px);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.campaign-level-card {
  position: relative;
  min-height: clamp(160px, 38vw, 230px);
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: clamp(12px, 3vw, 20px);
  color: var(--ink);
  background: #ffffff;
  box-shadow: 6px 6px 0 rgba(32, 21, 16, 0.28);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.campaign-level-card.is-unlocked:hover {
  transform: translate(3px, 3px);
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(32, 21, 16, 0.28);
}

.campaign-level-card img {
  display: block;
  width: min(42%, 118px);
  height: 118px;
  margin: 4px auto 34px;
  object-fit: contain;
  filter: drop-shadow(0 12px 0 rgba(0, 0, 0, 0.24));
}

.campaign-level-card strong {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: baseline;
  font-size: 1.18rem;
  font-weight: 1000;
}

.campaign-level-card strong span {
  color: #6b7280;
}

.campaign-level-card small {
  position: absolute;
  right: 16px;
  top: 14px;
  z-index: 2;
  border: 2px solid #f6c53b;
  border-radius: 999px;
  padding: 4px 8px;
  color: #f6c53b;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 1000;
}

.campaign-level-card.curve-easy small,
.campaign-level-card.curve-recovery small {
  border-color: #1eaf5b;
  color: #1eaf5b;
}

.campaign-level-card.curve-easyPlus small,
.campaign-level-card.curve-hard small {
  border-color: #f6c53b;
  color: #f6c53b;
}

.campaign-level-card.is-boss {
  border-color: #201510;
  color: #fff4d6;
  background:
    radial-gradient(circle at 50% 18%, rgba(246, 197, 59, 0.38), transparent 28%),
    repeating-linear-gradient(-18deg, rgba(255, 244, 214, 0.08) 0 8px, transparent 8px 18px),
    linear-gradient(145deg, #7f1d1d, #201510 62%);
  box-shadow: 7px 7px 0 rgba(239, 62, 55, 0.62), 0 0 0 5px rgba(246, 197, 59, 0.3) inset;
  isolation: isolate;
}

.campaign-level-card.is-boss:hover {
  background:
    radial-gradient(circle at 50% 18%, rgba(246, 197, 59, 0.46), transparent 30%),
    repeating-linear-gradient(-18deg, rgba(255, 244, 214, 0.11) 0 8px, transparent 8px 18px),
    linear-gradient(145deg, #9f1d1d, #201510 62%);
}

.campaign-level-card.is-boss img {
  position: relative;
  z-index: 1;
  width: min(52%, 142px);
  height: 132px;
  filter: drop-shadow(0 14px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 0 18px rgba(246, 197, 59, 0.38));
}

.campaign-level-card.is-boss strong {
  z-index: 2;
  color: #fff4d6;
  text-shadow: 2px 2px 0 #201510;
}

.campaign-level-card.is-boss strong span {
  color: #f6c53b;
}

.campaign-level-card.curve-miniBoss small,
.campaign-level-card.curve-bigBoss small,
.campaign-level-card.curve-finalBoss small {
  border-color: #f6c53b;
  color: #201510;
  background: #f6c53b;
  box-shadow: 2px 2px 0 #201510;
}

.boss-crown {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 2;
  color: #f6c53b;
  font-size: 1.45rem;
  font-weight: 1000;
  text-shadow: 2px 2px 0 #201510;
}

.boss-ribbon {
  position: absolute;
  left: -36px;
  top: 18px;
  z-index: 3;
  width: 138px;
  transform: rotate(-36deg);
  border: 3px solid #201510;
  background: #ef3e37;
  color: #fff4d6;
  padding: 4px 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(32, 21, 16, 0.38);
}

.boss-aura {
  position: absolute;
  inset: 18px;
  z-index: 0;
  border: 3px dashed rgba(246, 197, 59, 0.68);
  border-radius: 16px;
  animation: bossCardPulse 1400ms ease-in-out infinite;
  pointer-events: none;
}

.campaign-level-card.is-locked {
  border-color: #cbd5e1;
  color: #94a3b8;
  background: #f1f5f9;
  box-shadow: 4px 4px 0 rgba(32, 21, 16, 0.12);
}

.campaign-level-card.is-locked strong {
  color: #94a3b8;
}

.locked-mark {
  display: grid;
  place-items: center;
  height: 124px;
  color: rgba(239, 62, 55, 0.55);
  font-size: clamp(2.4rem, 10vw, 4rem);
  font-weight: 1000;
}

.lock-icon {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 22px;
  height: 22px;
  border: 3px solid #31415d;
  border-radius: 5px;
  color: transparent;
}

.npc-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 22px;
}

.npc-intro-modal.is-open {
  display: grid;
}

.npc-intro-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(239, 62, 55, 0.26), transparent 34%),
    rgba(2, 6, 12, 0.82);
  backdrop-filter: blur(10px);
}

.npc-intro-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1fr);
  gap: clamp(18px, 4vw, 34px);
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 34px));
  overflow: auto;
  border: 5px solid #201510;
  border-radius: 22px;
  padding: clamp(18px, 3vw, 30px);
  color: #201510;
  background:
    linear-gradient(135deg, rgba(255, 244, 214, 0.96), rgba(248, 251, 255, 0.96)),
    repeating-linear-gradient(-6deg, rgba(239, 62, 55, 0.08) 0 8px, transparent 8px 18px);
  box-shadow: 0 28px 0 rgba(0, 0, 0, 0.42), 0 0 0 8px rgba(246, 197, 59, 0.38);
}

.npc-intro-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #201510;
  border-radius: 50%;
  color: #201510;
  background: #f6c53b;
  font-size: 1.5rem;
  font-weight: 1000;
}

.npc-poster {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  overflow: hidden;
  border: 5px solid #201510;
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: inset 0 -16px 0 rgba(32, 21, 16, 0.08);
}

.npc-poster::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 3px dashed rgba(239, 62, 55, 0.38);
  border-radius: 14px;
}

.npc-poster img {
  position: relative;
  width: min(94%, 430px);
  max-height: 440px;
  object-fit: contain;
  filter: drop-shadow(0 20px 0 rgba(32, 21, 16, 0.16));
  transform: rotate(-1.5deg);
}

.npc-poster span {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  border: 4px solid #201510;
  border-radius: 999px;
  padding: 8px 13px;
  color: #fff4d6;
  background: #ef3e37;
  font-size: 1rem;
  font-weight: 1000;
  box-shadow: 4px 4px 0 #201510;
}

.npc-intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.npc-intro-copy p {
  margin: 0 0 8px;
  color: #ef3e37;
  font-size: 0.92rem;
  font-weight: 1000;
}

.npc-intro-copy h3 {
  margin: 0;
  color: #201510;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.npc-intro-copy > strong {
  margin-top: 12px;
  color: #31415d;
  font-size: 1.1rem;
  font-weight: 1000;
}

.npc-intro-copy blockquote {
  position: relative;
  margin: clamp(22px, 4vw, 38px) 0;
  border-left: 10px solid #ef3e37;
  padding: 12px 0 12px 18px;
  color: #201510;
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  line-height: 1.16;
  font-weight: 1000;
}

.npc-intro-copy blockquote::before {
  content: "“";
  position: absolute;
  left: -6px;
  top: -34px;
  color: rgba(239, 62, 55, 0.2);
  font-size: 7rem;
  line-height: 1;
  font-weight: 1000;
}

.npc-intro-copy .button {
  align-self: flex-start;
  min-width: 180px;
}

@media (max-width: 760px) {
  .npc-intro-card {
    grid-template-columns: 1fr;
  }

  .npc-poster {
    min-height: 280px;
  }

  .npc-poster img {
    max-height: 300px;
  }

  .npc-intro-copy .button {
    width: 100%;
  }
}

.hidden-setup {
  display: none;
}

.permission-card strong {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper-soft);
  white-space: nowrap;
}

.permission-card .button {
  grid-column: 1 / -1;
}

.opponent-picker-card {
  grid-template-columns: 1fr auto;
}

.level-picker-card {
  grid-template-columns: 1fr auto;
}

.level-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.level-choice {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  font-weight: 1000;
  box-shadow: 3px 3px 0 var(--ink);
}

.level-choice.is-selected {
  background: var(--blue);
  color: white;
}

.level-choice.is-boss {
  background: var(--red);
  color: white;
}

.level-choice.is-boss.is-selected {
  background: var(--green);
  color: var(--ink);
}

.opponent-preview-strip,
.opponent-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.opponent-preview-strip {
  grid-template-columns: repeat(3, 1fr);
}

.opponent-expression-demo {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 8px;
  text-align: center;
  font-weight: 950;
}

.opponent-expression-demo img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(5px 6px 0 rgba(32, 21, 16, 0.24));
}

.opponent-expression-demo::after {
  content: "";
  position: absolute;
  inset: 10px 14px 30px;
  pointer-events: none;
}

.opponent-expression-demo.smug::after {
  border-top: 7px solid var(--green);
  transform: skewY(-8deg);
}

.opponent-expression-demo.angry::after {
  border-top: 8px solid var(--red);
  transform: skewY(10deg);
}

.opponent-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.opponent-picker-card.is-locked .opponent-grid {
  opacity: 0.55;
  pointer-events: none;
}

.opponent-choice {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  padding: 7px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--ink);
}

.opponent-choice.is-selected {
  background: var(--green);
}

.opponent-choice img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--paper-soft);
  border: 2px solid var(--ink);
}

.permission-device-preview,
.mic-meter {
  grid-column: 1 / -1;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--black);
}

.permission-device-preview {
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: scaleX(-1);
}

.mic-meter {
  height: 26px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 244, 214, 0.14) 0 10px, transparent 10px 20px),
    var(--black);
}

.mic-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--paper), var(--red));
  transition: width 80ms linear;
}

.permission-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.comic-burst {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%) rotate(-9deg);
  padding: 12px 24px;
  border: 5px solid var(--ink);
  background: var(--paper);
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 1000;
  line-height: 1;
  box-shadow: 8px 8px 0 var(--ink);
  z-index: 3;
  animation: previewBurst 1600ms ease-in-out infinite;
}

.preview-fighter {
  position: absolute;
  bottom: 58px;
  display: grid;
  place-items: center;
  width: clamp(140px, 22vw, 180px);
  height: clamp(190px, 30vw, 250px);
  border: 5px solid var(--ink);
  border-radius: 46% 48% 8px 8px;
  color: white;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 1000;
  box-shadow: 10px 10px 0 rgba(32, 21, 16, 0.48);
  z-index: 2;
}

.player-preview {
  left: 48px;
  background: var(--blue);
  transform: rotate(-8deg);
}

.rival-preview {
  right: 48px;
  background: var(--red);
  transform: rotate(9deg);
  animation: previewHit 1600ms ease-in-out infinite;
}

.preview-slap-line {
  position: absolute;
  left: 34%;
  top: 50%;
  width: 32%;
  height: 14px;
  border: 4px solid var(--ink);
  background: var(--paper);
  transform: rotate(-9deg);
  box-shadow: 8px 8px 0 rgba(32, 21, 16, 0.3);
  z-index: 4;
  animation: previewSlap 1600ms ease-in-out infinite;
}

.preview-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  text-align: center;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 1000;
  letter-spacing: 0.02em;
  background: var(--paper);
  border: 4px solid var(--ink);
  padding: 12px 14px;
  box-shadow: 6px 6px 0 var(--ink);
  z-index: 5;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 22px;
}

.tool-panel,
.command-panel,
.capture-controls {
  padding: 18px;
}

.command-panel h2,
.tool-panel h2 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  font-weight: 800;
}

.leaderboard-panel h3 {
  margin-bottom: 0;
}

.red-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  box-shadow: 2px 2px 0 var(--ink);
}

.revenge-banner {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--red);
  color: white;
  padding: 10px;
  font-weight: 950;
  box-shadow: 4px 4px 0 var(--ink);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  padding: 8px;
  font-weight: 950;
}

.leaderboard-list li.is-player {
  background: var(--green);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 12px;
}

.character-card {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  padding: 8px;
  text-align: center;
  font-weight: 900;
}

.character-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f7e6bd;
  border: 2px solid var(--ink);
}

#cameraPreview,
#motionVideo,
#stickerCanvas,
#replayCanvas {
  display: block;
  width: 100%;
}

#challengeCanvas {
  display: none;
  width: 100%;
  max-height: 58vh;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

#challengeCanvas.is-ready {
  display: block;
}

#resultScreen.active {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(10px);
}

.result-modal-card {
  width: min(980px, 100%);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(12px, 2vw, 18px);
  background: var(--paper-soft);
  box-shadow: 0 24px 0 rgba(0, 0, 0, 0.42);
}

#resultScreen .section-head {
  margin-bottom: 10px;
}

#resultScreen .result-layout {
  grid-template-columns: minmax(180px, 0.72fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: stretch;
}

#resultScreen #replayCanvas {
  max-height: min(58vh, 520px);
  object-fit: contain;
  border: 4px solid var(--ink);
  background: var(--paper);
}

#resultScreen .tool-panel {
  min-height: 0;
}

#resultScreen .stats-list {
  grid-template-columns: repeat(2, 1fr);
}

.challenge-actions {
  display: none;
  gap: 10px;
  margin-top: 14px;
}

.challenge-actions.is-ready {
  display: grid;
}

.challenge-actions input {
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-weight: 800;
}

#cameraPreview {
  min-height: 420px;
  object-fit: cover;
  border: 4px solid var(--ink);
  background: var(--black);
  box-shadow: var(--shadow);
}

.sticker-stage {
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(45deg, rgba(32, 21, 16, 0.08) 25%, transparent 25%) 0 0 / 34px 34px,
    linear-gradient(-45deg, rgba(32, 21, 16, 0.08) 25%, transparent 25%) 0 0 / 34px 34px,
    var(--paper);
  box-shadow: var(--shadow);
}

.editor-tools {
  display: grid;
  gap: 14px;
}

.editor-tools label {
  display: grid;
  gap: 7px;
  font-weight: 900;
}

.editor-tools input[type="text"] {
  min-height: 42px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.battle-permission-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 18px;
}

.battle-permission-modal.is-open {
  display: grid;
}

.battle-permission-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(20, 17, 15, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.battle-permission-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(18px, 4vw, 24px);
  box-shadow: 12px 12px 0 var(--ink);
}

.battle-permission-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.05;
}

.battle-permission-lede {
  margin: 0 0 14px;
  line-height: 1.5;
  font-weight: 800;
}

.permission-explain-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.permission-explain-item {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  padding: 12px;
  box-shadow: 4px 4px 0 var(--ink);
}

.permission-explain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.permission-explain-item p {
  margin: 0;
  line-height: 1.45;
  font-weight: 700;
  font-size: 0.9rem;
}

.permission-status {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-soft);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 1000;
  white-space: nowrap;
}

.battle-permission-actions {
  display: grid;
  gap: 10px;
}

.battle-permission-actions .button {
  width: 100%;
  min-height: 50px;
  font-size: 1rem;
}

#battleScreen.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 4px;
}

.fighter-hud {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 1000;
}

.fighter-hud.player-hud {
  justify-items: start;
}

.fighter-hud.enemy-hud {
  justify-items: end;
  text-align: right;
}

.fighter-hud span {
  font-size: clamp(0.88rem, 2.6vw, 1rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.heart-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}

.heart {
  display: inline-grid;
  place-items: center;
  font-size: clamp(1.15rem, 4.2vw, 1.55rem);
  line-height: 1;
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.heart.is-full {
  filter: drop-shadow(1px 2px 0 rgba(32, 21, 16, 0.25));
}

.heart.is-empty {
  opacity: 0.42;
  transform: scale(0.88);
}

.heart-row.heart-lost .heart.is-full {
  animation: heartPulse 420ms ease;
}

@keyframes heartPulse {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
}

#battleScreen .round-chip {
  align-self: center;
  justify-self: center;
  min-width: 88px;
  font-size: clamp(0.82rem, 2.4vw, 0.95rem);
  padding: 8px 12px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#battleScreen .round-chip.is-active-turn {
  transform: scale(1.06);
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  padding: 10px 16px;
  box-shadow: 6px 6px 0 var(--ink);
}

#battleScreen .round-chip.is-active-turn.is-attack-turn {
  background: var(--red);
  color: #fff;
}

#battleScreen .round-chip.is-active-turn.is-dodge-turn {
  background: var(--blue);
  color: #fff;
}

.battle-arena.phase-attack {
  box-shadow: 0 0 0 4px rgba(239, 62, 55, 0.45), var(--shadow);
}

.battle-arena.phase-dodge {
  box-shadow: 0 0 0 4px rgba(30, 130, 255, 0.45), var(--shadow);
}

.battle-prompt.is-attack,
.battle-prompt.is-dodge {
  font-weight: 1000;
  border-width: 4px;
}

.battle-prompt.is-attack {
  background: #ffe2df;
  border-color: var(--red);
  color: #8f1d18;
}

.battle-prompt.is-dodge {
  background: #dcecff;
  border-color: var(--blue);
  color: #0f4f9d;
}

.battle-arena {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(transparent 70%, rgba(32, 21, 16, 0.18) 70%),
    radial-gradient(circle at 50% 18%, rgba(255, 244, 214, 0.82), transparent 28%),
    #f86f45;
  box-shadow: var(--shadow);
}

.battle-arena::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(70deg, transparent 0 46%, rgba(255, 255, 255, 0.92) 47% 52%, transparent 53% 100%),
    radial-gradient(circle at 50% 48%, rgba(255, 244, 214, 0.72), transparent 24%);
}

.battle-arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 36%, rgba(239, 62, 55, 0.34), transparent 24%),
    linear-gradient(90deg, rgba(239, 62, 55, 0.46), transparent 28% 72%, rgba(239, 62, 55, 0.4));
}

.battle-arena.impact-heavy {
  animation: arenaSlam 500ms cubic-bezier(0.14, 0.9, 0.18, 1.5);
}

.battle-arena.impact-heavy::before {
  animation: impactFlash 500ms ease;
}

.battle-arena.impact-taken {
  animation: arenaTaken 680ms cubic-bezier(0.16, 1, 0.18, 1.45);
}

.battle-arena.impact-taken::after {
  animation: playerDamageFlash 620ms ease;
}

.battle-arena.impact-dodge {
  animation: dodgeWhiff 420ms ease;
}

.battle-arena.impact-dodge::before {
  animation: whiffFlash 420ms ease;
}

.mobile-arena-guide {
  display: none;
}

.gesture-coach {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 5;
  display: grid;
  gap: 7px;
  justify-items: center;
  transform: translateX(-50%);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 8px 14px;
  color: var(--ink);
  background: rgba(255, 244, 214, 0.9);
  box-shadow: 5px 5px 0 rgba(32, 21, 16, 0.28);
  pointer-events: none;
}

.gesture-coach strong {
  font-size: clamp(0.78rem, 2.1vw, 1rem);
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.gesture-path {
  position: relative;
  width: 152px;
  height: 30px;
}

.ghost-hand {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 24px;
  transform: translateY(-50%);
  border: 3px solid var(--ink);
  border-radius: 999px 12px 12px 999px;
  color: var(--ink);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 1000;
  box-shadow: 2px 2px 0 var(--ink);
}

.ghost-hand.start {
  left: 4px;
  animation: attackHintStart 1300ms ease-in-out infinite;
}

.ghost-hand.end {
  right: 4px;
  color: #fff;
  background: var(--red);
  animation: attackHintEnd 1300ms ease-in-out infinite;
}

.gesture-arrow {
  position: absolute;
  left: 42px;
  right: 42px;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--red);
}

.gesture-arrow::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  width: 13px;
  height: 13px;
  border-top: 5px solid var(--red);
  border-right: 5px solid var(--red);
  transform: translateY(-50%) rotate(45deg);
}

.battle-arena.phase-dodge .ghost-hand.start {
  left: auto;
  right: 4px;
  color: #fff;
  background: var(--blue);
  animation: dodgeHintStart 1300ms ease-in-out infinite;
}

.battle-arena.phase-dodge .ghost-hand.end {
  left: 4px;
  right: auto;
  color: var(--ink);
  background: #fff;
  animation: dodgeHintEnd 1300ms ease-in-out infinite;
}

.battle-arena.phase-dodge .gesture-arrow {
  background: var(--blue);
}

.battle-arena.phase-dodge .gesture-arrow::after {
  left: -3px;
  right: auto;
  border-top-color: var(--blue);
  border-right-color: var(--blue);
  transform: translateY(-50%) rotate(-135deg);
}

.fighter {
  position: absolute;
  bottom: 42px;
  width: clamp(140px, 23vw, 270px);
  height: clamp(182px, 28vw, 330px);
  display: grid;
  place-items: end center;
  transition: transform 220ms ease;
}

.fighter.player {
  left: clamp(16px, 7vw, 110px);
}

.fighter.enemy {
  right: clamp(16px, 7vw, 110px);
  width: clamp(165px, 27vw, 320px);
  height: clamp(208px, 32vw, 380px);
}

.fighter.enemy.retreating {
  animation: enemyRetreat 620ms cubic-bezier(0.2, 1.15, 0.28, 1) both;
}

.fighter.enemy.striking {
  animation: enemyStrike 560ms cubic-bezier(0.16, 1, 0.18, 1.4) both;
}

.fighter img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(10px 12px 0 rgba(32, 21, 16, 0.35));
}

.fighter.enemy img {
  border: 5px solid var(--ink);
  border-radius: clamp(18px, 4vw, 28px);
  background: var(--paper);
  box-sizing: border-box;
  box-shadow: 8px 8px 0 rgba(32, 21, 16, 0.32);
}

.fighter.enemy .expression-badge {
  position: absolute;
  left: 0;
  top: 14%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(-72% - 6px));
  transition: opacity 160ms ease, transform 220ms ease;
}

.boss-taunt-bubble {
  position: absolute;
  left: auto;
  right: 28px;
  top: 74px;
  z-index: 6;
  max-width: min(390px, calc(48% - 20px));
  opacity: 0;
  transform: translateY(0) rotate(2deg) scale(0.9);
  border: 5px solid var(--ink);
  border-radius: 20px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--paper);
  font-size: clamp(1.05rem, 3.2vw, 1.55rem);
  font-weight: 1000;
  line-height: 1.18;
  text-align: center;
  box-shadow: 6px 6px 0 rgba(32, 21, 16, 0.32);
  pointer-events: none;
}

.boss-taunt-bubble::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: -13px;
  width: 18px;
  height: 18px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: var(--paper);
  transform: rotate(45deg);
}

.boss-taunt-bubble.is-showing {
  animation: bossTauntPop 1850ms ease both;
}

.boss-taunt-bubble.is-mercy {
  color: #0f4f9d;
  background: #dcecff;
}

.boss-taunt-bubble.is-mercy::after {
  background: #dcecff;
}

.fighter.enemy.mood-neutral .expression-badge,
.fighter.enemy.mood-smug .expression-badge,
.fighter.enemy.mood-angry .expression-badge,
.fighter.enemy.mood-hurt .expression-badge,
.fighter.enemy.mood-stunned .expression-badge,
.fighter.enemy.mood-dizzy .expression-badge,
.fighter.enemy.mood-panic .expression-badge,
.fighter.enemy.mood-cocky .expression-badge {
  opacity: 1;
}

.fighter.enemy .expression-face {
  position: relative;
  width: 58px;
  height: 58px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
}

.fighter.enemy .expression-face .eye,
.fighter.enemy .expression-face .mouth {
  position: absolute;
  left: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 1px 1px 0 var(--ink);
}

.fighter.enemy .expression-face .eye {
  top: 36%;
  width: 12px;
  height: 7px;
  border-radius: 999px;
}

.fighter.enemy .expression-face .eye.left {
  transform: translateX(-13px);
}

.fighter.enemy .expression-face .eye.right {
  transform: translateX(1px);
}

.fighter.enemy .expression-face .mouth {
  top: 60%;
  width: 20px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 0 0 999px 999px;
}

.fighter.enemy #enemyMoodLabel {
  position: static;
  transform: rotate(-4deg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 1000;
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}

.fighter.enemy.mood-smug .expression-face .eye {
  height: 5px;
  background: var(--green);
}

.fighter.enemy.mood-smug .expression-face .eye.left {
  transform: translateX(-13px) rotate(-10deg);
}

.fighter.enemy.mood-smug .expression-face .eye.right {
  transform: translateX(1px) rotate(10deg);
}

.fighter.enemy.mood-smug .expression-face .mouth {
  border-radius: 999px 999px 0 0;
  background: var(--green);
}

.fighter.enemy.mood-angry .expression-face .eye {
  height: 6px;
  background: var(--red);
}

.fighter.enemy.mood-angry .expression-face .eye.left {
  transform: translateX(-13px) rotate(18deg);
}

.fighter.enemy.mood-angry .expression-face .eye.right {
  transform: translateX(1px) rotate(-18deg);
}

.fighter.enemy.mood-angry .expression-face .mouth {
  top: 64%;
  border-radius: 999px 999px 0 0;
  background: var(--red);
}

.fighter.enemy.mood-hurt .expression-face .eye {
  height: 4px;
  background: var(--red);
  border-radius: 2px;
}

.fighter.enemy.mood-hurt .expression-face .eye.left {
  transform: translateX(-13px) rotate(25deg);
}

.fighter.enemy.mood-hurt .expression-face .eye.right {
  transform: translateX(1px) rotate(-25deg);
}

.fighter.enemy.mood-hurt .expression-face .mouth {
  top: 62%;
  width: 16px;
  height: 10px;
  border-radius: 999px;
  background: var(--red);
}

.fighter.enemy.mood-stunned .expression-face {
  animation: stunned 260ms steps(2, end) infinite;
}

.fighter.enemy.mood-stunned .expression-face .eye {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #201510;
  top: 34%;
}

.fighter.enemy.mood-stunned .expression-face .eye.left {
  transform: translateX(-11px);
}

.fighter.enemy.mood-stunned .expression-face .eye.right {
  transform: translateX(3px);
}

.fighter.enemy.mood-stunned .expression-face .mouth {
  top: 58%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
}

.fighter.enemy.mood-dizzy .expression-face {
  animation: stunned 300ms ease-in-out infinite;
}

.fighter.enemy.mood-dizzy .expression-face .eye {
  width: 10px;
  height: 3px;
  background: var(--blue);
}

.fighter.enemy.mood-dizzy .expression-face .eye.left {
  transform: translateX(-12px) rotate(-35deg);
}

.fighter.enemy.mood-dizzy .expression-face .eye.right {
  transform: translateX(2px) rotate(35deg);
}

.fighter.enemy.mood-dizzy .expression-face .mouth {
  top: 63%;
  width: 18px;
  height: 6px;
  border-radius: 999px;
  transform: translateX(-50%) rotate(8deg);
}

.fighter.enemy.mood-panic .expression-face .eye {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: var(--paper);
  top: 32%;
}

.fighter.enemy.mood-panic .expression-face .eye.left {
  transform: translateX(-14px);
}

.fighter.enemy.mood-panic .expression-face .eye.right {
  transform: translateX(0);
}

.fighter.enemy.mood-panic .expression-face .mouth {
  top: 60%;
  width: 12px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
}

.fighter.enemy.mood-cocky .expression-face .eye.left {
  height: 5px;
  transform: translateX(-13px) rotate(-18deg);
}

.fighter.enemy.mood-cocky .expression-face .eye.right {
  height: 9px;
  transform: translateX(1px);
}

.fighter.enemy.mood-cocky .expression-face .mouth {
  top: 61%;
  width: 22px;
  border-radius: 0 0 999px 999px;
  background: var(--green);
  transform: translateX(-42%);
}

.fighter.attack-left {
  transform: translateX(150px) translateY(-18px) rotate(16deg) scale(1.1);
  filter: drop-shadow(18px 14px 0 rgba(239, 62, 55, 0.24));
}

.fighter.attack-right {
  transform: translateX(-150px) translateY(-18px) rotate(-16deg) scale(1.1);
  filter: drop-shadow(-18px 14px 0 rgba(239, 62, 55, 0.24));
}

.fighter.hit {
  animation: hitShake 620ms cubic-bezier(0.2, 1.15, 0.25, 1);
}

.fighter.enemy.hit {
  animation: enemyLaunch 620ms cubic-bezier(0.2, 1.15, 0.25, 1);
}

.fighter.player.hit {
  animation: playerLaunch 760ms cubic-bezier(0.16, 1, 0.18, 1.5);
}

.fighter.stunned {
  animation: stunned 260ms steps(2, end) infinite;
  filter: saturate(0.6);
}

.impact-text,
.damage-pop {
  position: absolute;
  left: 50%;
  top: 25%;
  transform: translate(-50%, -50%) rotate(-8deg);
  z-index: 5;
  color: white;
  font-size: clamp(2.4rem, 9vw, 7rem);
  font-weight: 1000;
  text-shadow: 5px 5px 0 var(--ink);
  pointer-events: none;
}

.battle-arena.impact-heavy .impact-text {
  animation: textPunch 560ms ease;
}

.battle-arena.impact-heavy .damage-pop,
.battle-arena.impact-taken .damage-pop {
  animation: damageBurst 620ms ease;
}

.damage-pop {
  top: 44%;
  color: var(--paper);
  font-size: clamp(1.8rem, 6vw, 4rem);
}

.damage-pop.is-player-damage {
  top: 58%;
  color: #ef3e37;
  font-size: clamp(2.4rem, 8vw, 5.6rem);
  text-shadow: 5px 5px 0 #201510, 0 0 26px rgba(255, 244, 214, 0.9);
}

.damage-pop.is-dodge {
  color: #52e36c;
}

.battle-controls {
  margin-top: 8px;
}

.hand-skeleton-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.hand-skeleton-head {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 1000;
  border: 3px solid rgba(255, 244, 214, 0.28);
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  background: rgba(7, 10, 15, 0.7);
  backdrop-filter: blur(8px);
}

.hand-skeleton-head span {
  border: 2px solid rgba(246, 197, 59, 0.72);
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff4d6;
  background: rgba(246, 197, 59, 0.16);
  white-space: nowrap;
}

#handSkeletonCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#battleScreen .battle-controls {
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
  box-shadow: var(--shadow);
}

#battleScreen .battle-controls .battle-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.motion-capture-hidden {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.battle-prompt {
  margin: 0;
  line-height: 1.45;
  font-weight: 800;
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
}

.battle-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#battleScreen .slap-btn,
#battleScreen .dodge-btn,
#battleScreen .bark-wide {
  min-height: 52px;
  font-size: clamp(1rem, 3.6vw, 1.15rem);
  font-weight: 1000;
  border-width: 4px;
}

#battleScreen .slap-btn {
  background: var(--red);
  color: #fff;
}

#battleScreen .dodge-btn {
  background: var(--blue);
  color: #fff;
}

#battleScreen .bark-wide {
  grid-column: 1 / -1;
}

#battleScreen .skill-strip {
  margin-top: 2px;
}

#battleScreen .button.compact {
  padding: 8px 12px;
  min-height: auto;
  font-size: 0.88rem;
}

.camera-tile {
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--black);
  box-shadow: var(--shadow);
}

#motionVideo {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scaleX(-1);
}

#motionCanvas {
  display: none;
}

.status-line {
  padding: 9px;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.skill-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  border: 3px solid var(--ink);
  background: #fff;
  padding: 10px;
}

.skill-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--red);
}

#replayCanvas {
  max-height: 72vh;
  width: auto;
  max-width: 100%;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.stats-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.stats-list div {
  border: 3px solid var(--ink);
  padding: 10px;
  background: white;
}

.stats-list dt {
  color: var(--red);
  font-weight: 900;
}

.stats-list dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 1000;
}

.fineprint {
  margin-bottom: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  font-weight: 800;
}

@keyframes hitShake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  25% {
    transform: translate(20px, -8px) rotate(8deg);
  }
  55% {
    transform: translate(-18px, 10px) rotate(-8deg);
  }
  80% {
    transform: translate(9px, -5px) rotate(4deg);
  }
}

@keyframes previewHit {
  0%,
  60%,
  100% {
    transform: rotate(9deg) translateX(0);
  }
  68% {
    transform: rotate(18deg) translateX(28px) translateY(-12px);
  }
  76% {
    transform: rotate(4deg) translateX(-8px);
  }
}

@keyframes previewSlap {
  0%,
  58%,
  100% {
    opacity: 0;
    transform: rotate(-9deg) translateX(-18%) scaleX(0.55);
  }
  64% {
    opacity: 1;
    transform: rotate(-9deg) translateX(0) scaleX(1);
  }
  72% {
    opacity: 1;
    transform: rotate(-9deg) translateX(14%) scaleX(1.08);
  }
  80% {
    opacity: 0;
    transform: rotate(-9deg) translateX(28%) scaleX(0.7);
  }
}

@keyframes previewBurst {
  0%,
  58%,
  100% {
    opacity: 0.35;
    transform: translateX(-50%) rotate(-9deg) scale(0.92);
  }
  66% {
    opacity: 1;
    transform: translateX(-50%) rotate(-4deg) scale(1.08);
  }
  74% {
    opacity: 1;
    transform: translateX(-50%) rotate(-12deg) scale(1);
  }
}

@keyframes arenaSlam {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  18% {
    transform: translate(12px, -10px) rotate(0.8deg);
  }
  36% {
    transform: translate(-14px, 9px) rotate(-0.9deg);
  }
  56% {
    transform: translate(8px, 4px) rotate(0.4deg);
  }
}

@keyframes arenaTaken {
  0%,
  100% {
    transform: translate(0, 0);
  }
  18% {
    transform: translate(-30px, 2px) rotate(-1.1deg);
  }
  36% {
    transform: translate(26px, -8px) rotate(1deg);
  }
  58% {
    transform: translate(-14px, 6px) rotate(-0.5deg);
  }
  78% {
    transform: translate(8px, -3px);
  }
}

@keyframes impactFlash {
  0% {
    opacity: 0;
    transform: scale(0.84) rotate(-8deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.25) rotate(4deg);
  }
}

@keyframes playerDamageFlash {
  0%,
  100% {
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  28% {
    opacity: 0.25;
  }
  44% {
    opacity: 0.72;
  }
}

@keyframes whiffFlash {
  0% {
    opacity: 0;
    transform: translateX(8%) rotate(4deg) scale(0.9);
  }
  22% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: translateX(-18%) rotate(-9deg) scale(1.15);
  }
}

@keyframes dodgeWhiff {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  34% {
    transform: translate(18px, 0) rotate(0.5deg);
  }
  66% {
    transform: translate(-12px, 0) rotate(-0.4deg);
  }
}

@keyframes enemyRetreat {
  0%,
  100% {
    transform: translate(0, 0) rotate(0) scale(1);
  }
  42%,
  78% {
    transform: translate(58px, -8px) rotate(5deg) scale(0.94);
  }
}

@keyframes enemyStrike {
  0%,
  100% {
    transform: translate(0, 0) rotate(0) scale(1);
  }
  28% {
    transform: translate(-116px, -18px) rotate(-15deg) scale(1.12);
  }
  62% {
    transform: translate(-84px, -10px) rotate(-10deg) scale(1.08);
  }
}

@keyframes enemyRetreatMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
  42%,
  78% {
    transform: translateX(-50%) translateY(-42px) rotate(4deg) scale(0.94);
  }
}

@keyframes attackHintStart {
  0%,
  100% {
    transform: translateY(-50%) translateX(0) rotate(0);
    opacity: 0.72;
  }
  48% {
    transform: translateY(-50%) translateX(68px) rotate(8deg);
    opacity: 1;
  }
}

@keyframes attackHintEnd {
  0%,
  38%,
  100% {
    transform: translateY(-50%) scale(0.9);
  }
  52% {
    transform: translateY(-50%) scale(1.16);
  }
}

@keyframes dodgeHintStart {
  0%,
  100% {
    transform: translateY(-50%) translateX(0) rotate(0);
    opacity: 1;
  }
  48% {
    transform: translateY(-50%) translateX(-68px) rotate(-8deg);
    opacity: 0.82;
  }
}

@keyframes dodgeHintEnd {
  0%,
  38%,
  100% {
    transform: translateY(-50%) scale(0.9);
  }
  52% {
    transform: translateY(-50%) scale(1.08);
  }
}

@keyframes attackHintStartMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0);
    opacity: 0.72;
  }
  48% {
    transform: translateX(-50%) translateY(-58px) rotate(8deg);
    opacity: 1;
  }
}

@keyframes attackHintEndMobile {
  0%,
  38%,
  100% {
    transform: translateX(-50%) scale(0.9);
  }
  52% {
    transform: translateX(-50%) scale(1.16);
  }
}

@keyframes dodgeHintStartMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0);
    opacity: 1;
  }
  48% {
    transform: translateX(-50%) translateY(58px) rotate(-8deg);
    opacity: 0.82;
  }
}

@keyframes dodgeHintEndMobile {
  0%,
  38%,
  100% {
    transform: translateX(-50%) scale(0.9);
  }
  52% {
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes enemyStrikeMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
  28% {
    transform: translateX(-50%) translateY(116px) rotate(-10deg) scale(1.12);
  }
  62% {
    transform: translateX(-50%) translateY(82px) rotate(-7deg) scale(1.08);
  }
}

@keyframes enemyLaunch {
  0%,
  100% {
    transform: translate(0, 0) rotate(0) scale(1);
  }
  28% {
    transform: translate(128px, -58px) rotate(28deg) scale(1.16);
  }
  58% {
    transform: translate(-26px, 20px) rotate(-11deg) scale(0.94);
  }
}

@keyframes enemyLaunchMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
  28% {
    transform: translateX(-50%) translateY(-74px) rotate(22deg) scale(1.16);
  }
  58% {
    transform: translateX(-50%) translateY(18px) rotate(-8deg) scale(0.94);
  }
}

@keyframes playerLaunch {
  0%,
  100% {
    transform: translate(0, 0) rotate(0) scale(1);
  }
  28% {
    transform: translate(-132px, -58px) rotate(-28deg) scale(1.16);
  }
  58% {
    transform: translate(28px, 20px) rotate(12deg) scale(0.9);
  }
  76% {
    transform: translate(-16px, 8px) rotate(-6deg) scale(0.98);
  }
}

@keyframes playerLaunchMobile {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
  28% {
    transform: translateX(-50%) translateY(76px) rotate(-20deg) scale(1.16);
  }
  58% {
    transform: translateX(-50%) translateY(-22px) rotate(10deg) scale(0.9);
  }
  76% {
    transform: translateX(-50%) translateY(10px) rotate(-5deg) scale(0.98);
  }
}

@keyframes textPunch {
  0% {
    transform: translate(-50%, -50%) rotate(-18deg) scale(0.5);
  }
  42% {
    transform: translate(-50%, -50%) rotate(-6deg) scale(1.36);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-8deg) scale(1);
  }
}

@keyframes damageBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -10%) scale(0.4);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -65%) scale(1.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.9);
  }
}

@keyframes bossTauntPop {
  0% {
    opacity: 0;
    transform: translateY(-8px) rotate(4deg) scale(0.78);
  }
  12%,
  78% {
    opacity: 1;
    transform: translateY(0) rotate(2deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) rotate(-2deg) scale(0.94);
  }
}

@keyframes bossCardPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes stunned {
  from {
    transform: translateY(0) rotate(-2deg);
  }
  to {
    transform: translateY(-8px) rotate(2deg);
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 18px, 620px);
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #battleScreen {
    gap: 8px;
    min-height: calc(100dvh - 96px);
  }

  #battleScreen .battle-hud {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "player enemy"
      "round round";
    gap: 8px;
    align-items: start;
  }

  #battleScreen .player-hud {
    grid-area: player;
  }

  #battleScreen .enemy-hud {
    grid-area: enemy;
  }

  #battleScreen .round-chip {
    grid-area: round;
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .hero-grid,
  .editor-layout,
  .result-layout,
  .capture-layout,
  .permission-layout,
  .panel-row,
  #battleScreen .battle-controls {
    margin-top: 6px;
    padding: 10px;
  }

  #battleScreen .battle-controls .battle-action-grid {
    gap: 8px;
    grid-template-columns: 1fr 1fr;
  }

  #battleScreen .slap-btn,
  #battleScreen .dodge-btn,
  #battleScreen .bark-wide {
    min-height: 58px;
    font-size: 1.08rem;
    box-shadow: 6px 6px 0 var(--ink);
  }

  #battleScreen .bark-wide {
    grid-column: 1 / -1;
  }

  #battleScreen .skill-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .free-duel-preview-media {
    min-height: min(44vw, 220px);
  }

  .free-duel-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 310px;
  }

  .free-duel-choice-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .campaign-screen {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 40px 10px 22px;
    border-radius: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .back-tab {
    left: 10px;
    top: 10px;
    max-width: calc(100% - 20px);
  }

  .campaign-subtitle {
    margin: 14px 8px 20px;
    padding: 0 4px;
  }

  .campaign-player {
    margin-bottom: 16px;
    max-width: calc(100% - 16px);
  }

  .campaign-level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 100%;
    padding: 0 2px;
    box-sizing: border-box;
  }

  .campaign-level-card {
    min-height: 138px;
    padding: 10px 8px 36px;
    border-radius: 14px;
    border-width: 3px;
    box-shadow: 4px 4px 0 rgba(32, 21, 16, 0.22);
  }

  .campaign-level-card img {
    width: min(58%, 76px);
    height: 72px;
    margin: 2px auto 0;
  }

  .campaign-level-card strong {
    left: 6px;
    right: 6px;
    bottom: 8px;
    font-size: clamp(0.72rem, 3.2vw, 0.92rem);
    gap: 4px;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
  }

  .campaign-level-card small {
    right: 6px;
    top: 6px;
    max-width: 42px;
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  .boss-crown {
    left: 8px;
    top: 8px;
    font-size: 1.1rem;
  }

  .boss-ribbon {
    left: -42px;
    top: 12px;
    width: 130px;
    font-size: 0.62rem;
  }

  .boss-aura {
    inset: 12px;
  }

  .locked-mark {
    height: 72px;
  }

  #homeScreen .hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  #homeScreen .home-stage {
    order: -1;
  }

  .privacy-pill {
    border-radius: var(--radius);
  }

  .home-stage {
    min-height: min(26vh, 190px);
    height: min(26vh, 190px);
  }

  .home-stage .home-stage-label {
    left: 10px;
    top: 10px;
    padding: 5px 8px;
    font-size: 0.82rem;
  }

  .home-stage .comic-burst {
    top: 16%;
    padding: 6px 14px;
    font-size: clamp(1.8rem, 9vw, 2.6rem);
    box-shadow: 5px 5px 0 var(--ink);
  }

  .home-stage .preview-fighter {
    bottom: 34px;
    width: 72px;
    height: 96px;
    font-size: 1.05rem;
    border-width: 4px;
    box-shadow: 6px 6px 0 rgba(32, 21, 16, 0.48);
  }

  .home-stage .player-preview {
    left: 22px;
  }

  .home-stage .rival-preview {
    right: 22px;
  }

  .home-stage .preview-slap-line {
    top: 46%;
    width: 30%;
    height: 8px;
    border-width: 3px;
  }

  .home-stage .preview-caption {
    left: 10px;
    right: 10px;
    bottom: 8px;
    padding: 7px 10px;
    font-size: 0.88rem;
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .permission-preview {
    min-height: 320px;
  }

  .fighter-hud {
    width: 100%;
  }

  #battleScreen .heart-row {
    gap: 2px;
  }

  #battleScreen .heart {
    font-size: 1.35rem;
  }

  #battleScreen .battle-arena {
    min-height: min(58vh, 460px);
    flex: 1;
    border-width: 4px;
    background:
      linear-gradient(transparent 48%, rgba(32, 21, 16, 0.16) 48% 51%, transparent 51%),
      radial-gradient(circle at 50% 22%, rgba(255, 244, 214, 0.86), transparent 24%),
      radial-gradient(circle at 50% 82%, rgba(30, 130, 255, 0.22), transparent 30%),
      #f86f45;
  }

  #battleScreen .mobile-arena-guide {
    position: absolute;
    left: 50%;
    top: 52%;
    z-index: 3;
    display: block;
    transform: translate(-50%, -50%) rotate(-2deg);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--ink);
    background: rgba(255, 244, 214, 0.82);
    font-size: 0.78rem;
    font-weight: 1000;
    box-shadow: 4px 4px 0 rgba(32, 21, 16, 0.28);
    pointer-events: none;
  }

  #battleScreen .gesture-coach {
    top: auto;
    bottom: clamp(64px, 15vh, 92px);
    padding: 7px 10px;
    border-width: 3px;
  }

  #battleScreen .gesture-path {
    width: 36px;
    height: 94px;
  }

  #battleScreen .ghost-hand {
    width: 30px;
    height: 22px;
    font-size: 0.62rem;
  }

  #battleScreen .ghost-hand.start {
    left: 50%;
    top: auto;
    bottom: 2px;
    transform: translateX(-50%);
    animation: attackHintStartMobile 1300ms ease-in-out infinite;
  }

  #battleScreen .ghost-hand.end {
    left: 50%;
    right: auto;
    top: 2px;
    transform: translateX(-50%);
    animation: attackHintEndMobile 1300ms ease-in-out infinite;
  }

  #battleScreen .gesture-arrow {
    left: 50%;
    right: auto;
    top: 34px;
    bottom: 34px;
    width: 5px;
    height: auto;
    transform: translateX(-50%);
  }

  #battleScreen .gesture-arrow::after {
    right: auto;
    left: 50%;
    top: -3px;
    transform: translateX(-50%) rotate(-45deg);
  }

  #battleScreen .battle-arena.phase-dodge .ghost-hand.start {
    left: 50%;
    top: 2px;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    animation: dodgeHintStartMobile 1300ms ease-in-out infinite;
  }

  #battleScreen .battle-arena.phase-dodge .ghost-hand.end {
    left: 50%;
    top: auto;
    right: auto;
    bottom: 2px;
    transform: translateX(-50%);
    animation: dodgeHintEndMobile 1300ms ease-in-out infinite;
  }

  #battleScreen .battle-arena.phase-dodge .gesture-arrow::after {
    left: 50%;
    top: auto;
    bottom: -3px;
    transform: translateX(-50%) rotate(135deg);
  }

  #battleScreen .battle-arena.phase-attack .gesture-coach {
    top: clamp(126px, 30vh, 178px);
    bottom: auto;
  }

  #battleScreen .battle-arena.phase-dodge .gesture-coach {
    top: clamp(126px, 30vh, 178px);
    bottom: auto;
  }

  #battleScreen .fighter {
    width: clamp(112px, 33vw, 190px);
    height: clamp(144px, 40vw, 232px);
  }

  #battleScreen .fighter.player {
    left: 50%;
    top: auto;
    right: auto;
    bottom: clamp(8px, 2.4vh, 18px);
    transform: translateX(-50%);
  }

  #battleScreen .fighter.enemy {
    top: clamp(8px, 2vh, 16px);
    right: auto;
    bottom: auto;
    left: 50%;
    width: clamp(170px, 54vw, 280px);
    height: clamp(188px, 48vw, 288px);
    transform: translateX(-50%);
  }

  #battleScreen .fighter.enemy.retreating {
    animation: enemyRetreatMobile 620ms cubic-bezier(0.2, 1.15, 0.28, 1) both;
  }

  #battleScreen .fighter.enemy.striking {
    animation: enemyStrikeMobile 560ms cubic-bezier(0.16, 1, 0.18, 1.4) both;
  }

  #battleScreen .fighter.enemy.hit {
    animation: enemyLaunchMobile 620ms cubic-bezier(0.2, 1.15, 0.25, 1);
  }

  #battleScreen .fighter.player.hit {
    animation: playerLaunchMobile 760ms cubic-bezier(0.16, 1, 0.18, 1.5);
  }

  #battleScreen .fighter.attack-left {
    transform: translateX(-50%) translateY(-126px) rotate(10deg) scale(1.1);
  }

  #battleScreen .fighter.attack-right {
    transform: translateX(-50%) translateY(126px) rotate(-10deg) scale(1.1);
  }

  #battleScreen .impact-text {
    top: 50%;
    font-size: clamp(2rem, 12vw, 4.2rem);
  }

  #battleScreen .fighter.enemy .expression-badge {
    top: 18%;
    left: -10px;
    transform: translateX(-70%);
  }

  #battleScreen .fighter.enemy .expression-face {
    width: 50px;
    height: 50px;
  }

  #battleScreen .boss-taunt-bubble {
    top: 82px;
    right: 8px;
    left: auto;
    bottom: auto;
    max-width: min(56%, 230px);
    padding: 8px 10px;
    border-width: 4px;
    font-size: clamp(0.78rem, 3.4vw, 1rem);
    transform: translateY(0) rotate(2deg) scale(0.9);
  }

  #battleScreen .boss-taunt-bubble::after {
    display: none;
  }

  #battleScreen .camera-tile {
    max-width: none;
    width: 100%;
  }

  #battleScreen #motionVideo {
    max-height: 120px;
  }

  #battleScreen .status-line {
    font-size: 0.82rem;
    padding: 6px 8px;
  }

  #resultScreen.active {
    padding: 8px;
  }

  .result-modal-card {
    max-height: calc(100dvh - 16px);
    padding: 10px;
    border-width: 4px;
  }

  #resultScreen .section-head {
    flex-direction: row;
    align-items: center;
  }

  #resultScreen .result-layout {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
    gap: 10px;
  }

  #resultScreen .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  #resultScreen #replayCanvas {
    max-height: 48vh;
  }

  #resultScreen .tool-panel {
    padding: 10px;
  }

  #resultScreen .stats-list {
    gap: 6px;
  }

  .action-row,
  .mode-grid,
  .skill-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 14px 0 12px;
  }

  #homeScreen .mode-card {
    min-height: 95px;
    padding: 10px 12px;
    border-width: 4px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  #homeScreen .mode-card::after {
    right: -22px;
    bottom: -26px;
    width: 78px;
    height: 78px;
    border-width: 4px;
  }

  #homeScreen .mode-card span {
    font-size: 0.72rem;
  }

  #homeScreen .mode-card strong {
    margin-top: 4px;
    font-size: clamp(1.35rem, 7vw, 1.75rem);
    line-height: 0.95;
  }

  #homeScreen .mode-card small {
    margin-top: 4px;
    max-width: none;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .button {
    width: 100%;
  }
}
