/* Pagina de vot – gândită pentru telefon, într-o sală cu lumina stinsă */

body {
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(227, 6, 19, 0.34), transparent 62%),
    linear-gradient(180deg, var(--cortina) 0%, var(--noapte) 46%);
  background-color: var(--noapte);
  background-attachment: fixed;
}

.cap {
  display: flex; align-items: center; gap: 14px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 10px;
  max-width: 560px; margin: 0 auto;
}
/* în widget, derularea listei nu „scapă” în pagina din spate când ajungi la capăt */
html:has(body.in-widget), body.in-widget { overscroll-behavior: none; }
body.in-widget .cap { padding-right: 104px; }
body.in-pagina .bara { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
body.in-pagina main { padding-bottom: 230px; }
body.in-pagina .foaie { margin-bottom: 96px; }
body.in-widget .cap-titlu { font-size: 22px; }
.cap-logo { width: 52px; height: 52px; flex: none; padding: 8px; border-radius: 14px; background: #fff; object-fit: contain; }
.cap-sus { margin: 3px 0 0; font-size: 14px; color: var(--text-moale); }
.cap-titlu { margin: 0; font-family: var(--afis); font-weight: 700; font-size: 26px; line-height: 1.05; letter-spacing: -0.01em; }

main { max-width: 560px; margin: 0 auto; padding: 8px 16px 140px; }
.incarc { padding: 48px 8px; text-align: center; color: var(--text-moale); }

/* --- texte de stare --- */
.stare { padding: 18px 4px 6px; }
.stare h2 { margin: 0 0 8px; font-family: var(--afis); font-weight: 600; font-size: 34px; line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.stare h2 em { font-style: normal; color: var(--aur); }
.stare p:not(.eticheta) { margin: 0; color: var(--text-moale); font-size: 17px; text-wrap: pretty; }
.eticheta { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--aur); }
.eticheta::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.eticheta.viu::before { animation: puls 1.4s ease-in-out infinite; }
@keyframes puls { 50% { opacity: 0.25; transform: scale(0.7); } }

h3.sub { margin: 30px 4px 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-moale); }

/* --- portret --- */
.portret { display: block; flex: none; overflow: hidden; border-radius: 12px; background: linear-gradient(160deg, var(--visiniu), var(--cortina)); aspect-ratio: 4 / 5; }
.portret img { width: 100%; height: 100%; object-fit: cover; }
.portret-init { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--afis); font-size: 20px; color: rgba(255, 239, 240, 0.72); }

/* --- acum pe scenă --- */
.scena { display: flex; gap: 16px; align-items: center; margin-top: 22px; padding: 14px; border-radius: 20px; background: rgba(255, 239, 240, 0.07); border: 1px solid var(--linie); }
.scena .portret { width: 104px; border-radius: 14px; }
.scena .portret-init { font-size: 40px; }
.scena-nume { margin: 4px 0 2px; font-family: var(--afis); font-weight: 700; font-size: 28px; line-height: 1.05; overflow-wrap: anywhere; }
.scena-moment { margin: 0; color: var(--text-moale); }
.scena .eticheta { margin-bottom: 4px; }

/* --- confirmarea numărului prin SMS --- */
.sms { margin-top: 16px; padding: 16px; border-radius: 20px; background: rgba(255, 239, 240, 0.07); border: 1px solid var(--linie); }
.sms-form { display: grid; gap: 12px; }
.sms-eticheta { display: grid; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-moale); }
.sms-eticheta input { width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid rgba(255, 239, 240, 0.3); background: rgba(23, 6, 10, 0.6); color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: 0.04em; }
.sms-eticheta input::placeholder { color: rgba(255, 239, 240, 0.35); font-weight: 400; }
.sms-eticheta input:focus-visible { outline: 3px solid var(--aur); outline-offset: 0; border-color: var(--aur); }
.sms-text { margin: 0 4px; font-size: 15px; color: var(--text-moale); text-wrap: pretty; }
.sms-eroare { margin: 0; font-weight: 600; color: #ffb4b4; }
.sms-linkuri { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.sms-link { padding: 10px 2px; border: 0; background: none; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sms-link:disabled { opacity: 0.4; }

/* scara de puncte: ce primește fiecare loc */
.scara { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scara li { display: grid; justify-items: center; gap: 1px; padding: 7px 2px 8px; border-radius: 12px; background: rgba(255, 239, 240, 0.07); border: 1px solid rgba(255, 239, 240, 0.12); }
.scara b { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-moale); white-space: nowrap; }
.scara span { font-family: var(--afis); font-weight: 700; font-size: 22px; line-height: 1; color: var(--aur); font-variant-numeric: lining-nums tabular-nums; }
.scara li:first-child { background: rgba(255, 200, 87, 0.16); border-color: rgba(255, 200, 87, 0.5); }
.scara-nota { margin: 10px 4px 0; font-size: 14px; color: var(--text-moale); }
.aur-semn { display: inline-block; margin-left: 8px; padding: 2px 8px 3px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; line-height: 1.3; color: #2a1a00; background: linear-gradient(180deg, #ffe08a, #ffc857 55%, #e0a52e); vertical-align: 2px; white-space: nowrap; }
.scara-nota .aur-semn { margin-left: 0; }
.rand.pe-dinafara { opacity: 0.45; }
.sms-gata { display: flex; align-items: center; gap: 10px; margin: 18px 4px 0; font-weight: 600; color: var(--aur); }
.sms-gata svg { width: 22px; height: 22px; flex: none; }

/* --- lista de concurenți / clasament --- */
.lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }   /* coloana nu se lățește după un rând cu text lung */
.rand {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 76px; padding: 8px 10px 8px 8px;
  border-radius: 18px; border: 1px solid var(--linie);
  background: rgba(255, 239, 240, 0.05);
}
.rand .portret { width: 48px; }
.rand-loc {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--afis); font-weight: 700; font-size: 22px; line-height: 1;
  color: var(--text-moale); border: 1.5px dashed rgba(255, 239, 240, 0.3);
}
.rand-cine { flex: 1; min-width: 0; }
.rand-nume { display: block; font-weight: 600; font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.rand-moment { display: block; margin-top: 2px; font-size: 14px; color: var(--text-moale); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rand-puncte { color: var(--aur); font-weight: 600; }
.rand-total { flex: none; text-align: right; font-family: var(--afis); font-weight: 700; font-size: 24px; line-height: 1; }
.rand-total small { display: block; margin-top: 3px; font-family: var(--corp); font-weight: 400; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-moale); }

.rand.blocat { border-style: dashed; background: transparent; }
.rand.blocat .rand-nume { font-weight: 400; color: var(--text-moale); }
.rand.blocat .portret-init { font-size: 26px; }

/* rând care se poate alege */
button.rand-alege {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
button.rand-alege:focus-visible { outline: 3px solid var(--aur); outline-offset: 6px; border-radius: 12px; }
.rand.ales { background: rgba(227, 6, 19, 0.2); border-color: rgba(255, 51, 64, 0.6); }
.rand.ales .rand-loc { color: #fff; background: var(--rosu); border: 0; }
.rand.ales.primul .rand-loc { color: #2a1400; background: var(--aur); }
.rand.nou .rand-loc { animation: pop 0.34s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop { from { transform: scale(0.4); } }

.rand-muta { flex: none; display: flex; flex-direction: column; gap: 4px; }
.rand-muta button {
  display: grid; place-items: center; width: 46px; height: 34px; padding: 0;
  border: 0; border-radius: 12px; background: rgba(255, 239, 240, 0.1); color: var(--text);
}
.rand-muta button:disabled { opacity: 0.25; }
.rand-muta button:active:not(:disabled) { background: rgba(255, 239, 240, 0.24); }
.rand-muta svg { width: 18px; height: 18px; }

/* --- bara de jos --- */
.bara {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(23, 6, 10, 0), var(--noapte) 34%);
}
.bara-in { max-width: 528px; margin: 0 auto; display: grid; gap: 8px; }
.bara-text { margin: 0; text-align: center; font-size: 14px; color: var(--text-moale); }
.bara-text.eroare { color: #ffb4b4; }
.progres { height: 4px; border-radius: 4px; background: rgba(255, 239, 240, 0.16); overflow: hidden; }
.progres i { display: block; height: 100%; border-radius: 4px; background: var(--aur); transition: width 0.3s ease; }

.btn { display: block; width: 100%; min-height: 56px; padding: 14px 20px; border-radius: 16px; border: 0; font-weight: 700; font-size: 18px; text-align: center; }
.btn-plin { color: #fff; background: var(--rosu); }
.btn-plin:active:not(:disabled) { transform: translateY(1px); background: #c20510; }
.btn-plin:disabled { color: rgba(255, 239, 240, 0.5); background: rgba(255, 239, 240, 0.12); box-shadow: none; cursor: default; }
.btn-gol { color: var(--text); background: transparent; border: 1.5px solid rgba(255, 239, 240, 0.3); }

/* --- confirmare --- */
.foaie {
  width: min(520px, calc(100vw - 24px)); margin: auto auto 12px; padding: 24px 20px 20px;
  border: 1px solid var(--linie); border-radius: 26px; color: var(--text); background: #2a0c10;
}
.foaie::backdrop { background: rgba(10, 2, 4, 0.72); backdrop-filter: blur(3px); }
.foaie h2 { margin: 0 0 6px; font-family: var(--afis); font-weight: 600; font-size: 30px; line-height: 1.05; }
.foaie p { margin: 0 0 14px; color: var(--text-moale); }
.foaie-lista { margin: 0 0 18px; padding: 0 10px 0 0; list-style: none; max-height: 42dvh; overflow: auto; display: grid; gap: 2px; }
.foaie-lista li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--linie); }
.foaie-lista b { flex: none; width: 26px; font-family: var(--afis); font-size: 19px; color: var(--aur); }
.foaie-lista span { flex: 1; overflow-wrap: anywhere; }
.foaie-lista i { flex: none; font-style: normal; font-size: 14px; color: var(--text-moale); }
.foaie-butoane { display: grid; gap: 8px; }

/* --- vot înregistrat --- */
.bifa { width: 72px; height: 72px; margin: 14px 4px 4px; border-radius: 50%; display: grid; place-items: center; background: var(--rosu); border: 10px solid rgba(23, 6, 10, 0.55); background-clip: padding-box; box-sizing: content-box; animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.bifa svg { width: 34px; height: 34px; }

/* --- podium pe telefon --- */
.rand.loc-1 { border-color: rgba(255, 200, 87, 0.75); background: rgba(255, 200, 87, 0.12); }
.rand.loc-1 .rand-loc { color: #2a1400; background: var(--aur); border: 0; }
.rand.loc-2 .rand-loc, .rand.loc-3 .rand-loc { color: var(--text); border-style: solid; border-color: rgba(255, 239, 240, 0.5); }
.rand.apare { animation: urca 0.5s both cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes urca { from { opacity: 0; transform: translateY(14px); } }
