/* iamza.baby — stiluri */
:root {
  --burg: #6e2c3e; --burg-d: #55212f; --burg-l: #9a4b61;
  --cream: #faf6f1; --ink: #33272b; --muted: #8a7a80;
  --peach: #f5b78f; --mint: #a8c8b4; --card: #ffffff;
  --shadow: 0 10px 34px rgba(85, 33, 47, .14);
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, var(--cream) 0%, #f3e7e3 55%, #ecd9d6 100%);
  color: var(--ink); min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.pad { padding: 10px 14px; }
.accent { color: var(--burg); }
button { font: inherit; cursor: pointer; }

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(circle at 50% 42%, #7d3448 0%, var(--burg) 45%, var(--burg-d) 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .8s ease, transform .9s cubic-bezier(.6,-.1,.3,1);
}
#intro.fly { opacity: 0; transform: scale(.05) translate(-46vw, -46vh); pointer-events: none; }
#intro.passthrough { pointer-events: none; }
.intro-inner { text-align: center; color: #fff; }
.intro-fruit { font-size: 92px; transition: transform .18s ease; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -10px; } }
.intro-logo { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: .02em; margin-top: 12px; }
.intro-logo span { display: inline-block; opacity: 0; animation: pop .5s forwards; margin: 0 .12em; }
.intro-logo .w-i { animation-delay: .15s; color: var(--peach); }
.intro-logo .w-am { animation-delay: .5s; }
.intro-logo .w-amza { animation-delay: .9s; color: var(--peach); }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.7); } to { opacity: 1; transform: none; } }
.intro-sub { margin-top: 10px; opacity: .85; font-size: 1.05rem; animation: pop .6s 1.4s backwards; }

/* ---------- topbar / badge ---------- */
#topbar {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
#topbar > * { pointer-events: auto; }
#badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--burg); color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px 8px 10px; box-shadow: var(--shadow);
  animation: pop .5s backwards;
}
#badge:hover { background: var(--burg-l); }
.badge-fruit { font-size: 1.5rem; }
.badge-fruit.swap { animation: pop .45s; }
.g-emoji { font-size: 1.05rem; }
.badge-txt { text-align: left; line-height: 1.15; }
.badge-txt strong { font-size: .92rem; display: block; }
.badge-txt small { opacity: .85; }
.badge-ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 3.5; }
.ring-bg { stroke: rgba(255,255,255,.25); }
.ring-fg { stroke: var(--peach); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
#userbox { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 999px; padding: 7px 10px 7px 16px; box-shadow: var(--shadow); }

.pop {
  position: fixed; top: 74px; left: 12px; z-index: 60; width: min(320px, 90vw);
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 20px;
}
.pop h3 { margin: 0 0 6px; }
.pop .big { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.g-emoji { font-size: 1.4rem; }
.bar { height: 10px; background: #f0e2e6; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.bar div { height: 100%; background: linear-gradient(90deg, var(--peach), var(--burg)); border-radius: 999px; transition: width 1s ease; }

/* ---------- auth ---------- */
#authView { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 80px 16px 40px; }
.auth-card { width: min(430px, 100%); background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 28px; }
.auth-head { text-align: center; }
.auth-fruit { font-size: 56px; animation: bob 1.8s ease-in-out infinite; }
.auth-card h1 { margin: 6px 0 4px; font-size: 1.6rem; }
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; background: #f4ebee; border-radius: 12px; padding: 5px; }
.tab { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--burg); color: #fff; }
.pane label { display: block; margin: 12px 0; font-size: .9rem; font-weight: 600; color: var(--burg-d); }
.pane input {
  width: 100%; margin-top: 5px; padding: 11px 13px; font: inherit;
  border: 1.5px solid #e5d5da; border-radius: 11px; background: #fdfbfa;
}
.pane input:focus { outline: 2px solid var(--burg-l); border-color: transparent; }
button.primary {
  width: 100%; margin-top: 12px; padding: 12px; border: none; border-radius: 12px;
  background: var(--burg); color: #fff; font-weight: 700; font-size: 1rem;
}
button.primary:hover:not(:disabled) { background: var(--burg-l); }
button.primary:disabled { opacity: .55; cursor: wait; }
button.primary.sm { width: auto; padding: 8px 16px; margin: 0; font-size: .9rem; }
button.ghost { background: transparent; border: 1.5px solid #dcc7ce; color: var(--burg); border-radius: 12px; padding: 9px 14px; margin-top: 8px; width: 100%; }
#userbox .ghost { width: auto; margin: 0; padding: 6px 12px; }
#qrBox { display: flex; justify-content: center; margin: 10px 0; }
#qrBox svg { width: 180px; height: 180px; border: 8px solid #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); border-radius: 8px; }
code { background: #f4ebee; padding: 2px 7px; border-radius: 6px; font-size: .82rem; word-break: break-all; }
.msg { padding: 10px 14px; border-radius: 10px; margin-top: 14px; font-size: .9rem; }
.msg.err { background: #fdeaea; color: #a13030; }
.msg.ok { background: #e8f5ec; color: #2e7042; }

/* ---------- layout app ---------- */
#appView {
  display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px;
  max-width: 1420px; margin: 0 auto; padding: 84px 18px 24px; min-height: 100vh;
}
@media (max-width: 980px) { #appView { grid-template-columns: 1fr; } }

#roomWrap { position: relative; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 18px 10px; }
#roomTitle h2 { margin: 2px 0 2px; color: var(--burg-d); }
#roomTitle p { margin: 0 0 10px; }
#roomStage svg { width: 100%; height: auto; border-radius: 14px; display: block; }
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--burg); color: #fff; font-size: 26px; line-height: 1; box-shadow: var(--shadow);
}
.nav-arrow:hover { background: var(--burg-l); }
.nav-arrow.left { left: -8px; } .nav-arrow.right { right: -8px; }
#wallDots { display: flex; gap: 8px; justify-content: center; padding: 12px 0 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: none; background: #dcc7ce; padding: 0; }
.dot.active { background: var(--burg); transform: scale(1.25); }

/* ---------- obiecte din scenă ---------- */
.obj { cursor: pointer; transition: filter .2s; }
.obj:hover, .obj:focus { filter: drop-shadow(0 0 10px rgba(110, 44, 62, .55)); outline: none; }
.obj-plus, .obj-tag { display: none; }
.plus-c { fill: var(--burg); stroke: #fff; stroke-width: 2.5; }
.plus-p { stroke: #fff; stroke-width: 3.5; stroke-linecap: round; fill: none; }
.obj.ghost > *:not(.obj-plus):not(.obj-tag) { opacity: .38; }
.obj.ghost [fill]:not(.plus-c):not(.tag-r) { stroke-dasharray: 5 4; }
.obj.ghost .obj-plus { display: block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.obj.promised .obj-tag { display: block; }
.obj.promised .tag-r { fill: var(--peach); }
.obj.solved .obj-tag { display: block; }
.tag-r { fill: var(--mint); stroke: #fff; stroke-width: 2; }
.tag-t { font-size: 14px; font-weight: 700; fill: #3b3129; }
.mini-note { font-size: 13px; fill: var(--muted); font-style: italic; }
.wall-writing { font-size: 30px; letter-spacing: 14px; fill: #fff; opacity: .16; font-weight: 700; }

/* ---------- sidebar ---------- */
#sidebar { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; max-height: calc(100vh - 108px); overflow-y: auto; position: sticky; top: 84px; }
@media (max-width: 980px) { #sidebar { position: static; max-height: none; } }
.side-tabs { margin: 0 0 8px; }
details { border-bottom: 1px solid #f2e6ea; }
summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 8px; font-weight: 700; color: var(--burg-d); cursor: pointer; list-style: none;
}
summary::before { content: "▸ "; color: var(--burg-l); margin-right: 4px; }
details[open] summary::before { content: "▾ "; }
.cat-count { font-size: .78rem; background: #f4ebee; color: var(--burg); border-radius: 999px; padding: 2px 9px; }
.item-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 10px; cursor: pointer; }
.item-row:hover { background: #faf3f5; }
.item-main { min-width: 0; }
.item-name { display: block; font-weight: 600; font-size: .92rem; }
.item-meta { font-size: .78rem; color: var(--muted); }
.st-promis .item-name { color: #b06a28; }
.st-cumparat .item-name, .st-primit .item-name { color: #7d8d80; text-decoration: line-through; text-decoration-thickness: 1px; }
.item-side { display: flex; gap: 5px; align-items: flex-start; flex-shrink: 0; }
.chip { font-size: .72rem; background: #f4ebee; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.chip.urgent { background: #fdeaea; color: #a13030; font-weight: 700; }
.chip.warn { background: #fdf3e2; color: #a06a1c; font-weight: 700; }
.chip.calm { background: #e8f5ec; color: #2e7042; }
.urg-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 2px; }
.urg { border: 1.5px solid #ecd9df; background: #fdfbfa; border-radius: 999px; padding: 5px 11px; font-size: .8rem; }
.urg.on { background: var(--burg); color: #fff; border-color: var(--burg); }
.urg.ro { opacity: .7; cursor: default; }
.add-item select { padding: 9px 12px; border: 1.5px solid #e5d5da; border-radius: 10px; font: inherit; background: #fdfbfa; }

/* to-do */
.todo { display: flex; gap: 10px; padding: 8px 8px 8px 18px; align-items: flex-start; cursor: pointer; }
.todo input { margin-top: 3px; accent-color: var(--burg); width: 17px; height: 17px; }
.todo span { font-size: .92rem; font-weight: 600; display: block; }
.todo small { display: block; margin-top: 1px; }
.todo.done span { text-decoration: line-through; color: var(--muted); }

/* spoturile "+" din cameră */
.spot { cursor: pointer; }
.spot-c { fill: #fff; fill-opacity: .85; stroke: var(--burg); stroke-width: 2; stroke-dasharray: 5 4; }
.spot-p { stroke: var(--burg); stroke-width: 3.5; stroke-linecap: round; fill: none; }
.spot:not(.filled) { animation: pulse 1.8s ease-in-out infinite; }
.spot:hover { filter: drop-shadow(0 0 8px rgba(110, 44, 62, .5)); }
.spot.filled .spot-c, .spot.filled .spot-p { display: none; }
.spot .spot-tag { display: none; }
.spot.filled .spot-tag { display: block; }
.spot.filled.st-necesar .gift { opacity: .55; }
.g-box { fill: #e9a6b1; stroke: #d18795; stroke-width: 1.5; }
.g-lid { fill: #e9a6b1; stroke: #d18795; stroke-width: 1.5; }
.g-rib { fill: #fdfbfa; }
.g-bow { fill: #fdfbfa; stroke: #d18795; stroke-width: 1.2; }

/* adăugare articol + audit */
.add-toggle { width: calc(100% - 16px); margin: 10px 8px; }
.add-item { padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.add-item input { padding: 9px 12px; border: 1.5px solid #e5d5da; border-radius: 10px; font: inherit; }
.add-row { display: flex; gap: 8px; }
.add-row input[name="category"] { flex: 1; }
.add-row input[name="qty"] { width: 74px; }
.audit-note { display: block; color: #2e7042; font-size: .75rem; margin-top: 2px; }
.audit-line { font-size: .8rem; color: var(--muted); margin: 6px 0; border-bottom: 1px dashed #f0e2e6; padding-bottom: 6px; }

/* ---------- modal ---------- */
#overlay { position: fixed; inset: 0; background: rgba(52, 24, 33, .55); z-index: 70; backdrop-filter: blur(3px); }
.modal {
  position: fixed; z-index: 80; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(520px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 24px;
}
.modal h3 { margin: 0 30px 4px 0; color: var(--burg-d); }
.modal-x { position: absolute; top: 12px; right: 12px; border: none; background: #f4ebee; border-radius: 50%; width: 34px; height: 34px; font-size: 15px; }
.status-line { font-weight: 700; margin: 8px 0; }
.status-line.st-promis { color: #b06a28; }
.status-line.st-cumparat, .status-line.st-primit { color: #2e7042; }
.status-line.st-necesar, .status-line.st-partial { color: var(--burg); }
.notes { background: #fdf6ee; border-left: 3px solid var(--peach); padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.modal-actions button { width: auto; flex: 1 1 auto; margin: 0; }
.react-bar { display: flex; gap: 8px; margin: 10px 0; }
.react { border: 1.5px solid #ecd9df; background: #fdfbfa; border-radius: 999px; padding: 7px 15px; font-size: .95rem; }
.react.on { background: var(--burg); color: #fff; border-color: var(--burg); }
.modal h4 { margin: 14px 0 6px; }
.comments { max-height: 220px; overflow-y: auto; }
.comment { padding: 8px 0; border-bottom: 1px solid #f6edf0; }
.comment p { margin: 3px 0 0; font-size: .92rem; white-space: pre-wrap; }
.cform { display: flex; gap: 8px; margin-top: 10px; }
.cform input { flex: 1; padding: 10px 13px; border: 1.5px solid #e5d5da; border-radius: 11px; font: inherit; min-width: 0; }

/* ---------- responsive / mobile ---------- */
@media (max-width: 640px) {
  #topbar { top: 8px; left: 8px; right: 8px; flex-wrap: wrap; gap: 8px; }
  #badge { padding: 6px 12px 6px 8px; max-width: calc(100vw - 24px); }
  .badge-txt strong { font-size: .82rem; }
  .badge-txt small { font-size: .72rem; }
  .badge-ring svg { width: 28px; height: 28px; }
  #userbox { padding: 6px 8px 6px 12px; max-width: 100%; font-size: .85rem; }
  #helloUser { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
  #authView { padding: 72px 12px 28px; align-items: flex-start; }
  .auth-card { padding: 20px 18px; border-radius: 18px; }
  .auth-card h1 { font-size: 1.35rem; }
  .auth-fruit { font-size: 44px; }
  .tabs { flex-direction: column; }
  .tab { padding: 11px; }
  .pop { top: auto; bottom: 12px; left: 8px; right: 8px; width: auto; max-height: 70vh; overflow-y: auto; }
  #appView { padding: 76px 10px 16px; gap: 12px; }
  #roomWrap { padding: 12px 10px 8px; border-radius: 16px; }
  .nav-arrow { width: 40px; height: 40px; font-size: 22px; }
  .nav-arrow.left { left: 4px; } .nav-arrow.right { right: 4px; }
  #sidebar { padding: 10px; border-radius: 16px; }
  .side-tabs { flex-direction: column; }
  .side-tabs .tab { padding: 11px 8px; font-size: .88rem; }
  .modal { width: min(520px, 96vw); padding: 18px 16px; max-height: 92vh; }
  .modal-actions { flex-direction: column; }
  .modal-actions button { width: 100%; }
  .react-bar { flex-wrap: wrap; }
  .cform { flex-direction: column; }
  .cform button { width: 100%; }
  .item-row { flex-direction: column; gap: 4px; }
  .item-side { flex-wrap: wrap; }
  .urg-bar { gap: 4px; }
  .urg { padding: 6px 9px; font-size: .75rem; }
  .intro-logo { font-size: clamp(1.8rem, 10vw, 3rem); }
  .intro-fruit { font-size: 72px; }
}
@media (max-width: 380px) {
  #helloUser { max-width: 36vw; }
  .badge-fruit { font-size: 1.2rem; }
}
@media (hover: none) {
  button, .item-row, .obj, .spot, .tab { min-height: 44px; }
  .nav-arrow { min-width: 44px; min-height: 44px; }
}
