:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071024;
  color: #f7f8ff;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }

.lobby {
  background:
    radial-gradient(circle at 15% 0%, rgba(55, 92, 255, .24), transparent 36rem),
    linear-gradient(145deg, #060a16, #0a1734 70%, #111c3c);
}

.lobby main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0; }
.eyebrow { color: #7ea2ff; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 8px 0 0; font-size: clamp(40px, 8vw, 82px); line-height: .95; }
.intro { color: #aebbd5; margin: 18px 0 40px; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.game-card {
  min-height: 180px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  box-shadow: 0 16px 60px rgba(0,0,0,.18);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.game-card.has-art { min-height: 300px; }
.game-art {
  width: calc(100% + 44px);
  height: 154px;
  margin: -22px -22px 18px;
  object-fit: cover;
  background: #02050d;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.game-card:hover { transform: translateY(-3px); border-color: #6f94ff; background: rgba(68,98,196,.18); }
.provider { color: #8da8eb; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.game-card strong { font-size: 24px; line-height: 1.1; max-width: 15ch; }
.play { color: #cbd7ff; font-size: 13px; }

.game-page {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  background: #000;
}
.player-toolbar {
  position: relative;
  z-index: 10;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: #090f20;
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
}
.player-back,
.player-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #eef2ff;
  background: rgba(255,255,255,.07);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.player-back:hover,
.player-action:hover { border-color: #7ea2ff; background: rgba(78,112,220,.22); }
.player-heading { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.player-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-heading span { color: #8da8eb; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.player-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000; }
#game-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; opacity: 0; }
#game-frame.is-ready { opacity: 1; }
.player-loading,
.embed-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  color: #dce5ff;
  background: radial-gradient(circle at center, #14234a, #050814 68%);
  text-align: center;
}
.player-loading[hidden] { display: none; }
.player-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: #7ea2ff;
  border-radius: 50%;
  animation: player-spin .8s linear infinite;
}
@keyframes player-spin { to { transform: rotate(360deg); } }
.embed-page { width: 100vw; height: 100vh; overflow: hidden; background: #050814; }
.launch-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  color: #fff;
  background: #090d18;
  text-align: center;
}
.launch-error[hidden] { display: none; }

@media (max-width: 620px) {
  .game-page { grid-template-rows: 44px minmax(0, 1fr); }
  .player-toolbar { gap: 8px; padding: 0 8px; }
  .player-back, .player-action { min-height: 32px; padding: 0 10px; font-size: 12px; }
  .player-heading span { display: none; }
}
