:root {
  color-scheme: dark;
  --bg: #070711;
  --surface: rgba(18, 18, 38, 0.78);
  --surface-strong: #111125;
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --muted: #9ba3b7;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #34d399;
  --pink: #fb7185;
  --amber: #f59e0b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 15% -10%, rgba(139, 92, 246, 0.17), transparent 35rem),
    radial-gradient(circle at 90% 15%, rgba(34, 211, 238, 0.1), transparent 30rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 76%, white);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: white;
  color: #090914;
  translate: 0 -150%;
}

.skip-link:focus {
  translate: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.027) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ambient-orb {
  position: absolute;
  width: 24rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
}

.ambient-orb--violet {
  top: 18%;
  left: -12rem;
  background: var(--violet);
}

.ambient-orb--cyan {
  top: 55%;
  right: -14rem;
  background: var(--cyan);
}

.offline-banner {
  position: fixed;
  z-index: 80;
  top: 0;
  inset-inline: 0;
  padding: calc(8px + var(--safe-top)) 16px 8px;
  background: #f59e0b;
  color: #1f1300;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 max(18px, var(--safe-right)) calc(98px + var(--safe-bottom)) max(18px, var(--safe-left));
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(76px + var(--safe-top));
  padding-top: var(--safe-top);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(167, 139, 250, 0.55);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.34), rgba(34, 211, 238, 0.12));
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.2), inset 0 1px rgba(255, 255, 255, 0.18);
  font-size: 18px;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: -0.03em;
}

.brand-copy small {
  color: #777f96;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-actions,
.game-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #aeb6c8;
  font-size: 11px;
  font-weight: 700;
}

.connection-pill i,
.float-chip--offline i {
  width: 6px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.connection-pill.is-offline i {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.icon-button,
.avatar-button,
.game-header-button,
.modal-close {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

.avatar-button {
  --profile-color: var(--violet);
  overflow: hidden;
  border-color: color-mix(in srgb, var(--profile-color) 62%, transparent);
  background: color-mix(in srgb, var(--profile-color) 24%, #0b0b19);
  box-shadow: inset 0 0 0 3px rgba(7, 7, 17, 0.72), 0 0 18px color-mix(in srgb, var(--profile-color) 18%, transparent);
  font-weight: 900;
}

.view {
  padding-top: clamp(28px, 5vw, 66px);
}

.view.is-active {
  animation: view-in 0.35s ease both;
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 500px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 32px;
  background:
    radial-gradient(circle at 75% 34%, rgba(34, 211, 238, 0.11), transparent 30%),
    radial-gradient(circle at 25% 0%, rgba(139, 92, 246, 0.18), transparent 34%),
    linear-gradient(140deg, rgba(23, 20, 49, 0.92), rgba(8, 9, 22, 0.94));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.09);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  content: '';
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 74px);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #9b92c5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b9adf7;
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 8px var(--violet);
}

.hero-copy h1,
.page-heading h1 {
  max-width: 700px;
  margin: 18px 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.hero-copy h1 em {
  color: transparent;
  background: linear-gradient(90deg, #b69cff, #67e8f9 80%);
  background-clip: text;
  font-style: normal;
}

.hero-text,
.page-heading > p:last-child {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: translate 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.button:active:not(:disabled) {
  translate: 0 1px;
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

.button--primary {
  border-color: rgba(167, 139, 250, 0.52);
  background: linear-gradient(135deg, #7c3aed, #4f46e5 55%, #0891b2);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.25), inset 0 1px rgba(255, 255, 255, 0.28);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.025);
}

.button--compact {
  min-height: 42px;
  padding-inline: 16px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 30px 0 0;
  padding: 0;
  color: #878fa4;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
}

.hero-proof li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-proof span {
  color: #dbeafe;
  font-weight: 900;
}

.hero-visual {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 500px;
  place-items: center;
  perspective: 1200px;
}

.phone-art {
  position: relative;
  width: 232px;
  aspect-ratio: 0.52;
  overflow: hidden;
  border: 8px solid #17172a;
  border-radius: 40px;
  background: #090913;
  box-shadow: -34px 40px 90px rgba(0, 0, 0, 0.5), 0 0 60px rgba(34, 211, 238, 0.09), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  rotate: 4deg;
  transform: translateZ(0);
}

.phone-island {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 50%;
  width: 70px;
  height: 19px;
  border-radius: 20px;
  background: #020207;
  translate: -50% 0;
}

.phone-game {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 80%, rgba(34, 211, 238, 0.22), transparent 35%),
    linear-gradient(#101139, #08131e 58%, #07070f);
}

.phone-game::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px);
  background-size: 28px 32px;
  content: '';
  opacity: 0.35;
}

.ship-core {
  position: absolute;
  z-index: 2;
  bottom: 56px;
  left: 50%;
  color: #67e8f9;
  font-size: 44px;
  text-shadow: 0 0 22px #22d3ee;
  translate: -50% 0;
}

.shot {
  position: absolute;
  bottom: 112px;
  width: 2px;
  height: 42px;
  background: #ecfeff;
  box-shadow: 0 0 12px #22d3ee;
}

.shot--1 { left: 44%; }
.shot--2 { left: 50%; height: 64px; }
.shot--3 { left: 56%; }

.enemy {
  position: absolute;
  color: #fb7185;
  font-size: 26px;
  font-style: normal;
  text-shadow: 0 0 16px #fb7185;
}

.enemy--1 { top: 96px; left: 30px; }
.enemy--2 { top: 145px; right: 28px; color: #f59e0b; }
.enemy--3 { top: 220px; left: 87px; color: #a78bfa; }

.phone-score {
  position: absolute;
  top: 45px;
  left: 18px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(12, 12, 28, 0.8);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  font-size: 11px;
  font-weight: 800;
}

.float-chip--level {
  top: 80px;
  right: 5%;
  display: grid;
  grid-template-columns: auto auto;
}

.float-chip--level small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.float-chip--level b {
  grid-row: span 2;
  color: #c4b5fd;
  font-size: 22px;
}

.float-chip--offline {
  bottom: 70px;
  left: 3%;
  color: #bbf7d0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-block {
  margin-top: clamp(44px, 8vw, 84px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2,
.daily-card h2,
.level-card h2,
.settings-card h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: -0.045em;
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b7bfd1;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

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

.game-card {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20, 20, 43, 0.88), rgba(9, 9, 22, 0.93));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.065);
  transition: border-color 0.25s ease, translate 0.25s ease, box-shadow 0.25s ease;
}

.game-card:has(.game-card-main:hover) {
  border-color: color-mix(in srgb, var(--game-accent) 58%, transparent);
  box-shadow: 0 22px 60px color-mix(in srgb, var(--game-accent) 12%, transparent);
  translate: 0 -2px;
}

.game-card-main {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.game-poster {
  position: relative;
  display: grid;
  min-height: 190px;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--game-accent) 27%, transparent), transparent 24%),
    linear-gradient(145deg, color-mix(in srgb, var(--game-accent) 15%, #080814), #090916 70%);
}

.game-poster::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 70%, rgba(7, 7, 17, 0.68));
  content: '';
}

.poster-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: linear-gradient(color-mix(in srgb, var(--game-accent) 20%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--game-accent) 20%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  transform: perspective(220px) rotateX(62deg) scale(1.4) translateY(46px);
}

.poster-orbit {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--game-accent) 34%, transparent);
  border-radius: 50%;
}

.poster-orbit--one { width: 126px; aspect-ratio: 1; }
.poster-orbit--two { width: 178px; aspect-ratio: 1; opacity: 0.45; }

.game-poster strong {
  position: relative;
  z-index: 2;
  color: #effcff;
  font-size: 56px;
  line-height: 1;
  text-shadow: 0 0 26px var(--game-accent), 0 0 60px var(--game-accent-2);
}

.game-poster small {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 12px;
  color: #bbc3d3;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.game-card-copy {
  display: grid;
  gap: 9px;
  padding: 17px 18px 16px;
}

.game-card-copy > strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.game-card-copy > span:not(.game-card-meta, .game-card-stats) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-card-meta,
.game-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-card-meta i {
  color: color-mix(in srgb, var(--game-accent) 80%, white);
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.game-card-meta b,
.game-card-stats b {
  color: #7f879b;
  font-size: 9px;
  font-weight: 750;
}

.game-card-stats {
  margin-top: 3px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.game-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 12px;
}

.game-card-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.game-card-actions button:first-child {
  min-width: 38px;
  padding: 0;
  color: var(--game-accent);
  font-size: 20px;
}

.game-card-actions button:disabled {
  color: #6ee7b7;
  opacity: 0.75;
}

.progress-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 16px;
}

.daily-card,
.level-card {
  display: grid;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.daily-card {
  grid-template-columns: auto 1fr minmax(130px, 0.55fr) auto;
  padding: 24px;
}

.daily-icon {
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(167, 139, 250, 0.38);
  border-radius: 18px;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.14);
  font-size: 22px;
}

.daily-copy h2 {
  font-size: 18px;
}

.daily-copy > p:last-child,
.level-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.daily-progress > span {
  display: block;
  margin-bottom: 8px;
  color: #bcc4d6;
  font-size: 10px;
  font-weight: 850;
  text-align: right;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.38);
  transition: width 0.35s ease;
}

.level-card {
  grid-template-columns: auto 1fr auto;
  padding: 22px;
}

.level-ring {
  --progress: 0deg;
  display: grid;
  width: 68px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--progress), rgba(255, 255, 255, 0.08) 0);
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.1);
}

.level-ring::before {
  grid-area: 1 / 1;
  width: 52px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #101024;
  content: '';
}

.level-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  font-size: 20px;
  font-weight: 900;
}

.level-card h2 {
  font-size: 18px;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fde68a;
  font-size: 12px;
}

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

.feature-grid article {
  min-height: 190px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: rgba(13, 13, 30, 0.68);
}

.feature-grid article > span {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  font-size: 20px;
}

.feature-grid h3 {
  margin: 22px 0 8px;
  font-size: 16px;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.page-heading {
  padding: 12px 0 28px;
}

.page-heading h1 {
  margin-top: 14px;
  font-size: clamp(38px, 6vw, 64px);
}

.catalog-tools {
  position: sticky;
  z-index: 10;
  top: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(9, 9, 21, 0.82);
  backdrop-filter: blur(22px);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: #7c859b;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-field input::placeholder {
  color: #687086;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 38px;
  flex: none;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #8891a5;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.14);
  color: #ddd6fe;
}

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

.game-grid .game-card-main {
  grid-template-columns: minmax(180px, 0.68fr) 1fr;
}

.game-grid .game-poster {
  min-height: 255px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.game-grid .game-card-copy {
  align-content: center;
  padding: 24px;
}

.empty-state {
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(30, 25, 61, 0.85), rgba(10, 10, 24, 0.9));
}

.profile-avatar-large {
  --profile-color: var(--violet);
  display: grid;
  width: 84px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--profile-color) 65%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--profile-color) 25%, #080813);
  box-shadow: inset 0 0 0 5px rgba(7, 7, 17, 0.65), 0 0 35px color-mix(in srgb, var(--profile-color) 16%, transparent);
  font-size: 30px;
  font-weight: 900;
}

.profile-hero h1 {
  margin: 4px 0;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.05em;
}

.profile-hero p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stats-grid article {
  display: grid;
  min-height: 130px;
  align-content: center;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.stats-grid span {
  color: #8b9bb8;
  font-size: 16px;
}

.stats-grid b {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.stats-grid small {
  color: var(--muted);
  font-size: 10px;
}

.profile-section {
  margin-top: 42px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.achievement {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  opacity: 0.48;
}

.achievement > span {
  display: grid;
  width: 45px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 19px;
}

.achievement div {
  display: grid;
  gap: 4px;
}

.achievement b {
  font-size: 12px;
}

.achievement small {
  color: var(--muted);
  font-size: 10px;
}

.achievement > i {
  color: #8991a5;
  font-style: normal;
  font-weight: 900;
}

.achievement.is-unlocked {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.055);
  opacity: 1;
}

.achievement.is-unlocked > span {
  background: rgba(52, 211, 153, 0.11);
  color: #6ee7b7;
}

.achievement.is-unlocked > i {
  color: #6ee7b7;
}

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

.installed-list > button {
  display: grid;
  min-height: 70px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.installed-list > button span {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--game-accent) 16%, transparent);
  color: color-mix(in srgb, var(--game-accent) 70%, white);
  font-size: 20px;
}

.installed-list > button b,
.installed-list > button small {
  grid-column: 2;
}

.installed-list > button b {
  align-self: end;
  font-size: 12px;
}

.installed-list > button small {
  align-self: start;
  color: #6ee7b7;
  font-size: 9px;
}

.installed-list > button i {
  grid-row: 1 / 3;
  grid-column: 3;
  color: #7d869b;
  font-style: normal;
}

.installed-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: #737c92;
}

.installed-empty > span {
  font-size: 26px;
}

.installed-empty p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.installed-empty b {
  color: #adb5c8;
  font-size: 12px;
}

.installed-empty small {
  font-size: 10px;
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.setting-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.setting-row > span {
  display: grid;
  gap: 4px;
}

.setting-row b {
  font-size: 12px;
}

.setting-row small {
  color: var(--muted);
  font-size: 10px;
}

.setting-row input {
  width: 46px;
  height: 26px;
  accent-color: var(--violet);
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: max(10px, var(--safe-bottom));
  left: 50%;
  display: flex;
  width: min(330px, calc(100% - 28px));
  min-height: 64px;
  align-items: center;
  justify-content: space-around;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(11, 11, 25, 0.84);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(1.35);
  translate: -50% 0;
}

.nav-item {
  position: relative;
  display: grid;
  min-width: 76px;
  min-height: 49px;
  place-items: center;
  gap: 1px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #70798f;
  cursor: pointer;
}

.nav-item span {
  font-size: 18px;
}

.nav-item small {
  font-size: 8px;
  font-weight: 850;
}

.nav-item.is-active {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.17), rgba(34, 211, 238, 0.06));
  color: #e9e5ff;
}

.nav-item.is-active::before {
  position: absolute;
  top: -7px;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
  content: '';
}

.game-is-open {
  overflow: hidden;
}

.game-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #05050c;
  color: var(--text);
}

.game-dialog::backdrop {
  background: #05050c;
}

.game-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  flex-direction: column;
  align-items: center;
  padding-top: var(--safe-top);
  background:
    radial-gradient(circle at 50% 10%, color-mix(in srgb, var(--game-accent) 16%, transparent), transparent 38%),
    #05050c;
}

.game-shell:fullscreen {
  background: #05050c;
}

.game-header {
  z-index: 10;
  display: grid;
  width: min(100%, 540px);
  min-height: 58px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px max(10px, var(--safe-right)) 7px max(10px, var(--safe-left));
  background: rgba(5, 5, 12, 0.82);
}

.game-header > div:nth-child(2) {
  min-width: 0;
}

.game-header small {
  display: block;
  color: color-mix(in srgb, var(--game-accent) 72%, white);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.game-header h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-header-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  font-size: 16px;
}

.game-viewport {
  position: relative;
  width: min(100vw, calc((100dvh - 58px - var(--safe-top)) * 0.562));
  aspect-ratio: 390 / 694;
  overflow: hidden;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  background: #070711;
  box-shadow: 0 0 70px color-mix(in srgb, var(--game-accent) 11%, transparent);
  touch-action: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-hud {
  position: absolute;
  z-index: 3;
  top: 12px;
  inset-inline: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  pointer-events: none;
}

.game-hud > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  background: rgba(5, 5, 14, 0.62);
  backdrop-filter: blur(8px);
}

.game-hud > span:nth-child(2) {
  text-align: center;
}

.game-hud > span:last-child {
  text-align: right;
}

.game-hud small {
  overflow: hidden;
  color: #8e98ae;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-hud b {
  overflow: hidden;
  color: #f8fafc;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.touch-controls {
  position: absolute;
  z-index: 5;
  inset-inline: 0;
  bottom: max(10px, var(--safe-bottom));
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.touch-control {
  display: grid;
  width: clamp(52px, 15vw, 66px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 8, 20, 0.56);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.13), 0 9px 30px rgba(0, 0, 0, 0.26);
  color: #e2e8f0;
  backdrop-filter: blur(10px);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.touch-control span {
  grid-area: 1 / 1;
  font-size: 25px;
  font-weight: 700;
}

.touch-control small {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
}

.touch-control--primary {
  width: clamp(62px, 18vw, 76px);
  border-color: color-mix(in srgb, var(--game-accent) 62%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--game-accent) 58%, #17172b), color-mix(in srgb, var(--game-accent-2) 30%, #0a0a18));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25), 0 0 28px color-mix(in srgb, var(--game-accent) 24%, transparent);
}

.touch-control:active {
  scale: 0.93;
  background-color: color-mix(in srgb, var(--game-accent) 24%, #080814);
}

.touch-controls--1 {
  justify-content: flex-end;
}

.touch-controls--5 {
  height: 125px;
  display: block;
}

.touch-controls--5 .touch-control {
  position: absolute;
  width: 48px;
}

.touch-controls--5 .touch-control:nth-child(1) { bottom: 30px; left: 12px; }
.touch-controls--5 .touch-control:nth-child(2) { bottom: 62px; left: 62px; }
.touch-controls--5 .touch-control:nth-child(3) { bottom: 0; left: 62px; }
.touch-controls--5 .touch-control:nth-child(4) { bottom: 30px; left: 112px; }
.touch-controls--5 .touch-control:nth-child(5) { right: 16px; bottom: 24px; width: 70px; }

.game-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 30px max(28px, var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 27%, color-mix(in srgb, var(--game-accent) 21%, transparent), transparent 29%),
    linear-gradient(rgba(6, 6, 15, 0.88), rgba(6, 6, 15, 0.97));
  text-align: center;
  overscroll-behavior: contain;
}

.game-intro-icon {
  display: grid;
  width: 84px;
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 55%, transparent);
  border-radius: 28px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--game-accent) 22%, #0b0b18), color-mix(in srgb, var(--game-accent-2) 10%, #080813));
  box-shadow: 0 0 45px color-mix(in srgb, var(--game-accent) 20%, transparent), inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: 38px;
  text-shadow: 0 0 20px var(--game-accent);
}

.game-intro-badge {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--game-accent) 76%, white);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.game-overlay h3 {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.game-overlay > p:not(.game-intro-badge) {
  max-width: 320px;
  margin: 13px 0 0;
  color: #9ca5b9;
  font-size: 12px;
  line-height: 1.6;
}

.game-feature-list {
  display: grid;
  width: min(100%, 290px);
  gap: 7px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.game-feature-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c5ccda;
  font-size: 11px;
}

.game-feature-list span {
  display: grid;
  width: 20px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--game-accent) 14%, transparent);
  color: color-mix(in srgb, var(--game-accent) 70%, white);
  font-size: 9px;
}

.button--game {
  width: min(100%, 280px);
  margin-top: 9px;
}

.compact-overlay {
  background: rgba(5, 5, 13, 0.88);
  backdrop-filter: blur(18px);
}

.result-score {
  display: grid;
  gap: 5px;
  margin: 25px 0 12px;
}

.result-score small {
  color: #8992a8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-score strong {
  color: transparent;
  background: linear-gradient(90deg, var(--game-accent), var(--game-accent-2));
  background-clip: text;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.reward-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.reward-row span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 850;
}

.modal {
  width: min(92vw, 440px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #111123;
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.65);
}

.modal::backdrop {
  background: rgba(3, 3, 9, 0.75);
  backdrop-filter: blur(8px);
}

.modal-card {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 24px;
}

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

.modal-heading h2 {
  margin: 6px 0 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.modal-close {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 23px;
}

.field {
  display: grid;
  gap: 8px;
  color: #aab2c4;
  font-size: 11px;
  font-weight: 800;
}

.field input {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.field input:user-invalid {
  border-color: rgba(251, 113, 133, 0.65);
}

.color-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.color-picker legend {
  margin-bottom: 10px;
  color: #aab2c4;
  font-size: 11px;
  font-weight: 800;
}

.color-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-picker button {
  width: 44px;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 4px #111123;
  cursor: pointer;
}

.color-picker button[aria-pressed='true'] {
  border-color: white;
  box-shadow: inset 0 0 0 4px #111123, 0 0 18px var(--swatch);
}

.install-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  color: #aeb6c8;
  font-size: 12px;
  line-height: 1.55;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  top: calc(14px + var(--safe-top));
  right: max(14px, var(--safe-right));
  display: grid;
  width: min(360px, calc(100% - 28px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(17, 17, 35, 0.95);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  color: #dce2ef;
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
  translate: 0 -10px;
  transition: opacity 0.22s ease, translate 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  translate: 0;
}

.toast--success {
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
}

.toast--error {
  border-color: rgba(251, 113, 133, 0.38);
  color: #fecdd3;
}

@container (max-width: 310px) {
  .game-card-copy > span:not(.game-card-meta, .game-card-stats) {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .progress-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-grid .game-card-main {
    grid-template-columns: 210px 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding-inline: max(12px, var(--safe-left)) max(12px, var(--safe-right));
  }

  .topbar {
    min-height: calc(66px + var(--safe-top));
  }

  .connection-pill,
  .wide-label {
    display: none;
  }

  .icon-button {
    min-width: 42px;
    justify-content: center;
    padding: 0;
  }

  .view {
    padding-top: 22px;
  }

  .hero-card {
    min-height: auto;
    border-radius: 26px;
  }

  .hero-copy {
    padding: 32px 24px 30px;
  }

  .hero-copy h1 {
    font-size: clamp(39px, 12vw, 56px);
  }

  .hero-visual {
    min-height: 390px;
  }

  .phone-art {
    width: 198px;
  }

  .float-chip--level {
    top: 55px;
    right: 2%;
  }

  .float-chip--offline {
    bottom: 52px;
    left: 1%;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  .quick-games {
    display: flex;
    margin-inline: -12px;
    padding-inline: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .quick-games::-webkit-scrollbar {
    display: none;
  }

  .quick-games .game-card {
    width: min(82vw, 330px);
    flex: none;
    scroll-snap-align: start;
  }

  .progress-grid {
    gap: 12px;
  }

  .daily-card {
    grid-template-columns: auto 1fr auto;
    padding: 18px;
  }

  .daily-progress {
    grid-column: 1 / -1;
    order: 4;
  }

  .daily-copy h2 {
    font-size: 16px;
  }

  .daily-copy > p:last-child {
    font-size: 10px;
  }

  .daily-card .button {
    padding-inline: 12px;
  }

  .feature-grid,
  .stats-grid,
  .achievement-grid,
  .installed-list {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid article {
    min-height: 170px;
    padding: 20px;
  }

  .feature-grid article:last-child {
    grid-column: 1 / -1;
  }

  .game-grid .game-card-main {
    grid-template-columns: 1fr;
  }

  .game-grid .game-poster {
    min-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-grid .game-card-copy {
    padding: 18px;
  }

  .profile-hero {
    grid-template-columns: auto 1fr;
    padding: 20px;
  }

  .profile-hero .button {
    grid-column: 1 / -1;
  }

  .profile-avatar-large {
    width: 68px;
    border-radius: 22px;
  }

  .stats-grid article {
    min-height: 112px;
  }

  .achievement {
    grid-template-columns: auto 1fr;
  }

  .achievement > i {
    display: none;
  }
}

@media (max-width: 430px) {
  .feature-grid,
  .achievement-grid,
  .installed-list {
    grid-template-columns: 1fr;
  }

  .feature-grid article:last-child {
    grid-column: auto;
  }

  .stats-grid {
    gap: 8px;
  }

  .stats-grid article {
    min-height: 102px;
    padding: 14px;
  }

  .stats-grid b {
    font-size: 19px;
  }

  .game-header-actions {
    gap: 4px;
  }

  .game-header-button {
    min-width: 37px;
    min-height: 37px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled),
  .icon-button:hover,
  .game-header-button:hover,
  .modal-close:hover {
    border-color: rgba(255, 255, 255, 0.27);
    background-color: rgba(255, 255, 255, 0.09);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .phone-art {
    animation: phone-float 5s ease-in-out infinite;
  }

  .enemy--1 { animation: enemy-drift 2.8s ease-in-out infinite alternate; }
  .enemy--2 { animation: enemy-drift 3.4s ease-in-out -1s infinite alternate; }
  .enemy--3 { animation: enemy-drift 2.5s ease-in-out -0.4s infinite alternate; }
  .shot { animation: shot-run 1.25s linear infinite; }
}

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

@keyframes view-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0; }
}

@keyframes phone-float {
  0%, 100% { translate: 0 0; rotate: 4deg; }
  50% { translate: 0 -9px; rotate: 2deg; }
}

@keyframes enemy-drift {
  from { translate: -8px 0; }
  to { translate: 10px 15px; }
}

@keyframes shot-run {
  from { translate: 0 28px; opacity: 0; }
  30% { opacity: 1; }
  to { translate: 0 -130px; opacity: 0; }
}

