/* =====================================================================
   Colinde — temă deschisă de Crăciun: globuri, stele, aur și roșu de merișor
   ===================================================================== */
:root {
  --bg: #fbf5ea;
  --card: #fffdf8;
  --ink: #33211c;
  --muted: #8a7468;
  --line: #eadfcb;
  --red: #b3262e;
  --red-dark: #8c1c24;
  --gold: #c9962b;
  --gold-soft: #f6e7bf;
  --green: #2f6b4f;
  --green-soft: #e3efe6;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.5 var(--sans);
  background-color: var(--bg);
  /* fulgi / steluțe discrete pe fundal */
  background-image:
    radial-gradient(circle, #ecdcbc 1.6px, transparent 2px),
    radial-gradient(circle, #f1d9d3 1.3px, transparent 1.8px);
  background-size: 84px 84px, 122px 122px;
  background-position: 12px 20px, 60px 70px;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.app { max-width: 680px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- următoarea oprire ---------- */
.next {
  position: relative; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--red);
  border-radius: 16px; padding: 18px 18px 16px; box-shadow: 0 6px 22px rgba(120, 70, 30, .10);
}
.next-k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--red); display: flex; justify-content: space-between; gap: 12px; }
.next-k b { color: var(--muted); letter-spacing: .04em; }
.next-name { font: 800 clamp(24px, 6.5vw, 32px)/1.2 var(--serif); margin: 6px 0 2px; overflow-wrap: anywhere; }
.next-time { color: var(--muted); font-weight: 600; }
.next-addr { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; overflow-wrap: anywhere; }
.next svg, .go svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.next-addr svg { color: var(--red); margin-top: 2px; }
/* Info și butonul de hartă stau pe același rând */
.next-row { display: flex; align-items: stretch; gap: 10px; margin-top: 12px; }
.next-row .next-info { flex: 1; min-width: 0; margin: 0; }
.next-row .go { margin: 0; flex: 1; }
.next-row .next-info + .go { flex: none; width: 38%; max-width: 170px; flex-direction: column; gap: 4px; padding: 10px 8px; text-align: center; line-height: 1.25; font-size: 15px; }
.next-info { margin: 12px 0 0; padding: 10px 12px; background: var(--gold-soft); border-radius: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.next-info b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8a6412; }
.go {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; min-height: 50px; padding: 10px 16px;
  background: var(--red); color: #fff; border-radius: 12px; font-weight: 700; text-decoration: none;
}
.go:hover { background: var(--red-dark); }
.next-after { margin-top: 12px; color: var(--muted); font-size: 14px; }
.next-after b { color: var(--ink); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 99px; transition: width .4s; }
.bar-t { font-size: 13px; color: var(--muted); margin-top: 5px; }
.next.alldone { border-top-color: var(--green); text-align: center; }
.next.alldone .next-k { color: var(--green); justify-content: center; }
.next.alldone .next-info { background: none; padding: 0; color: var(--muted); }
.next.alldone .bar i { background: var(--green); }

/* ---------- tot traseul ---------- */
.route { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.route summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.route summary::-webkit-details-marker { display: none; }
.route summary span:first-child::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--red); transition: transform .2s; }
.route[open] summary span:first-child::before { transform: rotate(90deg); }
.route-count { color: var(--muted); font-weight: 600; font-size: 14px; }
.stops { list-style: none; margin: 0; padding: 0 16px 8px; }
.stop { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.stop-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--gold-soft); color: #8a6412; }
.stop-b { min-width: 0; flex: 1; }
.stop-name { font-weight: 700; overflow-wrap: anywhere; }
.stop-time { font-weight: 500; color: var(--muted); margin-left: 8px; font-size: 14px; white-space: nowrap; }
.stop-addr { display: inline-block; font-size: 14px; color: var(--red-dark); text-underline-offset: 3px; overflow-wrap: anywhere; padding: 2px 0; }
.stop-info { font-size: 14px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.stop.cur .stop-n { background: var(--red); color: #fff; }
.stop.done .stop-n { background: var(--green-soft); color: var(--green); }
.stop.done .stop-name { color: var(--muted); text-decoration: line-through; text-decoration-color: #cdbfae; }

/* ---------- colinde ---------- */
.tools { margin-top: 26px; }
.next[hidden] + .route[hidden] + .tools { margin-top: 0; }
.sec-title { font: 800 26px/1.2 var(--serif); margin: 0 0 10px; display: flex; align-items: center; gap: 12px; }
.sec-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: inherit; padding: 13px 0; }
.meta { font-size: 13px; color: var(--muted); margin: 10px 2px 8px; }

.song { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.song.sk { height: 58px; opacity: .6; }
.song-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; background: none; border: 0; text-align: left; }
.song-n {
  flex: none; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 30%, #e0626a, var(--red) 62%); color: #fff; font-weight: 700; font-size: 14px;
}
.song-t { flex: 1; min-width: 0; }
.song-title { display: block; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.song-hit { display: block; font-size: 14px; color: var(--muted); font-style: italic; }
.gama { flex: none; min-width: 34px; padding: 4px 8px; border-radius: 8px; text-align: center; background: var(--gold-soft); color: #8a6412; font-weight: 700; font-size: 14px; }
.song-x { display: none; flex: none; font-size: 28px; line-height: 1; color: var(--muted); padding: 0 4px; }
.song.open { border-color: var(--gold); }
.song.open .song-title { font: 800 22px/1.25 var(--serif); color: var(--red); }
.song.open .song-x { display: block; }

.lyrics { padding: 4px 16px 18px; border-top: 1px dashed var(--line); }
.st { display: flex; gap: 12px; margin-top: 18px; }
.st p { margin: 0; white-space: pre-line; font-size: clamp(18px, 4.8vw, 21px); line-height: 1.55; overflow-wrap: anywhere; }
.st-n { flex: none; width: 28px; height: 28px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: #8a6412; font-weight: 700; font-size: 14px; }
.st.ref p { font-style: italic; font-weight: 600; }
.st.ref .st-n { background: var(--red); color: #fff; }
.st.none { color: var(--muted); }
.close-song { display: block; width: 100%; margin-top: 24px; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 700; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 18px; }

/* un colind deschis ia tot ecranul: restul paginii se ascunde */
.locked .next, .locked .route, .locked .tools, .locked .foot, .locked .song:not(.open) { display: none; }
.locked .app { padding-top: 12px; }
.locked .song.open { border: 0; background: none; }
.locked .song-row { padding-left: 2px; padding-right: 2px; }
.locked .lyrics { padding-left: 2px; padding-right: 2px; }

/* ---------- subsol ---------- */
.foot { text-align: center; margin-top: 34px; color: var(--muted); font-size: 13px; }
.cozonac { width: 150px; height: auto; }
.foot-wish { font: italic 600 20px/1.3 var(--serif); color: var(--red); margin: 2px 0 12px; }
.foot-row { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.reload { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-weight: 600; color: var(--ink); }
.reload:disabled { opacity: .5; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
