/* Ink & Sticker and Night Hunt share the same layout and interaction tokens. */
:root {
  color-scheme: light;
  --ink: #171420;
  --paper: #e2dac9;
  --card: #efe9dc;
  --woven: var(--card);
  --profile-paper: var(--card);
  --profile-ink: var(--ink);
  --profile-soft: var(--soft);
  --soft: #20142a;
  --sticker-edge: var(--ink);
  --sticker-shadow: 0 4px 0 var(--sticker-edge);
  --sticker-radius: 17px;
  --control-radius: 10px;
  --action: #ffe169;
  --action-ink: #1c1a26;
  --site-accent: #200f32;
  --quiz-surface: #d4c8ea;
  --answer-a: #eaddff;
  --answer-b: #d7eee9;
  --answer-c: #f9ded4;
  --answer-d: #e7edd1;
  --care-surface: #eef4f1;
  --care-accent: #1f5a44;
  --urgent-surface: #fff0ec;
  --urgent-ink: #812c24;
  --masthead: var(--paper);
  --sticker-width: min(1280px, calc(100% - 88px));
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #faf3e6;
  --paper: #11121e;
  --card: #1b1d30;
  --soft: #c9c4da;
  --line: #51476c;
  --rule: #51476c;
  --profile-line: #51476c;
  --control-edge: #8d80a7;
  --sticker-edge: #51476c;
  --sticker-shadow: 0 4px 0 #090a13;
  --action: #ffce77;
  --action-ink: #231729;
  --site-accent: #ffce77;
  --quiz-surface: #1c1d34;
  --answer-a: #2a2542;
  --answer-b: #263341;
  --answer-c: #36273f;
  --answer-d: #2d3440;
  --care-surface: #202b39;
  --care-accent: #a9e3cb;
  --urgent-surface: #3c2732;
  --urgent-ink: #ffd2be;
  --danger-ink: #ffb6a4;
  --ok: #a9e3cb;
  --masthead: #1b1d30;
}

[data-theme="dark"] :is(body, [data-h]) {
  --wash: var(--card);
  --tint: var(--card);
  --deep-ink: #ddd0ff;
}

[data-theme="dark"] body {
  --room: var(--quiz-surface);
  --on: var(--ink);
  --deep: var(--sticker-edge);
}

[data-theme="dark"] body[data-h="play"] { --room: #282337; }

html.nav-open { overflow: hidden; }
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  border-bottom: 2px solid var(--sticker-edge);
  background: var(--masthead);
  color: var(--ink);
}
.top > .wrap {
  display: flex;
  width: var(--sticker-width);
  max-width: none;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}
.logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: 400 28px/1 Gloock, Georgia, serif;
  letter-spacing: -.055em;
  text-decoration: none;
}
.logo > img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--sticker-edge);
  background: var(--quiz-surface);
}
.top .logo-iq { color: var(--site-accent); }
.nav-controls, .top nav { display: flex; align-items: center; gap: 10px; }
.top nav a, .menu {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 780;
  text-decoration: none;
  border-radius: 7px;
}
.top nav a:hover, .top nav a[aria-current] { color: var(--site-accent); background: var(--quiz-surface); }
[data-theme="dark"] .top nav a[aria-current] { box-shadow: inset 0 -2px var(--site-accent); }
.menu { display: none; border: 1px solid var(--sticker-edge); background: transparent; }
.theme-toggle {
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  padding: 0;
}
.theme-toggle:hover { color: var(--site-accent); background: var(--quiz-surface); }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }

.panel, .profile-card {
  border: 2px solid var(--sticker-edge);
  border-radius: var(--sticker-radius);
  box-shadow: var(--sticker-shadow);
}
.btn, .room .btn, .panel .btn, .door .btn, .hunt .done .btn {
  border: 2px solid var(--sticker-edge);
  border-radius: var(--control-radius);
  box-shadow: var(--sticker-shadow);
  background: var(--action);
  color: var(--action-ink);
}
.btn.ghost, .room .btn.ghost, .panel .btn.ghost, .door .btn.ghost {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--sticker-shadow);
}
.btn.ghost[aria-pressed="true"], .panel .btn.ghost[aria-pressed="true"] { background: var(--action); color: var(--action-ink); }
[data-theme="dark"] :is(.btn.ghost, .menu, .home-answers a) { border-color: var(--control-edge); }
.btn:focus-visible, .room .btn:focus-visible, .room .panel .btn:focus-visible { outline-color: var(--site-accent); }
.foot .logo-iq { color: #ffce77; }
.skip, .bar[role="region"] { background: var(--card); color: var(--ink); }
.skip:focus { outline-color: var(--site-accent); z-index: 41; }
[data-theme="dark"] .cm-gear { background: #1c1a26; }

.care-urgent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--urgent-surface);
  color: var(--urgent-ink);
  padding: 11px 12px;
  border-inline-start: 4px solid currentColor;
  border-radius: 4px;
}
.care-urgent-mark {
  display: grid;
  flex: 0 0 20px;
  place-items: center;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}
.care-urgent h2, .care-urgent h3 { margin: 0 0 4px; font: 850 1rem/1.16 Gabarito, sans-serif; }
.care-urgent p { margin: 0; line-height: 1.28; }

@media (max-width: 720px) {
  :root { --sticker-width: calc(100% - 32px); }
  .top > .wrap { min-height: 54px; }
  .logo { font-size: 24px; }
  .logo > img { width: 31px; height: 31px; }
  .nav-controls { gap: 4px; }
  .menu { display: inline-flex; }
  .top nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    max-height: calc(100dvh - 56px);
    overflow: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 12px 16px;
    background: var(--masthead);
    border-block: 2px solid var(--sticker-edge);
    box-shadow: var(--sticker-shadow);
  }
  .top nav.open { display: flex; }
}
