:root {
  --bg-main: #080a11;
  --bg-card: #111420;
  --bg-soft: #171b2a;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text-main: #f3f5ff;
  --text-muted: #aab0c5;
  --brand: #ffc62e;
  --brand-strong: #ffb300;
  --green: #34d17f;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: radial-gradient(circle at top, #151a2a 0%, #080a11 45%, #06080f 100%);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 12px 104px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.topbar,
.hero-card,
.wallet-card,
.search-card,
.ticker-card,
.category-card,
.providers-card,
.games-card,
.modal {
  background: linear-gradient(180deg, rgba(24, 29, 44, 0.96), rgba(16, 20, 32, 0.96));
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.topbar {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #121212;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.brand-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.balance-chip {
  border: 1px solid rgba(255, 198, 46, 0.35);
  background: rgba(255, 198, 46, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  min-width: 128px;
  text-align: right;
  cursor: pointer;
}

.balance-chip span {
  font-size: 11px;
  color: var(--text-muted);
}

.balance-chip strong {
  font-size: 14px;
  color: var(--brand);
}

.balance-currency {
  font-size: 11px;
}

.hero-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 82%;
}

.hero-kicker {
  font-size: 11px;
  color: #8fa0ff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-card h1 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.08;
}

.hero-card p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-cta {
  margin-top: 14px;
  border: none;
  border-radius: 12px;
  height: 44px;
  padding: 0 18px;
  font-weight: 700;
  color: #161616;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  cursor: pointer;
}

.hero-glow {
  position: absolute;
  right: -30px;
  top: -20px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 128, 255, 0.45), rgba(74, 128, 255, 0));
  filter: blur(10px);
}

.wallet-card,
.search-card,
.ticker-card,
.category-card,
.providers-card,
.games-card {
  padding: 12px;
}

.wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wallet-title {
  font-size: 16px;
  font-weight: 700;
}

.wallet-balance {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
}

.wallet-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wallet-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.search-input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-main);
  padding: 0 12px;
  outline: none;
}

.search-input:focus {
  border-color: rgba(255, 198, 46, 0.42);
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

.section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.winners-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.winner-item,
.winner-skeleton {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: #171b2a;
  padding: 10px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.winner-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.winner-fallback {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #e8ecff;
  background: linear-gradient(135deg, #2b3659, #1a1f34);
}

.winner-user {
  font-size: 13px;
  font-weight: 700;
}

.winner-game {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.winner-amount {
  color: var(--brand);
  font-weight: 800;
}

.categories,
.providers-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
}

.categories::-webkit-scrollbar,
.providers-list::-webkit-scrollbar {
  display: none;
}

.cat-btn,
.provider-chip,
.provider-skeleton {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-muted);
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
  cursor: pointer;
}

.cat-btn.active,
.provider-chip.active {
  color: #1f1f1f;
  border-color: transparent;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.game-card,
.card-skeleton {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #171b2a;
}

.game-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  cursor: pointer;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.game-card-media {
  aspect-ratio: 1.08;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #202a46, #101423);
}

.game-card-image-backdrop,
.game-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game-card-image-backdrop {
  filter: blur(10px);
  transform: scale(1.06);
  opacity: 0.5;
  background-size: cover;
  background-position: center;
}

.game-card-image {
  object-fit: cover;
  display: block;
}

.game-card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #293760, #171d30);
}

.game-card-chrome {
  position: absolute;
  top: 6px;
  left: 6px;
}

.game-card-chip {
  display: inline-flex;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 9px;
  padding: 4px 8px;
  color: #edf0ff;
  background: rgba(10, 10, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.game-card-body {
  padding: 8px;
}

.game-card-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-card-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.game-card-link {
  color: var(--green);
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px 10px;
}

.empty-title {
  font-size: 20px;
  font-weight: 800;
}

.empty-text {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(6, 8, 14, 0.78);
  backdrop-filter: blur(6px);
  z-index: 90;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: min(100%, 620px);
  padding: 14px;
  border-radius: 16px;
}

.modal-close {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.modal-hero {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.modal-media {
  border-radius: 12px;
  overflow: hidden;
  background: #1a2136;
}

.modal-game-banner,
.modal-banner-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.modal-game-banner {
  object-fit: cover;
  display: none;
}

.modal-banner-fallback {
  display: grid;
  place-items: center;
  color: #d8defa;
  font-weight: 700;
}

.modal-kicker {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-game-name {
  margin-top: 5px;
  font-size: 24px;
  font-weight: 800;
}

.modal-game-provider {
  margin-top: 3px;
  color: var(--text-muted);
}

.modal-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modal-stat {
  background: #171b2a;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
}

.modal-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-stat-value {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--brand);
}

.modal-note {
  margin-top: 10px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.modal-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.btn {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: transparent;
  color: #141414;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  font-weight: 700;
}

.btn-secondary {
  background: #1a2032;
}

.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 94;
}

.side-menu-overlay.active {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -290px;
  width: 280px;
  height: 100%;
  background: #111524;
  border-left: 1px solid var(--line);
  z-index: 95;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  transition: right 0.25s ease;
  visibility: hidden;
}

.side-menu.active {
  right: 0;
  visibility: visible;
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.side-menu-header button,
.side-menu button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #1a2032;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  padding: 0 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 520px);
  background: #171b2a;
  color: #f3f5ff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  z-index: 96;
  display: none;
}

.toast.show {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 760px);
  background: rgba(15, 19, 31, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  backdrop-filter: blur(10px);
  z-index: 70;
}

.bottom-nav-item {
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav-item:active {
  border-color: var(--line);
  background: #1b2236;
}

.card-skeleton,
.winner-skeleton,
.provider-skeleton {
  position: relative;
  overflow: hidden;
  color: transparent;
}

.card-skeleton {
  min-height: 180px;
}

.card-skeleton::after,
.winner-skeleton::after,
.provider-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.35s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 560px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 100%;
  }
}
