:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: #090a0d;
  color: #f7f8fb;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #090a0d;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 75% -20%, rgba(69, 118, 255, 0.2), transparent 34rem),
    linear-gradient(180deg, #101116 0%, #090a0d 44%, #08090b 100%);
}

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

.ambient {
  position: fixed;
  z-index: 0;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.16;
}

.ambient-one {
  top: 20%;
  left: -12rem;
  background: #7748ff;
}

.ambient-two {
  right: -12rem;
  bottom: -5rem;
  background: #2d70ff;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.hall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hall-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.control-link {
  padding: 9px 13px;
  border: 1px solid rgba(101, 137, 255, 0.28);
  border-radius: 999px;
  background: rgba(76, 114, 241, 0.09);
  color: #aebfff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.control-link:hover,
.control-link:focus-visible {
  border-color: rgba(120, 151, 255, 0.6);
  background: rgba(76, 114, 241, 0.18);
  outline: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #467aff, #6654ed);
  box-shadow: 0 9px 28px rgba(61, 104, 255, 0.27);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.game-count {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #9699a5;
  font-size: 12px;
}

.game-count strong {
  color: #f6f7fb;
  font-size: 13px;
}

.hero {
  padding: 54px 0 27px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #6689ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.hero > p:last-child {
  margin: 14px 0 0;
  color: #888c98;
  font-size: 14px;
}

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

.game-card {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  outline: none;
}

.cover-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 235 / 320;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #17191f;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease, filter 180ms ease;
}

.cover-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 55%, rgba(4, 5, 8, 0.3));
  pointer-events: none;
}

.play-badge {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(65, 112, 255, 0.94);
  box-shadow: 0 12px 35px rgba(31, 67, 190, 0.55);
  opacity: 0;
  transform: translate(-50%, -44%) scale(0.88);
  transition: opacity 180ms ease, transform 180ms ease;
}

.play-badge svg {
  width: 20px;
  fill: white;
}

.card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px 0;
}

.game-title {
  display: block;
  overflow: hidden;
  color: #f2f3f7;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-provider {
  display: block;
  margin-top: 3px;
  color: #6f737e;
  font-size: 9px;
}

.game-status,
.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #737782;
  font-size: 9px;
  white-space: nowrap;
}

.game-status {
  padding-top: 2px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.online {
  background: #35d98a;
  box-shadow: 0 0 0 4px rgba(53, 217, 138, 0.08);
}

.status-dot.starting {
  background: #f2ad4e;
  box-shadow: 0 0 0 4px rgba(242, 173, 78, 0.08);
}

.game-card:hover .cover-wrap,
.game-card:focus-visible .cover-wrap {
  border-color: rgba(100, 139, 255, 0.75);
  box-shadow: 0 21px 46px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(70, 113, 255, 0.12);
  transform: translateY(-5px);
}

.game-card:hover .game-cover,
.game-card:focus-visible .game-cover {
  filter: brightness(0.74);
  transform: scale(1.035);
}

.game-card:hover .play-badge,
.game-card:focus-visible .play-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hall-footer {
  display: flex;
  gap: 18px;
  padding: 34px 4px 0;
}

body.player-open {
  overflow: hidden;
}

.game-player {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #050608;
}

.game-player[hidden] {
  display: none;
}

.player-toolbar {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 52px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #101116;
}

.player-toolbar strong {
  overflow: hidden;
  max-width: 50vw;
  color: #f2f3f6;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  width: max-content;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #f4f5f8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.player-button:hover,
.player-button:focus-visible {
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}

.player-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.player-back {
  justify-self: start;
  padding: 0 12px 0 9px;
}

.player-reload {
  justify-self: end;
  justify-content: center;
  width: 38px;
  padding: 0;
}

.player-stage {
  position: relative;
  min-height: 0;
  background: #000;
}

.player-stage iframe {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  pointer-events: none;
  color: #858995;
  font-size: 12px;
}

.player-loading i {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #5d82ff;
  border-radius: 50%;
  animation: loading-spin 800ms linear infinite;
}

.game-player.is-loaded .player-loading {
  display: none;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px 12px;
  }
}

@media (max-width: 590px) {
  .page-shell {
    width: min(100% - 20px, 430px);
    padding-top: 16px;
  }

  .hero {
    padding: 36px 2px 22px;
  }

  .control-link {
    padding: 8px 10px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: 29px;
  }

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

  .cover-wrap {
    border-radius: 11px;
  }

  .card-meta {
    align-items: center;
    padding: 7px 1px 0;
  }

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

  .game-provider,
  .game-status span {
    display: none;
  }

  .game-status {
    padding: 0 2px 0 0;
  }

  .hall-footer {
    padding-top: 25px;
  }

  .player-toolbar {
    min-height: calc(46px + env(safe-area-inset-top));
    padding: calc(5px + env(safe-area-inset-top)) 8px 5px;
  }

  .player-toolbar strong {
    font-size: 12px;
  }

  .player-button {
    min-height: 34px;
  }

  .player-back {
    padding: 0 9px 0 6px;
  }

}

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