/* AETHERRA Game Hub — premium dashboard shell */

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

body.hub-dashboard[data-hub-require-auth="true"]:not(.hub-auth-ready) {
  visibility: hidden;
}

.hub-dashboard {
  --hub-bg: #0a0e1a;
  --hub-bg-elevated: rgba(14, 20, 36, 0.72);
  --hub-border: rgba(139, 92, 246, 0.18);
  --hub-border-bright: rgba(139, 92, 246, 0.42);
  --hub-purple: #8b5cf6;
  --hub-purple-bright: #a78bfa;
  --hub-blue: #3b82f6;
  --hub-cyan: #38bdf8;
  --hub-gold: #fbbf24;
  --hub-green: #34d399;
  --hub-text: #f1f5f9;
  --hub-text-muted: #94a3b8;
  --hub-sidebar-w: 240px;
  --hub-rightbar-w: 300px;
  --hub-radius: 14px;
  --hub-radius-sm: 10px;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--hub-bg);
  color: var(--hub-text);
  min-height: 100vh;
  min-height: 100dvh;
}

.hub-dashboard::before {
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(139, 92, 246, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 85% 15%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(30, 27, 75, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, #0c1020 0%, #060a14 100%);
  filter: none;
}

.hub-dashboard .landing-wrap {
  display: none;
}

/* Shell layout */
.hub-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--hub-sidebar-w) minmax(0, 1fr) var(--hub-rightbar-w);
  min-height: 100vh;
  min-height: 100dvh;
  gap: 0;
}

/* Glass panels */
.glass-panel {
  background: var(--hub-bg-elevated);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Left sidebar */
.hub-sidebar {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(8, 12, 24, 0.55);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.hub-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

.hub-sidebar-brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hub-purple), var(--hub-blue));
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45);
}

.hub-sidebar-brand-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
}

.hub-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.hub-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--hub-radius-sm);
  color: var(--hub-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.hub-nav-item:hover {
  color: var(--hub-text);
  background: rgba(255, 255, 255, 0.04);
}

.hub-nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.35), rgba(59, 130, 246, 0.15));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.hub-nav-icon {
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.9;
}

.hub-nav-signin {
  margin-top: 0.5rem;
  color: var(--hub-purple-bright);
}

.hub-nav-signin:hover {
  background: rgba(139, 92, 246, 0.12);
  color: #fff;
}

.hub-nav-logout {
  margin-top: 0.35rem;
  color: #f87171;
}

.hub-nav-logout:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.hub-sidebar-promo {
  margin-top: 1.25rem;
  padding: 1rem;
  text-align: center;
}

.hub-sidebar-promo-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.hub-sidebar-promo-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.hub-sidebar-promo-copy {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--hub-text-muted);
}

/* Center column */
.hub-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.5rem 2rem;
  gap: 1.25rem;
}

.hub-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
}

.hub-greeting-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.hub-greeting-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.hub-badge-level {
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: var(--hub-purple-bright);
}

.hub-badge-currency {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--hub-gold);
}

.hub-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hub-icon-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--hub-text-muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hub-icon-btn:hover {
  border-color: var(--hub-border-bright);
  color: #fff;
  background: rgba(139, 92, 246, 0.12);
}

.hub-icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.hub-icon-badge-mail {
  background: var(--hub-purple);
}

.hub-mobile-menu-btn {
  display: none;
}

.hub-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Auth & room banners */
.hub-auth-banner,
.hub-room-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  flex-wrap: wrap;
}

.hub-auth-banner h2,
.hub-room-banner h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.hub-auth-banner p,
.hub-room-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--hub-text-muted);
  line-height: 1.45;
}

.hub-room-status {
  color: var(--hub-cyan) !important;
  font-size: 0.8rem !important;
}

.hub-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hub-room-code {
  font-weight: 800;
  letter-spacing: 0.1em;
}

/* Stats row */
.hub-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.hub-stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
}

.hub-stat-card-link {
  padding: 0;
}

.hub-stat-card-link .hub-stat-card-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  width: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: inherit;
  transition: background 0.15s;
}

.hub-stat-card-link:hover .hub-stat-card-inner {
  background: rgba(255, 255, 255, 0.04);
}

.hub-profile-detail dd a {
  color: #fbbf24;
  text-decoration: none;
}

.hub-profile-detail dd a:hover {
  text-decoration: underline;
}

.hub-stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.hub-stat-icon-purple { background: rgba(139, 92, 246, 0.18); }
.hub-stat-icon-gold { background: rgba(251, 191, 36, 0.15); }
.hub-stat-icon-blue { background: rgba(59, 130, 246, 0.18); }
.hub-stat-icon-green { background: rgba(52, 211, 153, 0.15); }

.hub-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.hub-stat-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--hub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Games section */
.hub-section-head {
  margin-bottom: 0.85rem;
}

.hub-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.hub-section-head p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--hub-text-muted);
}

.hub-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.hub-dash-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border-radius: var(--hub-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--hub-bg-elevated);
  border: 1px solid var(--hub-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hub-dash-game-card:hover {
  transform: translateY(-3px);
  border-color: var(--game-accent, var(--hub-purple));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--game-accent, var(--hub-purple)) 40%, transparent),
    0 12px 36px rgba(0, 0, 0, 0.4),
    0 0 24px color-mix(in srgb, var(--game-accent, var(--hub-purple)) 25%, transparent);
}

.hub-dash-game-art {
  position: relative;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.4);
}

.hub-dash-game-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10, 14, 26, 0.95) 100%);
}

.hub-dash-game-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hub-dash-game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 1rem;
}

.hub-dash-game-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.hub-dash-game-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.hub-dash-stat {
  min-width: 0;
}

.hub-dash-stat-label {
  display: block;
  font-size: 0.68rem;
  color: var(--hub-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hub-dash-stat-value {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-dash-game-last {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  color: var(--hub-text-muted);
}

.hub-dash-game-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.hub-dash-play-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--game-accent, var(--hub-purple));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--game-accent, var(--hub-purple)) 40%, transparent);
}

.hub-dash-stats-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--hub-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-dash-game-card:hover .hub-dash-stats-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.hub-dash-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hub-site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.hub-site-footer a {
  color: var(--hub-text-muted);
  text-decoration: none;
}

.hub-site-footer a:hover {
  color: var(--hub-cyan);
}

.cloud-save-row--highlight {
  border-color: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.account-avatar-photo-preview {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.account-avatar-photo-preview.has-image {
  font-size: 0;
}

.account-avatar-photo-preview img,
.account-avatar-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Community banner */
.hub-community-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.35), rgba(88, 28, 135, 0.25));
}

.hub-community-copy h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.hub-community-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--hub-text-muted);
}

.hub-community-links {
  display: flex;
  gap: 0.5rem;
}

.hub-social-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.15s, transform 0.15s;
}

.hub-social-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

/* Right sidebar */
.hub-rightbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem 2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.hub-profile-card {
  padding: 1.25rem 1.1rem;
  text-align: center;
}

.hub-profile-avatar-wrap {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.75rem;
}

.hub-profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35));
  border: 2px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.3);
  overflow: hidden;
}

.hub-profile-avatar.has-image,
.hub-player-chip-avatar.has-image,
.landing-profile-avatar.has-image {
  font-size: 0;
  padding: 0;
}

.hub-avatar-img,
.hub-profile-avatar img,
.hub-player-chip-avatar img,
.landing-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.hub-profile-level {
  position: absolute;
  bottom: -2px;
  right: -2px;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--hub-purple);
  border: 2px solid var(--hub-bg);
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  color: #fff;
}

.hub-profile-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.hub-profile-email {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.78rem;
  color: var(--hub-text-muted);
  word-break: break-word;
}

.hub-profile-details {
  margin: 1rem 0 0;
  padding: 0;
  text-align: left;
}

.hub-profile-detail {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.hub-profile-detail:last-child {
  border-bottom: none;
}

.hub-profile-detail dt {
  color: var(--hub-text-muted);
  font-weight: 500;
}

.hub-profile-detail dd {
  margin: 0;
  font-weight: 600;
  color: #e2e8f0;
  text-align: right;
}

.hub-verified.is-ok {
  color: var(--hub-green);
}

.hub-verified.is-pending {
  color: var(--hub-gold);
}

/* Activity feed */
.hub-activity-card,
.hub-daily-card {
  padding: 1rem 1.1rem;
}

.hub-activity-card h3,
.hub-daily-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.hub-activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.hub-activity-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.hub-activity-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-activity-body {
  min-width: 0;
  flex: 1;
}

.hub-activity-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}

.hub-activity-time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--hub-text-muted);
}

.hub-activity-empty {
  font-size: 0.82rem;
  color: var(--hub-text-muted);
  padding: 0.5rem 0;
}

/* Daily bonus */
.hub-daily-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hub-daily-head h3 {
  margin: 0;
}

.hub-daily-icon {
  font-size: 1.35rem;
}

.hub-daily-streak {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.hub-daily-day {
  flex: 1;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.hub-daily-day.is-done {
  background: linear-gradient(90deg, var(--hub-purple), var(--hub-blue));
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.hub-daily-day.is-today {
  background: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.hub-daily-copy {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--hub-text-muted);
  line-height: 1.4;
}

/* Buttons */
.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}

.hub-btn:hover {
  filter: brightness(1.08);
}

.hub-btn:active {
  transform: scale(0.98);
}

.hub-btn-purple {
  color: #fff;
  background: linear-gradient(135deg, var(--hub-purple), #6366f1);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4);
}

.hub-btn-purple:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.hub-btn-ghost {
  color: var(--hub-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.hub-btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
}

.hub-btn-block {
  width: 100%;
}

/* Mobile sidebar overlay */
.hub-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 1280px) {
  .hub-shell {
    grid-template-columns: var(--hub-sidebar-w) minmax(0, 1fr);
  }

  .hub-rightbar {
    display: none;
  }
}

@media (max-width: 900px) {
  .hub-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .hub-shell {
    grid-template-columns: 1fr;
  }

  .hub-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    width: min(280px, 85vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }

  .hub-sidebar.is-open {
    transform: translateX(0);
  }

  .hub-mobile-menu-btn {
    display: grid;
  }

  .hub-center {
    padding: 1rem 1rem 1.5rem;
  }

  .hub-game-grid {
    grid-template-columns: 1fr;
  }

  .hub-community-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hub-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .hub-stat-card {
    padding: 0.85rem;
  }

  .hub-stat-value {
    font-size: 1.25rem;
  }

  .hub-auth-banner,
  .hub-room-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .hub-dash-game-actions .hub-dash-play-btn,
  .hub-dash-game-actions .hub-dash-stats-btn {
    min-height: 44px;
  }
}

/* Extended platform UI */
.hub-greeting-sub {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--hub-text-muted);
  line-height: 1.45;
}

.hub-badge-premium {
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #67e8f9;
}

.hub-premium-active {
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
}

.hub-premium-free {
  color: var(--hub-text-muted) !important;
}

.hub-stat-icon-cyan {
  background: rgba(34, 211, 238, 0.15);
}

.hub-section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hub-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.hub-collections-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 1.25rem;
}

.hub-collection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.hub-collection-card:hover {
  transform: translateY(-2px);
  border-color: var(--hub-border-bright);
}

.hub-collection-icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.hub-collection-count {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.hub-collection-label {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--hub-text-muted);
}

.hub-achievements-section {
  margin-bottom: 1.25rem;
}

.hub-ach-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.hub-ach-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--hub-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--hub-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hub-ach-filter:hover,
.hub-ach-filter.is-active {
  border-color: var(--hub-border-bright);
  color: #fff;
  background: rgba(124, 58, 237, 0.15);
}

.hub-ach-filter-count {
  opacity: 0.75;
  font-weight: 500;
}

.hub-ach-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.hub-ach-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  align-items: flex-start;
}

.hub-ach-card.is-locked {
  opacity: 0.55;
}

.hub-ach-card-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.hub-ach-card-title {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.hub-ach-card-desc {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--hub-text-muted);
  line-height: 1.35;
}

.hub-ach-card-game {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a78bfa;
}

.hub-dash-sync {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hub-sync-ok { color: #34d399; }
.hub-sync-pending { color: #fbbf24; }
.hub-sync-local { color: #94a3b8; }
.hub-sync-muted { color: #64748b; }

.hub-dash-game-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hub-dash-game-card--soon {
  opacity: 0.85;
  cursor: default;
}

.hub-dash-soon-badge {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.85);
  color: #fff;
}

.hub-dash-game-desc {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--hub-text-muted);
  line-height: 1.4;
}

.hub-dash-stats-btn--full {
  flex: 1;
}

.hub-page-intro {
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.25rem;
}

.hub-page-intro h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.hub-page-intro p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--hub-text-muted);
  line-height: 1.45;
}

.hub-panel-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hub-panel {
  padding: 1.1rem 1.35rem;
}

.hub-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.hub-panel-copy {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--hub-text-muted);
  line-height: 1.45;
}

.hub-placeholder-note {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--hub-purple-bright);
  font-style: italic;
}

.hub-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hub-leaderboard-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.hub-community-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.hub-community-tile:hover {
  transform: translateY(-2px);
  border-color: var(--hub-border-bright);
}

.hub-community-tile-icon {
  font-size: 1.5rem;
}

.hub-community-tile-title {
  font-weight: 700;
  color: #fff;
}

.hub-community-tile-meta {
  font-size: 0.78rem;
  color: var(--hub-text-muted);
}

.hub-battlepass-card {
  padding: 1rem 1.1rem;
}

.hub-battlepass-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.hub-battlepass-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--hub-text-muted);
}

.hub-battlepass-track {
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hub-battlepass-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hub-purple), var(--hub-cyan));
  transition: width 0.3s ease;
}

/* Account page inside hub shell — Epic-style settings */
.hub-account-page .hub-main-account {
  max-width: 1100px;
}

.account-settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.account-settings-nav {
  position: sticky;
  top: 1rem;
  padding: 1rem 0.75rem;
  border-radius: var(--hub-radius);
}

.account-settings-nav-group {
  margin: 0.75rem 0 0.35rem;
  padding: 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hub-text-muted);
}

.account-settings-nav-group:first-child {
  margin-top: 0;
}

.account-settings-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin: 0.1rem 0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--hub-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.account-nav-icon {
  width: 1.1rem;
  flex-shrink: 0;
  opacity: 0.75;
  font-size: 0.95rem;
  line-height: 1;
}

.account-settings-nav-link:hover,
.account-settings-nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.account-settings-nav-link.is-active {
  box-shadow: inset 3px 0 0 var(--hub-cyan);
}

.account-tab-panel {
  display: none;
}

.account-tab-panel.is-active {
  display: block;
}

.account-form-stack {
  display: grid;
  gap: 0.85rem;
  max-width: 360px;
}

.account-link-email-block {
  margin-top: 0.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.account-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.account-toggle-copy {
  display: grid;
  gap: 0.2rem;
}

.account-toggle-copy strong {
  font-size: 0.92rem;
}

.account-toggle-copy span {
  font-size: 0.82rem;
  color: var(--hub-text-muted);
  line-height: 1.4;
}

.account-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.account-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.account-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.account-toggle-input:checked + .account-toggle {
  background: var(--hub-cyan);
}

.account-toggle-input:checked + .account-toggle::after {
  transform: translateX(20px);
}

.account-legal-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.account-legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.account-legal-table th,
.account-legal-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.account-legal-table th {
  color: var(--hub-text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-legal-details {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--hub-text-muted);
  line-height: 1.5;
}

.account-legal-details summary {
  cursor: pointer;
  color: var(--hub-cyan);
  margin-bottom: 0.5rem;
}

.linked-accounts-linked {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.linked-account-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}

.linked-account-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.linked-account-card-icon svg {
  width: 22px;
  height: 22px;
}

.linked-account-card-body {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.linked-account-card-body strong {
  font-size: 0.92rem;
}

.linked-account-card-body span {
  font-size: 0.82rem;
  color: var(--hub-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-account-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
}

.linked-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.linked-account-tile {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  padding: 1rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.linked-account-tile:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.linked-account-tile.is-disabled {
  opacity: 0.55;
  cursor: default;
}

.linked-account-tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.linked-account-tile-icon svg {
  width: 28px;
  height: 28px;
}

.linked-account-tile-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.linked-account-tile-hint {
  font-size: 0.72rem;
  color: var(--hub-text-muted);
}

.account-settings-nav-link--danger.is-active,
.account-settings-nav-link--danger:hover {
  color: #fca5a5;
}

.account-settings-header {
  margin-bottom: 1.75rem;
}

.account-settings-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.account-settings-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: var(--hub-text-muted);
  line-height: 1.5;
}

.account-settings-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-settings-section.glass-panel {
  padding: 1.25rem 1.35rem;
  border-radius: var(--hub-radius);
  border: 1px solid var(--hub-border);
  background: var(--hub-bg-elevated);
}

.account-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.account-subsection-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hub-text-muted);
}

.account-section-copy,
.account-muted {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--hub-text-muted);
  line-height: 1.5;
}

.account-info-list {
  margin: 0;
}

.account-info-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-info-row dt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hub-text-muted);
}

.account-info-row dd {
  margin: 0;
  font-size: 0.92rem;
}

.account-info-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.account-input {
  width: 100%;
  max-width: 320px;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--hub-text);
  font: inherit;
  font-size: 0.9rem;
}

.account-input:focus {
  outline: none;
  border-color: var(--hub-cyan);
}

.account-char-count {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--hub-text-muted);
}

.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 420px;
}

.account-stat {
  padding: 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.account-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.account-stat span {
  font-size: 0.75rem;
  color: var(--hub-text-muted);
}

.account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.account-btn-primary {
  margin-top: 1rem;
  color: #0a0a0b;
  background: var(--hub-cyan);
}

.account-btn-secondary {
  color: var(--hub-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.account-btn-danger {
  color: #0a0a0b;
  background: #f472b6;
  font-weight: 700;
}

.account-btn-danger:hover {
  background: #fb7185;
}

.account-delete-section {
  border-color: rgba(244, 114, 182, 0.25) !important;
}

.account-danger-zone {
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.account-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.account-delete-copy {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: var(--hub-text-muted);
  line-height: 1.55;
  max-width: 52ch;
}

.account-delete-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 360px;
}

.account-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hub-text-muted);
}

.account-settings-footer {
  margin-top: 1rem;
  padding-top: 1rem;
}

.account-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.88rem;
}

.account-error:empty {
  display: none;
}

.hub-account-nav {
  display: none;
}

.hub-account-page .hub-panel.landing-panel {
  margin-bottom: 1rem;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

@media (max-width: 900px) {
  .account-settings-layout {
    grid-template-columns: 1fr;
  }

  .account-settings-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem;
  }

  .account-settings-nav-group {
    width: 100%;
    margin-top: 0.5rem;
  }

  .account-settings-nav-link {
    width: auto;
    flex: 1 1 auto;
    min-width: calc(50% - 0.35rem);
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
  }

  .account-nav-icon {
    display: none;
  }

  .account-info-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.hub-account-error {
  text-align: center;
  margin-top: 0.5rem;
}

.hub-main-rooms .hub-panel.landing-panel {
  margin-bottom: 1rem;
}

.hub-main-rooms .landing-panel {
  background: var(--hub-bg-elevated);
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
}

/* Lore wiki embedded in hub */
.hub-lore-page .hub-center {
  padding: 1rem 1.25rem 1.5rem;
}

.hub-main-lore {
  min-width: 0;
}

.lore-wiki-shell-embedded {
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  background: var(--hub-bg-elevated);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.hub-lore-page.game-bg-lore::before {
  filter: none;
}
