:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #02070b;
  color: #f4f7f8;
  --red: #f0443e;
  --yellow: #ffd447;
  --cyan: #4ee7dc;
  --ink: #071018;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #02070b;
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: min(100vw, 540px);
  height: 100%;
  min-height: 540px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #071018;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
  touch-action: none;
}

.menu-mode .topbar,
.menu-mode .hud,
.menu-mode .ticker,
.menu-mode .skill-button,
.menu-mode .boost-status {
  opacity: 0;
  pointer-events: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.topbar {
  position: absolute;
  z-index: 25;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.intel-button {
  position: absolute;
  left: calc(50% - 56px);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--cyan);
  border: 1px solid rgba(78, 231, 220, 0.64);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(12, 28, 38, 0.94), rgba(7, 16, 24, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 14px rgba(78, 231, 220, 0.1);
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.intel-button:hover {
  border-color: rgba(78, 231, 220, 0.95);
  background: linear-gradient(180deg, rgba(19, 47, 58, 0.96), rgba(7, 16, 24, 0.86));
  transform: translateY(-1px);
}

.pause-button {
  position: absolute;
  left: calc(50% + 28px);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--yellow);
  border: 1px solid rgba(255, 212, 71, 0.58);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(28, 31, 24, 0.96), rgba(9, 16, 18, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 14px rgba(255, 212, 71, 0.1);
  font-size: 0;
  font-weight: 1000;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.pause-button::before,
.pause-button::after {
  content: "";
  position: absolute;
}

.pause-button::before {
  inset: 6px;
  border: 1px solid rgba(255, 212, 71, 0.24);
  border-radius: 5px;
  background: rgba(255, 212, 71, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pause-button::after {
  left: 50%;
  top: 50%;
  width: 4px;
  height: 15px;
  border-radius: 3px;
  background: currentColor;
  box-shadow: 8px 0 0 currentColor, 0 0 10px rgba(255, 212, 71, 0.28);
  transform: translate(-6px, -50%);
}

.pause-button:hover {
  border-color: rgba(255, 212, 71, 0.86);
  background: linear-gradient(180deg, rgba(37, 38, 27, 0.98), rgba(9, 16, 18, 0.88));
  transform: translateY(-1px);
}

.sound-button {
  position: absolute;
  left: calc(50% - 14px);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--cyan);
  border: 1px solid rgba(78, 231, 220, 0.64);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(12, 28, 38, 0.94), rgba(7, 16, 24, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 14px rgba(78, 231, 220, 0.1);
  font-size: 0;
  font-weight: 1000;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.sound-button::before {
  content: "";
  width: 8px;
  height: 12px;
  border-radius: 2px 0 0 2px;
  background: currentColor;
  box-shadow: -6px 3px 0 -2px currentColor;
  transform: translateX(-4px);
}

.sound-button::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 50%;
  transform: translateX(3px);
}

.sound-button:hover {
  border-color: rgba(78, 231, 220, 0.95);
  background: linear-gradient(180deg, rgba(19, 47, 58, 0.96), rgba(7, 16, 24, 0.86));
  transform: translateY(-1px);
}

.sound-button.muted {
  color: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.22);
}

.sound-button.muted::after {
  width: 20px;
  height: 3px;
  border: 0;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(-35deg);
}

.pause-screen {
  z-index: 28;
  background: rgba(3, 10, 15, 0.97);
}

.pause-screen h2 {
  margin: 13px 0 4px;
  font-size: 34px;
}

.pause-screen > p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.pause-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 340px);
  margin: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
}

.pause-stats div {
  padding: 14px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.17);
}

.pause-stats div:last-child { border-right: 0; }
.pause-stats small, .pause-stats strong { display: block; }
.pause-stats small { color: rgba(255,255,255,.46); font-size: 8px; }
.pause-stats strong { margin-top: 5px; color: var(--cyan); font-size: 20px; }
.danger-button { color: #ff8d89; border-color: rgba(240, 68, 62, 0.5); }
.pause-note { margin-top: 12px; color: rgba(255,255,255,.38) !important; font-size: 9px !important; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(240, 68, 62, 0.16);
  animation: live 1.1s infinite;
}

.timer {
  display: flex;
  align-items: baseline;
  min-width: 62px;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.timer span {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 34px;
}

.timer small {
  margin-left: 2px;
  color: var(--yellow);
  font-weight: 900;
}

.hud {
  position: absolute;
  z-index: 5;
  top: max(58px, calc(env(safe-area-inset-top) + 50px));
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  gap: 10px;
  align-items: end;
  pointer-events: none;
}

.hud-block {
  display: flex;
  flex-direction: column;
}

.hud-block-right {
  text-align: right;
}

.hud-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 800;
}

.hud-label b {
  margin-left: 3px;
  color: var(--cyan);
  font-size: 9px;
}

.hud strong {
  margin-top: 2px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.credibility {
  display: flex;
  flex-direction: column;
}

.credibility-track {
  height: 9px;
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
}

.credibility-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(78, 231, 220, 0.6);
  transition: width 180ms ease, background 180ms ease;
}

.toast {
  position: absolute;
  z-index: 7;
  top: 23%;
  left: 50%;
  width: max-content;
  max-width: 86%;
  padding: 6px 12px;
  transform: translate(-50%, -8px) rotate(-2deg);
  opacity: 0;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 14px;
  font-weight: 1000;
  text-align: center;
  pointer-events: none;
}

.toast.show {
  animation: toast 900ms ease;
}

.boost-status {
  position: absolute;
  z-index: 7;
  top: max(101px, calc(env(safe-area-inset-top) + 93px));
  left: 50%;
  padding: 5px 10px;
  transform: translateX(-50%) scale(0.85);
  opacity: 0;
  color: var(--ink);
  border: 2px solid var(--ink);
  background: var(--cyan);
  box-shadow: 3px 3px 0 var(--yellow);
  font-size: 10px;
  font-weight: 1000;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.boost-status.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.skill-button {
  position: absolute;
  z-index: 8;
  right: 18px;
  bottom: calc(48px + env(safe-area-inset-bottom));
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: white;
  background: rgba(5, 15, 22, 0.78);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
}

.skill-button.active {
  opacity: 1;
  pointer-events: auto;
}

.skill-button.ready {
  border-color: var(--yellow);
  box-shadow: 0 0 26px rgba(255, 212, 71, 0.5);
  animation: ready 0.8s infinite alternate;
}

.skill-ring {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--charge, 0%), rgba(255, 255, 255, 0.12) 0);
  mask: radial-gradient(circle, transparent 57%, #000 59%);
}

.skill-icon {
  margin-top: -8px;
  font-family: Impact, sans-serif;
  font-size: 31px;
  color: var(--yellow);
}

.skill-button small {
  position: absolute;
  bottom: 11px;
  font-size: 9px;
  font-weight: 900;
}

.screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(26px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  text-align: center;
  background:
    linear-gradient(rgba(7, 16, 24, 0.78), rgba(7, 16, 24, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.035) 6px);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.edition,
.result-kicker {
  padding: 5px 9px;
  color: var(--ink);
  background: var(--yellow);
  font-size: 10px;
  font-weight: 1000;
}

.start-screen h1 {
  margin: 12px 0 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(58px, 16vw, 92px);
  line-height: 0.8;
  letter-spacing: 0;
  transform: rotate(-2deg);
  text-shadow: 5px 5px 0 #000;
}

.start-screen h1 span {
  color: var(--red);
}

.subtitle {
  margin: 8px 0 20px;
  color: var(--cyan);
  font-size: 18px;
  font-weight: 1000;
}

.character-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  width: min(100%, 360px);
  min-height: 104px;
  align-items: center;
  gap: 16px;
  padding: 10px 16px 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 5px solid var(--red);
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
}

.character-card small {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
}

.character-card strong {
  display: block;
  margin: 3px 0;
  font-size: 20px;
}

.character-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.career-line {
  display: flex;
  width: min(100%, 360px);
  justify-content: space-between;
  margin-top: 9px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}

.portrait {
  position: relative;
  width: 78px;
  height: 88px;
  overflow: hidden;
}

.face {
  position: absolute;
  z-index: 2;
  top: 17px;
  left: 17px;
  width: 48px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 43% 47% 46% 44%;
  background: #f3ad78;
}

.hair {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 10px;
  width: 58px;
  height: 27px;
  border: 3px solid var(--ink);
  border-radius: 70% 25% 50% 12%;
  background: var(--yellow);
  transform: rotate(-8deg);
}

.hair::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -13px;
  width: 12px;
  height: 24px;
  border-right: 3px solid var(--ink);
  background: var(--yellow);
}

.eye {
  position: absolute;
  top: 21px;
  width: 5px;
  height: 3px;
  background: var(--ink);
}

.eye-left { left: 10px; }
.eye-right { right: 10px; }

.mouth {
  position: absolute;
  bottom: 10px;
  left: 15px;
  width: 19px;
  height: 5px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}

.suit {
  position: absolute;
  bottom: -16px;
  left: 7px;
  width: 70px;
  height: 42px;
  border: 3px solid var(--ink);
  background: #183958;
  transform: skew(-5deg);
}

.suit::after {
  content: "";
  position: absolute;
  top: 0;
  left: 31px;
  width: 9px;
  height: 30px;
  background: var(--red);
}

.hook {
  margin: 18px 0 12px;
  font-weight: 800;
}

.rule-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 330px);
  margin: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
}

.rule-strip div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.rule-strip div:nth-child(2n) {
  border-right: 0;
}

.rule-strip div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.rule-strip b {
  font-size: 10px;
}

.rule-sample {
  display: grid;
  min-width: 43px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 8px;
  font-weight: 1000;
}

.rule-sample.bad {
  background: var(--red);
  transform: rotate(-4deg);
}

.rule-sample.good {
  min-width: 51px;
  border-radius: 50%;
  background: #43e07b;
}

.rule-sample.mic {
  min-width: 48px;
  border-radius: 50%;
  background: var(--yellow);
}

.rule-sample.boost {
  min-width: 55px;
  background: var(--cyan);
  transform: skew(-6deg);
}

.primary-button,
.secondary-button {
  width: min(100%, 330px);
  min-height: 52px;
  border: 0;
  border-radius: 3px;
  font-weight: 1000;
  cursor: pointer;
}

.primary-button {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--red);
}

.primary-button:active,
.secondary-button:active {
  transform: translate(2px, 2px);
}

.secondary-button {
  margin-top: 10px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
}

.gesture-hint,
.satire-note,
.share-status {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
}

.satire-note {
  margin-top: 7px;
  color: rgba(255, 212, 71, 0.56);
}

.end-screen h2 {
  margin: 14px 0 3px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 42px;
  letter-spacing: 0;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}

.result-score strong {
  color: var(--yellow);
  font-family: Impact, sans-serif;
  font-size: 64px;
}

.result-score span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 360px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.result-grid div {
  padding: 14px 5px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.result-grid div:last-child {
  border-right: 0;
}

.result-grid strong,
.result-grid span {
  display: block;
}

.result-grid strong {
  color: var(--cyan);
  font-size: 20px;
}

.result-grid span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.end-screen blockquote {
  width: min(100%, 350px);
  min-height: 56px;
  margin: 18px 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.7;
}

.xp-reward {
  width: min(100%, 360px);
  margin: 12px 0 0;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--cyan);
  font-size: 11px;
  font-weight: 1000;
}

.intel-screen {
  position: absolute;
  z-index: 30;
  inset: 0;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(42px + env(safe-area-inset-bottom));
  color: white;
  background: #030a0f;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.intel-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.intel-header small {
  color: var(--yellow);
  font-size: 9px;
  font-weight: 1000;
}

.intel-header h2 {
  margin: 3px 0 0;
  font-size: 28px;
}

.intel-close {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.intel-close::before,
.intel-close::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}

.intel-close::before {
  transform: rotate(45deg);
}

.intel-close::after {
  transform: rotate(-45deg);
}

.intel-close:hover {
  border-color: rgba(240, 68, 62, 0.85);
  background: rgba(240, 68, 62, 0.18);
  transform: translateY(-1px);
}

.intel-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.intel-tab {
  height: 40px;
  color: rgba(255, 255, 255, 0.52);
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.intel-tab.active {
  color: white;
  border-bottom-color: var(--yellow);
}

.intel-panel.hidden {
  display: none;
}

.intel-lead {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.7;
}

.news-list article {
  display: grid;
  grid-template-columns: 82px 1fr;
  min-height: 68px;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.news-list article:last-child {
  border-bottom: 0;
}

.news-list strong,
.character-option strong {
  font-size: 13px;
}

.news-list p,
.character-option p,
.supply-guide p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  line-height: 1.45;
}

.news-chip {
  display: grid;
  width: 74px;
  min-height: 36px;
  place-items: center;
  padding: 4px;
  color: var(--ink);
  border: 3px solid var(--ink);
  font-size: 9px;
  font-weight: 1000;
  text-align: center;
  transform: rotate(-3deg);
}

.news-chip.fake { background: var(--red); }
.news-chip.hot { background: var(--yellow); transform: rotate(3deg); }
.news-chip.rumor { background: #ff69b4; }
.news-chip.source { color: white; background: #4b8cff; transform: rotate(2deg); }
.news-chip.breaking { color: white; background: var(--red); }

.supply-guide {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.supply-guide > div {
  display: grid;
  grid-template-columns: 70px 1fr;
  min-height: 44px;
  align-items: center;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
}

.guide-dot {
  display: grid;
  width: 58px;
  height: 28px;
  place-items: center;
  color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 8px;
  font-weight: 1000;
}

.guide-dot.fact { border-radius: 50%; background: #43e07b; }
.guide-dot.mic { border-radius: 50%; background: var(--yellow); }
.guide-dot.verify { background: var(--cyan); }

.career-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.career-summary div {
  padding: 12px 5px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.career-summary div:last-child {
  border-right: 0;
}

.career-summary small,
.career-summary strong {
  display: block;
}

.career-summary small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 8px;
}

.career-summary strong {
  margin-top: 4px;
  color: var(--cyan);
  font-size: 15px;
}

.character-list {
  display: grid;
  gap: 9px;
}

.character-option {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  min-height: 66px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.character-option.selected {
  border-color: var(--cyan);
  background: rgba(78, 231, 220, 0.08);
}

.character-option.locked {
  opacity: 0.52;
}

.character-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--avatar-color, var(--yellow));
  font-size: 18px;
  font-weight: 1000;
}

.character-select {
  min-width: 55px;
  height: 31px;
  padding: 0 8px;
  color: var(--ink);
  border: 0;
  border-radius: 3px;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 1000;
  cursor: pointer;
}

.character-select:disabled {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  cursor: default;
}

.hq-screen {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: max(24px, env(safe-area-inset-top));
  background: #071018;
}

.hq-header {
  display: flex;
  width: min(100%, 410px);
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
}

.hq-brand {
  min-width: 0;
}

.hq-brand .edition {
  display: inline-block;
}

.hq-brand h1 {
  margin: 10px 0 0;
  font-size: clamp(29px, 8.7vw, 43px);
  line-height: 0.9;
  transform: none;
  text-shadow: 3px 3px 0 #000;
  white-space: nowrap;
}

.hq-brand h1 span {
  margin-left: 5px;
}

.hq-brand > p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  font-weight: 800;
}

.resource-stack {
  display: grid;
  gap: 6px;
  min-width: 105px;
  margin-top: 2px;
  padding: 7px 9px;
  color: white;
  border: 1px solid rgba(255, 212, 71, 0.35);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  text-align: right;
  cursor: pointer;
}

.resource-stack span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-weight: 800;
}

.resource-stack b {
  display: inline-block;
  min-width: 38px;
  color: var(--yellow);
  font-size: 13px;
}

.resource-stack small {
  color: var(--cyan);
  font-size: 7px;
  font-weight: 900;
}

.hq-character {
  display: grid;
  grid-template-columns: 72px 1fr 46px;
  width: min(100%, 410px);
  min-height: 88px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 11px;
  border-left: 4px solid var(--red);
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}

.hq-character .portrait {
  width: 68px;
  height: 75px;
  transform: scale(0.83);
  transform-origin: center;
}

.hq-character-copy small {
  color: var(--yellow);
  font-size: 8px;
  font-weight: 900;
}

.hq-character-copy strong {
  display: block;
  margin: 2px 0;
  font-size: 17px;
}

.hq-character-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.credibility-preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.credibility-preview > span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 7px;
}

.credibility-preview > i {
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.credibility-preview > i b {
  display: block;
  width: 65%;
  height: 100%;
  background: var(--cyan);
}

.credibility-preview > strong {
  color: var(--cyan);
  font-size: 8px;
}

.evolution-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 50px;
  border: 1px solid rgba(78, 231, 220, 0.4);
}

.evolution-badge span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 7px;
}

.evolution-badge b {
  color: var(--cyan);
  font-size: 20px;
}

.route-card {
  width: min(100%, 410px);
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 212, 71, 0.38);
  border-left: 5px solid var(--yellow);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.route-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.route-heading small {
  display: block;
  color: rgba(255, 255, 255, 0.44);
  font-size: 8px;
}

.route-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.route-heading > span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}

.route-nodes {
  display: flex;
  align-items: center;
  margin: 12px 0 9px;
}

.route-nodes span {
  display: grid;
  min-width: 38px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 8px;
  font-weight: 900;
}

.route-nodes span.active {
  color: var(--ink);
  border-color: var(--yellow);
  background: var(--yellow);
}

.route-nodes i {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.route-card > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  line-height: 1.5;
}

.route-start {
  width: 100%;
  margin-top: 14px;
}

.hq-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 410px);
  gap: 7px;
  margin-top: 12px;
}

.hq-menu button {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  min-height: 58px;
  align-items: center;
  column-gap: 8px;
  padding: 8px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  cursor: pointer;
}

.hq-menu b,
.hq-menu small {
  display: block;
}

.hq-menu b {
  align-self: end;
  color: var(--cyan);
  font-size: 11px;
}

.hq-menu small {
  align-self: start;
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
}

.hq-menu-icon {
  display: grid !important;
  grid-row: 1 / 3;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--ink);
  border-radius: 3px;
  background: var(--cyan);
  font-size: 13px;
  font-weight: 1000;
}

.classic-link {
  margin-top: 11px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.upgrade-screen {
  background: #071018;
}

.upgrade-screen h2 {
  margin: 13px 0 4px;
  font-size: 27px;
}

.upgrade-screen > p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.upgrade-choices {
  display: grid;
  width: min(100%, 390px);
  gap: 10px;
  margin: 18px 0;
}

.upgrade-card {
  display: grid;
  grid-template-columns: 45px 1fr auto;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 11px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--cyan);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  cursor: pointer;
}

.upgrade-card:hover {
  background: rgba(78, 231, 220, 0.1);
}

.upgrade-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-size: 18px;
  font-weight: 1000;
}

.upgrade-card strong,
.upgrade-card span {
  display: block;
}

.upgrade-card strong {
  font-size: 13px;
}

.upgrade-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.upgrade-card > span {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
}

.text-button {
  margin-top: 12px;
  color: var(--cyan);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.end-screen .hidden {
  display: none;
}

.facility-panel.hidden {
  display: none;
}

.facility-wallet {
  position: sticky;
  z-index: 2;
  top: -1px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #071018;
}

.facility-wallet div {
  padding: 9px 7px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.facility-wallet div:last-child {
  border-right: 0;
}

.facility-wallet small,
.facility-wallet strong {
  display: block;
}

.facility-wallet small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 8px;
}

.facility-wallet strong {
  margin-top: 3px;
  color: var(--yellow);
  font-size: 15px;
}

.resource-feedback {
  min-height: 26px;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.resource-feedback.error {
  color: var(--red);
}

.economy-list {
  display: grid;
  gap: 10px;
}

.economy-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  min-height: 118px;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid var(--resource-color);
  background: rgba(255, 255, 255, 0.045);
}

.economy-card.coin { --resource-color: var(--yellow); }
.economy-card.evidence { --resource-color: var(--cyan); }
.economy-card.token { --resource-color: #43e07b; }

.economy-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
  background: var(--resource-color);
  font-size: 20px;
  font-weight: 1000;
}

.economy-card small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
}

.economy-card small b {
  color: var(--resource-color);
  font-size: 13px;
}

.economy-card h3 {
  margin: 3px 0;
  font-size: 18px;
}

.economy-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  line-height: 1.55;
}

.economy-card > div > strong {
  display: block;
  margin-top: 7px;
  color: var(--resource-color);
  font-size: 9px;
}

.economy-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 18px;
}

.economy-flow span {
  display: grid;
  min-height: 36px;
  place-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.economy-flow i {
  color: var(--yellow);
  font-style: normal;
}

.facility-list {
  display: grid;
  gap: 10px;
}

.facility-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  min-height: 76px;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.045);
}

.facility-item.selected {
  border-color: var(--cyan);
}

.facility-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: var(--cyan);
  font-size: 17px;
  font-weight: 1000;
}

.facility-item strong,
.facility-item small {
  display: block;
}

.facility-item p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
}

.facility-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.facility-numbers span {
  padding: 3px 5px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.06);
  font-size: 8px;
}

.facility-cost {
  display: block;
  margin-top: 5px;
  color: var(--yellow);
  font-size: 8px;
  font-weight: 900;
}

.facility-cost.short {
  color: var(--red);
}

.facility-item small {
  color: var(--yellow);
  font-size: 8px;
}

.facility-action {
  min-width: 60px;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--ink);
  border: 0;
  border-radius: 3px;
  background: var(--yellow);
  font-size: 9px;
  font-weight: 1000;
  cursor: pointer;
}

.facility-action:disabled {
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.archive-box {
  display: grid;
  width: 180px;
  height: 125px;
  place-items: center;
  margin: 30px auto 16px;
  border: 5px solid var(--ink);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 10px 10px 0 var(--red);
  transform: rotate(-2deg);
}

.archive-box span {
  font-size: 11px;
  font-weight: 1000;
}

.archive-box b {
  font-size: 54px;
}

#chestPanel {
  text-align: center;
}

#chestPanel h3 {
  margin: 10px 0 6px;
  font-size: 23px;
}

#chestPanel > p {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  line-height: 1.7;
}

.chest-result {
  min-height: 44px;
  margin-top: 16px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.ticker {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(27px + env(safe-area-inset-bottom));
  overflow: hidden;
  padding-top: 6px;
  color: var(--ink);
  background: var(--red);
  font-family: "Arial Black", sans-serif;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
}

.ticker div {
  width: max-content;
  animation: ticker 16s linear infinite;
}

@keyframes live {
  50% { opacity: 0.45; }
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, 6px) rotate(-2deg) scale(0.8); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) rotate(-2deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -15px) rotate(-2deg) scale(1.05); }
}

@keyframes ready {
  to { transform: scale(1.06); }
}

@media (min-width: 700px) {
  body {
    background:
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      #02070b;
    background-size: 30px 30px;
  }
}

@media (max-height: 680px) {
  .character-card { min-height: 88px; }
  .portrait { transform: scale(0.82); }
  .start-screen h1 { font-size: 58px; }
  .subtitle { margin-bottom: 10px; }
  .hook { margin-top: 10px; }
  .rule-strip { margin-bottom: 10px; }
  .gesture-hint { margin-top: 9px; }
  .result-score strong { font-size: 52px; }
  .end-screen blockquote { margin: 10px 0; }
}

@media (max-width: 380px) {
  .topbar .brand { display: none; }
  .intel-button { left: 34%; }
  .sound-button { left: calc(34% + 42px); }
  .pause-button { left: calc(34% + 84px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
