/* Turn & Fade on games.rapidrabbit.de: the family look (thick borders, hard shadows, pills, marker yellow, system
   fonts) in the game's own palette. */
:root {
  --paper: #f4f4f4;
  --sheet: #ffffff;
  --ink: #1a1c2c;
  --muted: #566c86;
  --marker: #ffcd75;
  --marker-ink: #1a1c2c;
  --accent: #38b764;
  --accent-ink: #1a1c2c;
  --green: #38b764;
  --placeholder: #b13e53;
  --game: #1a1c2c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1c2c;
    --sheet: #29366f;
    --ink: #f4f4f4;
    --muted: #94b0c2;
    --marker: #ffcd75;
    --marker-ink: #1a1c2c;
    --accent: #38b764;
    --accent-ink: #1a1c2c;
    --green: #a7f070;
    --placeholder: #ef7d57;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.5; }
a { color: inherit; }
code { font-size: 0.9em; }

/* ---- header (shared with the other games) ---- */
header.site {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  border-bottom: 3px solid var(--ink); background: var(--paper);
}
.to-hub { flex: none; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.to-hub + .wordmark { margin-right: auto; }
.wordmark { font-weight: 900; font-size: 22px; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.dot { color: var(--accent); }
header nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 28px); font-weight: 600; }
header nav a.tab { padding: 2px 8px; border-radius: 999px; text-decoration: none; }
header nav a[aria-current="page"] { background: var(--marker); color: var(--marker-ink); }
header nav a.account { display: inline-flex; align-items: center; gap: 6px; max-width: 11em;
  padding: 3px 11px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700;
  text-decoration: none; white-space: nowrap; }
.account-name { overflow: hidden; text-overflow: ellipsis; }
.account-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--green, #1a7f37); }
@media (hover: hover) {
  .to-hub:hover, header nav a:hover, .wordmark:hover, footer a:hover { background: var(--marker); color: var(--marker-ink); }
  .button:hover { background: var(--marker); color: var(--marker-ink); }
}
@media (max-width: 520px) {
  .to-hub { font-size: 13px; padding: 2px 8px; }
  .wordmark { font-size: 18px; }
  header nav a.account { max-width: 8em; padding: 1px 8px; }
  header nav { flex-wrap: wrap; justify-content: flex-start; column-gap: 14px; row-gap: 8px; }
  /* Text pages: the tabs and the account pill get a row of their own under the hub link and the wordmark. */
  header.site { flex-wrap: wrap; row-gap: 8px; }
  body:not(.game) header nav { flex-basis: 100%; }
}

/* ---- the game page: header on top, the game fills the rest ---- */
body.game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body.game header.site { flex: none; padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 520px) {
  /* On a phone the game needs every pixel: one tight row, and of the tabs only Info (the way to the footer's
     Impressum and Datenschutz). It still wraps if a long account name needs the room. */
  body.game header.site { flex-wrap: wrap; gap: 4px 8px; padding: 4px 10px; }
  body.game .to-hub { font-size: 12px; padding: 2px 7px; }
  body.game .wordmark { font-size: 16px; }
  body.game header nav { gap: 8px; flex-wrap: nowrap; }
  body.game header nav a.tab { font-size: 13px; padding: 1px 6px; }
  body.game header nav a.tab[aria-current="page"] { display: none; }
  body.game header nav a.account { font-size: 13px; max-width: 7em; }
}
#game { flex: 1; min-height: 0; position: relative; background: var(--game); color: #f4f4f4; overflow: hidden; }
#game .loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 12px; margin: 0; font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 4px solid #566c86; border-top-color: #ffcd75; border-radius: 50%;
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
#game .notice { position: absolute; top: 16px; left: 16px; right: 16px; margin: 0; padding: 10px 14px;
  background: var(--marker); color: var(--marker-ink); border: 3px solid var(--ink); }

/* ---- text pages ---- */
.sheet { max-width: 46rem; margin: 24px auto; padding: 20px clamp(16px, 4vw, 32px);
  background: var(--sheet); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
@media (max-width: 520px) { .sheet { margin: 16px; box-shadow: 3px 3px 0 var(--ink); } }
h1 { font-size: clamp(30px, 7vw, 44px); font-weight: 900; line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 800; margin: 24px 0 6px; }
.hero { display: block; width: 100%; height: auto; image-rendering: pixelated; border: 3px solid var(--ink); }
.tagline { font-weight: 800; font-size: 18px; }
.small { font-size: 14px; color: var(--muted); }
.button { display: inline-block; padding: 8px 20px; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink); }
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 8px; }
.placeholder { color: var(--placeholder); font-weight: 700; }

footer { max-width: 46rem; margin: 0 auto; padding: 8px 16px 32px; text-align: center; font-size: 14px; }
footer a { padding: 1px 4px; border-radius: 4px; }
