:root {
  --acid: #c8ff00;
  --green: #00e53b;
  --red: #ff453a;
  --cream: #f5f0df;
  --ink: #050806;
  --panel: rgba(8, 12, 9, 0.86);
  --line: rgba(255, 255, 255, 0.15);
  --muted: #859087;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
  --sans: Inter, Manrope, "Arial Black", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #020403;
  color: var(--cream);
  font-family: var(--sans);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

.game-app {
  position: relative;
  width: min(100vw, 560px);
  height: var(--tg-viewport-stable-height, 100dvh);
  min-height: 620px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #071008;
  box-shadow: 0 0 80px #000;
}

body.playing .game-app {
  width: 100vw;
  max-width: none;
  height: var(--tg-viewport-stable-height, 100dvh);
  min-height: 0;
}

body.playing {
  height: var(--tg-viewport-stable-height, 100dvh);
  min-height: 0;
}

#game-canvas,
.game-shade,
.noise {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
}

#game-canvas {
  z-index: 0;
  display: block;
  touch-action: none;
}

.game-shade {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(#020503 0%, transparent 17%, transparent 74%, rgba(2, 4, 3, 0.92) 100%),
    radial-gradient(circle at 50% 54%, transparent 42%, rgba(0, 0, 0, 0.3) 100%);
}

.noise {
  z-index: 2;
  opacity: 0.018;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hud {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-right: max(14px, env(safe-area-inset-right), var(--tg-content-safe-right, 0px));
  padding-left: max(14px, env(safe-area-inset-left), var(--tg-content-safe-left, 0px));
}

.hud-top {
  top: 0;
  min-height: 78px;
  padding-top: max(12px, env(safe-area-inset-top), var(--tg-content-safe-top, 0px));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(3, 7, 4, 0.96), rgba(3, 7, 4, 0.75));
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-right: auto;
  gap: 8px;
}

.game-home-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.brand-lockup > span:last-child,
.score-block,
.level-pill,
.ammo-block,
.objective-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--acid);
  color: var(--ink);
  font-size: 15px;
  transform: rotate(-12deg);
  box-shadow: 0 0 26px rgba(200, 255, 0, 0.24);
}

.brand-lockup strong {
  font-size: 12px;
  letter-spacing: -0.03em;
}

.brand-lockup small,
.hud small,
.legal-copy {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.brand-lockup small {
  margin-top: 2px;
  color: var(--acid);
}

.level-pill {
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.level-pill strong,
.score-block strong {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
}

.score-block {
  min-width: 63px;
  margin-right: 9px;
  text-align: right;
}

.score-block strong {
  color: var(--acid);
}

.round-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-family: var(--mono);
}

.round-button:active {
  transform: scale(0.93);
}

#sound-button[aria-pressed="true"] {
  color: var(--red);
  text-decoration: line-through;
}

.mission-tag {
  position: absolute;
  z-index: 5;
  top: max(91px, calc(env(safe-area-inset-top) + 82px), calc(var(--tg-content-safe-top, 0px) + 58px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(200, 255, 0, 0.24);
  border-radius: 999px;
  background: rgba(4, 9, 5, 0.76);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.mission-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
}

.hud-bottom {
  bottom: 0;
  min-height: 86px;
  gap: 12px;
  padding-bottom: max(14px, env(safe-area-inset-bottom), var(--tg-content-safe-bottom, 0px));
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(3, 7, 4, 0.98), rgba(3, 7, 4, 0.78));
  backdrop-filter: blur(16px);
}

.ammo-block {
  flex: 0 0 auto;
}

.arrow-counter {
  display: flex;
  min-height: 18px;
  align-items: center;
  gap: 3px;
}

.ammo-arrow {
  color: var(--acid);
  font-size: 15px;
  filter: drop-shadow(0 0 5px rgba(200, 255, 0, 0.35));
}

.ammo-arrow.used {
  color: #3d453f;
  filter: none;
}

.objective-block {
  flex: 1;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.objective-block strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 8px;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-burst {
  position: absolute;
  z-index: 8;
  top: 22%;
  left: 50%;
  opacity: 0;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 4px 18px #000;
  transform: translate(-50%, -50%) scale(0.6) rotate(-5deg);
}

.combo-burst.show {
  animation: combo-pop 850ms ease-out;
}

.aim-coach {
  position: absolute;
  z-index: 6;
  bottom: 16%;
  left: 50%;
  display: flex;
  width: min(82%, 330px);
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid rgba(200, 255, 0, 0.28);
  border-radius: 999px;
  background: rgba(3, 8, 4, 0.76);
  flex-direction: row;
  gap: 10px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 2px 8px #000;
  animation: coach-drag 1.8s ease-in-out infinite;
}

.coach-hand {
  margin: 0;
  font-size: 27px;
  transform: rotate(-35deg);
}

.overlay {
  position: absolute;
  z-index: 20;
  display: grid;
  inset: 0;
  padding:
    max(18px, env(safe-area-inset-top), var(--tg-content-safe-top, 0px))
    max(16px, env(safe-area-inset-right), var(--tg-content-safe-right, 0px))
    max(18px, env(safe-area-inset-bottom), var(--tg-content-safe-bottom, 0px))
    max(16px, env(safe-area-inset-left), var(--tg-content-safe-left, 0px));
  place-items: center;
  background: rgba(2, 5, 3, 0.74);
  backdrop-filter: blur(12px);
}

.start-card,
.result-card {
  width: min(100%, 390px);
  text-align: center;
}

.hero-token {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 0 auto 22px;
}

.hero-token::before,
.hero-token::after {
  position: absolute;
  border: 1px solid rgba(200, 255, 0, 0.28);
  border-radius: 50%;
  content: "";
  inset: -10px;
}

.hero-token::after {
  border-style: dashed;
  inset: -22px;
  animation: orbit 18s linear infinite;
}

.hero-token img {
  width: 100%;
  height: 100%;
  border: 3px solid var(--acid);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 50px rgba(200, 255, 0, 0.18);
}

.hero-token span {
  position: absolute;
  right: -22px;
  bottom: -6px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: #090b09;
  color: var(--red);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.05;
  transform: rotate(-10deg);
}

.overline {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.overline i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(58px, 18vw, 86px);
  line-height: 0.82;
  letter-spacing: -0.095em;
}

h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px var(--acid);
}

.start-copy {
  margin-bottom: 19px;
  color: #a5ada7;
  font-size: 14px;
  line-height: 1.45;
}

.start-copy strong {
  color: var(--cream);
}

.feature-row {
  display: grid;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.035);
}

.feature-row span {
  padding: 10px 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.feature-row span + span {
  border-left: 1px solid var(--line);
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 21px;
  border: 0;
  border-radius: 16px;
  background: var(--acid);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 7px 0 #667f00, 0 18px 34px rgba(0, 0, 0, 0.36);
  text-align: left;
}

.primary-button:active {
  box-shadow: 0 3px 0 #667f00;
  transform: translateY(4px);
}

.primary-button span {
  display: flex;
  flex-direction: column;
}

.primary-button small {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.primary-button strong {
  font-size: 18px;
  letter-spacing: -0.045em;
}

.primary-button b {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--acid);
}

.legal-copy {
  display: block;
  margin-top: 18px;
}

.result-overlay {
  background: rgba(2, 5, 3, 0.62);
}

.result-card {
  padding: 24px;
  border: 1px solid rgba(200, 255, 0, 0.26);
  border-radius: 26px;
  background: rgba(8, 13, 9, 0.92);
  box-shadow: 0 25px 90px #000;
}

.result-card.fail {
  border-color: rgba(255, 69, 58, 0.35);
}

.result-stamp {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 13px auto 16px;
  place-items: center;
  border: 3px solid var(--acid);
  border-radius: 50%;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  transform: rotate(-8deg);
}

.fail .result-stamp {
  border-color: var(--red);
  color: var(--red);
}

.result-card h2 {
  margin-bottom: 8px;
  font-size: 32px;
  letter-spacing: -0.055em;
}

.result-card > p:not(.overline) {
  color: var(--muted);
  font-size: 12px;
}

.stars {
  min-height: 37px;
  margin: 16px 0;
  color: var(--acid);
  font-size: 29px;
  letter-spacing: 7px;
  text-shadow: 0 0 20px rgba(200, 255, 0, 0.3);
}

.result-stats {
  display: grid;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  grid-template-columns: 1fr 1fr;
}

.result-stats div {
  display: flex;
  padding: 13px;
  flex-direction: column;
}

.result-stats div + div {
  border-left: 1px solid var(--line);
}

.result-stats small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
}

.result-stats strong {
  margin-top: 5px;
  color: var(--acid);
  font-family: var(--mono);
}

.secondary-actions {
  display: grid;
  margin-top: 13px;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}

.secondary-actions button {
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.rotate-note {
  position: fixed;
  z-index: 50;
  display: none;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  background:
    radial-gradient(circle at 50% 35%, rgba(200, 255, 0, 0.13), transparent 32%),
    var(--ink);
  flex-direction: column;
  text-align: center;
}

.rotate-phone {
  position: relative;
  display: grid;
  width: 74px;
  height: 128px;
  margin-bottom: 28px;
  place-items: center;
  border: 3px solid var(--acid);
  border-radius: 16px;
  color: var(--ink);
  animation: rotate-device 1.8s ease-in-out infinite;
}

.rotate-phone::before {
  position: absolute;
  top: 7px;
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--acid);
  content: "";
}

.rotate-phone span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--acid);
  font-size: 17px;
}

.rotate-note h2 {
  margin: 16px 0 12px;
  color: var(--cream);
  font-size: clamp(38px, 11vw, 56px);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.rotate-note h2 span {
  color: var(--acid);
}

.rotate-note > p:not(.overline) {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.rotate-note button {
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.mini-home {
  position: absolute;
  z-index: 30;
  overflow: hidden;
  inset: 0;
  background:
    radial-gradient(circle at 90% 5%, rgba(200, 255, 0, 0.13), transparent 26%),
    linear-gradient(155deg, #071009, #030604 54%, #090d09);
}

.home-orb {
  position: absolute;
  top: 145px;
  right: -130px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(200, 255, 0, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 100px rgba(200, 255, 0, 0.09);
}

.home-orb::before,
.home-orb::after {
  position: absolute;
  border: 1px dashed rgba(200, 255, 0, 0.09);
  border-radius: inherit;
  content: "";
  inset: 30px;
}

.home-orb::after {
  inset: 72px;
}

.home-header {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 4, 0.78);
  backdrop-filter: blur(18px);
}

.home-brand,
.home-player,
.home-player > span:last-child,
.home-brand > span:last-child {
  display: flex;
  min-width: 0;
}

.home-brand,
.home-player {
  align-items: center;
  gap: 9px;
}

.home-brand > span:last-child,
.home-player > span:last-child {
  flex-direction: column;
}

.home-brand strong {
  font-size: 12px;
}

.home-brand small,
.home-player small {
  margin-top: 2px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.home-player {
  max-width: 150px;
  justify-content: flex-end;
  text-align: right;
}

.home-player strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(200, 255, 0, 0.45);
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-pages {
  position: absolute;
  z-index: 2;
  top: max(74px, calc(env(safe-area-inset-top) + 64px));
  right: 0;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 61px));
  left: 0;
}

.home-page {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 14px 26px;
  scrollbar-width: none;
  animation: page-in 220ms ease-out;
}

.home-page::-webkit-scrollbar {
  display: none;
}

.home-hero-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 24px 18px;
  border: 1px solid rgba(200, 255, 0, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(105deg, rgba(6, 12, 7, 0.98) 0%, rgba(11, 24, 13, 0.94) 58%, rgba(75, 101, 53, 0.62) 100%),
    #0a120b;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
}

.home-hero-card::before {
  position: absolute;
  right: -45px;
  bottom: -80px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(200, 255, 0, 0.13);
  border-radius: 50%;
  content: "";
}

.home-character {
  position: absolute;
  z-index: 1;
  right: -7px;
  bottom: -2px;
  width: 188px;
  height: 300px;
  background-image: url("assets/quant-sprites.webp");
  background-position: left bottom;
  background-repeat: no-repeat;
  background-size: 400% 100%;
  filter: drop-shadow(-12px 10px 18px rgba(0, 0, 0, 0.5));
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  width: 65%;
}

.home-hero-copy h1 {
  margin: 38px 0 15px;
  font-size: clamp(48px, 15vw, 68px);
}

.home-hero-copy h1 span {
  margin-top: 4px;
}

.home-hero-copy > p:last-child {
  max-width: 210px;
  color: #a5afa7;
  font-size: 11px;
  line-height: 1.55;
}

.hero-badge {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 12px;
  display: grid;
  width: 57px;
  height: 57px;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-9deg);
}

.home-play-button {
  margin-bottom: 12px;
}

.home-stats {
  display: grid;
  margin-bottom: 23px;
  border: 1px solid var(--line);
  border-radius: 15px;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.025);
}

.home-stats > div {
  display: flex;
  min-width: 0;
  padding: 12px 7px;
  align-items: center;
  flex-direction: column;
}

.home-stats > div + div {
  border-left: 1px solid var(--line);
}

.home-stats small,
.home-section-heading,
.home-contract small,
.ranking-status,
.ranking-head,
.my-ranking small,
.scoring-card > span {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.home-stats small {
  color: var(--muted);
}

.home-stats strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-section-heading {
  display: flex;
  justify-content: space-between;
  margin: 0 3px 8px;
  color: var(--cream);
}

.home-section-heading small {
  color: var(--muted);
  font-size: inherit;
}

.home-contract {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px solid rgba(200, 255, 0, 0.18);
  border-radius: 15px;
  background: rgba(200, 255, 0, 0.045);
}

.home-contract > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-contract small {
  color: var(--acid);
}

.home-contract code {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
}

.home-contract button {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--acid);
  color: var(--ink);
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
}

.social-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.social-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.social-grid a b {
  color: var(--acid);
}

.home-disclaimer {
  margin: 15px 0 0;
  color: #536058;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.07em;
  text-align: center;
}

.page-title {
  padding: 18px 5px 13px;
}

.page-title h2 {
  margin: 15px 0 12px;
  font-size: 48px;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.page-title h2 span {
  color: var(--acid);
}

.page-title > p:last-child {
  max-width: 330px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.ranking-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--acid);
}

.ranking-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 9px var(--acid);
}

.ranking-status small {
  margin-left: auto;
  color: var(--muted);
  font-size: inherit;
}

.podium {
  display: grid;
  align-items: end;
  gap: 7px;
  margin-bottom: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.podium-player {
  display: flex;
  min-width: 0;
  min-height: 116px;
  padding: 12px 6px;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 16px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.035);
}

.podium-player.first {
  min-height: 139px;
  border-color: rgba(200, 255, 0, 0.35);
  background: rgba(200, 255, 0, 0.07);
}

.podium-rank {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 18px;
}

.podium-player strong {
  width: 100%;
  margin: 8px 0 4px;
  overflow: hidden;
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-player small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.ranking-table {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.ranking-head,
.ranking-row {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto;
}

.ranking-head {
  padding: 10px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.ranking-row {
  min-height: 49px;
  padding: 0 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ranking-row > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.ranking-row em {
  width: 19px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.ranking-row strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-row b,
.my-ranking > b {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
}

.my-ranking {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(200, 255, 0, 0.3);
  border-radius: 16px;
  background: rgba(200, 255, 0, 0.06);
}

.my-ranking > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.my-ranking small {
  color: var(--muted);
}

.my-ranking strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.how-steps {
  display: grid;
  margin-bottom: 12px;
  gap: 8px;
}

.how-steps article {
  display: grid;
  min-height: 88px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  grid-template-columns: 32px 52px 1fr;
  background: rgba(255, 255, 255, 0.03);
}

.how-steps article > b {
  align-self: start;
  color: #59635c;
  font-family: var(--mono);
  font-size: 8px;
}

.step-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--acid);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.how-steps article strong {
  font-size: 12px;
}

.how-steps article p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.scoring-card {
  margin-bottom: 13px;
  padding: 15px;
  border: 1px solid rgba(200, 255, 0, 0.22);
  border-radius: 16px;
  background: rgba(200, 255, 0, 0.045);
}

.scoring-card > span {
  color: var(--acid);
}

.scoring-card ul {
  display: grid;
  margin: 12px 0 0;
  padding: 0;
  gap: 8px;
  list-style: none;
  color: var(--muted);
  font-size: 9px;
}

.scoring-card li {
  display: flex;
  justify-content: space-between;
}

.scoring-card li b {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 8px;
}

.home-nav {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: 72px;
  padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr 1fr 1.1fr 1fr;
  background: rgba(4, 8, 5, 0.94);
  backdrop-filter: blur(18px);
}

.home-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #68736b;
  cursor: pointer;
  flex-direction: column;
  gap: 3px;
}

.home-nav button b {
  font-family: var(--mono);
  font-size: 15px;
}

.home-nav button span {
  font-size: 7px;
  font-weight: 700;
}

.home-nav button.active {
  color: var(--acid);
}

.home-nav .nav-play {
  width: 58px;
  height: 58px;
  align-self: center;
  justify-self: center;
  border-radius: 18px;
  background: var(--acid);
  color: var(--ink);
  box-shadow: 0 5px 0 #638000;
  transform: translateY(-9px);
}

.home-nav .nav-play:active {
  box-shadow: 0 2px 0 #638000;
  transform: translateY(-6px);
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes coach-drag {
  0%, 100% { opacity: 0.55; transform: translate(-47%, -5px); }
  50% { opacity: 1; transform: translate(-53%, 5px); }
}

@keyframes combo-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-8deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(-4deg); }
  70% { opacity: 1; transform: translate(-50%, -65%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(0.92); }
}

@keyframes rotate-device {
  0%, 28% { transform: rotate(0deg); }
  66%, 100% { transform: rotate(90deg); }
}

@media (max-height: 700px) {
  .game-app { min-height: 100dvh; }
  .hud-top { min-height: 66px; }
  .mission-tag { top: 73px; }
  .hud-bottom { min-height: 74px; }
  .hero-token { width: 98px; height: 98px; margin-bottom: 14px; }
  h1 { font-size: 54px; }
  .feature-row { margin-bottom: 12px; }
  .primary-button { min-height: 62px; }
  .legal-copy { margin-top: 12px; }
}

@media (orientation: portrait) {
  body.playing .rotate-note { display: flex; }
}

@media (orientation: landscape) and (max-height: 560px) {
  body.playing .hud-top {
    min-height: 58px;
    padding-top: max(7px, env(safe-area-inset-top), var(--tg-content-safe-top, 0px));
  }

  body.playing .hud-bottom {
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom), var(--tg-content-safe-bottom, 0px));
    left: max(10px, env(safe-area-inset-left), var(--tg-content-safe-left, 0px));
    width: min(68vw, 560px);
    min-height: 46px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    background: rgba(3, 7, 4, 0.82);
  }

  body.playing .mission-tag {
    display: none;
  }

  body.playing .aim-coach {
    bottom: 18%;
    left: 34%;
    width: min(36%, 300px);
    min-height: 38px;
    padding: 6px 12px;
  }

  body.playing .result-card {
    display: grid;
    width: min(92vw, 760px);
    padding: 16px 20px;
    align-items: center;
    gap: 6px 18px;
    grid-template-columns: 150px minmax(320px, 1fr);
    text-align: left;
  }

  body.playing .result-card .overline,
  body.playing .result-card h2,
  body.playing .result-card > p:not(.overline),
  body.playing .result-stats,
  body.playing .result-card > .primary-button,
  body.playing .secondary-actions {
    grid-column: 2;
  }

  body.playing .result-card .overline { grid-row: 1; }
  body.playing .result-card h2 { grid-row: 2; margin: 0; font-size: 28px; }
  body.playing .result-card > p:not(.overline) { grid-row: 3; margin: 0; }
  body.playing .result-stamp { grid-column: 1; grid-row: 1 / span 3; margin: 0 auto; }
  body.playing .stars { grid-column: 1; grid-row: 4 / span 2; margin: 0; text-align: center; }
  body.playing .result-stats { grid-row: 4; margin: 0; }
  body.playing .result-card > .primary-button { grid-row: 5; min-height: 54px; }
  body.playing .secondary-actions { grid-row: 6; margin-top: 0; }
}

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