:root {
  color-scheme: dark;
  --bg: #14161c;
  --panel: #1f232c;
  --panel-hover: #252a35;
  --border: #2d323e;
  --text: #e8e9ee;
  --muted: #9aa0ad;
  --brand: #f08a3c;
  --danger: #ff8f80;
  --success: #7fd48a;
  --radius: 14px;
  --focus: 0 0 0 3px rgba(240, 138, 60, 0.6);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.muted {
  color: var(--muted);
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 8px;
}

.account {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.account-placeholder {
  display: inline-block;
  width: 88px;
  height: 36px;
}

.account-name {
  min-width: 0;
  color: var(--muted);
  text-decoration: none;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Page */

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-narrow {
  max-width: 440px;
}

.tagline {
  margin: 16px 0 4px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
}

/* Game cards */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
  padding: 22px 20px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

a.card:hover {
  background: var(--panel-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px var(--accent);
}

a.card:focus-visible {
  box-shadow: var(--focus), 0 12px 28px -16px var(--accent);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

.card-blurb {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.card-cta {
  align-self: flex-start;
  font-weight: 600;
  color: var(--accent);
}

.card-cta::after {
  content: " →";
}

.card-soon {
  opacity: 0.55;
}

.card-badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Buttons and forms */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #1b1208;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
  filter: none;
}

.button-small {
  min-height: 36px;
  padding: 6px 14px;
}

.button-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.button-google {
  width: 100%;
  background: #f2f3f5;
  color: #1f1f1f;
}

.button-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.button-link:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

.badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(240, 138, 60, 0.18);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
}

.panel {
  margin-top: 24px;
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input#code {
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 143, 128, 0.12);
  color: var(--danger);
}

.notice {
  margin: 0 0 16px;
  color: var(--success);
}

#login,
#account-settings {
  margin-top: 20px;
}

.hint {
  margin: 0;
  font-size: 0.9rem;
}

a.account-name:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  border-radius: 4px;
}

/* Long-form text (privacy policy) */

.prose {
  max-width: 720px;
}

.prose h1 {
  margin: 16px 0 4px;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.prose h2 {
  margin: 36px 0 8px;
  font-size: 1.3rem;
}

.prose h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
}

.prose p,
.prose li {
  color: #cfd2da;
}

.prose li + li {
  margin-top: 6px;
}

.prose a {
  color: var(--brand);
  text-underline-offset: 3px;
}

.table-wrap {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text);
}

.prose code {
  font-size: 0.9em;
  white-space: nowrap;
}
