/* Komponenty */
.plate {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-1);
  padding: var(--s-4); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 10%, transparent);
}
.plate--framed::before, .plate--framed::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-color: var(--gold); border-style: solid; opacity: .8; pointer-events: none;
}
.plate--framed::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; }
.plate--framed::after { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.sec-head h3 { font-size: 1.15rem; color: var(--gold-hi); }
.sec-note { font-size: var(--fs-xs); color: var(--muted); margin: 0; }

/* Tlačidlá */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-1); cursor: pointer;
  background: var(--panel-2); color: var(--gold-hi); border: 1px solid var(--line);
  font-family: var(--f-text); font-size: var(--fs-s); text-decoration: none; transition: border-color var(--t-fast), background var(--t-fast);
}
.btn:hover { border-color: var(--gold-lo); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 600; }
.btn--primary:hover { background: var(--gold-hi); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--ember); }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-1); color: var(--muted);
}
.icon-btn:hover { color: var(--gold-hi); border-color: var(--line); }

/* Ukazovatele */
.bar { height: 6px; background: color-mix(in srgb, var(--line) 70%, var(--bg)); border-radius: 1px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--p, 0%); background: var(--c, var(--gold)); transition: width var(--t-med); }
.bar--thick { height: 10px; }
.meter-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-2) var(--s-3); align-items: center; }
.attr-c-int { --c: var(--a-int); color: var(--a-int); }
.attr-c-sil { --c: var(--a-sil); color: var(--a-sil); }
.attr-c-cha { --c: var(--a-cha); color: var(--a-cha); }
.attr-c-duch { --c: var(--a-duch); color: var(--a-duch); }
.attr-c-disc { --c: var(--a-disc); color: var(--a-disc); }

/* Formuláre */
.field { display: grid; gap: var(--s-1); align-content: start; }
.field label, .field legend { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-1); color: var(--text);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 1px var(--gold); }
.field-error { color: var(--ember); font-size: var(--fs-xs); min-height: 1em; margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-1); color: var(--muted); }
.seg input:checked + span { border-color: var(--gold); color: var(--gold-hi); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); }
.grid-2 > * { min-width: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.grid-3 > * { min-width: 0; }
@media (max-width: 420px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 > :last-child { grid-column: 1 / -1; } }
.select { text-overflow: ellipsis; }

/* Pečať (zaškrtávanie questov a modlitieb) */
.seal { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 8px; flex: none; cursor: pointer; border-radius: 50%; border: 1.5px solid var(--gold-lo); background: transparent; display: grid; place-items: center; }
.seal::after { content: ""; width: 10px; height: 6px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.seal:checked { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 50%, transparent); }
.seal:checked::after { opacity: 1; }

/* Dialóg */
.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(8, 6, 4, .7); }
.dlg-inner { display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100dvh - 50px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 1.2rem; color: var(--gold-hi); }
.dlg-body { padding: var(--s-4); overflow: auto; display: grid; gap: var(--s-4); }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.dlg-foot:empty { display: none; }

/* Hlásenie */
.toast {
  position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 40;
  max-width: min(520px, calc(100vw - 24px)); padding: var(--s-3) var(--s-4); border-radius: var(--r-1);
  background: var(--panel-2); border: 1px solid var(--gold-lo); color: var(--text); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity var(--t-med), transform var(--t-med);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-alert { border-color: var(--gold); color: var(--gold-hi); }
.toast.is-error { border-color: var(--ember); color: var(--ember); }
@media (min-width: 1000px) { .toast { bottom: var(--s-5); } }

/* Zoznamy */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.list > li:last-child { border-bottom: 0; }
.li-main { flex: 1; min-width: 0; }
.li-title { display: block; overflow-wrap: anywhere; }
.li-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-xs); color: var(--muted); align-items: center; }
.li-meta .ico { width: 16px; height: 16px; }
.xp { font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi); white-space: nowrap; font-size: var(--fs-s); }
.xp.neg { color: var(--ember); }
.empty { color: var(--muted); font-style: italic; margin: 0; }
.tag { display: inline-block; font-size: 0.8125rem; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-1); color: var(--muted); }
.tag--warn { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 40%, var(--line)); }
.tag--good { color: var(--sage); border-color: color-mix(in srgb, var(--sage) 40%, var(--line)); }
