/* Elrendezés: bevezető sáv, alatta kétoszlopos tábla – javaslat-űrlap (keskeny) a élő rangsor mellett; telefonon egymás alá kerül.
   Arculat (cégcsoportos arculati kézikönyv): Pantone 376C zöld + Biofilter-zöld; Gotham Black / Gotham Book, ahol nincs: Century Gothic / rendszerbetű. */
:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --ink: #1c2318;
  --muted: #5e6a57;
  --line: #dde4d5;
  --pine: #175c00;
  --pine-soft: #eaf4dc;
  --brand: #8cc03e;
  --on-brand: #12300a;
  --alert: #b3261e;
  --alert-soft: #fbe9e7;
  --hero-bg: #1c552a;
  --hero-deep: #0f3318;
  --hero-ink: #ffffff;
  --hero-accent: #c3e48e;
  --font-display: "Gotham Black", "Gotham", "Montserrat", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --font-body: "Gotham Book", "Gotham", "Montserrat", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f170c; --surface: #172213; --ink: #edf2e8; --muted: #a3b199; --line: #2b3a24;
    --pine: #a6d465; --pine-soft: #1f3315; --brand: #8cc03e; --on-brand: #12300a; --alert: #f2a097; --alert-soft: #3b1d1a;
    --hero-bg: #164a08; --hero-deep: #0a2203;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 32px 64px;
  display: grid; gap: 36px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.75rem, 4.4vw, 2.7rem); line-height: 1.12; color: var(--pine); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
h2 { font-size: 1.3rem; line-height: 1.25; }
p { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pine); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 4px; border-radius: 2px; background: var(--brand); }
.intro { display: grid; gap: 16px; max-width: 68ch; }
.lead { font-size: 1.12rem; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; color: var(--pine); }

.brandbar { display: flex; align-items: center; margin-bottom: -16px; }
.brandbar img { height: clamp(40px, 5vw, 56px); width: auto; display: block; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px;
  background: radial-gradient(90% 120% at 100% 0%, var(--hero-bg) 0%, var(--hero-deep) 100%);
  color: var(--hero-ink);
  padding: clamp(28px, 5vw, 52px) clamp(20px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .intro, .hero .tree { position: relative; }
.hero h1 { color: var(--hero-ink); }
.hero .eyebrow { color: var(--hero-accent); }
.hero .eyebrow::before { background: var(--hero-accent); }
.hero .lead, .hero p { color: var(--hero-ink); }
.hero .amount { color: var(--hero-accent); }
.hero .tree { width: clamp(120px, 16vw, 180px); height: auto; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { border-top: 1px dashed var(--muted); padding-top: 22px; display: grid; gap: 6px; justify-items: start; }
.steps .n {
  position: relative; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 4px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--hero-accent) 0%, var(--brand) 45%, var(--pine) 100%);
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; color: var(--on-brand); line-height: 1;
}
.steps .n::before { content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 12px; height: 7px; border-radius: 2px 2px 0 0; background: var(--muted); }
.steps .n::after { content: ""; position: absolute; top: -23px; left: 50%; width: 1px; height: 16px; background: var(--muted); }
.steps b { font-size: 1.02rem; }
.steps span { color: var(--muted); font-size: .95rem; }

.status { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: .95rem; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem; }
.pill.open { background: var(--pine-soft); color: var(--pine); }
.pill.closed { background: var(--alert-soft); color: var(--alert); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.board { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 16px; }
.panel.sticky { position: sticky; top: 16px; }
.hint { color: var(--muted); font-size: .92rem; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
button, .btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid transparent; padding: 10px 16px; font-weight: 600; text-decoration: none; display: inline-block; }
.btn-primary { background: var(--pine); color: var(--surface); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); padding: 6px 12px; font-size: .88rem; }
.btn-danger { background: var(--alert); color: var(--surface); padding: 6px 12px; font-size: .88rem; }
.msg { font-size: .9rem; min-height: 1.2em; }
.msg.err { color: var(--alert); }
.msg.ok { color: var(--pine); }

.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 14px; }
.my-votes { font-size: .95rem; color: var(--muted); }
.my-votes strong { color: var(--pine); font-variant-numeric: tabular-nums; }
.voter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; margin-bottom: 14px; padding: 14px 16px; border-radius: 12px; background: var(--pine-soft); }
.voter .msg { grid-column: 1 / -1; min-height: 0; }
.list { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px; }
.card.top { border-color: var(--brand); }
.card-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.rank { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; color: var(--muted); min-width: 1.6ch; font-variant-numeric: tabular-nums; }
.card.top .rank { color: var(--pine); }
.card h3 { font-size: 1.12rem; line-height: 1.3; overflow-wrap: anywhere; }
.badge { display: inline-block; margin-left: 8px; vertical-align: middle; font-family: var(--font-body); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pine); background: var(--pine-soft); border: 1px solid var(--brand); border-radius: 999px; padding: 1px 8px; }
.why { overflow-wrap: anywhere; white-space: pre-line; }
.meta { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.meta a { color: var(--pine); overflow-wrap: anywhere; }
.vote { min-width: 118px; border-color: var(--pine); color: var(--pine); background: transparent; }
.vote.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.vote:disabled { opacity: .45; cursor: not-allowed; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.track { height: 8px; border-radius: 999px; background: var(--pine-soft); overflow: hidden; }
.fill { height: 100%; background: var(--pine); border-radius: 999px; transition: width .4s ease; }
.card.top .fill { background: var(--brand); }
.count { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.del-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; }

.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 32px 22px; text-align: center; color: var(--muted); display: grid; gap: 6px; }
.empty b { color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.notice { background: var(--alert-soft); border-radius: 10px; padding: 12px 16px; font-size: .95rem; }

footer { color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); padding-top: 18px; max-width: 72ch; display: grid; gap: 8px; }
footer .xmas { font-family: var(--font-display); font-weight: 800; color: var(--pine); font-size: 1.05rem; }

/* Szervezői oldal */
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row label { flex: 1 1 180px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 150px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.8rem; line-height: 1.1; color: var(--pine); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; background: var(--pine-soft); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
td .sub { color: var(--muted); font-size: .85rem; white-space: pre-line; }
.anon { color: var(--muted); font-style: italic; }
.login { max-width: 380px; margin: 10vh auto 0; }

@media (max-width: 820px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .panel.sticky { position: static; }
}
@media (max-width: 560px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .tree { display: none; }
  .steps { grid-template-columns: 1fr; }
  .card-top { grid-template-columns: auto minmax(0, 1fr); }
  .card-top .vote { grid-column: 1 / -1; width: 100%; }
  .voter { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
