/* /card shared primitives. Screen-specific styles live in card-game.css / card-composer.css.
   Uses tokens from tokens.css only. Mobile-first; the app is a single column max 480px wide. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.card-app {
  font-family: var(--font-text);
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--turq-ink); outline-offset: 2px; }
[hidden] { display: none !important; }
/* Router moves focus to the screen heading for screen readers; no visible ring needed there. */
[data-screen] h1:focus, [data-screen] h2:focus { outline: none; }

/* App bar */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 480px; margin: 0 auto; padding: 14px 20px 6px;
}
.app-bar__brand { font-size: 22px; color: var(--navy); text-decoration: none; }
/* Brand wordmark: SCOR + the favicon X mark (images/brand/). Matches /images/Card.png. */
.brand-wordmark { display: inline-flex; align-items: center; font-family: var(--font-text); font-weight: 800; letter-spacing: 0.01em; line-height: 1; }
.brand-wordmark__x { height: 1.15em; width: auto; margin-left: 0.06em; display: block; }
.app-bar__get {
  font-size: 13px; font-weight: 800; color: var(--navy-deep); text-decoration: none;
  background: var(--grad-turq); border-radius: var(--r-pill); padding: 8px 14px;
  box-shadow: 0 4px 12px -5px rgba(0, 168, 150, 0.5);
}

.app-main { max-width: 480px; margin: 0 auto; padding: 8px 18px calc(40px + env(safe-area-inset-bottom)); }
.app-noscript { padding: 40px 0; color: var(--mid); }

/* Headings */
.screen-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.015em; line-height: 1.15; color: var(--navy); margin: 10px 4px 6px; }
.screen-title em { font-style: italic; font-weight: 500; color: var(--turq-ink); }
.screen-sub { color: var(--mid); font-size: 14.5px; line-height: 1.55; margin: 0 4px 18px; }
.eyebrow { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin: 18px 4px 8px; display: block; }

/* Card chassis */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 16px; margin-bottom: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); font-weight: 800; font-size: 15px; padding: 14px 20px;
  border: none; text-decoration: none; min-height: 48px;
  transition: transform .08s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--grad-turq); color: var(--navy-deep); box-shadow: 0 6px 16px -6px rgba(0, 168, 150, 0.55); }
.btn--ghost { background: none; border: 1.5px solid var(--turq-ink); color: var(--turq-ink); }
.btn--quiet { background: var(--inset); color: var(--ink); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.link-btn { background: none; border: none; color: var(--turq-ink); font-weight: 700; font-size: 14px; padding: 8px 4px; }

/* Form fields */
.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: 13px; font-weight: 700; color: var(--mid); margin: 0 2px 6px; }
.field__hint { display: block; font-size: 12px; color: var(--faint); margin: 5px 2px 0; }
.input {
  width: 100%; padding: 13px 14px; font-size: 16px; /* 16px stops iOS zoom */
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-inner); outline: none;
}
.input:focus { border-color: var(--turq); }
.input--num { font-variant-numeric: tabular-nums; text-align: center; font-weight: 800; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Segmented control */
.segment { display: flex; background: var(--inset); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 3px; gap: 3px; }
.segment button {
  flex: 1; border: none; background: none; border-radius: var(--r-pill);
  padding: 9px 8px; font-size: 13px; font-weight: 700; color: var(--faint); white-space: nowrap;
}
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 6px rgba(15, 42, 68, 0.1); }

/* Checkbox row */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink); margin-bottom: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--turq-ink); flex: none; }

/* Inline error / status */
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 6px 2px 0; }
.notice { background: var(--surface-tint); border: 1px solid rgba(0, 212, 196, 0.18); border-radius: var(--r-inner); padding: 12px 14px; font-size: 13.5px; color: var(--ink); line-height: 1.5; }

/* Bottom sheet (shared by game + composer) */
.sheet-scrim { position: fixed; inset: 0; background: rgba(4, 14, 24, .5); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 480px; margin: 0 auto; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}
.sheet h3 { font-size: 18px; margin-bottom: 6px; }
.sheet p { color: var(--mid); font-size: 14px; margin-bottom: 14px; }

@media (min-width: 768px) {
  .app-main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
