:root {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --text: #1a1a1e;
  --muted: #6b6b76;
  --accent: #5b5bf0;
  --border: #e0e0e6;
  --shadow: rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
  --bg: #14141a;
  --surface: #1e1e26;
  --text: #f0f0f5;
  --muted: #9a9aa6;
  --accent: #7d7dff;
  --border: #2c2c36;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-widget {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-name {
  font-weight: 600;
  color: var(--text);
}

.account-signout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.account-signout:hover {
  color: var(--text);
  border-color: var(--accent);
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.games-section h2 {
  font-size: 1.2rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

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

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px var(--shadow);
}

.empty-message {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.95rem;
}

.empty-message code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.scug-account-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.scug-account-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 12px 32px var(--shadow);
}

.scug-account-modal h2 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.scug-account-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 0.75rem;
}

.scug-existing-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.scug-account-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.scug-account-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#scug-account-form {
  display: flex;
  gap: 0.5rem;
}

#scug-username-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

#scug-account-form button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.scug-account-error {
  color: #e5484d;
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
}
