/* Lampiony vzpomínek — rozhraní kolem plátna. Barvy a písmo vycházejí z webu Stromu života:
   zelená #009444, bílá, oblé tvary, patkové nadpisy. Krajinu kreslí js/sky.js.
   Polohu pole se jménem, tlačítek a úvodního textu počítá js/app.js podle lampionu. */
:root {
  --green: #009444; --green-hi: #12a957; --night: #021009;
  --text: #f1faf4; --dim: #a9cdb8; --warm: #ffe2a0; --red: #ffb1a3;
  --serif: "Roboto Slab", Rockwell, "Rockwell Nova", Georgia, serif;
  --sans: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--text); }
body { overflow: hidden; font: 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; overflow: hidden; }
#cv { display: block; width: 100%; height: 100%; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* logo nahoře mezi lampiony (lampiony ho obcházejí) */
#logo {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: clamp(60px, 10vh, 92px); line-height: 0; border-radius: 50%; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
#logo img { width: 100%; height: auto; display: block; border-radius: 50%; }
#logo:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; }
#snd {
  position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(3, 30, 20, .6); color: #fff; border: 2px solid rgba(255, 255, 255, .45); font: 20px/1 var(--sans); cursor: pointer;
}
#snd[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
#snd:hover, #snd:focus-visible { border-color: #fff; outline: none; }

/* úvodní text nad lampionem */
#intro {
  position: absolute; left: 50%; transform: translateX(-50%); width: min(92%, 440px); text-align: center;
  text-shadow: 0 1px 10px rgba(0, 14, 8, .95), 0 0 3px rgba(0, 14, 8, .9); transition: opacity .5s;
}
#intro.off { opacity: 0; pointer-events: none; }
#intro h1 { margin: 0 0 6px; font: 500 clamp(22px, 3.4vh, 30px)/1.2 var(--serif); color: #fff; }
#intro p { margin: 0; font-size: clamp(14px, 2vh, 16px); line-height: 1.45; }

/* pole se jménem uvnitř lampionu */
#napis {
  position: absolute; transform: translate(-50%, -50%); padding: 10px 6px; border-radius: 999px; text-align: center;
  background: rgba(255, 255, 255, .94); color: #10261a; border: 2px solid rgba(20, 50, 34, .25); font: 16px/1.2 var(--sans);
  box-shadow: 0 3px 10px rgba(0, 20, 10, .25);
}
/* příklady jmen, které se v prázdném poli pomalu střídají */
#hint {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  color: #71897a; font: 16px/1.2 var(--sans); opacity: 0; transition: opacity .9s ease;
}
#hint.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #hint { transition: none; } }
#napis:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(0, 148, 68, .28); }

/* tlačítka pod lampionem */
#actions { position: absolute; left: 50%; transform: translateX(-50%); width: min(96%, 460px); text-align: center; }
#actions .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-block; padding: 12px 22px; min-height: 48px; border-radius: 999px;
  background: rgba(3, 30, 20, .6); color: #fff; border: 2px solid rgba(255, 255, 255, .55);
  font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover, .btn:focus-visible { border-color: #fff; outline: none; }
.btn.primary { background: var(--green); border-color: var(--green); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--green-hi); border-color: var(--green-hi); }
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(255, 226, 160, .35); }
.btn[disabled] { opacity: .6; cursor: default; }
#err { margin: 8px 0 0; color: var(--red); font-size: 14px; text-shadow: 0 1px 6px rgba(0, 14, 8, .9); }
#err:empty { display: none; }

/* závěr u dolního okraje */
#outro {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(94%, 620px); text-align: center; animation: rise .9s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { #outro { animation: none; } #intro { transition: none; } }
.sig { display: inline-flex; flex-direction: column; align-items: center; color: #fff; text-decoration: none; border-radius: 18px; padding: 6px 14px; }
.sig span { font: 400 clamp(17px, 2.6vh, 21px)/1.35 var(--serif); }
.sig strong { font-weight: 700; }
.sig .url { margin-top: 8px; font: 500 clamp(15px, 2.2vh, 17px)/1.3 var(--sans); color: var(--warm); text-decoration: underline; }
.sig:hover .url, .sig:focus-visible .url { color: #fff; }
.sig:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
#note { margin: 0 0 10px; color: var(--red); font-size: 14px; }
#note:empty { display: none; }
.quiet { display: block; margin: 10px auto 0; padding: 8px 12px; background: none; border: 0; color: var(--dim); font: 14px/1.2 var(--sans); text-decoration: underline; cursor: pointer; }
.quiet:hover, .quiet:focus-visible { color: #fff; outline: none; }
.noscript { padding: 20px; }

/* postupné objevení po načtení: text (s1), lampion na plátně (s2), pole na jméno (s3) */
body.start #intro, body.start #napis, body.start #hint { opacity: 0; }
body.start #napis { pointer-events: none; }
body.start.s1 #intro { opacity: 1; transition: opacity 2.8s ease; }
body.start.s3 #napis { opacity: 1; pointer-events: auto; transition: opacity 2.6s ease; }
body.start.s3 #hint.on { opacity: 1; }
body.start #intro.off { opacity: 0; }
/* tlačítka se objeví až po vepsání jména (třída has) */
#actions { opacity: 0; pointer-events: none; transition: opacity 1.8s ease; }
body.has #actions { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { #actions { transition: none; } }

/* „Rozsvítit lampion“ má barvu plamene, stejnou jako rozsvícený lampion */
#light { background: linear-gradient(180deg, #ffc35a 0%, #f58a34 100%); border-color: #f58a34; color: #3d1803; box-shadow: 0 6px 22px rgba(245, 138, 52, .45); }
#light:hover, #light:focus-visible { background: linear-gradient(180deg, #ffd27a 0%, #fb9a45 100%); border-color: #ffd27a; }

/* tři připravené vzkazy pod polem v lampionu, objeví se po vepsání jména */
#vzkazy { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0; pointer-events: none; transition: opacity 1.6s ease; }
body.has #vzkazy { opacity: 1; pointer-events: auto; }
#vzkazy button {
  padding: 6px 14px; min-height: 34px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  background: rgba(255, 255, 255, .5); color: #1c3626; border: 2px solid rgba(20, 50, 34, .22); font: 500 14px/1.2 var(--sans);
}
#vzkazy button:hover, #vzkazy button:focus-visible { background: rgba(255, 255, 255, .8); outline: none; }
#vzkazy button[aria-pressed="true"] { background: #f58a34; border-color: #f58a34; color: #fff; }
/* závěrečný text výš nad dolním okrajem */
#outro { bottom: max(9vh, 56px); }
