/* rollfor.party character creators — shared look.
   Graph-paper sheet, navy ink, highlighter for what you've picked, red pencil for what's still open. */

:root {
  --paper: #edf1f7;
  --grid: #d6deea;
  --card: #fbfcfe;
  --ink: #1c2b48;
  --ink-soft: #55627c;
  --rule: #b9c4d6;
  --pencil: #c2362b;
  --marker: #f4dc55;
  --marker-ink: #1c2b48;
  --focus: #2f6fd6;
  --ok: #2b8a52;
  --ok-tint: #e2f2e8;
  --brew: #7a52c7;
  --brew-deep: #4f2f9a;
  --brew-light: #b79cf0;
  --cork: #c79a62;
  --radius-s: 4px;
  --radius-m: 10px;
  --shadow: 0 1px 0 #c9d2e0, 0 6px 18px -12px rgba(28, 43, 72, .45);
  --casual: "CASL" 1;
  --mono: "MONO" 1;
  --font: "Recursive", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101a2c; --grid: #1a2740; --card: #16223a; --ink: #e2e8f3; --ink-soft: #9aa9c2; --rule: #33435f;
    --pencil: #ff7a6b; --marker: #6a5a12; --marker-ink: #fff6c8; --focus: #7fb0ff;
    --ok: #5fcf8f; --ok-tint: #16332a;
  --brew: #9b78e6; --brew-deep: #6a45c4; --brew-light: #cdb8ff; --cork: #a87d4c;
    --shadow: 0 1px 0 #0a1120, 0 8px 20px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101a2c; --grid: #1a2740; --card: #16223a; --ink: #e2e8f3; --ink-soft: #9aa9c2; --rule: #33435f;
  --pencil: #ff7a6b; --marker: #6a5a12; --marker-ink: #fff6c8; --focus: #7fb0ff;
  --ok: #5fcf8f; --ok-tint: #16332a;
  --brew: #9b78e6; --brew-deep: #6a45c4; --brew-light: #cdb8ff; --cork: #a87d4c;
  --shadow: 0 1px 0 #0a1120, 0 8px 20px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-variation-settings: var(--casual); line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.num, .mono { font-variation-settings: var(--mono); font-feature-settings: "tnum"; }
.soft { color: var(--ink-soft); }
.small { font-size: .85rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Buttons */
button, .btn {
  font: inherit; font-weight: 650; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius-s);
  padding: .45em .9em; line-height: 1.2; display: inline-flex; align-items: center; gap: .4em; text-decoration: none;
}
button:hover, .btn:hover { background: var(--paper); }
button.primary, .btn.primary { background: var(--ink); color: var(--card); }
button.primary:hover { filter: brightness(1.15); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { border-color: var(--rule); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.danger { color: var(--pencil); border-color: var(--pencil); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--rule); border-radius: var(--radius-s);
  padding: .4em .6em; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { min-height: 5em; resize: vertical; }
label.field { display: block; margin-bottom: .8em; }
label.field > span { display: block; font-size: .82rem; font-weight: 650; color: var(--ink-soft); margin-bottom: .2em; }

/* Highlighter: what you picked */
.hl { background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%); color: var(--marker-ink); padding: 0 .2em; }
/* Red pencil: what's still open */
.pencil { color: var(--pencil); font-variation-settings: var(--casual); font-weight: 700; }
.pencil-count {
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .3em; border-radius: 999px;
  border: 1.5px solid var(--pencil); color: var(--pencil); font-size: .78rem; font-weight: 800; font-variation-settings: var(--casual);
  transform: rotate(-4deg);
}

/* Cards */
.card { background: var(--card); border: 1.5px solid var(--rule); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .3em .7em; border: 1.5px solid var(--rule); border-radius: 999px;
  background: var(--card); cursor: pointer; font-size: .9rem; font-weight: 600; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--marker); color: var(--marker-ink); }
.chip:has(input:disabled:not(:checked)) { opacity: .4; cursor: not-allowed; }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--card);
  padding: .6em 1em; border-radius: var(--radius-s); font-weight: 650; z-index: 99; max-width: calc(100% - 32px);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
