:root {
  color-scheme: light dark;
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #5c5c57;
  --border: #d9d9d2;
  --accent: #1f5fbf;
  --danger: #b3261e;
  --warning-bg: #fff4d6;
  --error-bg: #fde7e5;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1d;
    --text: #ececea;
    --muted: #a5a59f;
    --border: #3a3a36;
    --accent: #7fb0ff;
    --danger: #ff8a80;
    --warning-bg: #3a3218;
    --error-bg: #3d1f1c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Hiragino Sans",
    "Noto Sans JP",
    sans-serif;
  line-height: 1.7;
}

a {
  color: var(--accent);
}

.site-header,
.site-footer,
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  border-radius: 6px;
}

.site-footer {
  display: flex;
  gap: 16px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 0.875rem;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.125rem;
  margin-top: 0;
}

/* Cards: account sections, game links and notices. */
section,
.game,
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

section {
  margin: 16px 0;
}

section p {
  color: var(--muted);
}

.games {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.game {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.game-title {
  display: block;
  font-weight: 700;
  font-size: 1.125rem;
}

.game-description {
  color: var(--muted);
  font-size: 0.875rem;
}

button {
  font: inherit;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

label[for] {
  width: 100%;
}

input:not([type]) {
  font: inherit;
  flex: 1 1 12rem;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-transform: uppercase;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.code-box {
  margin-top: 12px;
}

.code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Also inside a section, where paragraphs are otherwise muted. */
.notice {
  padding: 12px 16px;
  color: var(--text);
}

.notice.warning {
  background: var(--warning-bg);
}

.notice.error {
  background: var(--error-bg);
}

/* Long documents: terms and privacy. */
.document h2 {
  margin-top: 2rem;
}

.document h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
}

.document li {
  margin: 4px 0;
}

.document code {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}
