/* ── Variables (mirror style.css) ──────────────────────────────── */
:root {
  --bg:        #0b0c18;
  --surface:   #131425;
  --surface2:  #1a1b30;
  --border:    #252640;
  --border2:   #2e2f52;
  --red:       #e63950;
  --yellow:    #f5c518;
  --purple:    #7c3aed;
  --purple2:   #a855f7;
  --green:     #22c55e;
  --blue:      #3b82f6;
  --orange:    #f97316;
  --text:      #e8e9f5;
  --muted:     #7778a0;
  --radius:    14px;
}
body.light {
  --bg:       #eef0f7;
  --surface:  #ffffff;
  --surface2: #f4f5fb;
  --border:   #dde0ef;
  --border2:  #c8cce0;
  --text:     #1a1b2e;
  --muted:    #6b6d8e;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background 0.3s, color 0.3s;
}

body {
  background-image:
    radial-gradient(circle at 15% 20%, rgba(124,58,237,0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(230,57,80,0.08) 0%, transparent 45%);
  min-height: 100vh;
}

/* ── Theme toggle ──────────────────────────────────────────────── */
#theme-toggle {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 500;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.15s;
}
#theme-toggle:hover { background: var(--border); transform: scale(1.1); }

/* ── Hub layout ────────────────────────────────────────────────── */
.hub {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ── Header ────────────────────────────────────────────────────── */
.hub-header {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Cross-hub nav link ────────────────────────────────────────── */
.hub-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  margin-right: auto;
  margin-left: 1rem;
}
.hub-nav-link:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--border);
}

/* ── Auth widget ───────────────────────────────────────────────── */
.hub-auth { position: relative; font-size: 0.875rem; }

.auth-user { position: relative; }

.auth-avatar-btn {
  background: none;
  border: 2px solid transparent;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  transition: border-color 0.15s;
}
.auth-avatar-btn:hover { border-color: var(--purple2); }

.auth-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
}
.auth-avatar--initial {
  background: var(--purple);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  overflow: hidden;
}
.auth-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.auth-name { color: var(--text); font-weight: 600; font-size: 0.875rem; }
.auth-signout-item {
  display: block;
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}
.auth-signout-item:hover { background: var(--border); color: var(--text); }

.auth-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}
.auth-btn:hover { background: var(--border); }

.auth-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  min-width: 160px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.auth-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.auth-provider:hover { background: var(--border); }
.auth-provider--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.auth-coming-soon {
  font-size: 0.7em;
  background: var(--border2);
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.hub-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}

.hub-logo svg { color: var(--purple2); }

.hub-logo span {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Game cards ────────────────────────────────────────────────── */
.hub-games {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}

.game-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

/* ── Card icon ─────────────────────────────────────────────────── */
.game-card-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Connect4 icon: 4 discs in a row */
.connect4-icon {
  background: linear-gradient(135deg, #0d1340 0%, #1a2a80 100%);
  border: 1px solid #2a3a90;
  gap: 5px;
  flex-wrap: wrap;
  padding: 12px;
}

.connect4-icon .disc {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
}
.connect4-icon .disc.red    { background: radial-gradient(circle at 35% 35%, #ff8095, #e63950); box-shadow: 0 0 6px rgba(230,57,80,0.6); }
.connect4-icon .disc.yellow { background: radial-gradient(circle at 35% 35%, #ffe87a, #f5c518); box-shadow: 0 0 6px rgba(245,197,24,0.6); }

/* Sushi Squash icon */
.sushi-icon {
  background: linear-gradient(135deg, #0f0a06 0%, #2a1a0a 100%);
  border: 1px solid #c9a84c;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Card info ─────────────────────────────────────────────────── */
.game-card-info {
  flex: 1;
  min-width: 0;
}

.game-card-info h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.game-card-info p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.6rem;
}

.game-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.game-tag.multiplayer  { background: rgba(124,58,237,0.18); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.game-tag.singleplayer { background: rgba(34,197,94,0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }

/* ── Card arrow ────────────────────────────────────────────────── */
.game-card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}
.game-card:hover .game-card-arrow {
  color: var(--purple2);
  transform: translateX(3px);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hub { padding: 1.5rem 1rem 3rem; }
  .game-card { padding: 1rem; gap: 1rem; }
  .game-card-icon { width: 60px; height: 60px; }
}
