:root {
  color-scheme: dark;
  --bg: #020303;
  --panel: #090b0f;
  --panel-2: #11151b;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(43, 212, 255, 0.9);
  --text: #f6f9ef;
  --muted: #9aa3a0;
  --brand-blue: #2bd4ff;
  --brand-purple: #684dff;
  --brand-orange: #ff8a1f;
  --brand-red: #ff3159;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --desktop-width: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: none;
}

body {
  overflow-x: hidden;
  overscroll-behavior: none;
}

body.is-playing {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 14% 0%, rgba(43, 212, 255, 0.13), transparent 30%),
    radial-gradient(circle at 86% 0%, rgba(255, 138, 31, 0.1), transparent 28%),
    linear-gradient(180deg, #050606 0%, #020303 45%, #000 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 15px max(20px, calc((100vw - var(--desktop-width)) / 2));
  background:
    linear-gradient(90deg, rgba(43, 212, 255, 0.08), transparent 30%, rgba(255, 138, 31, 0.07)),
    rgba(2, 3, 3, 0.94);
  border-bottom: 1px solid rgba(43, 212, 255, 0.13);
  backdrop-filter: blur(16px);
}

.brand-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.brand-logo {
  width: 148px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(43, 212, 255, 0.38)) drop-shadow(0 0 16px rgba(255, 92, 36, 0.2));
}

.tabs {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.tab,
.search-box,
.currency-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 16, 19, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tab {
  min-width: 88px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
}

.tab:hover {
  border-color: rgba(43, 212, 255, 0.48);
}

.tab.is-active {
  color: #fff;
  border-color: transparent;
  background:
    linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    linear-gradient(135deg, var(--brand-blue), var(--brand-purple) 45%, var(--brand-orange)) border-box;
  box-shadow:
    0 0 0 1px rgba(43, 212, 255, 0.18),
    0 0 18px rgba(43, 212, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.telegram-header-contact {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(43, 212, 255, 0.38);
  border-radius: 14px;
  padding: 0 14px 0 10px;
  background: rgba(14, 16, 19, 0.88);
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.desktop-contact {
  width: 126px;
  padding: 0 10px;
  font-size: 13px;
}

.telegram-header-contact:hover,
.telegram-header-contact:focus-visible {
  border-color: rgba(43, 212, 255, 0.86);
  box-shadow: 0 0 0 1px rgba(43, 212, 255, 0.15), 0 0 20px rgba(43, 212, 255, 0.18);
  outline: 0;
  transform: translateY(-1px);
}

.telegram-mini-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
}

.telegram-mini-icon img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}

.mobile-contact {
  display: none;
}

.currency-picker {
  position: relative;
  width: 126px;
  flex: 0 0 auto;
}

.currency-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 0 10px 0 12px;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.currency-button:hover {
  border-color: rgba(43, 212, 255, 0.48);
}

.currency-button:focus-visible,
.currency-picker.is-open .currency-button {
  outline: 0;
  border-color: rgba(43, 212, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(43, 212, 255, 0.18), 0 0 22px rgba(104, 77, 255, 0.14);
}

.currency-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
  opacity: 0.85;
}

.currency-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: none;
  width: 148px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(43, 212, 255, 0.36);
  border-radius: 8px;
  background: #101419;
  color: var(--text);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5), 0 0 18px rgba(43, 212, 255, 0.14);
}

.currency-picker.is-open .currency-menu {
  display: grid;
  gap: 4px;
}

.currency-option {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
}

.currency-option:hover,
.currency-option[aria-selected="true"] {
  background: rgba(43, 212, 255, 0.16);
}

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 160px;
  padding: 0 14px;
}

.search-box svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: #737d82;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 650;
}

.search-box input::placeholder {
  color: #c5ccc7;
  opacity: 0.9;
}

.search-box:focus-within {
  border-color: rgba(43, 212, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(43, 212, 255, 0.18), 0 0 22px rgba(104, 77, 255, 0.14);
}

.search-box:focus-within svg {
  fill: var(--brand-blue);
}

.mobile-bar {
  display: none;
}

.mobile-controls {
  display: flex;
  gap: 8px;
}

.content {
  padding: 28px max(20px, calc((100vw - var(--desktop-width)) / 2)) 48px;
}

.status {
  display: none;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.status.is-visible {
  display: flex;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 170px);
  justify-content: start;
  gap: 22px 20px;
}

.game-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 229 / 315;
  border: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px;
  background: #161b25;
  box-shadow: var(--shadow);
  isolation: isolate;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.08) 48%, rgba(0, 0, 0, 0.78));
  opacity: 1;
  transition: opacity 180ms ease;
}

.game-card:hover::before,
.game-card:focus-visible::before {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(43, 212, 255, 0.28),
    0 0 26px rgba(255, 98, 32, 0.16);
}

.game-card:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
}

.game-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1);
  transition: transform 220ms ease;
}

.game-card:hover img,
.game-card:focus-visible img {
  transform: scale(1.035);
}

.ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  min-width: 58px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  transform: skewX(-18deg) translateX(-6px);
  transform-origin: left top;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
  color: #fff;
  font-size: 12px;
  font-style: italic;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.ribbon.hot {
  background: linear-gradient(90deg, var(--brand-red), var(--brand-orange));
}

.ribbon span {
  transform: skewX(18deg);
}

.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 18px 14px 14px;
  transform: none;
  opacity: 1;
  transition: transform 180ms ease, opacity 180ms ease;
}

.game-card:hover .card-info,
.game-card:focus-visible .card-info {
  transform: translateY(0);
  opacity: 1;
}

.card-title {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.card-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #dfe6df;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.play-label {
  align-self: flex-start;
  min-height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple) 46%, var(--brand-orange));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(43, 212, 255, 0.24), 0 8px 20px rgba(255, 98, 32, 0.18);
}

.game-card:hover .play-label,
.game-card:focus-visible .play-label {
  display: inline-flex;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: #000;
}

.telegram-contact {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  min-height: 52px;
  display: none;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(43, 212, 255, 0.42);
  border-radius: 8px;
  padding: 8px 14px 8px 9px;
  background: rgba(9, 17, 25, 0.9);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(43, 212, 255, 0.16);
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.telegram-contact:hover,
.telegram-contact:focus-visible {
  border-color: rgba(43, 212, 255, 0.9);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55), 0 0 30px rgba(43, 212, 255, 0.28);
  outline: 0;
  transform: translateY(-1px);
}

.telegram-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
}

.telegram-icon img {
  width: 52px;
  height: 52px;
  display: block;
  object-fit: contain;
}

.telegram-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.telegram-copy span:first-child {
  font-size: 12px;
  font-weight: 900;
}

.telegram-copy span:last-child {
  color: #a8e7ff;
  font-size: 11px;
  font-weight: 800;
}

body.is-playing .telegram-contact {
  display: none;
}

.scroll-top-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 21;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(43, 212, 255, 0.42);
  border-radius: 50%;
  background:
    linear-gradient(rgba(9, 17, 25, 0.9), rgba(9, 17, 25, 0.9)) padding-box,
    linear-gradient(135deg, var(--brand-blue), var(--brand-purple) 55%, var(--brand-orange)) border-box;
  color: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), 0 0 24px rgba(43, 212, 255, 0.16);
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  backdrop-filter: blur(12px);
}

.scroll-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  outline: 0;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55), 0 0 30px rgba(43, 212, 255, 0.28);
  transform: translateY(-1px) scale(1);
}

.scroll-top-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

body.is-playing .scroll-top-button {
  display: none;
}

.game-overlay.is-active {
  display: block;
}

.game-overlay iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.back-button {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  z-index: 101;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(22, 28, 44, 0.58);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36), 0 0 18px rgba(43, 212, 255, 0.18);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.back-button:hover {
  background: rgba(36, 44, 68, 0.72);
}

.back-button svg {
  width: 36px;
  height: 36px;
  fill: #fff;
}

@media (max-width: 1100px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-group {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar {
    width: 100%;
  }

  .search-box {
    flex: 1 1 220px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 180px));
    gap: 18px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    background: linear-gradient(180deg, #050606 0%, #020303 48%, #000 100%);
  }

  .topbar {
    min-height: 64px;
    padding: 12px 12px 10px;
    gap: 10px;
    backdrop-filter: none;
  }

  .tabs {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .tab {
    flex: 1 0 auto;
    min-width: 104px;
    padding: 0 14px;
    font-size: 13px;
  }

  .brand-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding-right: 0;
  }

  .brand-logo {
    width: 132px;
    filter: none;
  }

  .toolbar {
    display: none;
  }

  .mobile-bar {
    width: 100%;
    position: relative;
    z-index: 6;
    display: block;
    padding: 11px 0 0;
    background: transparent;
    backdrop-filter: none;
  }

  .mobile-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: -12px;
    right: -12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(43, 212, 255, 0.36) 12%, rgba(255, 138, 31, 0.28) 88%, transparent);
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .mobile-bar .currency-picker {
    width: 100%;
  }

  .mobile-bar .currency-button {
    padding-left: 12px;
    padding-right: 9px;
    font-size: 13px;
  }

  .mobile-bar .currency-menu {
    width: 156px;
  }

  .mobile-bar .search-box {
    width: 100%;
  }

  .content {
    padding: 12px 12px 96px;
  }

  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    gap: 10px;
  }

  .game-card {
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
    contain: layout paint style;
    content-visibility: auto;
    contain-intrinsic-size: 145px 200px;
    transition: none;
  }

  .game-card::before {
    opacity: 1;
    background: linear-gradient(180deg, transparent 46%, rgba(0, 0, 0, 0.82));
  }

  .game-card img {
    transform: none;
    transition: none;
  }

  .card-info {
    gap: 4px;
    padding: 28px 7px 7px;
    transform: none;
    opacity: 1;
  }

  .card-title {
    font-size: 11px;
  }

  .card-meta {
    gap: 4px;
  }

  .card-meta span {
    min-height: 17px;
    padding: 0 4px;
    font-size: 9px;
    backdrop-filter: none;
  }

  .play-label {
    display: none;
  }

  .telegram-contact {
    right: auto;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 52px;
    width: 52px;
    display: inline-flex;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
    backdrop-filter: none;
  }

  .scroll-top-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
    backdrop-filter: none;
  }

  .telegram-contact + .scroll-top-button,
  .scroll-top-button {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px);
  }

  .telegram-icon {
    width: 52px;
    height: 52px;
  }

  .telegram-icon img {
    width: 52px;
    height: 52px;
  }

  .telegram-copy {
    display: none;
  }

  .back-button {
    width: 52px;
    height: 52px;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
    backdrop-filter: none;
  }

  .back-button svg {
    width: 31px;
    height: 31px;
  }
}

@media (max-width: 360px) {
  .tab {
    min-width: 94px;
    font-size: 12px;
  }

  .game-grid {
    gap: 8px;
  }

  .card-title {
    font-size: 10px;
  }

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