/* ============================================================
   theme.css
   Shared design system for the Foosball site - "Tournament
   Orange" dark theme, translated from the Stitch mockup's
   DESIGN.md into plain CSS custom properties (no Tailwind, no
   Google Fonts/icon-font CDN - system fonts + inline SVG icons
   only, keeping the site fully self-contained).

   Link this from a page instead of embedding a duplicate <style>
   block: <link rel="stylesheet" href="theme.css">
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #212121;              /* page background - "the Pitch" */
  --card: #2c2c2c;            /* elevated surface - cards, modals */
  --card-raised: #333333;     /* level-2 surface - popovers, nested panels */
  --border: #3d3d3d;
  --input-bg: #1a1a1a;

  /* Text */
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);

  /* Brand */
  --accent-fg: #ff5722;       /* Tournament Orange - primary actions */
  --accent-fg-hover: #ff7a4d;
  --accent-secondary: #4caf50; /* Pitch Green - secondary actions, success */
  --accent-secondary-hover: #66bb6a;
  --err: #e53935;             /* distinct red for danger/remove actions */
  --err-hover: #ff6659;

  /* Buttons (ghost/neutral) */
  --btn-bg: #333333;
  --btn-hov: #3d3d3d;

  /* Shape */
  --radius: 0.5rem;           /* 8px - standard */
  --radius-lg: 1rem;          /* 16px - primary buttons */
  --radius-full: 9999px;      /* pill - score/status badges */
  --shadow: 0 1px 4px rgba(0, 0, 0, .35);

  /* Type - system stacks only, no webfonts */
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); }
body { display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; }

.wrap { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
}

h1 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }

.sub, p.sub { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* Navigation row shared by club-admin tab pages */
.navrow { display: flex; justify-content: space-between; align-items: center; }
.back { font-size: 12px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent-fg); }
.tabs { display: flex; gap: 14px; }
.tabs a { font-size: 12px; color: var(--accent-fg); text-decoration: none; }
.tabs a:hover { text-decoration: underline; }
.tabs .current { font-size: 12px; color: var(--text); font-weight: 700; }
.tabs .disabled { font-size: 12px; color: var(--border); cursor: not-allowed; }

/* Forms */
label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin: 12px 0 4px;
        text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono); }
label:first-of-type { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); background: var(--input-bg); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-secondary); border-width: 2px; padding: 9px 11px; }
textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent-fg); color: #fff; border: none;
  padding: 11px 20px; border-radius: var(--radius-lg); font-size: 14px; font-weight: 700;
  font-family: var(--font); cursor: pointer; text-decoration: none; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--accent-fg-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.full { width: 100%; margin-top: 10px; padding: 13px; font-size: 15px; }
.btn.secondary { background: transparent; color: var(--accent-secondary); border: 1px solid var(--accent-secondary); }
.btn.secondary:hover:not(:disabled) { background: rgba(76, 175, 80, .1); }
.btn.ghost { background: transparent; color: var(--text); border: none; text-transform: none; letter-spacing: normal; font-weight: 600; }
.btn.ghost:hover:not(:disabled) { color: var(--accent-fg); }
.btn.danger { background: var(--err); }
.btn.danger:hover:not(:disabled) { background: var(--err-hover); }
.btn.claim { background: var(--btn-bg); color: var(--text); border: 1px solid var(--border); text-transform: none; letter-spacing: normal; }
.btn.claim:hover:not(:disabled) { background: var(--btn-hov); }
.btn.small { padding: 6px 12px; font-size: 11px; border-radius: var(--radius); }

/* Messages */
.msg { font-size: 13px; margin-top: 10px; }
.msg.error { color: var(--err); }
.msg.ok { color: var(--accent-secondary); }
.empty { font-size: 13px; color: var(--muted); padding: 8px 0; }

/* Badges - pill-shaped per the design system's score/status treatment */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 9px; border-radius: var(--radius-full); font-family: var(--font-mono);
}
.badge.main { background: rgba(255, 87, 34, .15); color: var(--accent-fg); }
.badge.second { background: rgba(255, 255, 255, .1); color: var(--muted); }
.badge.unreg { background: rgba(229, 57, 53, .15); color: var(--err); }
.badge.active { background: rgba(76, 175, 80, .15); color: var(--accent-secondary); }
.badge.inactive { background: rgba(255, 255, 255, .1); color: var(--muted); }

/* Tables - desktop */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; color: var(--muted); text-transform: uppercase; font-family: var(--font-mono);
     letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tables - mobile stacked-card pattern (see club-members.php etc.) */
@media (max-width: 600px) {
  .table-wrap { overflow-x: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 4px 10px; }
  tbody tr:last-child { margin-bottom: 0; }
  td { display: flex; justify-content: space-between; align-items: center; gap: 10px;
       padding: 9px 0; border-bottom: 1px solid var(--border); text-align: right; }
  td:last-child { border-bottom: none; }
  td::before { content: attr(data-label); font-size: 10px; font-weight: 700; color: var(--muted); font-family: var(--font-mono);
               text-transform: uppercase; letter-spacing: .04em; text-align: left; flex-shrink: 0; }
  td[data-label="Actions"] { justify-content: flex-end; }
  td[data-label="Actions"]::before { content: none; }
}

.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.foot div { margin-top: 8px; }
.foot div:first-child { margin-top: 0; }
.foot a { color: var(--accent-fg); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.version-tag { position: fixed; bottom: 8px; right: 10px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
