/* Tajný Ježiško – vzhľad v2 */
:root {
  --pine: #133e31;
  --pine-2: #1d5a46;
  --pine-soft: #e6f0eb;
  --red: #b3262c;
  --red-dark: #8f1d22;
  --red-soft: #fbe9e9;
  --gold: #e3a93b;
  --gold-soft: #fdf3dc;
  --ink: #17302a;
  --muted: #5f7169;
  --line: #e2e8e3;
  --bg: #f7f4ec;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 62, 49, .06), 0 8px 28px rgba(19, 62, 49, .07);
  --focus: 0 0 0 3px rgba(227, 169, 59, .55);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; }
a { color: var(--pine-2); text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { background: var(--pine-soft); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 1.1rem; }
.wrap.wide, .site-header .wrap, .site-footer .wrap { max-width: 1120px; }
.skip { position: absolute; left: -999px; top: .5rem; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hlavička a päta ---------- */
.site-header {
  background: var(--pine);
  background-image: radial-gradient(circle at 20% -40%, rgba(255,255,255,.12), transparent 50%),
                    radial-gradient(circle at 90% 140%, rgba(227,169,59,.18), transparent 45%);
  color: #fff;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; padding-bottom: .9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: rgba(255,255,255,.12); }
.site-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.site-nav a, .site-nav .link-button { color: #fff; text-decoration: none; padding: .45rem .75rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.site-nav a:hover, .site-nav .link-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.site-nav a[aria-current="page"] { background: rgba(255,255,255,.16); }
.site-footer { margin-top: auto; color: var(--muted); font-size: .88rem; padding: 2.2rem 0; text-align: center; }
.site-footer a { color: var(--muted); }

.main { padding-top: 2rem; padding-bottom: 2rem; flex: 1; }
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { margin-bottom: .25rem; }
.back { display: inline-block; margin-bottom: .6rem; font-size: .92rem; text-decoration: none; color: var(--muted); }
.lead { font-size: 1.08rem; color: var(--muted); }
.section { margin-top: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.success { color: #12633b; font-weight: 700; }
.danger { color: var(--red-dark); font-weight: 700; }
.empty { color: var(--muted); padding: 1rem; background: #fafaf7; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.count { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .4rem; border-radius: 99px; background: var(--pine-soft); font-size: .9rem; vertical-align: middle; }

/* ---------- Karty a mriežky ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1.2rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.grid-2 > .card + .card { margin-top: 0; }

/* ---------- Tlačidlá ---------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--red); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: .72rem 1.15rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s; line-height: 1.2;
}
.btn:hover { background: var(--red-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.btn-secondary { background: var(--pine-2); }
.btn.btn-secondary:hover { background: var(--pine); }
.btn.btn-ghost { background: transparent; color: var(--pine-2); border: 1px solid var(--line); }
.btn.btn-ghost:hover { background: var(--pine-soft); color: var(--pine); }
.btn.btn-danger { background: #fff; color: var(--red-dark); border: 1px solid #e8b9bb; }
.btn.btn-danger:hover { background: var(--red-soft); color: var(--red-dark); }
.btn-sm { padding: .45rem .75rem; font-size: .88rem; border-radius: 8px; }
.btn-lg { padding: .95rem 1.5rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--pine-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline, .actions form { display: inline; }

/* ---------- Formuláre ---------- */
.form label { display: block; font-weight: 600; margin: 0 0 1rem; }
.form h3 { margin-bottom: .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .35rem; font: inherit; color: inherit;
  background: #fff; border: 1px solid #c9d6cf; border-radius: var(--radius-sm); padding: .7rem .8rem;
}
textarea { resize: vertical; min-height: 3rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input[disabled], input[readonly] { background: #f3f5f3; color: var(--muted); }
.form label.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; }
.check input { width: auto; margin: .25rem 0 0; accent-color: var(--red); }
.form-links { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0 0; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 1rem; padding: .8rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 .3rem; }
fieldset.wish input + input { margin-top: .5rem; }
.inline-form { display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap; }
.inline-form label { flex: 1 1 180px; margin: 0; }
.inline-sep { padding-bottom: .75rem; font-size: 1.2rem; color: var(--muted); }
.inline-note { margin-top: 1rem; }
.narrow-form { max-width: 420px; margin-top: 1rem; }

/* ---------- Hlášky a odznaky ---------- */
.alert { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 0 0 1rem; border: 1px solid transparent; display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.alert-ok { background: #e7f5ec; border-color: #bfe3cc; color: #0f5130; }
.alert-error { background: var(--red-soft); border-color: #f1c5c7; color: var(--red-dark); }
.alert-info { background: #eaf2f8; border-color: #c9dceb; color: #1d4560; display: block; }
.alert-warn { background: var(--gold-soft); border-color: #f1d9a5; color: #6b4a0b; }
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: #e1f3e8; color: #12633b; }
.badge-wait { background: var(--gold-soft); color: #7a540c; }
.badge-error { background: var(--red-soft); color: var(--red-dark); }
.badge-info { background: #e5eef6; color: #23506f; }
.badge-muted { background: #eef0ee; color: var(--muted); }

/* ---------- Úvod ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: .8rem; }
.hero .accent { color: var(--red); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--pine-2); margin-bottom: .6rem; }
.hero-art { display: flex; justify-content: center; }
.gift-card { background: #fff; border-radius: 22px; padding: 1.6rem 1.8rem; box-shadow: 0 20px 50px rgba(19,62,49,.15); border: 1px solid var(--line); width: 100%; max-width: 300px; transform: rotate(2deg); position: relative; }
.gift-card::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 14px; transform: translateX(-50%); background: repeating-linear-gradient(0deg, var(--red) 0 10px, #c9393f 10px 20px); opacity: .1; border-radius: 4px; }
.gift-emoji { font-size: 2.6rem; }
.gift-name { font-size: 1.9rem; font-weight: 800; color: var(--red); margin: 0 0 .6rem; }
.gift-wishes { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.steps p { margin: 0; color: var(--muted); font-size: .94rem; }
.step-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; margin-bottom: .7rem; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature { padding: 1rem .3rem; }
.feature > span { font-size: 1.8rem; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; }

/* ---------- Moje skupiny ---------- */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.event-card { display: flex; flex-direction: column; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(19,62,49,.12); color: inherit; }
.event-card h2 { margin: .7rem 0 .3rem; font-size: 1.2rem; }
.event-card p { margin: 0 0 .8rem; font-size: .92rem; }
.event-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .88rem; color: var(--muted); margin-top: auto; }
.event-card-new { border-style: dashed; box-shadow: none; background: transparent; justify-content: center; align-items: center; text-align: center; min-height: 170px; }
.plus { font-size: 2rem; color: var(--red); line-height: 1; }

/* ---------- Správa skupiny ---------- */
.subnav { position: sticky; top: 0; z-index: 5; display: flex; gap: .3rem; overflow-x: auto; background: rgba(247,244,236,.94); backdrop-filter: blur(6px); padding: .5rem 0; margin: -.4rem 0 .4rem; border-bottom: 1px solid var(--line); }
.subnav a { white-space: nowrap; text-decoration: none; padding: .4rem .8rem; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.subnav a:hover { background: var(--pine-soft); }
section[id] { scroll-margin-top: 4rem; }
.next-step { display: flex; gap: 1rem; align-items: center; background: var(--pine); color: #fff; border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.next-step p { margin: .1rem 0 0; opacity: .85; }
.next-icon { font-size: 1.9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-value small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.stat-label { font-size: .85rem; color: var(--muted); }
progress { width: 100%; height: 6px; margin-top: .45rem; appearance: none; border: 0; border-radius: 99px; background: #edf1ee; overflow: hidden; }
progress::-webkit-progress-bar { background: #edf1ee; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--pine-2); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--pine-2); border-radius: 99px; }

.table-wrap { overflow-x: auto; margin: 0 -.3rem; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.table td { padding: .75rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > form, .row-actions > details { display: inline-block; vertical-align: middle; margin-left: .3rem; }
.row-edit { position: relative; }
.row-edit summary { list-style: none; }
.row-edit summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 4; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 16px 40px rgba(0,0,0,.14); padding: 1rem; text-align: left; white-space: normal; }
.popover form + form { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.add-people { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

.pill-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--pine-soft); border-radius: 99px; padding: .35rem .5rem .35rem .9rem; font-weight: 600; font-size: .92rem; }
.pill-x { border: 0; background: rgba(0,0,0,.06); width: 1.5rem; height: 1.5rem; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink); }
.pill-x:hover { background: var(--red); color: #fff; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .45rem; }
.checklist li { padding-left: 1.8rem; position: relative; }
.checklist li::before { content: "○"; position: absolute; left: .2rem; color: var(--muted); }
.checklist li.done::before { content: "✓"; color: #12633b; font-weight: 800; }
.checklist li.optional::before { content: "–"; }
details > summary { cursor: pointer; font-weight: 700; }
.reveal, .danger-zone { margin-top: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.reveal[open] summary, .danger-zone[open] summary { margin-bottom: .8rem; }
.danger-zone { border-color: #f0cfd0; }
.danger-zone summary { color: var(--red-dark); }

/* ---------- Účastník ---------- */
.group-switch { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.4rem 0 1.2rem; }
.group-switch a { text-decoration: none; padding: .4rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; color: var(--ink); }
.group-switch a[aria-current="page"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.event-banner { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; background: var(--pine); color: #fff; border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.2rem; }
.banner-item { display: flex; flex-direction: column; }
.banner-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; opacity: .7; }
.banner-value { font-size: 1.2rem; font-weight: 800; }
.banner-value.small { font-size: 1rem; }
.countdown .banner-value { color: var(--gold); }
.note-from-org { margin-bottom: 1.2rem; }
.participant { align-items: start; }
.santa-card { border-top: 5px solid var(--red); }
.recipient-name { font-size: 2.1rem; font-weight: 800; color: var(--red); margin: 0 0 1rem; }
.wish-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.wish-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; background: #fbfaf6; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .85rem; }
.wish-title { font-weight: 600; overflow-wrap: anywhere; }
.wish-link { white-space: nowrap; font-size: .9rem; font-weight: 600; }
.receiver-note { background: var(--gold-soft); border-radius: var(--radius-sm); padding: .75rem .9rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.ready-form { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ready-form .success { margin-bottom: .3rem; }
.waiting { text-align: center; padding: 1.5rem .5rem; }
.waiting > span { font-size: 2.4rem; }
.big-hello { font-size: 1.3rem; }
.inline-h { display: inline; margin: 0; font-size: 1.2rem; }

.thread h3 { margin-bottom: .2rem; }
.chat { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .55rem; max-height: 380px; overflow-y: auto; }
.msg { max-width: 85%; padding: .6rem .85rem; border-radius: 14px; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg-who { display: block; font-size: .75rem; opacity: .75; margin-bottom: .15rem; }
.msg-me { align-self: flex-end; background: var(--pine-2); color: #fff; border-bottom-right-radius: 4px; }
.msg-them { align-self: flex-start; background: var(--pine-soft); border-bottom-left-radius: 4px; }
.chat-form textarea { margin-top: 0; margin-bottom: .5rem; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .steps, .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps, .features { grid-template-columns: 1fr; }
  .card { padding: 1.1rem; }
  .main { padding-top: 1.3rem; }
  .header-inner { justify-content: center; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .3rem; text-align: right; }
  .table.responsive td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .85rem; text-align: left; }
  .table.responsive td:first-child { display: block; text-align: left; }
  .table.responsive td:first-child::before { display: none; }
  .row-actions { justify-content: flex-start !important; flex-wrap: wrap; }
  .popover { position: static; width: 100%; margin-top: .5rem; box-shadow: none; }
  .row-edit[open] { display: block !important; width: 100%; margin: .5rem 0 0 !important; }
  .msg { max-width: 95%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Anonymná kontrola ---------- */
.code-check { margin: 1.2rem 0; padding: 1rem 1.1rem; background: #fbfaf6; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.code-check .checklist { margin-bottom: .8rem; }
.code-table { max-width: 360px; }
.code-table code, .my-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; font-weight: 700; }
.my-code { margin-top: 1rem; }
.reveal h3 { margin-bottom: .3rem; }
.reveal .table { margin-bottom: .8rem; }
.code-sm { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; color: var(--muted); background: #f1f3f1; }
