:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #26354d;
  --border: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --success: #10b981;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.35);
  --warning-text: #fde68a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-icon {
  font-size: 1.35rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.xp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-auth {
  background: var(--text);
  color: #0f172a;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.42rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-auth:hover {
  opacity: 0.9;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  border-radius: 999px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding-left: 0.35rem;
  border-left: 1px solid var(--border);
}

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

/* Guest Notice Banner */
.guest-notice {
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 0.85rem;
}

.guest-notice-inner {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.guest-notice-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-notice-login {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--warning-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-notice-login:hover {
  background: rgba(245, 158, 11, 0.3);
}

.btn-notice-dismiss {
  background: none;
  border: none;
  color: var(--warning-text);
  opacity: 0.75;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem;
}

.btn-notice-dismiss:hover {
  opacity: 1;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

.intro {
  margin-bottom: 2rem;
}

.intro h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.intro p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.game-card.live:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-hover);
}

.game-card.upcoming {
  opacity: 0.75;
  border-style: dashed;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-icon {
  font-size: 2rem;
  line-height: 1;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.status-badge.live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-badge.upcoming {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.game-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
}

.game-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-play {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.btn-play:hover {
  background: var(--accent-hover);
}

.btn-disabled {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.btn-repo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

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

/* Subtle Bottom Toast Prompt */
.xp-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.xp-toast-content p {
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.xp-toast-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-toast-primary {
  background: var(--accent);
  color: #0f172a;
  border: none;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-toast-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.footer-inner a:hover {
  color: var(--text);
}

