:root {
  --bg: #090b16;
  --bg-deep: #050610;
  --surface: rgba(19, 22, 41, 0.82);
  --surface-solid: #131629;
  --surface-raised: #1a1e36;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f8ff;
  --text-soft: #aeb4ce;
  --text-faint: #777f9f;
  --primary: #8f68ff;
  --primary-2: #5c7cff;
  --cyan: #39dff2;
  --pink: #ff5fcf;
  --green: #5de5a6;
  --yellow: #ffd166;
  --danger: #ff647c;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 45px rgba(0, 0, 0, 0.22);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --shell: 1220px;
  --topbar-height: 82px;
  --transition: 180ms ease;
}

html[data-theme="light"] {
  --bg: #f2f4fb;
  --bg-deep: #e8ebf5;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-raised: #f8f9fd;
  --surface-soft: rgba(12, 15, 35, 0.045);
  --line: rgba(16, 20, 44, 0.1);
  --line-strong: rgba(16, 20, 44, 0.18);
  --text: #14172b;
  --text-soft: #5d637e;
  --text-faint: #7c829a;
  --shadow: 0 24px 70px rgba(47, 53, 85, 0.14);
  --shadow-soft: 0 14px 35px rgba(47, 53, 85, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 48% -15%, rgba(119, 82, 255, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-game-open {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 72%, transparent);
  outline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

#twitchProfileStatus,
#twitchConnectionStatus {
  padding: 12px 14px;
  color: var(--text);
  background: rgba(136, 94, 255, .13);
  border: 1px solid rgba(159, 128, 255, .45);
  border-radius: 12px;
  font-size: .8rem;
  line-height: 1.55;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.16;
  pointer-events: none;
}

.page-glow--one {
  top: 14%;
  left: -240px;
  background: var(--primary);
}

.page-glow--two {
  right: -260px;
  bottom: 4%;
  background: var(--cyan);
}

.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(22px) saturate(140%);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand__mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  width: 34px;
  height: 34px;
  align-content: center;
  justify-content: center;
  border: 1px solid rgba(143, 104, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(143, 104, 255, 0.2), rgba(57, 223, 242, 0.09));
  box-shadow: inset 0 0 18px rgba(143, 104, 255, 0.16), 0 0 22px rgba(143, 104, 255, 0.18);
}

.brand__mark span {
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(143, 104, 255, 0.6);
}

.brand__mark span:nth-child(2),
.brand__mark span:nth-child(3) {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(57, 223, 242, 0.5);
}

.brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__copy strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand__copy small {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.nav-link {
  text-decoration: none;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--surface-raised);
  color: var(--text);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-soft);
  cursor: pointer;
  transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
}

.icon-button:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.profile-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.profile-button__avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(113, 82, 255, 0.28);
}

.profile-button__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.profile-button__copy small {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-button__copy strong {
  max-width: 86px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  display: grid;
  min-height: 575px;
  grid-template-columns: minmax(0, 1.02fr) minmax(430px, 0.98fr);
  align-items: center;
  gap: 60px;
  padding-block: 72px 58px;
}

.hero__copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow > span:empty {
  flex: 0 0 22px;
  width: 22px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  box-shadow: 0 0 12px rgba(143, 104, 255, 0.55);
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(55px, 6.5vw, 94px);
  letter-spacing: -0.065em;
  line-height: 0.88;
  text-transform: uppercase;
}

.hero h1 em {
  display: inline-block;
  background: linear-gradient(100deg, #ae8cff 0%, #6b8cff 46%, #52e5ed 100%);
  background-clip: text;
  color: transparent;
  font-style: normal;
  text-shadow: 0 0 50px rgba(108, 127, 255, 0.16);
}

.hero__lead {
  max-width: 570px;
  margin: 28px 0 0;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), filter var(--transition);
}

.primary-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 14px 34px rgba(100, 78, 255, 0.32), inset 0 1px rgba(255, 255, 255, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  filter: brightness(1.08);
  box-shadow: 0 18px 40px rgba(100, 78, 255, 0.4), inset 0 1px rgba(255, 255, 255, 0.18);
}

.secondary-button {
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line-strong));
  background: var(--surface-raised);
}

.danger-button {
  border: 1px solid rgba(255, 100, 124, 0.42);
  background: rgba(255, 100, 124, 0.13);
  color: #ff8fa2;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 27px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}

.hero__visual {
  position: relative;
  display: grid;
  min-height: 440px;
  place-items: center;
  perspective: 1000px;
}

.hero__visual::before {
  position: absolute;
  width: 85%;
  height: 85%;
  border: 1px solid rgba(143, 104, 255, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 104, 255, 0.18), transparent 63%);
  content: "";
  filter: blur(2px);
  animation: visualPulse 5s ease-in-out infinite;
}

.arcade-machine {
  position: relative;
  z-index: 1;
  width: 300px;
  padding: 13px 16px 23px;
  transform: rotateY(-9deg) rotateX(2deg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px 26px 34px 34px;
  background: linear-gradient(145deg, #272b4b, #101326 72%);
  box-shadow:
    30px 40px 80px rgba(0, 0, 0, 0.45),
    inset 1px 1px rgba(255, 255, 255, 0.12),
    inset -8px -12px 25px rgba(0, 0, 0, 0.25);
}

.arcade-machine::after {
  position: absolute;
  right: 18px;
  bottom: -27px;
  left: 18px;
  height: 33px;
  border-radius: 0 0 16px 16px;
  background: #0b0d1b;
  content: "";
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.34);
}

.arcade-machine__top {
  position: relative;
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(135deg, var(--primary), #5f53d8);
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.12), 0 0 26px rgba(143, 104, 255, 0.27);
}

.arcade-machine__top > span {
  z-index: 2;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 19px;
  letter-spacing: 0.08em;
  color: white;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.marquee-dots {
  position: absolute;
  inset: 0;
  opacity: 0.21;
  background-image: radial-gradient(circle, white 1px, transparent 1.5px);
  background-size: 8px 8px;
}

.arcade-machine__screen {
  position: relative;
  display: flex;
  height: 247px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 14px 5px 0;
  overflow: hidden;
  border: 9px solid #080a14;
  border-radius: 17px 17px 35px 35px;
  background:
    radial-gradient(circle at 50% 45%, rgba(47, 240, 225, 0.13), transparent 36%),
    #050812;
  box-shadow: inset 0 0 45px rgba(18, 233, 228, 0.06);
}

.scanlines {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.035) 3px 4px);
}

.screen-score {
  position: absolute;
  top: 18px;
  left: 21px;
  color: var(--pink);
  font-family: monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.screen-cta {
  margin-top: 28px;
  color: var(--cyan);
  font-family: monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  animation: blink 1.15s steps(1) infinite;
}

.pixel-alien {
  display: grid;
  width: 105px;
  height: 105px;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 3px;
  filter: drop-shadow(0 0 17px rgba(143, 104, 255, 0.58));
  animation: alienFloat 2.3s ease-in-out infinite;
}

.pixel-alien span {
  background: transparent;
}

.pixel-alien span:nth-child(2),
.pixel-alien span:nth-child(4),
.pixel-alien span:nth-child(6),
.pixel-alien span:nth-child(7),
.pixel-alien span:nth-child(8),
.pixel-alien span:nth-child(9),
.pixel-alien span:nth-child(10),
.pixel-alien span:nth-child(11),
.pixel-alien span:nth-child(13),
.pixel-alien span:nth-child(15),
.pixel-alien span:nth-child(16),
.pixel-alien span:nth-child(17),
.pixel-alien span:nth-child(18),
.pixel-alien span:nth-child(19),
.pixel-alien span:nth-child(20),
.pixel-alien span:nth-child(21),
.pixel-alien span:nth-child(23),
.pixel-alien span:nth-child(25) {
  border-radius: 2px;
  background: linear-gradient(135deg, #b895ff, var(--primary));
}

.pixel-alien span:nth-child(7),
.pixel-alien span:nth-child(9) {
  background: #050812;
  box-shadow: inset 0 0 0 3px var(--cyan);
}

.arcade-machine__controls {
  position: relative;
  display: flex;
  height: 86px;
  align-items: center;
  justify-content: space-around;
  margin: -9px -5px 0;
  padding-top: 10px;
  transform: perspective(160px) rotateX(16deg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px 8px 20px 20px;
  background: linear-gradient(180deg, #252943, #161a2e);
}

.joystick {
  position: relative;
  width: 58px;
  height: 22px;
  border-radius: 50%;
  background: #0b0e1c;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.4);
}

.joystick::before {
  position: absolute;
  top: -31px;
  left: 27px;
  width: 8px;
  height: 38px;
  border-radius: 4px;
  background: #323850;
  content: "";
}

.joystick span {
  position: absolute;
  z-index: 2;
  top: -43px;
  left: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff6689, #b52c54);
  box-shadow: inset 4px 4px 8px rgba(255, 255, 255, 0.18), 0 8px 15px rgba(0, 0, 0, 0.33);
}

.arcade-buttons {
  display: flex;
  gap: 17px;
}

.arcade-buttons span {
  width: 32px;
  height: 25px;
  border: 4px solid #0b0e1c;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 5px 0 #176b79, 0 9px 14px rgba(0, 0, 0, 0.28);
}

.arcade-buttons span:last-child {
  background: var(--pink);
  box-shadow: 0 5px 0 #832e6e, 0 9px 14px rgba(0, 0, 0, 0.28);
}

.float-card {
  position: absolute;
  z-index: 3;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: rgba(20, 23, 44, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .float-card {
  background: rgba(255, 255, 255, 0.84);
}

.float-card--score {
  top: 36px;
  right: -8px;
  flex-direction: column;
  padding: 13px 17px;
  transform: rotate(3deg);
}

.float-card--score small,
.float-card--streak small {
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.float-card--score strong {
  color: var(--green);
  font-family: monospace;
  font-size: 19px;
}

.float-card--streak {
  bottom: 18px;
  left: 5px;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  transform: rotate(-3deg);
}

.float-card--streak > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 209, 102, 0.13);
}

.float-card--streak div {
  display: flex;
  flex-direction: column;
}

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

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.76fr)) minmax(310px, 1.45fr);
  gap: 12px;
  margin-bottom: 110px;
}

.stat-card {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.stat-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 18px;
}

.stat-card > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.stat-card span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
}

.stat-card--daily {
  position: relative;
  overflow: hidden;
  border-color: rgba(143, 104, 255, 0.25);
  background:
    linear-gradient(110deg, rgba(143, 104, 255, 0.16), rgba(57, 223, 242, 0.045)),
    var(--surface);
}

.stat-card--daily::after {
  position: absolute;
  top: -30px;
  right: 45px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(143, 104, 255, 0.12);
  content: "";
  filter: blur(20px);
}

.stat-card--daily button {
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  margin-left: auto;
  place-items: center;
  border: 1px solid rgba(143, 104, 255, 0.35);
  border-radius: 11px;
  background: rgba(143, 104, 255, 0.14);
  color: #b9a4ff;
  cursor: pointer;
}

.games-section {
  margin-bottom: 110px;
}

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

.section-heading h2,
.panel__heading h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(26px, 3vw, 39px);
  letter-spacing: -0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.section-heading > p {
  max-width: 330px;
  margin: 0;
  color: var(--text-faint);
  font-size: 12px;
  text-align: right;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.search-box {
  display: flex;
  width: 250px;
  height: 43px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text-faint);
}

.search-box:focus-within {
  border-color: rgba(143, 104, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(143, 104, 255, 0.08);
}

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

.search-box input::placeholder {
  color: var(--text-faint);
}

.category-tabs {
  display: flex;
  max-width: 100%;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.category-tab:hover,
.category-tab.is-active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

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

.game-card {
  --game-accent: var(--primary);
  position: relative;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  backdrop-filter: blur(14px);
}

.game-card:hover {
  transform: translateY(-7px);
  border-color: color-mix(in srgb, var(--game-accent) 40%, var(--line-strong));
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.28);
}

.game-card__art {
  position: relative;
  display: grid;
  height: 172px;
  flex: 0 0 172px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--game-accent) 24%, transparent), transparent 46%),
    linear-gradient(145deg, color-mix(in srgb, var(--game-accent) 12%, var(--surface-solid)), var(--surface-solid));
}

.game-card__art::before {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(color-mix(in srgb, var(--game-accent) 22%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--game-accent) 22%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  content: "";
  mask-image: linear-gradient(transparent, black 50%, transparent);
}

.game-card__icon {
  position: relative;
  z-index: 2;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  transform: rotate(-3deg);
  border: 1px solid color-mix(in srgb, var(--game-accent) 40%, white 12%);
  border-radius: 28px;
  background: color-mix(in srgb, var(--game-accent) 16%, rgba(10, 12, 24, 0.72));
  font-size: 48px;
  box-shadow: 0 20px 50px color-mix(in srgb, var(--game-accent) 20%, transparent), inset 0 0 25px rgba(255, 255, 255, 0.04);
  transition: transform 220ms ease;
}

.game-card:hover .game-card__icon {
  transform: rotate(2deg) scale(1.07);
}

.game-card[data-game-id="crowd-gates"] .game-card__icon,
.game-card[data-game-id="pin-rescue"] .game-card__icon,
.game-card[data-game-id="draw-shield"] .game-card__icon,
.game-card[data-game-id="neon-siege"] .game-card__icon {
  display: none;
}

.ad-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.game-card[data-game-id="crowd-gates"] .game-card__art {
  background: radial-gradient(circle at 52% 10%, #fff8bb, transparent 37%), linear-gradient(#8ee9ef 0 62%, #4aa6ae);
}

.ad-preview--crowd .ad-preview__road {
  position: absolute;
  inset: 10px 12% 0;
  clip-path: polygon(42% 0, 58% 0, 96% 100%, 4% 100%);
  background: repeating-linear-gradient(180deg, #dde8e9 0 22px, #c8d8de 23px 25px);
  box-shadow: inset 0 0 0 4px white;
}

.ad-preview__gate {
  position: absolute;
  top: 31%;
  display: grid;
  width: 18%;
  height: 38px;
  place-items: center;
  border: 2px solid #d7fff5;
  border-radius: 5px;
  background: #1aaf97d9;
  color: white;
  font-size: 18px;
  text-shadow: 0 2px 3px #126a69;
  box-shadow: 0 5px 14px #15616b69;
}

.ad-preview__gate--left { left: 31%; }
.ad-preview__gate--right { right: 31%; background: #e87895dd; }
.ad-preview__crowd {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #128f92;
  font-size: 21px;
  line-height: .7;
  letter-spacing: -4px;
  text-shadow: 0 -3px #f6d9a9, 0 3px 7px #225b6e88;
  white-space: nowrap;
}

.game-card[data-game-id="pin-rescue"] .game-card__art {
  background: radial-gradient(circle at 50% 35%, #ba92d7, transparent 52%), linear-gradient(145deg, #4d375f, #32284e);
}

.ad-preview__shaft {
  position: absolute;
  inset: -12px 30% -10px;
  border: 8px solid #9472a6;
  border-radius: 25px;
  background: linear-gradient(90deg, #281b42, #4f3a6a 50%, #271b42);
  box-shadow: 0 0 25px #1c1633aa, inset 0 0 18px #16122c;
}

.ad-preview__coin,
.ad-preview__hero {
  position: absolute;
  left: 50%;
  display: grid;
  width: 29px;
  height: 29px;
  transform: translateX(-50%);
  place-items: center;
  border: 3px solid #ffe7a4;
  border-radius: 50%;
  background: #d99542;
  color: #fff3be;
  font-size: 16px;
  box-shadow: 0 0 17px #ffda6eaa;
}

.ad-preview__coin { top: 25px; }
.ad-preview__hero { bottom: 17px; border-color: #8ef3dd; background: #317b8d; color: #ffe0bc; }
.ad-preview__pin {
  position: absolute;
  left: 22%;
  width: 56%;
  height: 8px;
  border: 1px solid #fff2cb;
  border-radius: 12px;
  background: linear-gradient(#fff1c7, #d99a5a);
  box-shadow: 0 0 12px #ffda9a;
}

.ad-preview__pin--top { top: 67px; }
.ad-preview__pin--bottom { bottom: 56px; }
.ad-preview__lava {
  position: absolute;
  right: 6%;
  bottom: 4px;
  width: 16%;
  height: 31px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(#ffe48c, #fa806c);
  filter: drop-shadow(0 0 8px #ff927b);
}

.game-card[data-game-id="draw-shield"] .game-card__art {
  background: radial-gradient(circle at 70% 22%, #fbe6a3 0 11%, transparent 12%), linear-gradient(#2b7181, #236d76 70%, #367c66 71%);
}

.ad-preview__barrier {
  position: absolute;
  top: 19px;
  left: 50%;
  width: 108px;
  height: 108px;
  transform: translateX(-50%) rotate(-10deg);
  border: 9px solid #9effe8;
  border-top-color: #ffd4a0;
  border-right-color: #ffd4a0;
  border-radius: 44% 56% 46% 54%;
  box-shadow: 0 0 0 3px #ecfff7b7, 0 0 25px #a5ffe8;
}

.ad-preview__shield-hero {
  position: absolute;
  top: 61px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe2bb;
  font-size: 39px;
  text-shadow: 0 8px #2d7185, 0 10px 9px #103a4e;
}

.ad-preview__bee,
.ad-preview__rock {
  position: absolute;
  z-index: 1;
  color: #ffe28d;
  font-size: 32px;
  text-shadow: 0 0 10px #ffe99c;
}

.ad-preview__bee { top: 47px; left: 12%; }
.ad-preview__rock { top: 22px; right: 13%; color: #d3bdd0; text-shadow: 0 3px 8px #142c3e; }

.game-card[data-game-id="neon-siege"] .game-card__art {
  background: radial-gradient(ellipse at 50% 83%, #16477e 0%, transparent 57%), linear-gradient(150deg, #160e32, #090d25 72%);
}

.ad-preview--siege::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 42px, #85e9ff13 43px 44px), repeating-linear-gradient(0deg, transparent 0 31px, #85e9ff12 32px 33px);
  transform: perspective(140px) rotateX(20deg) scale(1.15);
  content: '';
}

.ad-preview__siege-stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #80edff 1px, transparent 2px), radial-gradient(circle, #ed96f9 1px, transparent 2px);
  background-position: 8px 12px, 37px 49px;
  background-size: 58px 41px, 73px 58px;
  opacity: .5;
}

.ad-preview__siege-enemy {
  position: absolute;
  color: #ff627b;
  font-size: 31px;
  text-shadow: 0 0 7px #ff446f, 0 0 24px #ff446f;
}

.ad-preview__siege-enemy--one { top: 23px; left: 31%; transform: rotate(14deg); }
.ad-preview__siege-enemy--two { top: 42px; right: 27%; transform: rotate(-11deg) scale(.8); }
.ad-preview__siege-enemy--three { top: 9px; right: 44%; transform: scale(.55); }

.ad-preview__siege-core {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  color: #9df9ff;
  font-size: 60px;
  line-height: 1;
  text-shadow: 0 0 7px #69f0ff, 0 0 28px #16b9ef;
}

.ad-preview__siege-shot {
  position: absolute;
  bottom: 62px;
  left: calc(50% - 2px);
  width: 4px;
  height: 55px;
  border-radius: 10px;
  background: #a5f8ff;
  box-shadow: 0 0 12px 4px #56e8fc;
}

.ad-preview__siege-turret {
  position: absolute;
  bottom: 28px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #73e5ff;
  border-radius: 10px;
  background: #102b50;
  color: #86f8ff;
  font-size: 28px;
  box-shadow: 0 0 19px #45def488;
}

.ad-preview__siege-turret--left { left: 13%; }
.ad-preview__siege-turret--right { right: 13%; border-color: #ffb47d; color: #ffd193; box-shadow: 0 0 19px #ff9e5888; }

.ad-preview__siege-upgrade {
  position: absolute;
  bottom: 76px;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 5px;
  background: #092534dc;
  color: #89f5fc;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  box-shadow: 0 0 12px #5be1ff88;
}

.ad-preview__siege-upgrade--left { left: 15%; }
.ad-preview__siege-upgrade--right { right: 15%; color: #ffc392; box-shadow: 0 0 12px #fca66d88; }

.game-card__badges {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 13px;
  display: flex;
  gap: 6px;
}

.game-card__badge {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 35%, var(--line));
  border-radius: 999px;
  background: rgba(8, 10, 22, 0.62);
  color: color-mix(in srgb, var(--game-accent) 72%, white);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.favorite-button {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 10, 22, 0.56);
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform var(--transition), color var(--transition), background var(--transition);
}

.favorite-button:hover {
  transform: scale(1.08);
}

.favorite-button.is-favorite {
  background: rgba(255, 209, 102, 0.14);
  color: var(--yellow);
}

.game-card__body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 19px 19px 17px;
}

.game-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.game-card__category {
  color: var(--game-accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card__difficulty {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
}

.game-card h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.game-card__description {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 16px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.game-card__record {
  display: flex;
  flex-direction: column;
}

.game-card__record small {
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.game-card__record strong {
  font-family: monospace;
  font-size: 13px;
}

.game-card__play {
  display: flex;
  align-items: center;
  gap: 6px;
  color: color-mix(in srgb, var(--game-accent) 75%, white);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state,
.empty-list {
  padding: 35px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-bottom: 110px;
}

.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.panel__heading h2 {
  font-size: 25px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: color var(--transition);
}

.text-button:hover {
  color: var(--text);
}

.leaderboard {
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  display: grid;
  min-height: 59px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-soft);
  transition: border-color var(--transition), transform var(--transition);
}

.leaderboard-row:hover {
  transform: translateX(3px);
  border-color: var(--line);
}

.leaderboard-row__rank {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-faint);
  font-family: monospace;
  font-size: 11px;
  font-weight: 900;
}

.leaderboard-row:nth-child(1) .leaderboard-row__rank {
  background: rgba(255, 209, 102, 0.14);
  color: var(--yellow);
}

.leaderboard-row:nth-child(2) .leaderboard-row__rank {
  background: rgba(197, 210, 226, 0.12);
  color: #c5d2e2;
}

.leaderboard-row:nth-child(3) .leaderboard-row__rank {
  background: rgba(216, 142, 98, 0.13);
  color: #d88e62;
}

.leaderboard-row__game {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.leaderboard-row__icon {
  font-size: 21px;
}

.leaderboard-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.leaderboard-row__copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row__copy span {
  color: var(--text-faint);
  font-size: 9px;
}

.leaderboard-row__score {
  color: var(--text);
  font-family: monospace;
  font-size: 14px;
  font-weight: 900;
}

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

.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item__icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 18px;
}

.activity-item__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.activity-item__copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item__copy span {
  color: var(--text-faint);
  font-size: 9px;
}

.activity-item__score {
  font-family: monospace;
  font-size: 12px;
  font-weight: 900;
}

.achievements {
  margin-bottom: 100px;
}

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

.achievement-card {
  display: flex;
  min-height: 98px;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.achievement-card__icon {
  position: relative;
  display: grid;
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-soft);
  filter: grayscale(1);
  font-size: 23px;
  opacity: 0.45;
}

.achievement-card.is-unlocked {
  border-color: rgba(93, 229, 166, 0.2);
  background: linear-gradient(110deg, rgba(93, 229, 166, 0.06), transparent), var(--surface);
}

.achievement-card.is-unlocked .achievement-card__icon {
  background: rgba(93, 229, 166, 0.12);
  filter: none;
  opacity: 1;
  box-shadow: 0 0 28px rgba(93, 229, 166, 0.12);
}

.achievement-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.achievement-card__copy strong {
  font-size: 12px;
}

.achievement-card__copy span {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.45;
}

.achievement-card__state {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 13px;
}

.achievement-card.is-unlocked .achievement-card__state {
  color: var(--green);
}

.footer {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
}

.brand--footer {
  cursor: default;
}

.footer p {
  color: var(--text-faint);
  font-size: 10px;
}

.modal {
  width: min(calc(100% - 30px), 480px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 25px;
  background: transparent;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(2, 3, 10, 0.74);
  backdrop-filter: blur(8px);
}

.modal__card {
  position: relative;
  padding: 31px;
  border-radius: inherit;
  background: var(--surface-solid);
}

.modal__card h2 {
  margin: 0 0 7px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.modal__card > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--text-faint);
  font-size: 12px;
}

.modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 20px;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  outline: 0;
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 104, 255, 0.1);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.avatar-picker button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.avatar-picker button:hover,
.avatar-picker button.is-selected {
  border-color: var(--primary);
  background: rgba(143, 104, 255, 0.13);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.modal--confirm {
  width: min(calc(100% - 30px), 410px);
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(255, 100, 124, 0.35);
  border-radius: 16px;
  background: rgba(255, 100, 124, 0.11);
  color: var(--danger);
  font-size: 25px;
  font-weight: 900;
}

.modal--confirm .modal__actions {
  justify-content: center;
}

.toast-region {
  position: fixed;
  z-index: 3000;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100% - 40px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  transform: translateY(20px);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  box-shadow: var(--shadow);
  opacity: 0;
  backdrop-filter: blur(18px);
  animation: toastIn 260ms ease forwards;
}

.toast.is-leaving {
  animation: toastOut 220ms ease forwards;
}

.toast__icon {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  background: rgba(143, 104, 255, 0.12);
}

.toast__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.toast__copy strong {
  font-size: 11px;
}

.toast__copy span {
  color: var(--text-faint);
  font-size: 9px;
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  pointer-events: auto;
}

.noscript {
  position: fixed;
  z-index: 9999;
  right: 20px;
  bottom: 20px;
  padding: 15px 20px;
  border-radius: 14px;
  background: var(--danger);
  color: white;
  font-weight: 800;
}

/* Game view */
.game-view {
  min-height: calc(100vh - var(--topbar-height));
  padding: 31px 0 70px;
}

.game-view__header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 23px;
}

.back-button {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.game-view__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}

.game-view__icon {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface-soft);
  font-size: 25px;
}

.game-view__title p {
  margin: 0;
  color: var(--primary);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.game-view__title h1 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-transform: uppercase;
}

.game-view__record {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.game-view__record small {
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 800;
}

.game-view__record strong {
  font-family: monospace;
  font-size: 18px;
}

.game-stage {
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 0%, rgba(143, 104, 255, 0.08), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.game-shell {
  --game-accent: var(--primary);
  display: grid;
  min-height: 610px;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px;
}

.game-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.game-intro__copy h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.game-intro__copy p {
  margin: 0;
  color: var(--text-faint);
  font-size: 10px;
}

.game-hud {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.hud-item {
  display: flex;
  min-width: 88px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.hud-item small {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-item strong {
  font-family: monospace;
  font-size: 14px;
}

.game-main {
  position: relative;
  display: grid;
  min-height: 420px;
  place-items: center;
}

.game-canvas-wrap {
  position: relative;
  display: grid;
  width: min(100%, 780px);
  overflow: hidden;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--game-accent) 30%, var(--line));
  border-radius: 20px;
  background: #070912;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45), 0 18px 45px rgba(0, 0, 0, 0.2);
  touch-action: none;
}

.game-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
}

.game-overlay {
  position: absolute;
  z-index: 10;
  display: flex;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 13, 0.75);
  backdrop-filter: blur(7px);
}

.game-overlay__card {
  width: min(100%, 350px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 21px;
  background: rgba(18, 21, 39, 0.93);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.game-overlay__icon {
  display: grid;
  width: 55px;
  height: 55px;
  margin: 0 auto 15px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--game-accent) 35%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--game-accent) 12%, transparent);
  font-size: 26px;
}

.game-overlay__card h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.game-overlay__card p {
  margin: 0 0 19px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.game-controls {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.control-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
}

.key {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
}

.control-actions {
  display: flex;
  gap: 8px;
}

.control-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.control-button:hover {
  border-color: color-mix(in srgb, var(--game-accent) 45%, var(--line));
  color: var(--text);
}

.control-button--primary {
  border-color: color-mix(in srgb, var(--game-accent) 50%, var(--line));
  background: color-mix(in srgb, var(--game-accent) 16%, transparent);
  color: color-mix(in srgb, var(--game-accent) 72%, white);
}

.mobile-dpad {
  display: none;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
  gap: 5px;
}

.mobile-dpad button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 18px;
  touch-action: manipulation;
}

.mobile-dpad button[data-direction="up"] {
  grid-column: 2;
}

.mobile-dpad button[data-direction="left"] {
  grid-column: 1;
  grid-row: 2;
}

.mobile-dpad button[data-direction="down"] {
  grid-column: 2;
  grid-row: 2;
}

.mobile-dpad button[data-direction="right"] {
  grid-column: 3;
  grid-row: 2;
}

/* Memory */
.memory-layout {
  display: grid;
  width: min(100%, 680px);
  gap: 16px;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 10px;
}

.memory-card {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  transform-style: preserve-3d;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
}

.memory-card.is-flipped,
.memory-card.is-matched {
  transform: rotateY(180deg);
}

.memory-card__face {
  position: absolute;
  display: grid;
  inset: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: inherit;
  backface-visibility: hidden;
}

.memory-card__front {
  background:
    linear-gradient(135deg, rgba(143, 104, 255, 0.12), rgba(57, 223, 242, 0.04)),
    var(--surface-raised);
}

.memory-card__front::after {
  color: var(--primary);
  content: "?";
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(20px, 4vw, 38px);
  opacity: 0.55;
}

.memory-card__back {
  transform: rotateY(180deg);
  background: color-mix(in srgb, var(--game-accent) 12%, var(--surface-solid));
  font-size: clamp(25px, 5vw, 43px);
}

.memory-card.is-matched .memory-card__back {
  border-color: rgba(93, 229, 166, 0.38);
  box-shadow: inset 0 0 35px rgba(93, 229, 166, 0.08);
}

/* 2048 */
.game-2048-layout {
  display: grid;
  width: min(100%, 520px);
  gap: 14px;
}

.grid-2048 {
  display: grid;
  aspect-ratio: 1;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  touch-action: none;
}

.tile-2048 {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(18px, 5vw, 38px);
  animation: tilePop 160ms ease;
}

.tile-2048[data-value="2"] { background: rgba(143, 104, 255, 0.14); color: #c5b6ff; }
.tile-2048[data-value="4"] { background: rgba(92, 124, 255, 0.18); color: #aebcff; }
.tile-2048[data-value="8"] { background: rgba(57, 223, 242, 0.18); color: #8df2fb; }
.tile-2048[data-value="16"] { background: rgba(93, 229, 166, 0.2); color: #9cf0c8; }
.tile-2048[data-value="32"] { background: rgba(255, 209, 102, 0.22); color: #ffe3a0; }
.tile-2048[data-value="64"] { background: rgba(255, 144, 93, 0.25); color: #ffbe9f; }
.tile-2048[data-value="128"] { background: rgba(255, 95, 207, 0.24); color: #fface6; font-size: clamp(16px, 4.4vw, 32px); }
.tile-2048[data-value="256"] { background: rgba(255, 100, 124, 0.28); color: #ffadba; font-size: clamp(16px, 4.4vw, 32px); }
.tile-2048[data-value="512"] { background: rgba(154, 102, 255, 0.34); color: #e0d0ff; font-size: clamp(16px, 4.4vw, 32px); }
.tile-2048[data-value="1024"] { background: linear-gradient(135deg, #6e56de, #4271e9); color: white; font-size: clamp(14px, 3.8vw, 27px); }
.tile-2048[data-value="2048"] { background: linear-gradient(135deg, #ff5fcf, #745cff); color: white; font-size: clamp(14px, 3.8vw, 27px); box-shadow: 0 0 34px rgba(255, 95, 207, 0.25); }
.tile-2048[data-value="4096"],
.tile-2048[data-value="8192"] { background: linear-gradient(135deg, #39dff2, #5de5a6); color: #061217; font-size: clamp(13px, 3.3vw, 24px); }

/* Simon */
.simon-layout {
  display: grid;
  width: min(100%, 530px);
  justify-items: center;
  gap: 20px;
}

.simon-board {
  position: relative;
  display: grid;
  width: min(78vw, 430px);
  aspect-ratio: 1;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #090b15;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), 0 25px 60px rgba(0, 0, 0, 0.28);
}

.simon-pad {
  border: 0;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 110ms ease, filter 110ms ease, transform 110ms ease;
}

.simon-pad:nth-child(1) { border-radius: 100% 14px 14px 14px; background: #36d98c; }
.simon-pad:nth-child(2) { border-radius: 14px 100% 14px 14px; background: #ff5574; }
.simon-pad:nth-child(3) { border-radius: 14px 14px 14px 100%; background: #ffd05c; }
.simon-pad:nth-child(4) { border-radius: 14px 14px 100% 14px; background: #4f8cff; }

.simon-pad:hover,
.simon-pad.is-active {
  opacity: 1;
  filter: brightness(1.35) saturate(1.2);
  transform: scale(0.98);
}

.simon-center {
  position: absolute;
  display: grid;
  width: 34%;
  aspect-ratio: 1;
  inset: 33%;
  place-items: center;
  border: 8px solid #090b15;
  border-radius: 50%;
  background: var(--surface-solid);
  box-shadow: inset 0 0 24px rgba(143, 104, 255, 0.08);
  pointer-events: none;
}

.simon-center strong {
  font-family: monospace;
  font-size: clamp(22px, 5vw, 38px);
}

.simon-center small {
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.simon-status {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* Reaction */
.reaction-layout {
  display: grid;
  width: min(100%, 780px);
  gap: 14px;
}

.reaction-zone {
  position: relative;
  display: grid;
  min-height: 380px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(143, 104, 255, 0.13), transparent 40%),
    #0b0e1a;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background 180ms ease, border-color 180ms ease;
}

.reaction-zone.is-waiting {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 209, 102, 0.11), transparent 42%),
    #0b0e1a;
  border-color: rgba(255, 209, 102, 0.3);
}

.reaction-zone.is-ready {
  background:
    radial-gradient(circle at 50% 50%, rgba(93, 229, 166, 0.32), transparent 48%),
    #081811;
  border-color: rgba(93, 229, 166, 0.5);
  box-shadow: inset 0 0 80px rgba(93, 229, 166, 0.1);
}

.reaction-zone.is-false-start {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 100, 124, 0.25), transparent 48%),
    #19090e;
  border-color: rgba(255, 100, 124, 0.5);
}

.reaction-zone__content {
  display: grid;
  justify-items: center;
  padding: 30px;
  text-align: center;
}

.reaction-light {
  width: 77px;
  height: 77px;
  margin-bottom: 20px;
  border: 8px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 1px var(--line-strong), inset 0 0 28px rgba(0, 0, 0, 0.35);
}

.reaction-zone.is-waiting .reaction-light {
  background: var(--yellow);
  box-shadow: 0 0 45px rgba(255, 209, 102, 0.35);
}

.reaction-zone.is-ready .reaction-light {
  background: var(--green);
  box-shadow: 0 0 55px rgba(93, 229, 166, 0.48);
}

.reaction-zone.is-false-start .reaction-light {
  background: var(--danger);
  box-shadow: 0 0 55px rgba(255, 100, 124, 0.42);
}

.reaction-zone h3 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(28px, 6vw, 55px);
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.reaction-zone p {
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.reaction-results {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.reaction-result {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  text-align: center;
}

.reaction-result small {
  display: block;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.reaction-result strong {
  font-family: monospace;
  font-size: 12px;
}

/* Tic tac toe */
.ttt-layout {
  display: grid;
  width: min(100%, 520px);
  justify-items: center;
  gap: 18px;
}

.ttt-scorebar {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ttt-score {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: center;
}

.ttt-score small {
  display: block;
  color: var(--text-faint);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.ttt-score strong {
  font-family: monospace;
}

.ttt-board {
  display: grid;
  width: min(78vw, 420px);
  aspect-ratio: 1;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.ttt-cell {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(42px, 11vw, 77px);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.ttt-cell:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(143, 104, 255, 0.5);
  background: rgba(143, 104, 255, 0.08);
}

.ttt-cell[data-mark="X"] {
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(57, 223, 242, 0.28);
}

.ttt-cell[data-mark="O"] {
  color: var(--pink);
  text-shadow: 0 0 24px rgba(255, 95, 207, 0.26);
}

.ttt-cell.is-winning {
  border-color: rgba(93, 229, 166, 0.5);
  background: rgba(93, 229, 166, 0.1);
}

.ttt-status {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

/* Minesweeper */
.mines-layout {
  display: grid;
  width: min(100%, 620px);
  justify-items: center;
  gap: 13px;
}

.mine-grid {
  display: grid;
  width: min(86vw, 540px);
  aspect-ratio: 1;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.23);
}

.mine-cell {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: monospace;
  font-size: clamp(9px, 2.2vw, 18px);
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.mine-cell:hover:not(:disabled) {
  border-color: rgba(143, 104, 255, 0.45);
  background: rgba(143, 104, 255, 0.11);
}

.mine-cell.is-open {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.035);
}

.mine-cell.is-flagged {
  color: var(--yellow);
}

.mine-cell.is-mine {
  background: rgba(255, 100, 124, 0.17);
  color: var(--danger);
}

.mine-cell[data-count="1"] { color: #70a7ff; }
.mine-cell[data-count="2"] { color: #66e5a8; }
.mine-cell[data-count="3"] { color: #ff778e; }
.mine-cell[data-count="4"] { color: #a78bff; }
.mine-cell[data-count="5"] { color: #ff9a66; }
.mine-cell[data-count="6"] { color: #56e5ed; }
.mine-cell[data-count="7"] { color: #e6e9f5; }
.mine-cell[data-count="8"] { color: #a4a9c1; }

.flag-mode-button.is-active {
  border-color: rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.12);
  color: var(--yellow);
}

/* Breakout / canvas helpers */
.canvas-message {
  position: absolute;
  top: 14px;
  left: 50%;
  padding: 7px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(7, 9, 18, 0.68);
  color: rgba(255, 255, 255, 0.73);
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
  backdrop-filter: blur(7px);
}

.breakout-launch-button {
  position: absolute;
  z-index: 2;
  top: 52%;
  left: 50%;
  min-width: 185px;
  min-height: 54px;
  padding: 0 18px;
  transform: translate(-50%, -50%);
  border: 2px solid #ffe8fa;
  border-radius: 16px;
  background: linear-gradient(135deg, #e84aa9, #7855dc);
  box-shadow: 0 10px 32px #e84aa988;
  color: white;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.breakout-launch-button:active { transform: translate(-50%, -50%) scale(.96); }
.breakout-launch-button:disabled { opacity: .55; cursor: default; }

#reactionTapButton { min-height: 52px; font-size: 13px; }

@keyframes blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0.18; }
}

@keyframes alienFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes visualPulse {
  0%, 100% { transform: scale(0.98); opacity: 0.8; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes tilePop {
  from { transform: scale(0.82); opacity: 0.45; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes toastIn {
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
  to { transform: translateY(12px); opacity: 0; }
}

@media (max-width: 1060px) {
  .desktop-nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.7fr);
    gap: 25px;
  }

  .hero__visual {
    transform: scale(0.86);
  }

  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-card--daily {
    grid-column: 1 / -1;
  }

  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  :root {
    --topbar-height: 70px;
  }

  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .topbar__actions .icon-button:first-child {
    display: none;
  }

  .profile-button {
    min-width: 0;
    padding-right: 5px;
  }

  .profile-button__copy {
    display: none;
  }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding-block: 65px 45px;
    text-align: center;
  }

  .hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero h1 {
    font-size: clamp(50px, 13vw, 82px);
  }

  .hero__lead {
    max-width: 620px;
  }

  .hero__meta {
    justify-content: center;
  }

  .hero__visual {
    display: none;
  }

  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 85px;
  }

  .stat-card--daily {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > p {
    display: none;
  }

  .game-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

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

  .content-grid {
    grid-template-columns: 1fr;
  }

  .activity-panel {
    order: -1;
  }

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

  .game-view__title {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .back-button {
    grid-column: 1;
    grid-row: 2;
  }

  .game-view__record {
    grid-column: 2;
    grid-row: 2;
  }

  .game-stage {
    min-height: 560px;
    border-radius: 25px;
  }

  .game-shell {
    min-height: 560px;
    padding: 16px;
  }

  .game-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-hud {
    width: 100%;
  }

  .hud-item {
    min-width: 0;
    flex: 1;
  }

  .game-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-actions {
    width: 100%;
  }

  .control-actions .control-button {
    flex: 1;
  }

  .mobile-dpad {
    display: grid;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(calc(100% - 20px), var(--shell));
  }

  .brand__copy small {
    display: none;
  }

  .brand__copy strong {
    font-size: 14px;
  }

  .topbar__actions {
    gap: 5px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-block: 51px 35px;
  }

  .hero h1 {
    font-size: clamp(45px, 15vw, 67px);
  }

  .hero__lead {
    margin-top: 22px;
    font-size: 15px;
  }

  .hero__actions {
    width: 100%;
  }

  .hero__actions button,
  .hero__actions a {
    width: 100%;
  }

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

  .dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 75px;
  }

  .stat-card {
    min-height: 77px;
    gap: 9px;
    padding: 11px;
  }

  .stat-card__icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .stat-card strong {
    font-size: 15px;
  }

  .stat-card span {
    font-size: 8px;
  }

  .stat-card--daily {
    grid-column: 1 / -1;
  }

  .games-section,
  .content-grid {
    margin-bottom: 75px;
  }

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

  .game-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .game-card {
    min-height: 285px;
  }

  .game-card__art {
    height: 145px;
    flex-basis: 145px;
  }

  .game-card__icon {
    width: 76px;
    height: 76px;
    font-size: 40px;
  }

  .panel {
    padding: 18px;
  }

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

  .footer {
    flex-direction: column;
    justify-content: center;
    padding-block: 25px;
    text-align: center;
  }

  .modal__card {
    padding: 25px 20px;
  }

  .avatar-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-view {
    padding-top: 20px;
  }

  .game-view__title h1 {
    font-size: 22px;
  }

  .game-view__icon {
    width: 43px;
    height: 43px;
  }

  .game-stage {
    border-radius: 20px;
  }

  .game-main {
    min-height: 380px;
  }

  .memory-board {
    gap: 6px;
  }

  .memory-card {
    border-radius: 11px;
  }

  .grid-2048 {
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
  }

  .tile-2048 {
    border-radius: 9px;
  }

  .reaction-zone {
    min-height: 340px;
  }

  .reaction-results {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .reaction-result {
    padding: 7px 3px;
  }

  .reaction-result strong {
    font-size: 9px;
  }

  .mine-grid {
    gap: 2px;
    padding: 5px;
  }

  .mine-cell {
    border-radius: 4px;
  }
}

@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;
  }
}

/* Account and persistence edition */
button,
input,
select {
  font: inherit;
}

select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 72%, transparent);
  outline-offset: 3px;
}

.startup-loader {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgba(143, 104, 255, 0.18), transparent 28%),
    var(--bg-deep);
  color: var(--text);
  transition: opacity 220ms ease;
}

.startup-loader .brand__mark {
  transform: scale(1.3);
  margin-bottom: 8px;
  animation: startupPulse 1.1s ease-in-out infinite alternate;
}

.startup-loader strong {
  font-family: "Arial Black", Impact, sans-serif;
  letter-spacing: 0.13em;
}

.startup-loader small {
  color: var(--text-faint);
  font-size: 11px;
}

@keyframes startupPulse {
  from { transform: scale(1.18); filter: brightness(0.9); }
  to { transform: scale(1.35); filter: brightness(1.35); }
}

.sync-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.sync-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.sync-button__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 99px;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-faint) 14%, transparent);
}

.sync-button[data-state="synced"] .sync-button__dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(93, 229, 166, 0.13), 0 0 12px rgba(93, 229, 166, 0.5);
}

.sync-button[data-state="syncing"] .sync-button__dot,
.sync-button[data-state="pending"] .sync-button__dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.13), 0 0 12px rgba(255, 209, 102, 0.45);
  animation: syncBlink 900ms ease-in-out infinite alternate;
}

.sync-button[data-state="offline"] .sync-button__dot,
.sync-button[data-state="login-required"] .sync-button__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 100, 124, 0.13), 0 0 12px rgba(255, 100, 124, 0.4);
}

@keyframes syncBlink {
  to { opacity: 0.38; transform: scale(0.82); }
}

.profile-button.is-connected {
  border-color: rgba(93, 229, 166, 0.22);
  background: linear-gradient(120deg, rgba(93, 229, 166, 0.07), var(--surface-soft));
}

.account-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: -8px;
  margin-bottom: 32px;
  padding: 22px 24px;
  border: 1px solid rgba(143, 104, 255, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, rgba(143, 104, 255, 0.12), rgba(57, 223, 242, 0.035) 58%, transparent),
    var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.account-banner__icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(143, 104, 255, 0.28);
  border-radius: 18px;
  background: rgba(143, 104, 255, 0.11);
  color: var(--cyan);
  font-size: 27px;
  box-shadow: inset 0 0 25px rgba(143, 104, 255, 0.08), 0 0 28px rgba(143, 104, 255, 0.08);
}

.account-banner .eyebrow {
  margin-bottom: 5px;
}

.account-banner h2 {
  margin: 0;
  font-size: 21px;
}

.account-banner__copy > p:last-child {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 11px;
}

.account-banner__actions {
  display: flex;
  gap: 9px;
}

.global-panel {
  margin-bottom: 110px;
}

.global-panel__heading {
  align-items: center;
}

.compact-select {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-select select {
  min-width: 185px;
  height: 42px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}

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

.global-row {
  display: grid;
  min-height: 62px;
  grid-template-columns: 38px 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-soft);
}

.global-row.is-current-player {
  border-color: rgba(93, 229, 166, 0.3);
  background: linear-gradient(110deg, rgba(93, 229, 166, 0.08), var(--surface-soft));
}

.global-row__rank {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-faint);
  font-family: monospace;
  font-size: 11px;
  font-weight: 900;
}

.global-row:nth-child(1) .global-row__rank {
  background: rgba(255, 209, 102, 0.15);
  color: var(--yellow);
}

.global-row:nth-child(2) .global-row__rank {
  background: rgba(174, 180, 206, 0.15);
  color: var(--text-soft);
}

.global-row:nth-child(3) .global-row__rank {
  background: rgba(255, 154, 105, 0.13);
  color: #ffab7c;
}

.global-row__avatar {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(143, 104, 255, 0.22), rgba(57, 223, 242, 0.1));
  font-size: 16px;
}

.global-row__player {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.global-row__player strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-row__player small {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-row__score {
  font-family: monospace;
  font-size: 13px;
}

.global-panel__note {
  margin: 15px 2px 0;
  color: var(--text-faint);
  font-size: 10px;
  text-align: right;
}

.empty-list--global {
  grid-column: 1 / -1;
}

.global-loading {
  display: flex;
  min-height: 96px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.global-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: globalLoading 700ms ease-in-out infinite alternate;
}

.global-loading span:nth-child(2) { animation-delay: 120ms; }
.global-loading span:nth-child(3) { animation-delay: 240ms; }

@keyframes globalLoading {
  to { transform: translateY(-7px); opacity: 0.35; }
}

.auth-modal {
  width: min(calc(100% - 30px), 720px);
}

.modal__card--auth {
  min-height: 510px;
}

.modal__card--auth > p:not(.eyebrow) {
  max-width: 600px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 0 22px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.auth-form > div {
  display: grid;
  gap: 15px;
}

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

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.check-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--primary);
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
}

.form-error {
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid rgba(255, 100, 124, 0.28);
  border-radius: 11px;
  background: rgba(255, 100, 124, 0.08);
  color: color-mix(in srgb, var(--danger) 82%, var(--text));
  font-size: 11px !important;
  text-align: left;
}

.password-hint {
  margin: -3px 0 0 !important;
  color: var(--text-faint);
  font-size: 9px !important;
}

.auth-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-avatar-row > span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.avatar-picker--compact {
  width: min(100%, 330px);
  margin-top: 0;
}

.avatar-picker--compact button {
  min-height: 40px;
}

.account-card {
  display: grid;
  gap: 0;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -8px 0 18px;
  padding: 11px;
  border: 1px solid rgba(93, 229, 166, 0.2);
  border-radius: 14px;
  background: rgba(93, 229, 166, 0.055);
}

.account-identity__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 900;
}

.account-identity div {
  display: flex;
  flex-direction: column;
}

.account-identity small {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-identity strong {
  font-size: 13px;
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.account-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0 11px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.account-action:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.account-action > span {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 12px;
  background: rgba(143, 104, 255, 0.12);
  color: var(--cyan);
  font-size: 18px;
}

.account-action strong {
  align-self: end;
  font-size: 11px;
}

.account-action small {
  align-self: start;
  color: var(--text-faint);
  font-size: 9px;
}

.account-actions__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 360px) {
  .topbar__inner { gap: 8px; }
  .brand__copy { display: none; }
  .topbar__actions { gap: 4px; }
  .page-glow--two { display: none; }
}

@media (max-width: 600px) {
  .game-view:has(.cg-play:not([hidden]), .pr-shell[data-pr-mode="play"], .ds-game:not([hidden])) { padding-top: 8px; }
  .game-view:has(.cg-play:not([hidden]), .pr-shell[data-pr-mode="play"], .ds-game:not([hidden])) .game-view__title { display: none; }
  .game-view:has(.cg-play:not([hidden]), .pr-shell[data-pr-mode="play"], .ds-game:not([hidden])) .game-view__header { gap: 8px; margin-bottom: 8px; }
  .game-view:has(.cg-play:not([hidden]), .pr-shell[data-pr-mode="play"], .ds-game:not([hidden])) .back-button,
  .game-view:has(.cg-play:not([hidden]), .pr-shell[data-pr-mode="play"], .ds-game:not([hidden])) .game-view__record { grid-row: 1; }
}

.text-button--danger {
  color: var(--danger);
}

.text-button--danger:hover {
  color: color-mix(in srgb, var(--danger) 75%, white);
}

button.is-busy {
  cursor: progress;
  opacity: 0.72;
}

#deleteAccountModal .field {
  margin-top: 18px;
  text-align: left;
}

#deleteAccountModal .form-error {
  margin-top: 12px !important;
}

@media (max-width: 1060px) {
  .sync-button span:last-child {
    display: none;
  }

  .sync-button {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .account-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-banner__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 820px) {
  .account-banner {
    margin-top: 0;
  }

  .global-leaderboard {
    grid-template-columns: 1fr;
  }

  .global-panel__heading {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .sync-button {
    width: 36px;
    min-height: 36px;
  }

  .topbar__actions .sync-button {
    display: none;
  }

  .account-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
    text-align: center;
  }

  .account-banner__icon {
    margin-inline: auto;
  }

  .account-banner .eyebrow {
    justify-content: center;
  }

  .account-banner__actions {
    display: grid;
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .global-panel {
    margin-bottom: 75px;
  }

  .global-panel__heading {
    flex-direction: column;
  }

  .compact-select {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .compact-select select {
    width: 100%;
  }

  .global-row {
    grid-template-columns: 31px 35px minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 8px;
  }

  .global-row__avatar {
    width: 34px;
    height: 34px;
  }

  .global-row__player small {
    max-width: 130px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal {
    width: min(calc(100% - 16px), 720px);
  }

  .modal__card--auth {
    min-height: 0;
  }

  .auth-avatar-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .avatar-picker--compact {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .account-actions__row {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Arena modes opened in the common game view. */
.game-stage .arena-unavailable { max-width: 720px; margin: clamp(2rem, 8vw, 5rem) auto; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid #bcd3cb55; border-radius: 18px; background: #1c2b38d9; box-shadow: 0 18px 45px #0005; }
.game-stage .arena-unavailable h2 { margin: 0 0 .7rem; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.03em; }
.game-stage .arena-unavailable p { max-width: 55ch; margin: 0; color: #c6d8dc; line-height: 1.6; }
/* During a live Arena match the site chrome gives the whole screen to the game, as the former Arena page did. */
body.a3-playing .topbar, body.a3-playing .game-view__header { display: none; }
/* Link to the shared Arena profile above an Arena lobby; hidden with the rest of the chrome during a match. */
.arena-inline__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin: 0 0 12px; padding: 10px 16px; border: 1px solid rgba(214, 226, 255, .12); border-radius: 14px; color: #a9b2c6; background: rgba(255, 255, 255, .04); font-size: .82rem; }
.arena-inline__bar a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: #eef1f7; background: rgba(255, 255, 255, .08); font-weight: 800; text-decoration: none; }
.arena-inline__bar a:hover { background: rgba(255, 255, 255, .14); }
.arena-inline__bar a:focus-visible { outline: 3px solid #8deafe; outline-offset: 3px; }
body.a3-playing .arena-inline__bar { display: none; }

/* The page heading takes focus for screen readers when a game opens; it is not a control and needs no ring. */
#gameViewTitle:focus { outline: none; }
/* Small screens: one compact header row above the game and a top bar that scrolls away, so the play area gets the screen. */
@media (max-width: 760px), (max-height: 760px) {
  body.is-game-open .topbar { position: static; }
}
@media (max-width: 760px) {
  body.is-game-open .game-view { padding-top: 8px; }
  body.is-game-open .game-view__header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
  body.is-game-open .back-button { grid-column: 1; grid-row: 1; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; font-size: 0; }
  body.is-game-open .back-button span { font-size: 18px; }
  body.is-game-open .game-view__title { grid-column: 2; grid-row: 1; justify-content: flex-start; min-width: 0; }
  body.is-game-open .game-view__title > div { min-width: 0; }
  body.is-game-open .game-view__icon { display: none; }
  body.is-game-open .game-view__title h1 { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
  body.is-game-open .game-view__record { grid-column: 3; grid-row: 1; }
}

/* Laptop-height screens: classic boards shrink with the viewport height so the whole board and its controls are visible at once. */
@media (min-width: 700px) and (max-height: 820px) {
  .game-main .memory-layout, .game-main .game-2048-layout { max-width: clamp(420px, calc(100vh - 170px), 700px); margin-inline: auto; }
  .game-main .simon-layout, .game-main .mines-layout { max-width: clamp(420px, calc(100vh - 210px), 700px); margin-inline: auto; }
  .game-main .ttt-layout { max-width: clamp(400px, calc(100vh - 230px), 700px); margin-inline: auto; }
}
