/* Compass — light SDA design system.
   Airy white, soft cards, bright SDA green as the single accent. Spirit of
   Tabbycat. Typography: Epilogue. Recreated from the "Compass Redizajn" handoff. */

:root {
  /* SDA brand */
  --green: #21D46E;       /* Zelená SDA — primary accent */
  --green-deep: #0F4B42;  /* Tmavozelená SDA — deep brand ink */
  --ink: #0A2A1C;         /* near-black green for body text */

  /* light neutrals (green-tinted, restrained) */
  --bg: #F3F6F4;
  --card: #FFFFFF;
  --line: #E1E8E3;
  --line-2: #D2DCD6;
  --muted: #5B6B62;
  --muted-2: #8A988F;
  --green-soft: #E4F7EC;
  --green-soft-2: #D6F2E1;

  /* state */
  --danger: #E81525;
  --danger-bg: #FDECEC;
  --danger-line: #F6CFCF;
  --danger-ink: #A11320;
  --danger-text: #B0414B;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(12, 26, 20, 0.04), 0 8px 24px rgba(12, 26, 20, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Epilogue", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 30px);
  display: flex;
  flex-direction: column;
}

/* ── Header (authenticated only) ─────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.wordmark {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  line-height: 1;
}

.logout { margin: 0; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 2px;
}
.link-btn:active { color: var(--green-deep); }

.app-main { flex: 1; display: flex; flex-direction: column; }

/* ── Compass mark / badge ────────────────────────────────────── */
.compass-mark { display: block; }

.compass-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green);
}
.compass-badge .compass-mark { width: 66%; height: 66%; }
.compass-badge--lg { width: 62px; height: 62px; border-radius: 18px; }

/* ── Generic text helpers ────────────────────────────────────── */
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.center { text-align: center; }
a { color: var(--green-deep); text-decoration: none; }

/* ── Page title row ──────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 16px;
}
.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
.count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

/* ── Login / auth branding header ────────────────────────────── */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 18px 0 26px;
}
.auth-brand .wordmark { font-size: 1.625rem; margin-top: 14px; }
.auth-brand .tagline { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-top: 6px; }

.auth-title { font-size: 1.3125rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.auth-sub { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin: 0 0 20px; }

.auth-link { display: block; text-align: center; margin-top: 18px; font-size: 0.85rem; font-weight: 600; color: var(--green-deep); }

/* Back-to-login link (reset flow) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 28px;
}

/* Icon tile (reset / info screens) */
.icon-tile {
  width: 60px;
  height: 60px;
  border-radius: 17px;
  background: var(--green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* ── Forms ───────────────────────────────────────────────────── */
form { margin: 0; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 7px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--muted-2); font-weight: 500; }
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(33, 212, 110, 0.14);
}

/* Remember-me / inline checkbox */
label.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
label.checkbox input {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  accent-color: var(--green);
  flex-shrink: 0;
  margin: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 52px;
  margin-top: 20px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(33, 212, 110, 0.34);
}
.btn-primary:active { background: #1cc065; }
.btn svg { display: block; }

/* ── Tournament list ─────────────────────────────────────────── */
.tournament-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.tournament {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 16px;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1.5px solid transparent;
}
.tournament:active { background: #fbfdfc; }
.tournament.running { border-color: var(--green); }

.status-dot {
  width: 12px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}
.status-dot span {
  width: 11px;
  height: 11px;
  border-radius: 6px;
  border: 2px solid var(--line-2);
}
.tournament.running .status-dot span {
  background: var(--green);
  border: none;
  box-shadow: 0 0 0 4px rgba(33, 212, 110, 0.15);
}

.tournament-body { flex: 1; min-width: 0; }
.tournament-name {
  display: block;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}
.tournament-meta {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  margin-top: 3px;
}
.tournament.running .tournament-meta { color: var(--green-deep); }

.badge {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-deep);
  background: var(--green-soft);
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.chevron { flex-shrink: 0; display: flex; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.empty-icon {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.empty-icon .compass-mark { width: 66px; height: 66px; }
.empty-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 9px; }
.empty-text { font-size: 0.875rem; font-weight: 500; color: var(--muted); line-height: 1.5; max-width: 260px; margin: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 10px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--green-deep);
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* Generic muted footnote */
.footnote { font-size: 0.81rem; font-weight: 500; color: var(--muted-2); line-height: 1.5; }

/* ── Messages / banners ──────────────────────────────────────── */
.messages { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.message.error {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger-text);
  font-weight: 600;
}
.message.success {
  background: var(--green-soft);
  border-color: var(--green-soft-2);
  color: var(--green-deep);
  font-weight: 600;
}

/* Form-level errors */
.form-error, .field-error {
  display: flex;
  gap: 9px;
  color: var(--danger-ink);
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-line);
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 0.83rem;
  font-weight: 600;
  margin-top: 12px;
}
.field-error {
  background: none;
  border: none;
  padding: 6px 2px 0;
  margin-top: 0;
  color: var(--danger);
}
