@font-face {
  font-family: "Cherry Bomb Kawaii";
  src: url("./assets/fonts/CherryBombOne-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Kawaii";
  src: url("./assets/fonts/ZenMaruGothic-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --hot: #ff2998;
  --pink: #ff76bd;
  --rose: #ffb9da;
  --milk: #fff8fc;
  --paper: #fffef8;
  --plum: #64205f;
  --lavender: #bd8bf3;
  --lemon: #ffe74e;
  --orange: #f27b47;
  --ink-shadow: rgba(83, 22, 82, .24);
  --round: "Zen Maru Kawaii", "Arial Rounded MT Bold", "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --display: "Cherry Bomb Kawaii", "Zen Maru Kawaii", "Arial Rounded MT Bold", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html {
  background: #f8b1d7 url("./assets/images/ui-v2/backgrounds/home-portrait.webp") center / cover no-repeat;
}

@media (orientation: landscape) {
  html { background-image: url("./assets/images/ui-v2/backgrounds/home-landscape.webp"); }
}

body { background: transparent; }

body {
  color: var(--plum);
  font-family: var(--round);
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button { touch-action: manipulation; }

button:focus-visible {
  outline: 5px solid white;
  outline-offset: 3px;
  box-shadow: 0 0 0 9px var(--plum);
}

.hidden { display: none !important; }

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

#game {
  position: fixed;
  left: var(--vv-x, 0px);
  top: var(--vv-y, 0px);
  display: block;
  width: var(--vv-w, 100%);
  height: var(--vv-h, 100%);
  background: #ef6cb7;
  touch-action: none;
}

.screen {
  position: fixed;
  z-index: 5;
  left: var(--vv-x, 0px);
  top: var(--vv-y, 0px);
  width: var(--vv-w, 100%);
  height: var(--vv-h, 100%);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: auto;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }

.home-screen {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--pink);
}

.home-screen::before {
  content: "";
  position: fixed;
  inset: -2px 0;
  z-index: 0;
  pointer-events: none;
  background: #ffc4df url("./assets/images/ui-v2/backgrounds/home-landscape.webp") center / cover no-repeat;
}

.home-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, transparent 42%, rgba(91, 22, 85, .15)),
    linear-gradient(115deg, rgba(255,255,255,.16), transparent 38%);
}

.home-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 32px));
  min-height: 680px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: 126px minmax(0, 1fr);
  column-gap: 28px;
  padding: 22px 28px 28px;
  border: 8px solid var(--hot);
  border-radius: 54px;
  background:
    linear-gradient(135deg, rgba(255,190,224,.16), rgba(238,211,255,.12)),
    #fff8fc url("./assets/images/ui-v2/backgrounds/panel-landscape.webp") center / cover no-repeat;
  box-shadow:
    0 0 0 7px white,
    0 0 0 12px #b765c8,
    0 22px 0 rgba(115, 37, 111, .18),
    0 34px 50px rgba(93, 28, 90, .32),
    inset 0 0 0 4px #ffd1e9,
    inset 0 -16px 28px rgba(170, 96, 179, .14);
}

.home-shell::before,
.home-shell::after {
  content: "♥";
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  top: -26px;
  border: 6px solid white;
  border-radius: 50%;
  background: linear-gradient(#ff8dcc, #ff3ca1);
  color: white;
  font-size: 30px;
  text-shadow: 0 3px 0 var(--plum);
  box-shadow: 0 6px 0 #a3429c;
}

.home-shell::before { left: 42px; transform: rotate(-8deg); }
.home-shell::after { right: 42px; transform: rotate(8deg); }

.brand-lockup {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 34px;
  min-width: 0;
  padding: 0 72px;
}

.artist-wordmark,
.album-wordmark {
  display: block;
  width: 100%;
  object-fit: contain;
}

.artist-wordmark { height: 108px; transform: scale(1.32); transform-origin: center; }
.album-wordmark { height: 112px; }

.album-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 16px;
  padding: 0 8px;
}

@media (min-width: 861px) and (min-height: 651px) {
  .album-panel { transform: translateY(0); }
  .album-panel .collection-summary { margin-top: 8px; }
}

.album-panel > img {
  width: min(100%, 270px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 8px solid white;
  border-radius: 22px;
  box-shadow: 7px 8px 0 var(--hot), 12px 13px 0 var(--lemon), 0 22px 30px var(--ink-shadow);
  transform: translateY(-10px) rotate(-1.5deg);
}

.collection-summary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  overflow: hidden;
  border: 3px solid white;
  border-radius: 18px;
  background: rgba(255, 225, 241, .86);
  box-shadow: 0 5px 0 var(--lavender), inset 0 0 18px rgba(255,255,255,.72);
}

.collection-summary span {
  min-width: 0;
  padding: 10px 4px 9px;
  border: 0;
  border-right: 2px solid rgba(187, 91, 187, .2);
  background: transparent;
  color: var(--plum);
  text-align: center;
  font-size: 9px;
  letter-spacing: .08em;
  box-shadow: none;
}
.collection-summary span:last-child { border-right: 0; }

.collection-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--hot);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.chapter-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  gap: 10px;
}

.chapter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.heading-stack {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.kicker {
  display: block;
  color: var(--plum);
  font-size: 12px;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.35;
}

.heading-stack .kicker { max-width: 118px; text-align: right; }
.section-wordmark { display: block; object-fit: contain; }
.arcade-wordmark { width: 260px; height: 74px; }

.chapter-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chapter-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 5px solid white;
  border-radius: 28px;
  background: linear-gradient(150deg, #ff9ed1, #bd83ec);
  color: var(--plum);
  cursor: pointer;
  box-shadow: 0 7px 0 #a649a3, 0 12px 18px var(--ink-shadow), inset 0 0 0 3px #ffd6ec;
  transform: translateY(0);
  transition: transform .15s ease, filter .15s ease;
}

.chapter-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  border-radius: 23px;
  background: linear-gradient(135deg, rgba(255,255,255,.55), transparent 22% 78%, rgba(255,255,255,.22));
}

.chapter-card:hover:not(:disabled),
.chapter-card:focus-visible:not(:disabled) {
  transform: translateY(-6px) rotate(-.35deg);
  filter: saturate(1.08);
}

.chapter-card:active:not(:disabled) { transform: translateY(3px) scale(.985); }
.chapter-card:disabled { cursor: not-allowed; filter: grayscale(.78) brightness(.78); }

.chapter-art {
  position: absolute;
  inset: 0 0 28%;
  background-position: center;
  background-size: cover;
}

.chapter-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgba(84, 20, 79, .45));
}

.chapter-card .number,
.chapter-card .best {
  position: absolute;
  z-index: 4;
  top: 12px;
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 4px solid white;
  box-shadow: 0 4px 0 var(--hot);
}

.chapter-card .number {
  left: 12px;
  width: 72px;
  min-height: 42px;
  grid-template-columns: auto auto;
  gap: 4px;
  padding: 0 9px;
  border-radius: 12px 18px 12px 18px;
  background: linear-gradient(145deg, #fff47a, #ffc72d);
  color: #8b257b;
  transform: rotate(-3deg);
  font-family: var(--display);
}
.chapter-card .number small { font-size: 7px; letter-spacing: .08em; }
.chapter-card .number b { font-size: 21px; line-height: 1; }
.chapter-card .number.locked { background: linear-gradient(145deg, #f5d9ee, #cfaddd); color: #785073; }
.chapter-card .number.locked small { font-size: 7px; }

.chapter-card .best {
  right: 12px;
  min-width: 70px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--hot);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.track-wordmark {
  position: absolute;
  z-index: 4;
  left: 8%;
  right: 8%;
  bottom: 2%;
  width: 84%;
  height: 25%;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 white);
}

.site-credit {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin: 0;
  color: rgba(94, 31, 95, .72);
  font-size: 10px;
  letter-spacing: .09em;
  text-align: center;
}
.site-credit { padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.62); color: #6b2264; text-shadow: none; }
.site-credit a { font-weight: 800; }
@media (max-width: 860px) { .site-credit { font-size: 9px; letter-spacing: .04em; } }
.site-credit a { color: #c2187a; text-decoration: none; border-bottom: 2px solid rgba(194,24,122,.55); }
.site-credit a:hover { border-bottom-color: #c2187a; }

.home-actions {
  position: static;
  z-index: 5;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: 10px;
  margin-top: 2px;
}

.home-actions .primary { grid-column: 1 / -1; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }

.bubble-button,
.text-button,
.touch-controls button {
  min-height: 52px;
  padding: 0 24px;
  border: 4px solid white;
  border-radius: 999px;
  background: linear-gradient(#ffb9dd 0 45%, #ff71bb 46% 100%);
  color: var(--plum);
  font-family: var(--display);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .05em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 0 #a7469f, 0 10px 14px var(--ink-shadow), inset 0 2px 0 rgba(255,255,255,.75);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

.bubble-button:hover,
.text-button:hover,
.touch-controls button:hover { filter: brightness(1.04) saturate(1.08); transform: translateY(-2px); }

.bubble-button:active,
.text-button:active,
.touch-controls button:active { transform: translateY(4px); box-shadow: 0 2px 0 #a7469f, 0 5px 8px var(--ink-shadow); }

.bubble-button.primary,
.touch-controls button { background: linear-gradient(#fff67a 0 45%, #ffd91f 46% 100%); box-shadow: 0 6px 0 #d36a39, 0 10px 14px var(--ink-shadow), inset 0 2px 0 white; }
.bubble-button.lavender { background: linear-gradient(#e3c8ff 0 45%, #b982ec 46% 100%); }
.bubble-button.small { min-height: 48px; padding: 0 18px; }
.bubble-button.icon { width: 56px; min-width: 56px; padding: 0; }
.bubble-button.wide { width: 100%; margin-top: 12px; }
.text-button { display: block; min-width: 170px; margin: 16px auto 0; }
.text-button.danger { color: #982255; background: linear-gradient(#ffe8f1, #ffc0d5); }

.overlay {
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(75, 17, 73, .62);
  backdrop-filter: blur(10px) saturate(1.15);
}

.modal {
  position: relative;
  width: min(820px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 32px;
  border: 7px solid var(--hot);
  border-radius: 42px;
  background:
    linear-gradient(145deg, rgba(255,250,254,.68), rgba(255,226,243,.72) 55%, rgba(229,208,247,.72)),
    url("./assets/images/ui-v2/backgrounds/panel-landscape.webp") center / cover no-repeat;
  background-size: auto, cover;
  box-shadow: 0 0 0 6px white, 0 0 0 10px #b46bd0, 0 22px 45px rgba(50, 10, 49, .5), inset 0 -10px 22px rgba(178, 95, 180, .14);
}

.modal::after {
  content: "♡";
  position: absolute;
  top: 12px;
  right: 18px;
  color: #f5aed2;
  font-size: 28px;
  pointer-events: none;
}

.modal.compact { width: min(500px, 100%); }
.character-modal { width: min(920px, 100%); text-align: center; }
.instruction-modal { width: min(940px, 100%); }
.result-modal { width: min(760px, 100%); text-align: center; }
.unlock-modal { width: min(620px, 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; overflow: hidden; text-align: center; }
.locker-modal,
.board-modal { width: min(880px, 100%); }

.modal-wordmark,
.song-wordmark { display: block; object-fit: contain; }
.hero-wordmark { width: min(480px, 80%); height: 92px; margin: -8px auto 0; }
.song-wordmark { width: min(520px, 82%); height: 92px; margin: 0 auto 12px; }
.character-song-wordmark { height: 78px; }
.instruction-wordmark { height: 104px; }
.result-wordmark,
.unlock-wordmark { height: 108px; max-width: 100%; object-fit: contain; }
.locker-wordmark { width: min(430px, 82vw); height: 112px; }
.scores-wordmark { width: 280px; height: 82px; }

.modal h2,
.reward-card h2 {
  margin: 8px 0 18px;
  color: white;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 950;
  line-height: .95;
  letter-spacing: -.035em;
  -webkit-text-stroke: 2px var(--hot);
  text-shadow: 4px 4px 0 var(--lemon);
}

.character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.character-card {
  position: relative;
  height: min(50vh, 430px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 6px solid white;
  border-radius: 32px;
  background: linear-gradient(150deg, #ffd6ea, #d6acfa);
  cursor: pointer;
  box-shadow: 0 7px 0 #a748a2, inset 0 0 0 4px #ff8fc8;
  transition: transform .15s ease;
}

.character-card:nth-child(2) { background: linear-gradient(150deg, #fff0bd, #ffa9cd); }
.character-card:hover,
.character-card:focus-visible { transform: translateY(-6px) rotate(-.4deg); }
.character-card:nth-child(2):hover { transform: translateY(-6px) rotate(.4deg); }
.character-card img { width: 100%; height: 82%; object-fit: contain; object-position: center bottom; transform-origin: 50% 92%; animation: hero-idle-a 2.8s ease-in-out infinite; }
.character-card:nth-child(2) img { animation-name: hero-idle-b; animation-delay: -.9s; }
.character-card span { position: absolute; left: 12px; right: 12px; bottom: 14px; color: white; font-family: var(--display); font-size: clamp(20px, 3vw, 30px); font-weight: 400; -webkit-text-stroke: 1.5px var(--hot); text-shadow: 3px 3px 0 var(--plum); }
@keyframes hero-idle-a { 0%,100% { transform: translateY(0) rotate(-.35deg) scaleY(1); } 50% { transform: translateY(-7px) rotate(.35deg) scaleY(1.012); } }
@keyframes hero-idle-b { 0%,100% { transform: translateY(-2px) rotate(.4deg) scaleY(1.008); } 50% { transform: translateY(-9px) rotate(-.35deg) scaleY(1); } }

.instruction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: 28px;
  align-items: stretch;
}

.instruction-visual {
  min-height: 330px;
  border: 6px solid white;
  border-radius: 28px;
  background-position: center;
  background-size: cover;
  box-shadow: 0 7px 0 var(--hot), inset 0 0 0 3px #ffaad2;
}

.instruction-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 3px solid rgba(255,255,255,.86);
  border-radius: 24px;
  background: rgba(255,248,253,.58);
  box-shadow: inset 0 0 20px rgba(255,255,255,.65), 0 5px 0 rgba(182,103,196,.28);
}

.instruction-cue {
  display: block;
  padding: 16px;
  border: 4px solid white;
  border-radius: 20px;
  background: var(--lemon);
  color: var(--plum);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 5px 0 var(--orange);
}

.instruction-modal p { margin: 20px 0; font-size: 18px; line-height: 1.45; }
.instruction-scoring { display: none; }
.instruction-copy .bubble-button { width: 100%; margin-top: auto; }

.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.close-button,
.pause-button {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  padding: 0;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--hot);
  color: white;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--plum);
}

.hud {
  position: fixed;
  z-index: 10;
  left: var(--vv-x, 0px);
  top: var(--vv-y, 0px);
  width: var(--vv-w, 100%);
  height: var(--vv-h, 100%);
  display: grid;
  grid-template-columns: auto minmax(240px, 430px) auto;
  align-content: start;
  justify-content: space-between;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  pointer-events: none;
}

.hud-chip,
.hud-song,
.goal-chip,
.mode-prompt {
  border: 4px solid white;
  box-shadow: 0 5px 0 var(--hot), 0 8px 14px var(--ink-shadow);
}

.hud-chip {
  min-width: 136px;
  padding: 9px 14px;
  border-radius: 18px;
  background: var(--lemon);
}

.hud-chip.right { text-align: right; background: #d4aaff; }
.hud-chip span { display: block; font-size: 10px; letter-spacing: .1em; }
.hud-chip strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.hud-chip small { display: block; margin-top: 2px; color: #a12f6e; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .05em; }

.hud-song {
  padding: 9px 16px;
  border-radius: 19px;
  background: rgba(94, 31, 95, .9);
  color: white;
  text-align: center;
}

.hud-wordmark:not([src]) { display: none; }
.hud-wordmark { display: block; width: 100%; height: 40px; margin: 1px auto 2px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.mode-prompt:empty { display: none; }
.progress { height: 9px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.25); }
.progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--pink), var(--lemon)); box-shadow: 0 0 10px white; }

.goal-chip {
  min-width: 0;
  margin-top: 5px;
  padding: 2px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff6a6;
  font-size: 11px;
  text-align: center;
  letter-spacing: .06em;
}

.mode-prompt {
  position: absolute;
  top: auto;
  bottom: 104px;
  left: 50%;
  max-width: min(560px, 74vw);
  padding: 9px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 250, 246, .92);
  color: var(--plum);
  font-size: 12px;
  text-align: center;
  letter-spacing: .05em;
}

.pause-button { position: absolute; top: auto; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); pointer-events: auto; }

.hud[data-level="rologiseto"] .mode-prompt,
.hud[data-level="xrated"] .mode-prompt { display: none; }

.touch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 14px;
  pointer-events: none;
}

.touch-controls button { min-width: 118px; min-height: 62px; pointer-events: auto; font-size: 14px; }
.touch-controls .jump-control { min-width: 210px; min-height: 68px; font-size: 17px; }
.clock-controls button:only-child { flex: 0 1 240px; width: min(240px, calc(100vw - 92px)); font-size: 15px; }
.club-controls { display: grid; grid-template-columns: repeat(3, minmax(118px, 168px)); }
.club-controls button { min-width: 0; width: 100%; padding: 7px 10px; line-height: 1.08; }
.club-controls button span { font-family: "Zen Maru Kawaii", sans-serif; font-size: .67em; line-height: 1.15; }
.club-controls .club-worker { display: grid; grid-template-columns: 42px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center; text-align: left; }
.club-worker img { grid-column: 1; grid-row: 1 / 3; width: 42px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(91,27,84,.25)); }
.club-worker b { font: inherit; font-size: .88em; line-height: 1; }
.club-controls .club-investment { display: grid; grid-template-columns: 38px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 6px; align-items: center; text-align: left; }
.club-investment img { grid-column: 1; grid-row: 1 / 3; width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(91,27,84,.25)); }
.club-investment b { grid-column: 2; align-self: end; font: inherit; font-size: .82em; line-height: 1; }
.club-investment span { grid-column: 2; align-self: start; }
.club-controls[data-phase^="setup-"] button:nth-child(1) { background: linear-gradient(#d7f8ff 0 45%, #8befff 46% 100%); }
.club-controls[data-phase^="setup-"] button:nth-child(2) { background: linear-gradient(#ffb8df 0 45%, #ff72bf 46% 100%); }
.club-controls[data-phase^="setup-"] button:nth-child(3) { background: linear-gradient(#fff7a0 0 45%, #ffe553 46% 100%); }
.club-controls[data-phase^="setup-"] button:nth-child(4) { background: linear-gradient(#dfc5ff 0 45%, #b982ef 46% 100%); }
.club-controls[data-phase="setup-worker"],
.club-controls[data-phase="setup-upgrade"],
.club-controls[data-phase="emergency-hire"],
.club-controls[data-phase="reinvest"] { grid-template-columns: repeat(4, minmax(118px, 168px)); }
.club-controls[data-phase="emergency-hire"] button { background: linear-gradient(#ffb8df 0 45%, #ff72bf 46% 100%); }
.club-controls[data-phase="reinvest"] button { background: linear-gradient(#d7f8ff 0 45%, #8befff 46% 100%); }
.club-controls[data-phase="reinvest"] button:last-child { background: linear-gradient(#fff7a0 0 45%, #ffe553 46% 100%); }
.club-controls[data-phase="door"] { grid-template-columns: repeat(2, minmax(118px, 168px)); }
.club-controls[data-phase="door"] button:nth-child(2),
.club-controls[data-phase="door"] button:nth-child(3) { background: linear-gradient(#ffc4b9 0 45%, #ff8b78 46% 100%); }
.club-controls[data-phase="door"] button:last-child:nth-child(4) { background: linear-gradient(#d7f8ff 0 45%, #8befff 46% 100%); }
.club-controls[data-phase="setup-ready"],
.club-controls[data-phase="service"],
.club-controls[data-phase="closed"] { grid-template-columns: minmax(220px, 360px); }
.club-controls .club-main-button { width: 100%; justify-self: center; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.result-grid div,
.locker-stats span {
  border: 4px solid white;
  border-radius: 20px;
  background: #ffe0f0;
  box-shadow: 0 5px 0 var(--lavender);
}

.result-grid div { padding: 16px 8px; text-align: center; }
.result-grid strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(21px, 4vw, 34px);
  white-space: nowrap;
  line-height: 1.06;
  color: var(--plum);
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--hot);
  font-variant-numeric: tabular-nums;
}
.result-grid span { font-size: 11px; letter-spacing: .1em; }
.reward-line { min-height: 56px; padding: 15px; border: 4px solid white; border-radius: 20px; background: var(--lemon); font-size: 14px; text-align: center; box-shadow: 0 5px 0 var(--orange); }

.unlock-sticker-stage {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 1 auto;
  width: clamp(184px, 34vmin, 252px);
  aspect-ratio: 1;
  margin: -2px auto 0;
  isolation: isolate;
}
.unlock-sticker-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 92%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255,238,91,.92), rgba(255,98,184,.72) 52%, rgba(190,134,239,.72));
  clip-path: polygon(50% 0,59% 28%,79% 8%,75% 36%,100% 33%,78% 52%,98% 68%,70% 67%,75% 94%,54% 76%,39% 100%,38% 73%,10% 87%,28% 60%,0 49%,29% 43%,10% 17%,39% 31%);
  filter: blur(8px);
  opacity: 0;
  transform: rotate(-10deg) scale(.55);
}
.unlock-sticker {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 13px 5px rgba(104,28,96,.18)) drop-shadow(0 4px 0 rgba(255,255,255,.88));
  opacity: 0;
  transform: translateY(-22px) rotate(-11deg) scale(1.18);
  transform-origin: 46% 90%;
}
.unlock-sparkle {
  position: absolute;
  z-index: 2;
  color: var(--lemon);
  font-family: var(--display);
  font-size: clamp(24px, 5vmin, 42px);
  line-height: 1;
  -webkit-text-stroke: 3px white;
  paint-order: stroke fill;
  opacity: 0;
  pointer-events: none;
  transform: scale(.15) rotate(-18deg);
}
.unlock-sparkle.sparkle-a { top: 8%; left: 2%; }
.unlock-sparkle.sparkle-b { top: 2%; right: 3%; color: var(--hot); font-size: clamp(20px, 4vmin, 34px); }
.unlock-sparkle.sparkle-c { right: 0; bottom: 10%; color: #c58af0; }
.unlock-next { display: grid; width: 100%; min-width: 0; justify-items: center; gap: 2px; opacity: 0; transform: translateY(10px); }
.unlock-next > span { color: var(--plum); font-size: 10px; letter-spacing: .18em; }
.unlock-next .unlock-wordmark { width: min(520px, 94%); height: 86px; margin: 0; }
.unlock-modal > .bubble-button { opacity: 0; transform: translateY(8px); }
.is-revealing .unlock-sticker-stage::before { animation: unlock-burst .72s .06s cubic-bezier(.2,.8,.2,1) both; }
.is-revealing .unlock-sticker { animation: sticker-peel-pop .78s cubic-bezier(.16,.9,.28,1.24) both; }
.is-revealing .unlock-sparkle { animation: unlock-sparkle .52s .48s cubic-bezier(.18,.89,.32,1.4) both; }
.is-revealing .sparkle-b { animation-delay: .58s; }
.is-revealing .sparkle-c { animation-delay: .68s; }
.is-revealing .unlock-next { animation: unlock-settle .42s .62s ease-out both; }
.is-revealing .unlock-modal > .bubble-button { animation: unlock-settle .36s .78s ease-out both; }
@keyframes sticker-peel-pop {
  0% { opacity: 0; transform: translateY(-22px) rotate(-11deg) scale(1.18); }
  58% { opacity: 1; transform: translateY(5px) rotate(3deg) scale(.96); }
  78% { transform: translateY(-3px) rotate(-1.5deg) scale(1.025); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes unlock-burst {
  0% { opacity: 0; transform: rotate(-10deg) scale(.55); }
  55% { opacity: .72; }
  100% { opacity: .18; transform: rotate(7deg) scale(1.06); }
}
@keyframes unlock-sparkle {
  0% { opacity: 0; transform: scale(.15) rotate(-18deg); }
  70% { opacity: 1; transform: scale(1.18) rotate(8deg); }
  100% { opacity: .9; transform: scale(1) rotate(0); }
}
@keyframes unlock-settle { to { opacity: 1; transform: translateY(0); } }

body.reduce-motion .unlock-sticker-stage::before,
body.reduce-motion .unlock-sticker,
body.reduce-motion .unlock-sparkle,
body.reduce-motion .unlock-next,
body.reduce-motion .unlock-modal > .bubble-button {
  opacity: 1;
  transform: none;
}

.locker-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.locker-stats span { padding: 10px 14px; background: var(--lemon); font-size: 12px; }
.locker-modal .modal-head { position: relative; justify-content: center; text-align: center; }
.locker-modal .modal-head > div { width: 100%; display: grid; justify-items: center; }
.locker-modal .modal-head .close-button { position: absolute; top: 0; left: 0; right: auto; }
.locker-modal .kicker { text-align: center; }
.sticker-help { max-width: 760px; margin: 14px auto 0; padding: 11px 18px; border: 3px solid #ffaad3; border-radius: 16px; background: rgba(255,247,252,.72); color: var(--plum); font-size: 12px; line-height: 1.45; text-align: center; text-wrap: balance; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 4px; }
.sticker { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 6px; overflow: hidden; border: 5px solid white; border-radius: 22px; background: #e2c2ed; box-shadow: 0 5px 0 #a94ca4; cursor: default; }
.sticker img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) opacity(.24); }
.sticker > span { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); white-space: nowrap; padding: 4px 7px; border-radius: 999px; background: rgba(86,31,84,.88); color: white; font-size: 8px; letter-spacing: .08em; }
.sticker.earned { background: linear-gradient(#fff9fd,#ffd9ed); animation: pop .32s both; cursor: pointer; }
.sticker.earned img { filter: none; }
.sticker.earned > span { background: var(--hot); }
.sticker.earned:hover img { transform: translateY(-3px) scale(1.035); }
.sticker.earned:focus-visible { outline: 4px solid var(--lemon); outline-offset: 3px; }
.sticker:disabled { color: inherit; opacity: 1; }
@keyframes pop { from { transform: scale(.5) rotate(-10deg); } to { transform: scale(1); } }

.score-board { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: rank; }
.score-board li { counter-increment: rank; display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; padding: 14px; border-bottom: 3px dotted rgba(255, 46, 157, .35); font-size: 14px; }
.score-board li::before { content: counter(rank, decimal-leading-zero); color: var(--hot); }
.score-board a { color: var(--plum); text-decoration-color: var(--hot); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.score-board li.is-player { border: 4px solid var(--lemon); border-radius: 18px; background: rgba(255,238,91,.28); box-shadow: 0 4px 0 var(--hot); }
.score-board li.board-message { counter-increment: none; grid-template-columns: 1fr auto; border-bottom-style: solid; color: var(--plum); }
.score-board li.board-message::before { content: none; }
.setting-row { display: flex; align-items: center; justify-content: space-between; min-height: 58px; border-bottom: 3px dotted rgba(255, 46, 157, .35); font-size: 14px; }

.profile-field { display: grid; gap: 7px; margin: 14px 0; color: var(--plum); font-size: 12px; letter-spacing: .12em; }
.profile-field input { width: 100%; min-height: 54px; padding: 0 16px; border: 4px solid var(--rose); border-radius: 18px; background: white; color: var(--plum); font-size: 17px; font-weight: 900; outline: none; box-shadow: inset 0 3px 0 rgba(157, 66, 148, .12); }
.profile-field input:focus { border-color: var(--hot); box-shadow: 0 0 0 4px #ffe16b; }
.profile-status { min-height: 18px; margin: -3px 0 10px; color: var(--plum); font-size: 11px; line-height: 1.4; text-align: center; }
.platform-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; padding: 0; border: 0; }
.platform-choice legend { grid-column: 1 / -1; margin-bottom: 8px; color: var(--plum); font-size: 12px; letter-spacing: .12em; }
.platform-choice label { cursor: pointer; }
.platform-choice input { position: absolute; opacity: 0; pointer-events: none; }
.platform-choice span { display: grid; place-items: center; min-height: 52px; border: 4px solid white; border-radius: 18px; background: #e1c0fb; box-shadow: 0 5px 0 #9d55bd; font-size: 12px; }
.platform-choice input:checked + span { background: var(--lemon); box-shadow: 0 5px 0 var(--orange); }
.platform-choice input:focus-visible + span { outline: 4px solid var(--plum); outline-offset: 2px; }

.share-modal { width: min(980px, 100%); }
.share-layout { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(300px, 1.22fr); gap: 28px; align-items: center; }
#shareCanvas { display: block; width: min(100%, 320px); aspect-ratio: 9 / 16; margin: 0 auto; border: 6px solid white; border-radius: 24px; background: var(--pink); box-shadow: 0 7px 0 var(--hot), 0 14px 22px var(--ink-shadow); }
.share-actions p { margin: 0 0 20px; font-size: 21px; line-height: 1.35; }
.share-actions small { display: block; margin-top: 16px; font-size: 12px; line-height: 1.5; }

.reward-screen { background: rgba(57, 10, 55, .88); }
.reward-card { width: min(1040px, 100%); display: grid; grid-template-columns: 1.35fr 1fr; overflow: hidden; border: 8px solid white; border-radius: 32px; background: #ffe0f0; box-shadow: 12px 14px 0 var(--hot); }
.reward-card img { width: 100%; height: min(70vh, 620px); object-fit: cover; }
.reward-card > div { align-self: center; padding: 28px; }
.reward-card p { font-size: 17px; line-height: 1.5; }

body.reduce-motion * { animation: none !important; transition: none !important; }

@media (max-width: 860px) {
  .screen { padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .home-screen { justify-content: start; }
  .home-screen::before { background-image: url("./assets/images/ui-v2/backgrounds/home-portrait.webp"); }
  .home-shell {
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 16px 20px;
    border-width: 6px;
    border-radius: 34px;
    background-image:
      linear-gradient(145deg, rgba(255,190,224,.18), rgba(238,211,255,.14)),
      url("./assets/images/ui-v2/backgrounds/panel-portrait.webp");
    background-position: center top;
    box-shadow: 0 0 0 5px white, 0 0 0 9px #b765c8, 0 18px 30px rgba(93,28,90,.3), inset 0 0 0 3px #ffd1e9;
  }
  .home-shell::before,
  .home-shell::after { display: none; }
  .brand-lockup { flex: none; grid-template-columns: 1fr 1fr; gap: 8px; height: 80px; padding: 0 4px; }
  .artist-wordmark,
  .album-wordmark { height: 76px; }
  .artist-wordmark { transform: scale(1.16); }
  .album-panel { display: contents; }
  .album-panel > img,
  .collection-summary { display: none; }
  .chapter-panel { order: 2; display: flex; flex-direction: column; min-height: 0; }
  .chapter-heading { min-height: 62px; }
  .heading-stack .kicker { display: none; }
  .arcade-wordmark { width: 190px; height: 60px; }
  .chapter-heading .bubble-button { min-height: 46px; padding: 0 14px; font-size: 10px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(155px, 1fr)); gap: 11px; min-height: 330px; }
  .chapter-card { border-width: 4px; border-radius: 22px; box-shadow: 0 5px 0 #a649a3, 0 9px 13px var(--ink-shadow), inset 0 0 0 2px #ffd6ec; }
  .chapter-card .number,
  .chapter-card .best { top: 8px; min-height: 32px; border-width: 3px; }
  .chapter-card .number { left: 8px; width: 61px; min-height: 34px; padding: 0 7px; gap: 3px; }
  .chapter-card .number small { font-size: 6px; }
  .chapter-card .number b { font-size: 17px; }
  .chapter-card .best { right: 8px; min-width: 54px; padding: 0 7px; font-size: 10px; }
  .chapter-art { inset-bottom: 30%; }
  .track-wordmark { left: 4%; right: 4%; bottom: 1%; width: 92%; height: 28%; }
  .home-actions { order: 3; position: static; width: 100%; grid-template-columns: 1fr 58px; margin-top: 10px; }

  .bubble-button,
  .text-button { min-height: 50px; font-size: 13px; letter-spacing: .025em; }

  .modal,
  .modal.compact,
  .character-modal,
  .instruction-modal,
  .result-modal,
  .unlock-modal,
  .locker-modal,
  .board-modal { width: 100%; max-height: 100%; padding: 22px 18px; border-width: 5px; border-radius: 30px; box-shadow: 0 0 0 4px white, 0 0 0 7px #b46bd0, 0 18px 30px rgba(50,10,49,.5); }
  .hero-wordmark { width: 88%; height: 70px; }
  .song-wordmark { width: 94%; height: 68px; margin-bottom: 8px; }
  .instruction-wordmark,
  .result-wordmark,
  .unlock-wordmark { height: 78px; }
  .character-grid { gap: 10px; }
  .character-card { height: min(43dvh, 360px); min-height: 0; border-width: 4px; border-radius: 24px; }
  .character-card img { height: 80%; }
  .character-card span { bottom: 11px; font-size: 18px; }
  .instruction-layout { grid-template-columns: 1fr; gap: 16px; }
  .instruction-visual { min-height: 190px; border-width: 4px; border-radius: 22px; }
  .modal {
    background:
      linear-gradient(145deg, rgba(255,250,254,.66), rgba(255,226,243,.7) 55%, rgba(229,208,247,.72)),
      url("./assets/images/ui-v2/backgrounds/panel-portrait.webp") center / cover no-repeat;
  }
  .instruction-copy { padding: 14px; }
  .instruction-cue { padding: 12px; font-size: 17px; }
  .instruction-modal p { margin: 14px 0; font-size: 15px; }
  .instruction-copy .bubble-button { margin-top: 2px; }

  .hud { grid-template-columns: minmax(78px,.72fr) minmax(126px,1.35fr) minmax(68px,.68fr); grid-template-rows: auto; align-items: start; gap: 6px; padding: max(7px,env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)); }
  .hud-chip { grid-row: 1; min-width: 0; padding: 5px 7px; border-width: 3px; border-radius: 15px; box-shadow: 0 4px 0 var(--hot),0 6px 10px var(--ink-shadow); }
  .hud-chip.right { grid-column: 3; min-width: 0; }
  .hud-chip span { font-size: 8px; }
  .hud-chip strong { font-size: clamp(13px,4vw,16px); }
  .hud-chip small { overflow: visible; white-space: nowrap; font-size: clamp(5px,1.7vw,7px); letter-spacing: 0; }
  .hud-song { position: static; grid-column: 2; grid-row: 1; width: 100%; min-width: 0; justify-self: stretch; padding: 4px 7px 5px; border-width: 3px; border-radius: 16px; box-shadow: 0 4px 0 var(--hot),0 6px 10px var(--ink-shadow); }
  .hud-wordmark { height: clamp(21px,7vw,30px); margin: 0 auto 1px; }
  .hud-song .progress { height: 5px; margin-top: 2px; }
  .goal-chip { margin-top: 3px; padding: 1px 2px 0; font-size: clamp(8px,2.3vw,10px); letter-spacing: .02em; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
  .mode-prompt { max-width: calc(100% - 56px); bottom: max(78px,calc(env(safe-area-inset-bottom) + 66px)); padding: 6px 10px; font-size: 9px; }
  .hud[data-level="rologiseto"] .mode-prompt,
  .hud[data-level="xrated"] .mode-prompt { display: none; }
  .pause-button { top: auto; right: 10px; bottom: max(16px, env(safe-area-inset-bottom)); width: 48px; height: 48px; }
  .touch-controls { bottom: max(14px, env(safe-area-inset-bottom)); gap: 8px; }
  .touch-controls button { min-width: 92px; min-height: 58px; padding: 0 16px; font-size: 12px; }
  .touch-controls .jump-control { min-width: 180px; min-height: 64px; }
  .clock-controls { left: 8px; right: 64px; gap: 6px; }
  .clock-controls button { flex: 1 1 0; min-width: 0; padding: 0 5px; font-size: 10px; }
  .clock-controls button:only-child { flex: 0 1 230px; font-size: 14px; }
  .club-controls { left: 8px; right: 68px; width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; }
  .club-controls[data-phase="setup-worker"],
  .club-controls[data-phase="setup-upgrade"],
  .club-controls[data-phase="reinvest"],
  .club-controls[data-phase="emergency-hire"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .club-controls button { min-width: 0; min-height: 54px; padding: 4px 6px; font-size: 10px; }
  .club-controls .club-worker { grid-template-columns: 31px minmax(0,1fr); column-gap: 4px; }
  .club-worker img { width: 31px; height: 36px; }
  .club-controls .club-investment { grid-template-columns: 31px minmax(0,1fr); column-gap: 4px; }
  .club-investment img { width: 31px; height: 31px; }
  .club-controls[data-phase="setup-ready"],
  .club-controls[data-phase="service"],
  .club-controls[data-phase="closed"] { grid-template-columns: minmax(0, 1fr); }
  .result-grid { gap: 6px; }
  .result-grid div { padding: 11px 4px; }
  .result-grid span { font-size: 9px; }
  .sticker-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sticker { border-width: 3px; border-radius: 16px; }
  .sticker::after { bottom: 5px; font-size: 7px; }
  .reward-card { display: block; }
  .reward-card img { height: 42vh; }
  .reward-card > div { padding: 20px; }
  .share-layout { grid-template-columns: 1fr; gap: 18px; }
  #shareCanvas { width: min(48vw, 270px); }
  .share-actions p { margin-bottom: 12px; font-size: 16px; text-align: center; }
}

@media (max-width: 390px) {
  .home-shell { padding-left: 12px; padding-right: 12px; }
  .brand-lockup { height: 70px; }
  .artist-wordmark,
  .album-wordmark { height: 66px; }
  .arcade-wordmark { width: 164px; }
  .chapter-grid { grid-template-rows: repeat(2, minmax(138px, 1fr)); min-height: 288px; gap: 8px; }
  .chapter-heading .bubble-button { padding: 0 10px; }
  .character-card { height: 42dvh; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .screen { padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .home-shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    gap: 6px;
    padding: 12px 12px 14px;
    overflow: hidden;
    border-width: 5px;
    border-radius: 30px;
  }
  .brand-lockup { height: 60px; gap: 4px; padding: 0; }
  .artist-wordmark,
  .album-wordmark { height: 58px; }
  .artist-wordmark { transform: scale(1.08); }
  .chapter-panel { flex: 1 1 auto; overflow: hidden; }
  .chapter-heading { flex: 0 0 52px; min-height: 52px; gap: 8px; }
  .arcade-wordmark { width: 158px; height: 50px; }
  .chapter-heading .bubble-button { min-width: 116px; min-height: 46px; padding: 0 10px; font-size: 11px; }
  .chapter-grid {
    flex: 1 1 auto;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
  }
  .chapter-card { min-height: 0; border-radius: 19px; }
  .chapter-card::before { border-radius: 15px; }
  .chapter-art { inset: 0; background-position: center 52%; }
  .chapter-art::after { background: linear-gradient(90deg, rgba(79,18,74,.16), transparent 28% 68%, rgba(79,18,74,.18)), linear-gradient(transparent 46%, rgba(84,20,79,.38)); }
  .chapter-card .number,
  .chapter-card .best { top: 7px; min-height: 34px; }
  .chapter-card .number { left: 7px; width: 66px; min-height: 36px; }
  .chapter-card .best { right: 7px; min-width: 62px; }
  .track-wordmark { left: 24%; right: 24%; top: 50%; bottom: auto; width: 52%; height: 78%; transform: translateY(-50%); }
  .chapter-2 .track-wordmark { left: 19%; right: 19%; top: 59%; width: 62%; }
  .chapter-art::after { background: linear-gradient(90deg, rgba(79,18,74,.3), rgba(79,18,74,.16) 30% 70%, rgba(79,18,74,.3)), linear-gradient(rgba(84,20,79,.24), rgba(84,20,79,.34)); }
  .result-grid { grid-template-columns: 1fr; gap: 7px; margin: 12px 0; }
  .result-grid div { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; padding: 8px 16px; text-align: right; }
  .result-grid strong { font-size: 32px; -webkit-text-stroke-width: 2.5px; text-shadow: 2px 2px 0 var(--hot); }
  .result-grid span { font-size: 10px; letter-spacing: .12em; }
  .locker-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
  .locker-stats span { padding: 7px 3px; font-size: 9px; line-height: 1.3; text-align: center; letter-spacing: 0; }
  .sticker-help { margin-top: 10px; padding: 8px 12px; font-size: 10px; line-height: 1.35; }
  .sticker-grid { gap: 8px; margin: 12px 0 2px; }
  .home-actions { flex: 0 0 auto; grid-template-columns: 1fr 54px; gap: 8px; margin-top: 3px; }

  .home-actions .bubble-button { min-height: 48px; font-size: 13px; }
}

@media (max-width: 600px) and (orientation: portrait) and (max-height: 720px) {
  .home-shell { padding-top: 8px; padding-bottom: 10px; }
  .brand-lockup { height: 48px; }
  .artist-wordmark,
  .album-wordmark { height: 48px; }
  .chapter-heading { flex-basis: 44px; min-height: 44px; }
  .arcade-wordmark { height: 43px; }
  .chapter-heading .bubble-button { min-height: 42px; }
  .home-actions { gap: 6px; }
  .home-actions .bubble-button { min-height: 44px; }
}

@media (max-width: 340px) and (orientation: portrait) {
  .home-shell { padding: 8px 9px 10px; border-width: 4px; border-radius: 26px; }
  .brand-lockup { height: 44px; }
  .artist-wordmark,
  .album-wordmark { height: 44px; }
  .artist-wordmark { transform: scale(1.02); }
  .chapter-heading { flex-basis: 42px; min-height: 42px; gap: 4px; }
  .arcade-wordmark { width: 126px; height: 40px; }
  .chapter-heading .bubble-button { min-width: 104px; min-height: 42px; padding: 0 6px; font-size: 10px; letter-spacing: 0; }
  .chapter-grid { gap: 6px; }
  .chapter-card { border-width: 3px; border-radius: 16px; }
  .chapter-card .number { width: 60px; }
  .chapter-card .best { min-width: 54px; }
  .home-actions { gap: 6px; }
  .home-actions .bubble-button { min-height: 44px; font-size: 11px; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .screen { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .home-shell {
    width: 100%;
    height: calc(100dvh - 16px);
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(180px, 25vw, 240px) minmax(0, 1fr);
    grid-template-rows: 50px minmax(0, 1fr);
    gap: 7px 14px;
    padding: 8px 14px 10px;
    overflow: hidden;
    border-width: 5px;
    border-radius: 30px;
  }
  .home-shell::before,
  .home-shell::after { display: none; }
  .brand-lockup { grid-column: 1; grid-row: 1; height: 50px; gap: 3px; padding: 0; }
  .artist-wordmark,
  .album-wordmark { height: 48px; }
  .artist-wordmark { transform: scale(1.03); }
  .album-panel { display: contents; }
  .album-panel > img {
    display: block;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: center;
    width: min(19vw, 154px);
    border-width: 5px;
    border-radius: 16px;
    transform: none;
  }
  .collection-summary { display: none; }
  .home-actions { grid-column: 1; grid-row: 2; align-self: end; width: 100%; gap: 6px; margin: 0; }
  .home-actions .bubble-button { min-height: 44px; }
  .chapter-panel { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .chapter-heading { flex: 0 0 48px; min-height: 48px; }
  .arcade-wordmark { width: 170px; height: 46px; }
  .chapter-heading .bubble-button { min-height: 42px; padding: 0 12px; font-size: 11px; }
  .chapter-grid { flex: 1 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; }
  .chapter-card { min-height: 0; border-width: 3px; border-radius: 18px; }
  .chapter-card::before { border-radius: 15px; }
  .chapter-card .number,
  .chapter-card .best { top: 6px; min-height: 31px; border-width: 3px; }
  .chapter-card .number { left: 6px; width: 60px; min-height: 33px; }
  .chapter-card .best { right: 6px; min-width: 54px; }
  .track-wordmark { bottom: 0; height: 29%; }
  .modal { max-height: 100%; padding: 16px 20px; border-radius: 24px; }
  .instruction-modal { width: min(900px, 100%); }
  .instruction-wordmark { height: 58px; }
  .instruction-layout { grid-template-columns: 1.05fr .95fr; gap: 14px; }
  .instruction-visual { min-height: 190px; }
  .instruction-copy { padding: 10px; }
  .instruction-modal p { margin: 9px 0; font-size: 13px; }
  .character-card { height: 54dvh; }
  .hud { row-gap: 0; }
  .hud-song { width: 100%; padding: 3px 6px 4px; }
  .hud-wordmark { height: clamp(20px,6.4vw,26px); margin: 0 auto 1px; }
  .hud-song .progress { height: 5px; margin-top: 3px; }
  .goal-chip { padding: 1px 0 0; font-size: clamp(7px,2.2vw,9px); }
  .mode-prompt { padding: 5px 9px; font-size: 9px; }
  .pause-button { top: auto; right: max(8px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .touch-controls { bottom: max(10px, env(safe-area-inset-bottom)); }
  .touch-controls button { min-height: 52px; }
  .touch-controls .jump-control { min-height: 56px; }
  .club-controls { left: 8px; right: 62px; width: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .club-controls[data-phase="setup-worker"],
  .club-controls[data-phase="setup-upgrade"],
  .club-controls[data-phase="reinvest"],
  .club-controls[data-phase="emergency-hire"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .club-controls[data-phase="door"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .club-controls button { min-height: 48px; font-size: 9px; }
  .club-controls .club-investment { grid-template-columns: 27px minmax(0,1fr); }
  .club-investment img { width: 27px; height: 27px; }
}

@media (max-width: 350px) and (orientation: portrait) {
  .hud { grid-template-columns: 72px minmax(116px,1fr) 62px; gap: 4px; padding-inline: 5px; }
  .hud-chip { padding-inline: 5px; }
  .hud-chip span { font-size: 7px; }
  .hud-chip strong { font-size: 12px; }
  .hud-wordmark { height: 19px; }
  .goal-chip { font-size: 7px; letter-spacing: .025em; }
  .clock-controls { left: 5px; right: 57px; }
  .clock-controls button { min-height: 50px; padding-inline: 3px; font-size: 9px; }
  .clock-controls button:only-child { font-size: 13px; }
}

/* Responsive system audit -------------------------------------------------
   These rules deliberately sit last: they normalize every overlay and keep
   the branded shells inside the visual viewport without undoing the existing
   full-width/max-height fixes above. */

.screen,
.hud {
  max-width: var(--vv-w, 100%);
  max-height: var(--vv-h, 100%);
}

.screen {
  overscroll-behavior: contain;
}

.overlay {
  overflow: hidden;
}

.modal,
.reward-card {
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 41, 152, .52) transparent;
}

.modal::-webkit-scrollbar,
.reward-card::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track,
.reward-card::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb,
.reward-card::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255, 41, 152, .52); }

.modal > *,
.modal-head > *,
.share-layout > *,
.reward-card > *,
.instruction-layout > *,
.character-grid > * { min-width: 0; }

.modal-wordmark,
.song-wordmark,
.section-wordmark,
.track-wordmark,
.locker-wordmark,
.scores-wordmark { max-width: 100%; }

.bubble-button,
.text-button,
.touch-controls button {
  display: grid;
  place-items: center;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
}

.modal-actions > * {
  flex: 1 1 150px;
  max-width: 260px;
}

.score-board,
.setting-row,
.profile-field,
.platform-choice,
.share-actions { min-width: 0; }

.score-board li > *,
.setting-row > * { min-width: 0; }

.locker-wordmark { width: min(430px, 100%); }
.scores-wordmark { width: min(280px, 100%); }
.locker-modal .modal-head > div { min-width: 0; padding-inline: 52px; }
.board-modal .modal-head { position: relative; justify-content: center; text-align: center; }
.board-modal .modal-head > div { width: 100%; display: grid; justify-items: center; padding-inline: 52px; }
.board-modal .modal-head .close-button { position: absolute; top: 0; right: 0; }

@media (min-width: 601px) and (max-width: 860px) and (orientation: portrait) {
  .chapter-panel { flex: 1 1 auto; }
  .chapter-grid { flex: 1 1 auto; min-height: 0; }
  .home-actions { flex: 0 0 auto; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .overlay { place-items: center; }

  .modal,
  .modal.compact,
  .character-modal,
  .instruction-modal,
  .result-modal,
  .unlock-modal,
  .locker-modal,
  .board-modal,
  .share-modal {
    max-width: 100%;
    max-height: 100%;
  }

  .modal h2,
  .reward-card h2 {
    max-width: 100%;
    font-size: clamp(28px, 10vw, 42px);
    line-height: 1;
    text-wrap: balance;
  }

  .modal-head { align-items: flex-start; }
  .modal-head > div { min-width: 0; }
  .modal-head .close-button { z-index: 3; }

  .score-board li {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 4px;
    font-size: 12px;
  }

  .share-modal .modal-head > div { padding-right: 48px; }
  .share-layout { width: 100%; }
  .share-actions .bubble-button { margin-top: 8px; }

  .reward-card {
    width: 100%;
    max-height: 100%;
    border-width: 5px;
    border-radius: 26px;
    box-shadow: 7px 8px 0 var(--hot);
  }

  .reward-card img {
    height: clamp(180px, 36dvh, 320px);
    object-position: center 28%;
  }

  .reward-card > div { padding: 18px; }
  .reward-card p { font-size: 14px; }
}

@media (max-width: 600px) and (orientation: portrait) and (max-height: 720px) {
  .modal,
  .modal.compact,
  .character-modal,
  .instruction-modal,
  .result-modal,
  .unlock-modal,
  .locker-modal,
  .board-modal,
  .share-modal { padding: 15px 14px; }

  .modal::after { top: 7px; right: 11px; font-size: 22px; }

  .hero-wordmark { height: 54px; margin-top: -5px; }
  .song-wordmark { height: 54px; margin-bottom: 5px; }
  .character-song-wordmark { height: 48px; }
  .instruction-wordmark { height: 50px; }
  .result-wordmark,
  .unlock-wordmark { height: 58px; }
  .locker-wordmark { height: 72px; }
  .scores-wordmark { height: 62px; }

  .chapter-card .number {
    width: 56px;
    min-height: 31px;
    padding-inline: 5px;
  }
  .chapter-card .best { min-width: 50px; padding-inline: 5px; }
  .track-wordmark {
    left: 27%;
    right: 27%;
    top: 58%;
    width: 46%;
    height: 66%;
  }
  .chapter-2 .track-wordmark {
    left: 24%;
    right: 24%;
    top: 60%;
    width: 52%;
  }

  .character-grid { gap: 8px; }
  .character-card { height: min(39dvh, 242px); }
  .character-card span { left: 6px; right: 6px; bottom: 7px; font-size: 15px; }
  .character-modal .text-button { min-height: 42px; margin-top: 10px; }

  .instruction-layout { gap: 9px; }
  .instruction-visual { min-height: 132px; }
  .instruction-copy { padding: 10px; }
  .instruction-cue { padding: 9px; font-size: 15px; }
  .instruction-modal p { margin: 9px 0; font-size: 13px; line-height: 1.34; }
  .instruction-copy .bubble-button { min-height: 44px; }

  .unlock-modal { gap: 6px; }
  .unlock-sticker-stage { width: clamp(146px, 31dvh, 202px); }
  .unlock-next .unlock-wordmark { height: 56px; }

  .locker-modal .modal-head > div { padding-inline: 40px; }
  .locker-modal .modal-head .close-button { top: 0; left: 0; }
  .locker-modal .kicker { font-size: 9px; letter-spacing: .08em; }

  .share-layout { gap: 10px; }
  #shareCanvas { width: min(40vw, 170px); border-width: 4px; border-radius: 18px; }
  .share-actions p { margin-bottom: 8px; font-size: 13px; }
  .share-actions small { margin-top: 8px; font-size: 10px; line-height: 1.35; }
}

@media (max-width: 360px) and (orientation: portrait) {
  .screen {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .home-shell {
    padding-inline: 9px;
  }

  .brand-lockup,
  .chapter-panel,
  .home-actions { min-width: 0; }

  .chapter-heading .bubble-button {
    min-width: 98px;
    padding-inline: 6px;
    font-size: 9px;
  }

  .modal-actions { gap: 8px; margin-top: 12px; }
  .modal-actions > * { flex-basis: 100%; max-width: none; }
  .locker-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-height: 650px) and (orientation: landscape) {
  .modal,
  .modal.compact,
  .character-modal,
  .instruction-modal,
  .result-modal,
  .unlock-modal,
  .locker-modal,
  .board-modal,
  .share-modal { max-height: 100%; }

  .character-modal { padding: 8px 16px 10px; }
  .character-modal .hero-wordmark { width: min(300px, 52%); height: 40px; margin: -3px auto 0; }
  .character-modal .character-song-wordmark { width: min(300px, 54%); height: 38px; margin-bottom: 3px; }
  .character-grid { gap: 12px; }
  .character-card { height: min(42dvh, 158px); border-width: 4px; border-radius: 22px; }
  .character-card img { height: 80%; }
  .character-card span { bottom: 5px; font-size: 16px; }
  .character-modal .text-button { min-height: 38px; margin-top: 7px; }

  .instruction-modal { padding: 9px 18px 10px; }
  .instruction-modal .kicker { font-size: 9px; }
  .instruction-wordmark { height: 45px; margin-bottom: 3px; }
  .instruction-layout { gap: 12px; }
  .instruction-visual { min-height: 166px; }
  .instruction-copy { padding: 8px; }
  .instruction-cue { padding: 8px; font-size: 14px; }
  .instruction-modal p { margin: 6px 0; font-size: 12px; line-height: 1.3; }
  .instruction-copy .bubble-button { min-height: 40px; }

  .result-modal { padding-block: 10px; }
  .result-wordmark { height: 48px; margin-bottom: 3px; }
  .result-grid { margin: 8px 0; }
  .result-grid div { padding-block: 8px; }
  .reward-line { min-height: 44px; padding: 10px; }
  .modal-actions { margin-top: 10px; }
  .modal-actions .bubble-button { min-height: 42px; }

  .share-layout { grid-template-columns: minmax(150px, .62fr) minmax(240px, 1.38fr); gap: 16px; }
  #shareCanvas { width: min(24vw, 180px); }
  .share-actions p { margin-bottom: 8px; font-size: 14px; }
  .share-actions small { margin-top: 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .unlock-sticker-stage::before,
  .unlock-sticker,
  .unlock-sparkle,
  .unlock-next,
  .unlock-modal > .bubble-button {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
