:root {
  --bg: #090b10;
  --panel: #151922;
  --panel-2: #202432;
  --text: #f6ead0;
  --muted: #b6a98e;
  --gold: #f5b83b;
  --ember: #f46f2e;
  --teal: #37f0d2;
  --danger: #de3754;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 20%, rgba(55, 240, 210, 0.14), transparent 28rem),
    radial-gradient(circle at 50% 90%, rgba(244, 111, 46, 0.14), transparent 24rem),
    var(--bg);
  overflow: hidden;
  touch-action: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: var(--tg-viewport-height, 100%);
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  position: relative;
  width: min(100vw - 28px, 430px);
  height: min(calc(var(--tg-viewport-height, 100dvh) - 28px), 860px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(246, 234, 208, 0.18);
  border-radius: 28px;
  background: #090b10;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45), inset 0 0 0 8px rgba(255, 255, 255, 0.025);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  min-height: 100%;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(rgba(9, 11, 16, 0.24), rgba(9, 11, 16, 0.88)),
    radial-gradient(circle at 50% 34%, rgba(55, 240, 210, 0.18), transparent 9rem),
    linear-gradient(150deg, #101621, #120d13 58%, #1d130e);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(90deg, transparent 47%, rgba(245, 184, 59, 0.18) 48%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 90px 100%, 100% 34px;
  pointer-events: none;
}

.portal-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  left: 50%;
  top: 120px;
  translate: -50% 0;
  border: 14px solid rgba(55, 240, 210, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(55, 240, 210, 0.36), inset 0 0 34px rgba(55, 240, 210, 0.22);
}

.top-bar,
.select-header,
.hud {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  padding: 8px 12px;
  border: 1px solid rgba(246, 234, 208, 0.15);
  border-radius: 999px;
  background: rgba(9, 11, 16, 0.42);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.telegram-expand-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #37f0d2, #f7c95a);
  color: #10131b;
  box-shadow: 0 12px 30px rgba(55, 240, 210, 0.22);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.telegram-expand-button.visible {
  display: inline-grid;
  place-items: center;
}

.hero-mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 230px;
}

.hero-orc {
  --skin: #c39237;
  --aura: rgba(245, 184, 59, 0.34);
  position: relative;
  width: 146px;
  height: 184px;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.44));
}

.hero-orc .orc-aura {
  position: absolute;
  inset: 4px 0 auto;
  height: 150px;
  border-radius: 48%;
  background: radial-gradient(circle, var(--aura), transparent 66%);
  transform: scale(1.25);
}

.orc-head {
  position: absolute;
  z-index: 2;
  left: 26px;
  top: 6px;
  width: 94px;
  height: 84px;
  border-radius: 38% 38% 42% 42%;
  background: linear-gradient(#fff3 0 18%, transparent 18%), var(--skin);
  box-shadow: inset 0 -13px 0 rgba(0, 0, 0, 0.16);
}

.orc-head::before,
.orc-head::after {
  content: "";
  position: absolute;
  top: 27px;
  width: 38px;
  height: 24px;
  background: var(--skin);
  clip-path: polygon(0 50%, 100% 0, 84% 100%);
}

.orc-head::before {
  left: -26px;
}

.orc-head::after {
  right: -26px;
  scale: -1 1;
}

.orc-body {
  position: absolute;
  z-index: 1;
  left: 14px;
  bottom: 4px;
  width: 118px;
  height: 112px;
  border-radius: 34px 34px 20px 20px;
  background:
    radial-gradient(circle at 50% 18%, rgba(245, 184, 59, 0.55) 0 14px, transparent 15px),
    linear-gradient(90deg, #262a35, #343a4a);
  border: 2px solid rgba(246, 234, 208, 0.16);
}

.hero-orc::before,
.hero-orc::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 58px;
  top: 40px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #11151c;
  box-shadow: 28px 0 #11151c;
}

.hero-orc::after {
  left: 62px;
  top: 65px;
  width: 22px;
  height: 8px;
  border-radius: 0 0 12px 12px;
  background: #171018;
  box-shadow: none;
}

.title-block {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.92;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28), 0 0 26px rgba(245, 184, 59, 0.16);
}

h1 {
  font-size: clamp(48px, 14vw, 66px);
}

h2 {
  font-size: 34px;
}

.subtitle {
  width: min(310px, 100%);
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 58px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.primary-button {
  background: linear-gradient(135deg, #f7c95a, #f07832);
  color: #221006;
  box-shadow: 0 12px 24px rgba(244, 111, 46, 0.26);
}

.primary-button:disabled {
  cursor: not-allowed;
  color: rgba(246, 234, 208, 0.52);
  background: rgba(246, 234, 208, 0.1);
  box-shadow: none;
}

.secondary-button {
  margin-top: 10px;
  background: rgba(246, 234, 208, 0.1);
  border: 1px solid rgba(246, 234, 208, 0.18);
}

.icon-button,
.nav-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.09);
  border: 1px solid rgba(246, 234, 208, 0.14);
  font-size: 34px;
  line-height: 1;
}

.select-screen {
  gap: 12px;
}

.wallet-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.5);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.wallet-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.wallet-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.wallet-strip button {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #37f0d2, #f7c95a);
  color: #10131b;
  font-size: 12px;
  font-weight: 950;
}

.wallet-strip button:disabled {
  color: #10131b;
  opacity: 0.68;
}

.wallet-strip.connected {
  border-color: rgba(55, 240, 210, 0.28);
}

.play-window-status {
  position: relative;
  z-index: 2;
  display: block;
  margin: -4px 4px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.bonus-window-button {
  position: relative;
  z-index: 2;
  display: none;
  width: 100%;
  min-height: 42px;
  margin: 0 0 10px;
  border: 1px solid rgba(55, 240, 210, 0.34);
  border-radius: 14px;
  background: rgba(55, 240, 210, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.bonus-window-button.visible {
  display: block;
}

.access-screen {
  gap: 14px;
}

.access-card {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(246, 234, 208, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(32, 36, 50, 0.82), rgba(11, 13, 19, 0.72));
  overflow: visible;
}

.access-orb {
  position: absolute;
  right: -28px;
  top: -28px;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  border: 12px solid rgba(55, 240, 210, 0.22);
  box-shadow: 0 0 36px rgba(55, 240, 210, 0.22);
}

.access-card h3 {
  position: relative;
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.access-card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.access-card small {
  position: relative;
  color: var(--muted);
  font-size: 12px;
}

.access-wallet {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.5);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.access-wallet span,
.access-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-wallet strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.access-wallet .primary-button {
  width: auto;
  min-width: 138px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
}

.access-summary {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(55, 240, 210, 0.08);
  border: 1px solid rgba(55, 240, 210, 0.18);
}

.access-summary strong {
  color: var(--teal);
  font-size: 24px;
  line-height: 1;
}

.unlocked-teams {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(9, 11, 16, 0.38);
  border: 1px solid rgba(246, 234, 208, 0.1);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.access-list {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.access-list::-webkit-scrollbar {
  display: none;
}

.collection-link {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 14px;
  border: 0;
  color: #10131b;
  background: linear-gradient(135deg, #37f0d2, #f7c95a);
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.collection-link.compact {
  min-height: 46px;
  background: linear-gradient(135deg, #f7c95a, #f07832);
  border: 1px solid rgba(245, 184, 59, 0.46);
  color: #211006;
  box-shadow: 0 10px 22px rgba(244, 111, 46, 0.22);
}

.leaderboard-screen {
  gap: 14px;
}

.items-screen {
  gap: 14px;
}

.leaderboard-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.leaderboard-tabs button {
  min-height: 42px;
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.08);
  border: 1px solid rgba(246, 234, 208, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.leaderboard-tabs button.active {
  background: linear-gradient(135deg, #37f0d2, #f7c95a);
  border-color: transparent;
  color: #10131b;
}

.leaderboard-mode-tabs button {
  min-height: 38px;
}

.leaderboard-race-filter {
  position: relative;
  z-index: 2;
  display: none;
  gap: 6px;
  min-height: 42px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.leaderboard-race-filter::-webkit-scrollbar {
  display: none;
}

.leaderboard-race-filter button {
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.08);
  border: 1px solid rgba(246, 234, 208, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.leaderboard-race-filter button.active {
  background: rgba(55, 240, 210, 0.18);
  border-color: rgba(55, 240, 210, 0.42);
  color: var(--paper);
}

.leaderboard-race-filter button:only-child {
  min-width: 128px;
  pointer-events: none;
}

.leaderboard-player {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(55, 240, 210, 0.1);
  border: 1px solid rgba(55, 240, 210, 0.26);
}

.leaderboard-player span,
.leaderboard-player small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-player strong {
  grid-row: span 2;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.leaderboard-note {
  position: relative;
  z-index: 2;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(9, 11, 16, 0.42);
  border: 1px solid rgba(246, 234, 208, 0.1);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.leaderboard-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.leaderboard-list::-webkit-scrollbar {
  display: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.48);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.leaderboard-row.player-run {
  background: rgba(55, 240, 210, 0.12);
  border-color: rgba(55, 240, 210, 0.34);
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #10131b;
  background: var(--gold);
  font-size: 13px;
  font-weight: 950;
}

.leaderboard-row strong,
.leaderboard-row b {
  display: block;
}

.leaderboard-row span,
.leaderboard-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.leaderboard-row em {
  color: var(--rarity-color);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.leaderboard-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0;
}

.leaderboard-source {
  display: inline-grid;
  min-height: 18px;
  padding: 2px 7px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(246, 234, 208, 0.18);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.leaderboard-source.verified {
  border-color: rgba(55, 240, 210, 0.35);
  color: #37f0d2;
}

.leaderboard-source.local {
  border-color: rgba(247, 201, 90, 0.34);
  color: var(--gold);
}

.items-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.items-list::-webkit-scrollbar {
  display: none;
}

.items-group {
  display: grid;
  gap: 10px;
}

.items-group h3 {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.item-tile {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 132px;
  padding: 12px 7px 10px;
  border: 1px solid rgba(246, 234, 208, 0.13);
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.07);
  text-align: center;
}

.item-tile.good {
  border-color: rgba(55, 240, 210, 0.24);
}

.item-tile.bad {
  border-color: rgba(255, 75, 116, 0.28);
}

.item-tile.special {
  border-color: rgba(245, 184, 59, 0.32);
}

.item-tile img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.item-tile strong {
  max-width: 100%;
  color: var(--paper);
  font-size: 11px;
  line-height: 1.05;
}

.item-tile span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.access-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(9, 11, 16, 0.42);
  border: 1px solid rgba(246, 234, 208, 0.1);
  color: inherit;
  text-align: left;
}

button.access-row {
  cursor: pointer;
}

.access-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--race-color);
  box-shadow: 0 0 16px var(--race-color);
}

.access-row strong {
  display: block;
  font-size: 13px;
}

.access-row span,
.access-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.access-row.unlocked {
  border-color: rgba(55, 240, 210, 0.28);
  background: rgba(55, 240, 210, 0.08);
}

.access-row.unlocked:active {
  transform: translateY(1px);
}

.access-badge {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(246, 234, 208, 0.08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.access-rarity {
  display: inline-block;
  margin-top: 4px;
  color: var(--rarity-color);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.access-row.unlocked .access-badge {
  color: #10131b;
  background: var(--teal);
}

.race-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  min-height: 300px;
  padding: 14px;
  border: 1px solid rgba(246, 234, 208, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(32, 36, 50, 0.82), rgba(11, 13, 19, 0.72));
}

.selected-orc {
  display: grid;
  grid-template-rows: 138px auto auto minmax(44px, auto);
  justify-items: center;
  align-items: center;
  gap: 6px;
}

.selected-orc .hero-orc {
  scale: 0.72;
  margin: -20px 0 -34px;
}

.race-name {
  font-size: 30px;
  font-weight: 950;
}

.rarity-badge {
  min-width: 94px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #10131b;
  background: var(--rarity-color, var(--gold));
  font-size: 11px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.race-trait {
  min-height: 38px;
  max-width: 200px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(9, 11, 16, 0.42);
  border: 1px solid rgba(246, 234, 208, 0.1);
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
}

.team-status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.5);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.team-status span,
.team-status small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.team-status strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.team-status.locked {
  border-color: rgba(222, 55, 84, 0.28);
}

.team-status.unlocked {
  border-color: rgba(55, 240, 210, 0.28);
}

.stats-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(9, 11, 16, 0.48);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.stat-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(246, 234, 208, 0.12);
}

.bar i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.race-strip {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  min-height: 54px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.race-strip::-webkit-scrollbar {
  display: none;
}

.race-chip {
  min-width: 78px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(246, 234, 208, 0.08);
  border: 1px solid rgba(246, 234, 208, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.race-chip.active {
  color: #160d07;
  background: var(--gold);
}

.race-chip.unlocked {
  color: #10131b;
  background: var(--teal);
}

.race-chip.unlocked.active {
  background: var(--gold);
}

.race-chip.locked::after {
  content: " locked";
  color: rgba(246, 234, 208, 0.52);
  font-size: 10px;
}

.game-screen {
  position: relative;
  grid-template-rows: 60px minmax(0, 1fr) 82px;
  gap: 8px;
  padding: 14px;
  background: #090b10;
}

.game-screen.active {
  display: grid;
}

.hud {
  height: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hud div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px;
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.08);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.hud span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.hud strong {
  margin-top: 2px;
  font-size: 20px;
}

.hud .speed-up {
  animation: speedPulse 0.55s ease-out;
}

@keyframes speedPulse {
  0% {
    background: rgba(245, 184, 59, 0.42);
    box-shadow: 0 0 0 0 rgba(245, 184, 59, 0.34);
  }

  100% {
    background: rgba(246, 234, 208, 0.08);
    box-shadow: 0 0 0 14px rgba(245, 184, 59, 0);
  }
}

#gameCanvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 18px;
  background: #10131b;
  border: 1px solid rgba(246, 234, 208, 0.16);
  touch-action: none;
}

.dev-panel {
  position: absolute;
  right: 22px;
  top: 88px;
  z-index: 5;
  display: none;
}

.dev-panel.active {
  display: block;
}

.game-screen.active .dev-panel.active {
  display: block;
}

.dev-tools {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: 150px;
  margin-top: 5px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(9, 11, 16, 0.68);
  border: 1px solid rgba(55, 240, 210, 0.22);
  backdrop-filter: blur(10px);
}

.dev-panel.open .dev-tools {
  display: grid;
}

.dev-panel #devSmoke,
.dev-panel #devPreflight {
  grid-column: 1 / -1;
}

.dev-panel small {
  grid-column: 1 / -1;
  min-height: 14px;
  color: rgba(246, 234, 208, 0.72);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.dev-panel button {
  min-height: 30px;
  padding: 6px 7px;
  border-radius: 8px;
  background: rgba(55, 240, 210, 0.12);
  border: 1px solid rgba(55, 240, 210, 0.26);
  color: var(--paper);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.dev-toggle {
  width: 48px;
  min-width: 48px;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(9, 11, 16, 0.64);
  backdrop-filter: blur(10px);
}

.dev-panel button:active {
  transform: translateY(1px);
  background: rgba(245, 184, 59, 0.24);
}

.touch-zones {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 82px;
}

.pause-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(9, 11, 16, 0.72);
  border: 1px solid rgba(246, 234, 208, 0.18);
  color: rgba(246, 234, 208, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
  font-size: 12px;
  font-weight: 950;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
}

.pause-button:active {
  color: var(--accent);
  border-color: rgba(55, 240, 210, 0.42);
  background: rgba(55, 240, 210, 0.14);
  transform: translate(-50%, -50%) scale(0.94);
}

.touch-zones > button:not(.pause-button) {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  color: rgba(246, 234, 208, 0.86);
  font-size: 0;
  font-weight: 900;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.touch-zones > button:not(.pause-button)::before {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(246, 234, 208, 0.1);
  border: 1px solid rgba(246, 234, 208, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: scale(1);
  transition:
    transform 110ms ease,
    background 110ms ease,
    border-color 110ms ease,
    box-shadow 110ms ease;
}

.touch-zones > button:not(.pause-button)::after {
  position: relative;
  z-index: 1;
  font-size: 38px;
  line-height: 1;
}

#moveLeft::after {
  content: "<";
}

#moveRight::after {
  content: ">";
}

.touch-zones > button:not(.pause-button):active::before,
.touch-zones > button:not(.pause-button).pressed::before {
  background: rgba(55, 240, 210, 0.2);
  border-color: rgba(55, 240, 210, 0.48);
  box-shadow: 0 0 18px rgba(55, 240, 210, 0.18);
  transform: scale(0.9);
}

.touch-zones > button:not(.pause-button):active,
.touch-zones > button:not(.pause-button).pressed {
  color: #37f0d2;
}

.pause-overlay {
  position: absolute;
  inset: 14px;
  z-index: 8;
  display: none;
  place-items: center;
  border-radius: 22px;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(8px);
}

.pause-overlay.reduced-effects {
  backdrop-filter: none;
}

.pause-overlay.active {
  display: grid;
}

.pause-menu {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(290px, 86%);
  padding: 22px;
  border-radius: 20px;
  background: rgba(9, 11, 16, 0.92);
  border: 1px solid rgba(246, 234, 208, 0.16);
  text-align: center;
}

.pause-menu.hidden,
.settings-menu {
  display: none;
}

.settings-menu.active {
  display: grid;
}

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

.pause-menu .primary-button,
.pause-menu .secondary-button {
  min-height: 48px;
}

.window-confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.76);
  backdrop-filter: blur(10px);
}

.window-confirm-overlay.active {
  display: grid;
}

.window-confirm {
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid rgba(246, 234, 208, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 34, 46, 0.98), rgba(9, 11, 18, 0.98));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

.window-confirm h2 {
  margin: 0;
  font-size: 30px;
}

.window-confirm p,
.window-confirm small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.window-confirm .primary-button,
.window-confirm .secondary-button {
  min-height: 48px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(246, 234, 208, 0.08);
  border: 1px solid rgba(246, 234, 208, 0.12);
  text-align: left;
}

.settings-row strong {
  display: block;
  font-size: 14px;
}

.settings-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.toggle-button {
  min-width: 58px;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(246, 234, 208, 0.1);
  border: 1px solid rgba(246, 234, 208, 0.16);
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.toggle-button.active {
  background: linear-gradient(135deg, #37f0d2, #f7c95a);
  border-color: transparent;
  color: #10131b;
}

.danger-button {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(222, 55, 84, 0.12);
  border: 1px solid rgba(222, 55, 84, 0.26);
  color: #ff8b9d;
  font-size: 12px;
  font-weight: 950;
}

.danger-button.armed {
  background: rgba(222, 55, 84, 0.24);
  border-color: rgba(222, 55, 84, 0.58);
  color: #ffe6ea;
}

.version-panel {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 11, 16, 0.44);
  border: 1px solid rgba(246, 234, 208, 0.1);
  text-align: left;
}

.version-panel span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.version-panel strong {
  color: var(--accent);
  font-size: 16px;
}

.version-panel small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.over-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.result-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: rgba(9, 11, 16, 0.58);
  border: 1px solid rgba(246, 234, 208, 0.14);
}

.result-card span,
.result-card small {
  color: var(--muted);
  font-weight: 800;
}

.result-card strong {
  font-size: 58px;
  line-height: 1;
}

.result-card b {
  justify-self: center;
  min-width: 94px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #10131b;
  background: var(--rarity-color, var(--gold));
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.result-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.result-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 11, 16, 0.48);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.result-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-grid strong {
  font-size: 24px;
}

.breakdown-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.42);
  border: 1px solid rgba(246, 234, 208, 0.12);
}

.breakdown-panel > span {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  text-align: left;
  text-transform: uppercase;
}

.breakdown-panel div {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.breakdown-panel small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.breakdown-panel strong {
  color: var(--paper);
  font-size: 16px;
}

.submit-status {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

@media (max-height: 700px) {
  .phone-frame {
    min-height: 560px;
  }

  .start-screen {
    padding: 13px 20px 14px;
  }

  .start-screen .portal-glow {
    top: 104px;
    width: 198px;
    height: 198px;
    border-width: 10px;
  }

  .start-screen .top-bar {
    margin-bottom: 4px;
  }

  .start-screen .pill {
    padding: 7px 10px;
    font-size: 11px;
  }

  .hero-mark {
    flex: 0 0 auto;
    min-height: 96px;
  }

  .hero-orc {
    scale: 0.84;
  }

  .start-screen .hero-orc {
    scale: 0.52;
    margin: -48px 0 -48px;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 30px;
  }

  .start-screen .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .start-screen .title-block {
    margin-bottom: 14px;
  }

  .subtitle {
    width: min(260px, 100%);
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.22;
  }

  .start-screen .primary-button,
  .start-screen .secondary-button {
    min-height: 39px;
    border-radius: 11px;
    font-size: 13px;
  }

  .start-screen .secondary-button {
    margin-top: 6px;
  }

  .race-card {
    min-height: 270px;
  }

  .selected-orc {
    grid-template-rows: 108px auto auto minmax(42px, auto);
  }

  .selected-orc .hero-orc {
    scale: 0.58;
    margin: -36px 0 -46px;
  }

  .race-name {
    font-size: 27px;
  }

  .race-trait {
    max-width: 180px;
    padding: 6px 9px;
    font-size: 10px;
  }

  .stats-panel {
    padding: 12px;
  }

  .access-card {
    gap: 8px;
    padding: 13px;
  }

  .access-card h3 {
    font-size: 25px;
  }

  .access-card p {
    font-size: 12px;
    line-height: 1.3;
  }

  .access-wallet {
    padding: 9px;
  }

  .access-wallet .primary-button {
    min-width: 118px;
    min-height: 38px;
    padding: 0 10px;
  }

  .access-row {
    padding: 8px 10px;
  }
}
