/* css/dorinte.css — Dorințe: freci lampa, iese Șamanul (sau Moș Crăciun) */

#dorinte-section .container { max-width: 820px; }

.dor-intro {
    padding: 0.85rem 1rem;
    border: 1px solid var(--card-border);
    border-left: 4px solid #d97706;
    border-radius: 0.6rem;
    background: var(--section-alt-bg);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
}

/* ─── Alegerea personajului ─────────────────────────────────────────────── */
.dor-personas { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.dor-persona {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 44px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dor-persona.is-active {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.14);
    box-shadow: inset 0 -2px 0 #d97706;
    font-weight: 700;
}
.dor-persona.is-locked { opacity: 0.5; cursor: not-allowed; }

/* Cât mai e până vine Moșul — sau că a venit deja. */
.dor-season {
    margin: 0 0 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid var(--card-border);
    background: var(--section-alt-bg);
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--secondary-text-color);
}
.dor-season.is-open {
    border-color: rgba(220, 38, 38, 0.45);
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
}
body.dark-theme .dor-season.is-open { color: #fca5a5; }

/* ─── Scena ─────────────────────────────────────────────────────────────── */
.dor-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 1.6rem 1rem 1.4rem;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.2rem;
    background: radial-gradient(ellipse at 50% 78%, rgba(217, 119, 6, 0.26) 0%, rgba(15, 23, 42, 0) 68%),
                linear-gradient(180deg, #101a2e 0%, #1b1024 100%);
}
.dor-stage[data-persona="mos"] {
    background: radial-gradient(ellipse at 50% 78%, rgba(220, 38, 38, 0.28) 0%, rgba(15, 23, 42, 0) 68%),
                linear-gradient(180deg, #0b1a2b 0%, #14243a 100%);
}

/* Personajul iese din fum: pornește mic, jos și transparent. */
.dor-character {
    width: min(15rem, 62vw);
    filter: drop-shadow(0 0.6rem 1.4rem rgba(0, 0, 0, 0.45));
    transform-origin: 50% 100%;
    animation: dor-appear 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes dor-appear {
    0%   { opacity: 0; transform: translateY(2.2rem) scale(0.4); filter: blur(6px); }
    60%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.dor-character-float { animation: dor-float 4.5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes dor-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-0.5rem) rotate(1deg); }
}

/* Culorile personajului. Aceleași forme, două acoperăminte de cap și două obiecte de frecat —
   se schimbă doar ce se vede, în funcție de cine e chemat. */
.dor-body { fill: #6d28d9; }
.dor-skin { fill: #e0ab7d; }
.dor-beard { fill: #e2e8f0; }
.dor-eye { fill: #1e293b; }
.dor-stage[data-persona="mos"] .dor-body { fill: #dc2626; }

.dor-stage[data-persona="saman"] .dor-hat-mos,
.dor-stage[data-persona="mos"] .dor-hat-saman,
.dor-stage[data-persona="saman"] .dor-lamp-mos,
.dor-stage[data-persona="mos"] .dor-lamp-saman { display: none; }

/* Lampa / clopoțelul: se încălzesc pe măsură ce le freci. */
.dor-lamp {
    width: min(13rem, 56vw);
    border: 0;
    background: transparent;
    padding: 0;
    cursor: grab;
    touch-action: none;                 /* frecatul nu trebuie să tragă pagina */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    --glow: 0;
    filter: drop-shadow(0 0 calc(var(--glow) * 2.4rem) rgba(253, 224, 71, calc(var(--glow) * 0.85)));
    transition: filter 0.2s ease, transform 0.2s ease;
}
.dor-lamp:active, .dor-lamp.is-rubbing { cursor: grabbing; transform: scale(0.98); }
.dor-lamp.is-warm { animation: dor-shiver 0.5s ease-in-out infinite; }
.dor-lamp.is-hot { animation: dor-shiver 0.22s ease-in-out infinite; }
@keyframes dor-shiver {
    0%, 100% { transform: rotate(0) scale(0.99); }
    25%      { transform: rotate(-1.4deg) scale(1); }
    75%      { transform: rotate(1.4deg) scale(1); }
}
.dor-stage.is-summoned .dor-lamp { opacity: 0.45; pointer-events: none; }

.dor-meter {
    width: min(22rem, 88%);
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(253, 224, 71, 0.18);
    overflow: hidden;
}
.dor-meter span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #b45309, #fbbf24, #fde68a);
    border-radius: 999px;
    transition: width 0.08s linear;
}
.dor-stage.is-summoned .dor-meter { visibility: hidden; }

.dor-rub-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fde68a;
    text-align: center;
}
.dor-stage.is-summoned .dor-rub-label { display: none; }
.dor-hint { margin: 0; font-size: 0.85rem; color: #cbd5e1; text-align: center; }
/* ─── Ecran complet ─────────────────────────────────────────────────────── */
.dor-fs-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.55);
    color: #fde68a;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dor-fs-btn:hover { background: rgba(15, 23, 42, 0.85); border-color: #fbbf24; }

/* Butonul de sunet, în colțul opus celui de ecran complet. */
.dor-sound-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 5;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.55);
    color: #fde68a;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dor-sound-btn:hover { background: rgba(15, 23, 42, 0.85); border-color: #fbbf24; }
.dor-sound-btn.is-off { color: #64748b; border-color: rgba(148, 163, 184, 0.35); }

/* Pagina dă lămpii o înălțime fixă; pe tot ecranul trebuie dată la o parte. */
.dor-3d:fullscreen,
.dor-3d:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    aspect-ratio: auto !important;      /* altfel raportul 4/3 se bate cu 100vw/100vh */
    border-radius: 0 !important;
    background: linear-gradient(180deg, #101a2e 0%, #1b1024 100%) !important;
}
/* iOS Safari nu dă ecran complet decât pentru video — acoperim fereastra cu CSS. */
.dor-3d.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2000 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none !important;
    aspect-ratio: auto !important;      /* altfel raportul 4/3 se bate cu 100vw/100vh */
    border-radius: 0 !important;
    margin: 0 !important;
    background: linear-gradient(180deg, #101a2e 0%, #1b1024 100%) !important;
}
body.dor-fs-lock { overflow: hidden !important; }

/* Chemarea ratată: lampa se zbate scurt și se potolește. */
.dor-lamp.is-fizzle { animation: dor-fizzle 0.9s ease-out; }
@keyframes dor-fizzle {
    0%   { transform: scale(1.03) rotate(0); }
    15%  { transform: scale(1.05) rotate(-2.5deg); }
    35%  { transform: scale(1.02) rotate(2deg); }
    55%  { transform: scale(1.01) rotate(-1.2deg); }
    100% { transform: scale(1) rotate(0); }
}

/* ─── Vorba cu personajul ───────────────────────────────────────────────── */
/* Se vede și ce spui tu, nu doar ce răspunde el — altfel nu e discuție. */
.dor-chat {
    width: min(34rem, 100%);
    max-height: 15rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.2rem;
}
.dor-chat:empty { display: none; }

.dor-msg {
    max-width: 85%;
    padding: 0.55rem 0.85rem;
    border-radius: 0.9rem;
    font-size: 0.93rem;
    line-height: 1.5;
    animation: dor-say 0.35s ease;
    overflow-wrap: anywhere;
}
.dor-msg.is-them {
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    background: rgba(109, 40, 217, 0.24);
    border: 1px solid rgba(167, 139, 250, 0.35);
    color: #ede9fe;
}
.dor-msg.is-me {
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    background: rgba(217, 119, 6, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fef3c7;
}
.dor-stage[data-persona="mos"] .dor-msg.is-them {
    background: rgba(220, 38, 38, 0.24);
    border-color: rgba(252, 165, 165, 0.35);
    color: #fee2e2;
}

.dor-speech {
    margin: 0;
    min-height: 2.6rem;
    max-width: 34rem;
    padding: 0.6rem 1rem;
    border-radius: 0.9rem;
    background: rgba(253, 230, 138, 0.14);
    border: 1px solid rgba(253, 224, 71, 0.35);
    color: #fde68a;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}
.dor-speech.is-new { animation: dor-say 0.45s ease; }
@keyframes dor-say {
    from { opacity: 0; transform: translateY(0.4rem); }
    to   { opacity: 1; transform: none; }
}

/* ─── Cererea dorinței ──────────────────────────────────────────────────── */
.dor-form { width: min(34rem, 100%); display: flex; flex-direction: column; gap: 0.5rem; }
.dor-form-row { display: flex; gap: 0.4rem; }
.dor-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(253, 224, 71, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    font-size: 1rem;                    /* ≥1rem: iOS nu mai face zoom la focus */
}
.dor-input::placeholder { color: #94a3b8; }
.dor-btn {
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
}
.dor-mic {
    background: transparent;
    border-color: rgba(253, 224, 71, 0.4);
    color: #fde68a;
}
.dor-mic.is-on { background: #dc2626; border-color: transparent; color: #fff; animation: dor-pulse 1.1s ease-in-out infinite; }
@keyframes dor-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); } 50% { box-shadow: 0 0 0 0.6rem rgba(220, 38, 38, 0); } }
.dor-quota { margin: 0; font-size: 0.8rem; color: #fbbf24; text-align: center; }

/* ─── Lista ─────────────────────────────────────────────────────────────── */
.dor-list-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem;
}
.dor-list-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.dor-count { font-size: 0.8rem; color: var(--secondary-text-color); }
.dor-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.dor-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
}
.dor-item:last-child { border-bottom: 0; }
.dor-item.is-done .dor-item-text { text-decoration: line-through; opacity: 0.6; }
.dor-tick, .dor-del {
    flex-shrink: 0;
    width: 2.2rem; height: 2.2rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; cursor: pointer;
    border-radius: 50%;
    font-size: 1.05rem;
}
.dor-tick { color: #d97706; }
.dor-item.is-done .dor-tick { color: #16a34a; }
.dor-del { color: var(--secondary-text-color); font-size: 0.95rem; }
.dor-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.dor-item-text { font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }
.dor-item-meta { font-size: 0.74rem; color: var(--secondary-text-color); }
.dor-empty {
    padding: 1.1rem;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.88rem;
    border: 1px dashed var(--card-border);
    border-radius: 0.7rem;
}

/* ─── Trimiterea listei ─────────────────────────────────────────────────── */
.dor-share {
    padding: 1rem 1.15rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
    margin-bottom: 1.4rem;
}
.dor-share h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.dor-share h3 i { color: #d97706; }
.dor-share-hint { font-size: 0.85rem; color: var(--secondary-text-color); line-height: 1.55; margin-bottom: 0.8rem; }
.dor-share-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dor-share-row .dor-btn { flex: 1 1 10rem; }
.dor-btn-ghost { background: transparent; border-color: var(--card-border); color: var(--text-color); }
.dor-name-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.dor-name-row label { font-size: 0.85rem; flex: 0 0 auto; }
.dor-name-row input {
    flex: 1 1 10rem; min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: var(--section-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.dor-shared {
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.12);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
}

.dor-toast {
    position: fixed;
    left: 50%;
    bottom: 1.4rem;
    transform: translateX(-50%) translateY(1.4rem);
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.95);
    color: #fde68a;
    font-size: 0.88rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1080;
    max-width: calc(100vw - 2rem);
    text-align: center;
}
.dor-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Explicații ────────────────────────────────────────────────────────── */
.dor-tips {
    padding: 1rem 1.15rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
}
.dor-tips h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.6rem; }
.dor-tips h3 i { color: #eab308; }
.dor-tips ul { margin: 0 0 0.8rem; padding-left: 1.2rem; }
.dor-tips li { font-size: 0.9rem; line-height: 1.65; }
.dor-tips-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--card-border);
    padding-top: 0.7rem;
}

@media (hover: hover) {
    .dor-persona:hover, .dor-btn:hover { border-color: #d97706; }
}
@media (max-width: 575.98px) {
    .dor-stage { padding: 1.1rem 0.6rem; }
    .dor-share-row .dor-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .dor-lamp.is-fizzle, .dor-msg { animation: none; }
    .dor-lamp.is-warm, .dor-lamp.is-hot, .dor-character, .dor-character-float, .dor-mic.is-on { animation: none; }
}

/* Scena 3D: pânza umple containerul și e scoasă din flux, ca lățimea ei în pixeli să nu
   poată împinge layoutul (aceeași capcană ca la Tai Chi). */
.dor-3d {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    max-height: 24rem;
    border-radius: 0.9rem;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}
.dor-3d:active { cursor: grabbing; }
.dor-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.dor-birth-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.7rem; font-size: 0.85rem; }
.dor-birth-row input {
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: var(--section-bg);
    color: var(--text-color);
    font-size: 1rem;
}
.dor-birth-note { color: var(--secondary-text-color); font-size: 0.78rem; }

.dor-luck {
    margin: 0 0 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid var(--card-border);
    background: var(--section-alt-bg);
    font-size: 0.85rem;
    line-height: 1.55;
}
.dor-luck.is-hot { border-color: rgba(217, 119, 6, 0.5); background: rgba(217, 119, 6, 0.12); }
.dor-luck.is-cold { border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.10); }
.dor-luck.is-warm { border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.10); }
