:root {
  --bg-0: #0e1729;
  --bg-1: #13203a;
  --bg-2: #1b2b4d;
  --card: #f7f8fb;
  --card-ink: #1a2438;
  --muted: #8a96b3;
  --muted-ink: #5d6b88;
  --line: #e3e7f0;
  --gold: #d7b369;
  --gold-strong: #c9a04a;
  --blue: #3d7bf2;
  --blue-soft: #e8f0ff;
  --green: #2faa6a;
  --amber: #d9952b;
  --danger: #e15555;
  --shadow: 0 10px 30px rgba(5, 12, 28, .28);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: #eef1f8;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(61,123,242,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(215,179,105,.10), transparent 55%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 55%, var(--bg-2) 100%);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===================== Belépés ===================== */
.auth-wrap {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px 30px;
}
.brand { text-align: center; margin-bottom: 22px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
  color: #2a2110; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 16px rgba(201,160,74,.35);
  margin-bottom: 14px;
}
.brand-mark.sm { width: 38px; height: 38px; font-size: 18px; margin: 0; box-shadow: none; }
.brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.brand-sub { color: var(--muted-ink); font-size: 14px; margin-top: 4px; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted-ink); }
.field input {
  font: inherit; font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff; color: var(--card-ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61,123,242,.15);
}

.btn {
  font: inherit; font-size: 16px; font-weight: 700;
  border: 0; border-radius: 12px;
  padding: 14px 18px; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(145deg, var(--gold), var(--gold-strong));
  color: #2a2110;
  box-shadow: 0 8px 20px rgba(201,160,74,.30);
}
.btn-primary:hover { filter: brightness(1.04); }

.alert {
  background: #fdecec; color: #a02525;
  border: 1px solid #f4c9c9;
  padding: 11px 14px; border-radius: 12px;
  font-size: 14px; margin-bottom: 16px;
}

/* ===================== Felső sáv ===================== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14,23,41,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px;
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title strong { display: block; font-size: 15px; }
.topbar-title small { color: var(--muted); font-size: 13px; }
.link-logout {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
}
.link-logout:hover { color: #fff; border-color: rgba(255,255,255,.25); }

/* ===================== Pontozó tábla ===================== */
.board { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.intro { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }

.notice {
  background: rgba(61,123,242,.12); border: 1px solid rgba(61,123,242,.3);
  color: #cfe0ff; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}
.notice.warn {
  background: rgba(217,149,43,.13); border-color: rgba(217,149,43,.35); color: #ffe2b3;
}

.cards { display: grid; gap: 14px; }

.card-presenter {
  background: var(--card); color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  width: 100%; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 18px; font: inherit; text-align: left;
}
.card-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.card-meta { display: flex; align-items: center; gap: 10px; }
.card-sum { font-size: 13px; font-weight: 700; color: var(--muted-ink); white-space: nowrap; }
.chevron { color: var(--muted-ink); font-size: 16px; transition: transform .2s; }
.card-presenter.open .chevron { transform: rotate(180deg); }

.status {
  font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.status-empty   { background: #eef0f5; color: #7b88a3; }
.status-partial { background: #fff2da; color: #a9701a; }
.status-done    { background: #e1f5ea; color: #1f8553; }

.card-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.criterion { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.criterion:last-of-type { border-bottom: 0; }
.criterion-name { font-size: 14px; font-weight: 600; color: var(--card-ink); margin-bottom: 10px; }

.score-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.score-btn {
  font: inherit; font-size: 18px; font-weight: 700;
  padding: 14px 0; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--card-ink);
  transition: transform .08s, background .15s, border-color .15s, color .15s;
}
.score-btn:hover { border-color: var(--blue); }
.score-btn:active { transform: scale(.96); }
.score-btn.selected {
  background: linear-gradient(145deg, var(--blue), #2f63d4);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 14px rgba(61,123,242,.35);
}
.score-btn:disabled { opacity: .5; cursor: not-allowed; }

.save-hint {
  min-height: 18px; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--muted-ink);
  opacity: 0; transition: opacity .15s;
}
.save-hint.show { opacity: 1; }
.save-hint.ok  { color: var(--green); }
.save-hint.err { color: var(--danger); }

/* ===================== Admin ===================== */
.admin-page { color: #eef1f8; }
.admin-wrap { max-width: 1040px; margin: 0 auto; padding: 24px 18px 70px; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.admin-head h1 { font-size: 22px; font-weight: 700; }
.admin-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-ghost {
  background: rgba(255,255,255,.06); color: #eef1f8;
  border: 1px solid rgba(255,255,255,.16);
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: 10px; display: inline-block;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.panel {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px;
}
.panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.panel .hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.data th, table.data td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
table.data th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: rgba(255,255,255,.03); }

.rank { font-weight: 800; }
.rank-1 td { background: rgba(215,179,105,.12); }
.medal { display: inline-block; width: 1.4em; }

.pill {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.pill-done    { background: rgba(47,170,106,.18); color: #74e0a6; }
.pill-partial { background: rgba(217,149,43,.18); color: #ffcd80; }
.pill-empty   { background: rgba(255,255,255,.08); color: #aab4cc; }

.admin-login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }

.empty-state { color: var(--muted); font-size: 14px; padding: 8px 2px; }

@media (max-width: 560px) {
  .card-name { font-size: 16px; }
  .card-sum { display: none; }
}
