/* ==========================================================================
   Kings Baseball — design tokens & reusable components (mobile-first, compact)
   ========================================================================== */

:root {
  /* Core brand */
  --navy: #142a55;          /* primary — logo navy */
  --navy-deep: #0d1d3d;     /* hover/active on navy elements */
  --navy-soft: #46598a;     /* secondary text, quiet icons */
  --cream: #f7f6f2;         /* page background */
  --surface: #ffffff;       /* cards, inputs */

  /* Accents */
  --stitch-red: #b5372e;    /* baseball-stitch red — key actions, highlights */
  --stitch-red-deep: #93291f;
  --gold: #b8860b;          /* championship gold — badges, moments of pride */
  --gold-soft: #f3ead0;

  /* Alerts */
  --success: #2f7d4f;
  --success-soft: #e8f2ec;
  --warning: #9a6a10;
  --warning-soft: #f8efdd;
  --danger: #b5372e;
  --danger-soft: #f7e7e4;
  --info: #33628f;
  --info-soft: #e6eef5;

  /* Neutrals derived from navy */
  --ink: var(--navy);
  --ink-muted: rgba(20, 42, 85, 0.62);
  --line: rgba(20, 42, 85, 0.15);
  --line-strong: rgba(20, 42, 85, 0.3);

  /* Type & shape */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --radius: 4px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(13, 29, 61, 0.08), 0 2px 8px rgba(13, 29, 61, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;   /* 15px base — compact but readable at arm's length */
  line-height: 1.45;
}

/* --- Typography ------------------------------------------------------- */

h1, .h1 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
h2, .h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
h3, .h3 { font-size: 1rem; font-weight: 600; }

.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.muted { color: var(--ink-muted); }
.small { font-size: 0.8125rem; }

.rule {
  width: 56px;
  height: 2px;
  background: var(--navy);
  border: none;
  margin: 0.875rem auto;
}

a { color: var(--navy); }
a:hover { color: var(--stitch-red); }

/* --- Buttons ----------------------------------------------------------- */
/* Dense look, but min-height keeps the ~44px touch target (Apple HIG). */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--navy-deep); color: var(--cream); }

.btn-accent { background: var(--stitch-red); color: #fff; }
.btn-accent:hover { background: var(--stitch-red-deep); color: #fff; }

.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--cream); }

.btn-quiet { background: transparent; color: var(--navy-soft); }
.btn-quiet:hover { color: var(--stitch-red); }

.btn:disabled, .btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm { min-height: 36px; font-size: 0.75rem; padding: 0 0.75rem; }

/* --- Forms -------------------------------------------------------------- */

.field { margin-bottom: 0.875rem; text-align: left; }

.field label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy-soft);
  margin-bottom: 0.25rem;
}

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;        /* 16px floor — anything smaller triggers iOS zoom */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  min-height: 42px;
}

.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.field .hint { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.25rem; }

.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: var(--danger);
}
.field.has-error .hint { color: var(--danger); }

.checkbox,
.field label.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.checkbox input { accent-color: var(--navy); width: 1.1rem; height: 1.1rem; }

/* --- Alerts ------------------------------------------------------------- */

.alert {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  text-align: left;
  font-size: 0.8125rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin-bottom: 0.5rem;
}

.alert strong { display: block; font-size: 0.8125rem; }

.alert-success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger);  color: var(--danger); }
.alert-info    { background: var(--info-soft);    border-color: var(--info);    color: var(--info); }

/* --- Badges & chips ------------------------------------------------------ */

.badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.badge-navy    { background: var(--navy); color: var(--cream); }
.badge-gold    { background: var(--gold-soft); color: var(--gold); }
.badge-red     { background: var(--danger-soft); color: var(--stitch-red); }
.badge-green   { background: var(--success-soft); color: var(--success); }
.badge-neutral { background: rgba(20, 42, 85, 0.08); color: var(--navy-soft); }

.jersey-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.3rem;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--cream);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- RSVP segmented control --------------------------------------------- */

.rsvp {
  display: inline-flex;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
}

.rsvp button {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 40px;
  padding: 0 1rem;
  background: transparent;
  color: var(--navy);
  border: none;
  cursor: pointer;
}

.rsvp button + button { border-left: 1px solid var(--line); }

.rsvp button.is-active-in    { background: var(--success); color: #fff; }
.rsvp button.is-active-maybe { background: var(--warning); color: #fff; }
.rsvp button.is-active-out   { background: var(--danger);  color: #fff; }

/* --- Cards & lists ------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.875rem;
  text-align: left;
}

.card + .card { margin-top: 0.625rem; }

.list {
  list-style: none;
  text-align: left;
}

.list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;      /* full row is the touch target */
  padding: 0.35rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.list li:last-child { border-bottom: none; }

/* --- Chat ---------------------------------------------------------------- */

.chat-msg { text-align: left; margin-bottom: 0.65rem; max-width: 34rem; }

.chat-msg .meta {
  font-size: 0.6875rem;
  color: var(--ink-muted);
  margin-bottom: 0.15rem;
}

.chat-msg .bubble {
  display: inline-block;
  font-size: 0.9375rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
}

.chat-msg.is-mine .bubble {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

/* --- Misc ----------------------------------------------------------------- */

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background: var(--navy-soft);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0 0.875rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.site-nav .links { display: flex; gap: 1rem; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;      /* nav links stay thumb-sized even at compact text */
  text-decoration: none;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
