:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-elevated: #243044;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #3d9cf0;
  --accent-dim: #2a6fad;
  --gold: #f0c14b;
  --success: #3ecf8e;
  --danger: #e85d5d;
  --warning: #f0a030;
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --max: 820px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 156, 240, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(240, 193, 75, 0.08), transparent),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.15rem 3rem;
}

.hero {
  margin-bottom: 1.75rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  min-height: 2.25rem;
}

body.hub-home {
  --app-max: var(--max, 820px);
}

body.hub-home .games-platform-bar-inner {
  max-width: var(--max, 820px);
}

body.hub-home .games-platform-bar-conn {
  display: none;
}

body.hub-home .hero-top.hidden {
  display: none;
}

body.hub-home.has-platform-bar .page {
  padding-top: 1rem;
}

.toast {
  position: fixed;
  left: 50%;
  top: auto;
  bottom: 1.25rem;
  height: auto;
  width: max-content;
  transform: translateX(-50%) translateY(0.5rem);
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #1a2332;
  color: #e8eef7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(232, 93, 93, 0.5);
}

.games-account-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.games-account-menu .games-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 12rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.35);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.games-account-menu a.games-account-chip:hover {
  border-color: rgba(62, 207, 142, 0.65);
  filter: brightness(1.06);
}

.games-account-menu .games-account-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.2);
  flex-shrink: 0;
}

.games-account-menu .games-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.88rem;
}

.games-account-menu .btn-account {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
}

.games-account-menu .btn-sign-in {
  background: var(--accent);
  border: 1px solid transparent;
  color: #041018;
}

.games-account-menu .btn-sign-in:hover {
  filter: brightness(1.08);
}

.games-account-menu .btn-sign-out {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.games-account-menu .btn-sign-out:hover {
  border-color: rgba(232, 93, 93, 0.55);
  color: var(--danger);
}

.games-account-menu .btn-account:disabled {
  opacity: 0.6;
  cursor: wait;
}

.my-games-list {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  color: var(--text);
  line-height: 1.55;
}

.my-games-list .muted {
  color: var(--muted);
  font-size: 0.9em;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1;
}

.hero-logo-mark {
  width: 0.82em;
  height: 0.82em;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.hero-logo-word {
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  background: linear-gradient(180deg, #fff4c4 0%, #f0c14b 46%, #c99628 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #f0c14b;
  -webkit-text-fill-color: transparent;
}

.lede {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.section-head h2,
.card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.status-line {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.25em;
}

.btn-ghost {
  cursor: pointer;
  border: 1px solid var(--bg-elevated);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: wait;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.game-grid > .empty,
.game-grid > .error-banner {
  grid-column: 1 / -1;
}

.game-card {
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.85rem 0.85rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.game-card.is-featured {
  border-color: rgba(61, 156, 240, 0.35);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(61, 156, 240, 0.12);
}

.game-card.is-looking {
  border-color: rgba(62, 207, 142, 0.45);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(62, 207, 142, 0.16);
}

.game-card-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.game-card h3 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.game-tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.14rem 0.38rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--muted);
  white-space: nowrap;
}

.badge-preview {
  background: rgba(240, 160, 48, 0.18);
  color: var(--warning);
}

.badge-live {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.badge-down {
  background: rgba(232, 93, 93, 0.15);
  color: var(--danger);
}

.badge-listed,
.badge-unknown {
  background: var(--bg-elevated);
  color: var(--muted);
}

.badge-looking {
  background: rgba(62, 207, 142, 0.18);
  color: var(--success);
  cursor: pointer;
  border: 0;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

button.badge-looking:hover,
button.badge-looking:focus-visible {
  filter: brightness(1.08);
  outline: 2px solid rgba(62, 207, 142, 0.45);
  outline-offset: 1px;
}

.badge .dot {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: currentColor;
}

.game-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text);
  opacity: 0.88;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0;
}

.game-info-links button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.game-info-links button:hover,
.game-info-links button:focus-visible {
  color: #7dc4ff;
}

.game-stats-line {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.game-looking-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.game-looking-link:hover,
.game-looking-link:focus-visible {
  color: #6ee0ab;
}

.looking-lede {
  margin: 0.15rem 0 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.looking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.looking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.looking-row-main {
  min-width: 0;
}

.looking-row-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.looking-row-meta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.looking-row .btn-play {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(61, 156, 240, 0.28);
}

.hub-popover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hub-popover[hidden] {
  display: none !important;
}

.hub-popover-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 14, 0.62);
}

.hub-popover-panel {
  position: relative;
  width: min(28rem, 100%);
  max-height: min(32rem, calc(100vh - 2rem));
  overflow: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.05rem 1.05rem;
}

.hub-popover.is-looking .hub-popover-panel {
  border-color: rgba(62, 207, 142, 0.28);
}

.hub-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hub-popover-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hub-popover-close {
  flex-shrink: 0;
}

.hub-popover-body {
  margin-top: 0.7rem;
}

.hub-popover-prose {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.howto-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.howto-list h3 {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
}

.howto-list p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 520px) {
  .looking-row {
    flex-wrap: wrap;
  }

  .looking-row .btn-play {
    width: 100%;
  }
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.2rem;
}

.game-actions .btn-play {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(61, 156, 240, 0.35);
}

.btn-play:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem;
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.about-list {
  margin: 0.75rem 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.55;
}

.about-list li {
  margin-bottom: 0.45rem;
}

.about-list strong {
  color: var(--text);
}

.hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-card);
  border-radius: var(--radius);
}

.footer {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.legal {
  margin-top: 0.35rem;
}

.legal-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.legal h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.legal .legal-updated {
  margin: 0 0 1.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legal h2 {
  margin: 1.35rem 0 0.45rem;
  font-size: 1.05rem;
}

.legal p,
.legal li {
  margin: 0 0 0.7rem;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.92;
}

.legal ul {
  margin: 0 0 0.7rem;
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

.footer .dot {
  opacity: 0.6;
}

.error-banner {
  background: rgba(232, 93, 93, 0.12);
  border: 1px solid rgba(232, 93, 93, 0.35);
  color: #f0a0a0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
