/* Ghici ce sunt? — stilul: petrecere, mov închis, roz și galben */
:root {
  --bg: #1b1035; --bg2: #2a1650; --panel: #2e1a58; --panel2: #3a2270; --line: rgba(255, 255, 255, .12);
  --txt: #fff6ff; --muted: #b9a7da; --pink: #ff3e8a; --pink2: #ff7ab0; --yellow: #ffd23f; --green: #2ee59d; --red: #ff5a5a; --blue: #4cc9ff;
  --felt: #1f8a5b; --felt2: #136b45;
  --r: 18px;
  font-family: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #4a2290 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #3b0f4a 0%, transparent 60%), var(--bg);
  background-attachment: fixed; color: var(--txt); font-size: 16px; line-height: 1.35;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior-y: none;
}
#app { max-width: 640px; margin: 0 auto; padding: 10px 14px 24px; }
#app.scr-playing { padding-bottom: 80px; }
.grp { display: contents; }
.cols { display: contents; }
.kbd { display: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
h1, h2, h3 { margin: .2em 0 .4em; line-height: 1.1; }
h3 { font-size: 1.1rem; color: var(--yellow); }
small { font-size: .78em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row > .btn { flex: 1; }

/* ---------- elemente ---------- */
.panel { background: linear-gradient(180deg, var(--panel), #26144a); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 14px;
  background: var(--panel2); border: 1px solid var(--line); font-weight: 700; min-height: 46px; transition: transform .08s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn.big { width: 100%; font-size: 1.2rem; min-height: 56px; margin-top: 8px; }
.btn.pink { background: linear-gradient(180deg, var(--pink2), var(--pink)); border-color: transparent; color: #fff; box-shadow: 0 4px 0 #b3175a; }
.btn.ghost { background: transparent; }
.btn.danger, .link.danger { color: var(--red); }
.link { color: var(--pink2); text-decoration: underline; padding: 6px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; }
.chip.on { background: var(--pink); border-color: var(--pink); }
.inp {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #170c2e; color: var(--txt);
  font: inherit; font-size: 1.1rem; outline: none;
}
.inp:focus { border-color: var(--pink); }
.lbl { color: var(--muted); font-size: .9rem; margin: 6px 0 4px; font-weight: 700; }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--red); color: #fff; text-align: center; padding: 4px; font-weight: 700; }

/* ---------- acasă ---------- */
.home { text-align: center; padding-top: 10px; }
.logo { font-size: clamp(2.6rem, 12vw, 4rem); font-weight: 800; letter-spacing: -1px; margin: 10px 0 0; transform: rotate(-3deg); }
.logo span { display: inline-block; color: var(--yellow); text-shadow: 0 4px 0 #b3175a, 0 8px 20px rgba(255, 62, 138, .5); animation: bob 2.4s ease-in-out infinite; }
.logo span:nth-child(2) { color: var(--pink2); animation-delay: .2s; }
.logo span:nth-child(3) { color: var(--blue); animation-delay: .4s; }
.logo.small { font-size: 2.4rem; text-align: center; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(2deg); } }
.tag { color: var(--muted); font-size: 1.1rem; margin: 6px 0 4px; }
.me-card { text-align: left; }
.avatar-btn { display: block; margin: 0 auto 6px; position: relative; width: 150px; }
.avatar-btn svg { width: 150px; display: block; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
.pill { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); background: var(--pink); padding: 2px 10px; border-radius: 99px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.or { color: var(--muted); margin: 14px 0 6px; }
.join-row { display: flex; gap: 8px; }
.join-row .btn { width: auto; margin: 0; flex: 0 0 auto; }
.inp.code { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 800; font-size: 1.5rem; }

/* ---------- bara de sus ---------- */
[data-region="top"] { position: sticky; top: 0; z-index: 25; }
.top { display: flex; align-items: center; gap: 8px; padding: 8px 0; background: linear-gradient(180deg, var(--bg) 70%, transparent); color: var(--muted); font-size: .9rem; }
.code-chip { color: var(--yellow); letter-spacing: 2px; }

/* ---------- lobby ---------- */
.bigcode { font-size: 3.4rem; font-weight: 800; letter-spacing: 10px; color: var(--yellow); text-shadow: 0 4px 0 #b3175a; }
.lplayers { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.lp { background: var(--panel2); border-radius: 14px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: .9rem; }
.lp svg { width: 100%; max-width: 90px; }
.lp.off { opacity: .45; }
.lp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cat { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: #1d1038; border: 2px solid var(--line); text-align: left; font-weight: 700; font-size: .92rem; line-height: 1.1; }
.cat .ci { font-size: 1.5rem; display: flex; }
.ci-img { width: 28px; height: 28px; }
.emo.ci-img { width: auto; height: auto; }
.cat small { margin-left: auto; color: var(--muted); }
.cat.on { border-color: var(--pink); background: linear-gradient(180deg, #4a1f63, #3a1650); }
.cat em { position: absolute; top: -8px; right: 6px; background: var(--red); color: #fff; font-style: normal; font-size: .7rem; padding: 0 6px; border-radius: 6px; }
.cat:disabled { opacity: 1; cursor: default; }
.cat:disabled:not(.on) { opacity: .45; }
h3:has(.mini) { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mini { font-size: .85rem; white-space: nowrap; }
.tog { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.tog:first-of-type { border-top: 0; }
.tog > span:last-child { display: flex; flex-direction: column; }
.tog small { color: var(--muted); }
.tog input[type=checkbox] { display: none; }
.tog .sw { flex: 0 0 48px; height: 28px; border-radius: 99px; background: #170c2e; border: 2px solid var(--line); position: relative; transition: .2s; }
.tog .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .2s; }
.tog input:checked + .sw { background: var(--pink); border-color: var(--pink); }
.tog input:checked + .sw::after { left: 22px; background: #fff; }
.tog.ro { cursor: default; opacity: .8; }
.tog.sel { justify-content: space-between; }
.tog.sel > span { display: flex; flex-direction: column; }
.tog select { background: #170c2e; color: var(--txt); border: 2px solid var(--line); border-radius: 10px; padding: 8px; font: inherit; }
/* butonul principal rămâne jos la vedere, dar la capătul paginii nu mai acoperă nimic */
.sticky-cta { position: sticky; bottom: 0; padding: 16px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--bg) 65%, transparent); z-index: 20; display: flex; gap: 8px; justify-content: center; }
.sticky-cta > * { flex: 1; max-width: 460px; }
.sticky-cta .btn { margin: 0; }
.wait { flex: 1; text-align: center; padding: 14px; background: var(--panel); border-radius: 14px; color: var(--muted); font-weight: 700; }

/* ---------- masa ---------- */
.table-area { position: relative; width: 100%; aspect-ratio: 1 / 1.02; margin: 4px auto 0; max-width: 62vh; }
@media (min-width: 560px) { .table-area { aspect-ratio: 1.15 / 1; max-width: 64vh; } }
.felt { position: absolute; inset: 22% 18%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, var(--felt), var(--felt2)); border: 10px solid #6b3b1f; box-shadow: inset 0 0 30px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .5); }
.felt-info { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 56%; text-align: center; pointer-events: none; z-index: 5;
  background: rgba(10, 30, 20, .55); border-radius: 16px; padding: 4px 14px; backdrop-filter: blur(2px); }
.felt-info:empty { display: none; }
.felt-info .who { font-weight: 800; font-size: clamp(1rem, 4.5vw, 1.4rem); color: var(--yellow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.felt-info .st { font-size: .85rem; color: #e6ffe9; }
.felt-info .res { font-weight: 800; font-size: 1.3rem; }
.res.da, b.da { color: var(--green); } .res.nu, b.nu { color: var(--red); } .res.poate, b.poate { color: var(--yellow); }
.timer { font-weight: 800; color: #fff; }
.timer.hurry { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.2); } }
.seat { position: absolute; transform: translate(-50%, -55%); display: flex; flex-direction: column; align-items: center; z-index: 2; transition: left .4s, top .4s; }
.seat.off { opacity: .5; filter: grayscale(.7); }
.seat .nm { font-weight: 700; font-size: clamp(.7rem, 2.8vw, .95rem); background: rgba(0, 0, 0, .5); padding: 0 8px; border-radius: 99px; margin-top: -6px; white-space: nowrap; max-width: 140%; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 3; }
.seat.me .nm { background: var(--pink); }
.seat.turn .av-wrap::before { content: ''; position: absolute; inset: 20% 2% -2%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 63, .55), transparent 70%); animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { transform: scale(1.12); opacity: .6; } }
.badge { position: absolute; top: 34%; right: -4%; font-style: normal; z-index: 4; background: var(--panel2); border-radius: 50%; width: 1.7em; height: 1.7em; display: grid; place-items: center; font-size: clamp(.7rem, 2.8vw, .95rem); border: 2px solid var(--line); }
.badge.ok { background: var(--green); color: #063; font-weight: 800; }
.badge.rank { background: var(--yellow); }

/* avatar + cartonașul de pe frunte; dimensiunile cartonașului sunt relative la avatar (cqw) */
.av-wrap { position: relative; width: 100%; container-type: inline-size; }
.av-wrap svg { width: 100%; display: block; position: relative; }
.card {
  position: absolute; left: 50%; top: 1%; transform: translateX(-50%) rotate(-3deg); width: 50cqw; aspect-ratio: .82; background: #fff; color: #222;
  border-radius: 7cqw; border: 1.6cqw solid #ff3e8a; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3cqw;
  box-shadow: 0 2cqw 4cqw rgba(0, 0, 0, .35); z-index: 2;
}
.card .item-img { width: 70%; height: auto; aspect-ratio: 1; display: block; }
.card .emo.item-img { font-size: 22cqw; line-height: 1; text-align: center; }
.card b { font-size: 7.5cqw; line-height: 1; text-align: center; margin-top: 1.5cqw; overflow-wrap: anywhere; max-height: 2.1em; overflow: hidden; }
.card.mine { background: repeating-linear-gradient(45deg, #ffd23f, #ffd23f 4cqw, #ffc400 4cqw, #ffc400 8cqw); }
.card.mine .q { font-size: 30cqw; font-weight: 800; line-height: 1; color: #b3175a; animation: wobble 2s ease-in-out infinite; }
.card.mine b { font-size: 6cqw; color: #5a2a00; }
.card.done { border-color: var(--green); }
.card .tick { position: absolute; top: -4cqw; right: -4cqw; background: var(--green); color: #fff; border-radius: 50%; width: 13cqw; height: 13cqw; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 8cqw; }
@keyframes wobble { 50% { transform: rotate(8deg) scale(1.08); } }
.av-wrap.big { width: 220px; margin: 0 auto; }

/* ---------- panoul de acțiune ---------- */
.action { border-color: rgba(255, 62, 138, .5); }
.your-turn { color: var(--pink2); font-size: 1.4rem; animation: pulse .7s infinite alternate; transform-origin: left; }
.sugg { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.sugg::-webkit-scrollbar { display: none; }
.chip.s { white-space: nowrap; font-size: .85rem; font-weight: 500; }
.bubble { background: #fff; color: #222; border-radius: 18px; padding: 12px 16px; font-size: 1.2rem; font-weight: 700; position: relative; margin: 6px 0 10px; }
.bubble.big { font-size: 1.5rem; text-align: center; }
.bubble.muted { color: #777; font-weight: 500; }
.vote { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 8px 0; }
.vbtn { padding: 16px 6px; border-radius: 16px; font-size: 1.3rem; font-weight: 800; border: 3px solid transparent; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.vbtn:active { transform: translateY(3px); box-shadow: none; }
.vbtn.da { background: #15995f; } .vbtn.nu { background: #c23535; } .vbtn.poate { background: #a3820f; }
.vbtn.on { border-color: #fff; transform: scale(1.04); box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.result { text-align: center; font-size: 2.6rem; font-weight: 800; animation: pop .35s; }
.result.da { color: var(--green); } .result.nu { color: var(--red); } .result.poate { color: var(--yellow); }
.counts { display: flex; justify-content: center; gap: 16px; color: var(--muted); font-weight: 700; }
.waiting { text-align: center; color: var(--muted); padding: 10px; font-weight: 700; }
.dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); } }
.their-item { display: flex; align-items: center; gap: 12px; background: #fff; color: #222; border-radius: 16px; padding: 8px 12px; margin-bottom: 10px; border: 3px solid var(--pink); }
.their-img { width: 52px; height: 52px; }
.emo.their-img { font-size: 44px; line-height: 52px; }
.their-item small { display: block; color: #777; }
.their-item b { font-size: 1.3rem; }
.done-banner { background: rgba(46, 229, 157, .15); border: 1px solid var(--green); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.hist li b { white-space: nowrap; }
.hist li.ok b { color: var(--green); } .hist li.bad b { color: var(--red); }
.feed .fi { padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; color: var(--muted); }
.feed .fi:first-of-type { color: var(--txt); }
.fi.good { color: var(--green) !important; } .fi.bad { color: #ffb1b1 !important; } .fi.big { font-weight: 800; color: var(--yellow) !important; }
.reacts { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: safe center; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(27, 16, 53, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); z-index: 20; overflow-x: auto; }
.reacts button { font-size: 1.4rem; padding: 4px 3px; border-radius: 10px; flex: 0 0 auto; }
.reacts button:active { transform: scale(1.4); background: var(--panel2); }

/* ---------- final ---------- */
.loser-box { text-align: center; border-color: var(--yellow); }
.big-emoji { width: 96px; height: 96px; margin: 0 auto; animation: wobble 1.5s infinite; }
.big-emoji .ei, .pos .ei { width: 100%; height: 100%; }
.emo.ei { font-size: 80px; line-height: 1; }
.pos .emo.ei { font-size: 1.6rem; }
.punish { background: var(--yellow); color: #3a2000; border-radius: 14px; padding: 10px; margin-top: 10px; }
.punish small { display: block; font-weight: 700; }
.punish b { font-size: 1.2rem; }
.end-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.end-row .pos { font-size: 1.6rem; width: 36px; height: 36px; text-align: center; flex: 0 0 36px; }
.end-row .av-wrap { width: 64px; flex: 0 0 64px; }
.end-row .who { flex: 1; display: flex; flex-direction: column; }
.end-row .who small { color: var(--muted); }
.end-row .was { display: flex; flex-direction: column; align-items: center; width: 70px; text-align: center; line-height: 1; }
.end-img { width: 40px; height: 40px; }
.emo.end-img { font-size: 34px; }
.end-row.loser { background: rgba(255, 210, 63, .1); border-radius: 12px; }

/* ---------- ferestre ---------- */
#modal { display: none; }
#modal.open { display: block; }
.backdrop { position: fixed; inset: 0; background: rgba(5, 0, 15, .7); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--bg2); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); animation: up .25s ease-out; }
@keyframes up { from { transform: translate(-50%, 40%); opacity: 0; } }
.sheet .x { position: absolute; top: 10px; right: 12px; font-size: 1.3rem; width: 40px; height: 40px; border-radius: 50%; background: var(--panel2); z-index: 3; }
.sheet.player .av-wrap.big { margin-top: 6px; }
.host-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.rules li { margin-bottom: 8px; }
.sheet.editor { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 92vh; }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 0; }
.ed-preview { width: 130px; flex: 0 0 130px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .4)); }
.ed-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 12px; font-size: 1.3rem; min-width: 64px; }
.tab span { font-size: .72rem; font-weight: 700; white-space: nowrap; color: var(--muted); }
.tab.on { background: var(--pink); } .tab.on span { color: #fff; }
.ed-body { flex: 1; overflow-y: auto; padding: 4px 14px 14px; }
.part { margin-bottom: 10px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.opt { background: #1d1038; border: 2px solid var(--line); border-radius: 14px; padding: 4px; display: flex; flex-direction: column; align-items: center; font-size: .78rem; font-weight: 700; line-height: 1.1; }
.opt.on { border-color: var(--pink); background: #3a1650; }
.opt .mini { width: 100%; aspect-ratio: 1; background: radial-gradient(circle, #3a2270, #1d1038); border-radius: 10px; margin-bottom: 4px; }
.opt span { min-height: 2.2em; display: flex; align-items: center; text-align: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-c { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); }
.sw-c.on { border-color: #fff; box-shadow: 0 0 0 3px var(--pink); }
.texts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.texts .chip { font-size: .8rem; }
.ed-foot { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ed-foot .btn { margin: 0; flex: 1; }

/* ---------- efecte ---------- */
#toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: drop .25s; transition: opacity .4s, transform .4s; }
.toast.good { background: #136b45; } .toast.bad { background: #8f2333; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti { position: absolute; top: -50px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.big-text { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 800; line-height: 1.05; text-shadow: 0 4px 0 rgba(0, 0, 0, .5); animation: zoom 2.6s ease-out forwards; width: 92vw; }
.big-text span { font-size: .55em; display: block; margin-top: 8px; }
.big-text.good { color: var(--green); } .big-text.bad { color: var(--yellow); }
@keyframes zoom { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }
.float-react { position: absolute; font-size: 2.2rem; transform: translate(-50%, 0); animation: rise 1.8s ease-out forwards; }
@keyframes rise { to { transform: translate(-50%, -120px) scale(1.4); opacity: 0; } }

/* ---------- vocea ---------- */
.voice-panel { display: flex; flex-direction: column; gap: 6px; border-color: var(--green); background: linear-gradient(180deg, #1f4a3f, #1a2f3a); }
.voice-panel b { font-size: 1.15rem; display: block; }
.voice-panel small { color: #cdeee0; font-size: .9rem; }
.top .chip { padding: 6px 10px; min-height: 38px; white-space: nowrap; }
.top .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vbar { display: flex; gap: 4px; }
.chip.vjoin { background: linear-gradient(180deg, #3fe0a2, #17a86f); color: #052e1f; border-color: transparent; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 85%, 100% { transform: none; } 90% { transform: rotate(-6deg) scale(1.06); } 95% { transform: rotate(6deg) scale(1.06); } }
.chip.vmic { background: var(--green); border-color: transparent; font-size: 1.1rem; }
.chip.vmic.muted { background: var(--red); }
.chip.vlisten { background: var(--blue); border-color: transparent; }
.chip.vwarn { background: var(--yellow); border-color: transparent; animation: pulse .6s infinite alternate; }
.chip.vx small { font-size: .7rem; color: var(--muted); margin-left: 2px; }
.speaking .av-wrap > svg, .lp.speaking > svg { filter: drop-shadow(0 0 6px #2ee59d) drop-shadow(0 0 14px #2ee59d); }
.lp.speaking { outline: 3px solid var(--green); }

/* ---------- calculator: totul mai lat, pe coloane ---------- */
@media (min-width: 980px) {
  body { font-size: 17px; }
  #app { max-width: 1320px; padding: 8px 28px 28px; }
  #app.scr-home { max-width: 560px; }
  /* jocul: chat | masa | acțiuni, pe toată lățimea ecranului */
  #app.scr-playing { display: grid; max-width: 1840px; grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(290px, 340px);
    grid-template-areas: "banner banner banner" "top top top" "chat main side"; column-gap: 18px; align-items: start; padding-bottom: 20px; }
  #app.scr-playing [data-region="banner"] { grid-area: banner; }
  #app.scr-playing [data-region="top"] { grid-area: top; }
  .grp-chat { grid-area: chat; display: flex; flex-direction: column; position: sticky; top: 62px; height: calc(100vh - 78px); }
  .grp-chat [data-region="chatlog"] { flex: 1; min-height: 0; display: flex; }
  .grp-chat .panel.chat { flex: 1; display: flex; flex-direction: column; margin: 0; min-height: 0; }
  .grp-chat .chat-log { flex: 1; max-height: none; }
  .grp-main { grid-area: main; display: flex; flex-direction: column; justify-content: center; position: sticky; top: 62px; min-height: calc(100vh - 78px); }
  .grp-side { grid-area: side; display: block; }
  .grp-side .panel:first-child { margin-top: 0; }
  .table-area { aspect-ratio: 1.25 / 1; width: 100%; max-width: calc((100vh - 140px) * 1.25); }
  .seat .nm { font-size: 1.05rem; }
  .felt-info .who { font-size: 1.6rem; }
  .felt-info .st { font-size: 1rem; }
  .reacts { position: static; background: transparent; border: 0; backdrop-filter: none; padding: 4px 0 0; justify-content: center; }
  .reacts button { font-size: 1.6rem; padding: 4px 6px; }
  .reacts button:hover { background: var(--panel2); transform: scale(1.15); }
  .kbd { display: inline; }
  div.kbd { display: block; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .col > .panel:first-child { margin-top: 12px; }
  .lplayers { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .end .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .loser-box { margin-top: 12px; }
  .btn:hover, .chip:hover, .cat:hover, .opt:hover, .lp:hover { filter: brightness(1.12); }
  .vbtn:hover { filter: brightness(1.15); }
  /* ferestrele: la mijloc, nu jos */
  .sheet { top: 50%; bottom: auto; transform: translate(-50%, -50%); border-radius: 24px; max-width: 620px; max-height: 88vh; padding: 22px 24px; }
  @keyframes up { from { transform: translate(-50%, -46%); opacity: 0; } }
  .sheet.editor { max-width: 980px; height: 84vh; display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "head tabs" "head body" "head foot"; }
  .ed-head { grid-area: head; flex-direction: column; justify-content: center; padding: 24px; border-right: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #3a2270, transparent 70%); }
  .ed-preview { width: 240px; flex: 0 0 auto; }
  .ed-btns { width: 100%; flex: 0 0 auto; }
  .tabs { grid-area: tabs; padding: 10px 14px; }
  .ed-body { grid-area: body; padding: 8px 20px 20px; }
  .ed-foot { grid-area: foot; padding: 12px 20px; }
  .opts { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
@media (min-width: 1400px) {
  #app.scr-playing { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) minmax(360px, 460px); }
}

/* ---------- chat ---------- */
.chat-log { overflow-y: auto; max-height: 230px; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; overscroll-behavior: contain; }
.chat-log p { margin: 4px 0; }
.cm { background: rgba(255, 255, 255, .06); border-radius: 12px 12px 12px 4px; padding: 6px 10px; max-width: 92%; align-self: flex-start; overflow-wrap: anywhere; }
.cm.me { align-self: flex-end; background: rgba(255, 62, 138, .25); border-radius: 12px 12px 4px 12px; }
.cm-h { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; }
.cm-h small { color: var(--muted); font-size: .7rem; }
.cm-t { display: block; }
.chat-form { display: flex; gap: 8px; margin: -4px 0 12px; }
.chat-form .inp { flex: 1; padding: 10px 12px; font-size: 1rem; }
.chat-form .btn { min-width: 52px; }
.chat-bubble { position: absolute; transform: translate(-50%, -100%); background: #fff; color: #222; font-weight: 700; padding: 6px 12px; border-radius: 14px; max-width: 220px; font-size: .9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: bubble 4.2s ease-out forwards; z-index: 75; text-align: center; overflow-wrap: anywhere; }
.chat-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, -80%) scale(.7); } 8% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -115%); } }
/* telefon: masa, acțiunea, apoi chatul, notițele și ce s-a întâmplat */
@media (max-width: 979px) {
  #app.scr-playing { display: flex; flex-direction: column; }
  #app.scr-playing [data-region="banner"], #app.scr-playing [data-region="top"] { order: 0; }
  #app.scr-playing [data-region="table"] { order: 1; }
  #app.scr-playing [data-region="react"] { order: 2; }
  #app.scr-playing [data-region="action"] { order: 3; }
  #app.scr-playing [data-region="chatlog"] { order: 4; }
  #app.scr-playing [data-region="chatinput"] { order: 5; }
  #app.scr-playing [data-region="notes"] { order: 6; }
  #app.scr-playing [data-region="feed"] { order: 7; }
  .chat-form { margin-top: -6px; }
  [data-region="chatlog"] .panel { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; padding-bottom: 14px; }
  .chat-form { background: #26144a; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 0 14px 14px; margin: 0 0 12px; }
}
@media (min-width: 980px) {
  .grp-chat .chat-form { margin: 10px 0 0; }
}

/* ---------- întrebare pe voce ---------- */
.hint { margin: 6px 0 4px; font-size: .9rem; }
.write-q { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.write-q summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 4px 0; }
.write-q[open] summary { margin-bottom: 8px; }
.write-q .btn { width: 100%; margin-top: 8px; }
.vote.small .vbtn { padding: 10px 6px; font-size: 1.05rem; }
.voice-q { text-align: center; font-size: 1.25rem; padding: 14px; background: rgba(46, 229, 157, .12); border: 1px solid var(--green); border-radius: 14px; }
.voice-q small { color: var(--muted); font-size: .85rem; }
.res.voce, b.voce, .result.voce { color: var(--green); }

/* ---------- telefon întors (landscape): masa în stânga, acțiunea și chatul în dreapta ---------- */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) and (max-width: 979px) {
  #app { max-width: none; padding: 4px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); }
  #app.scr-playing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 44%);
    grid-template-areas: "banner banner" "top top" "main side" "main chat"; column-gap: 14px; align-items: start; padding-bottom: 12px; }
  #app.scr-playing [data-region="banner"] { grid-area: banner; }
  #app.scr-playing [data-region="top"] { grid-area: top; }
  #app.scr-playing .grp-main { grid-area: main; display: block; position: sticky; top: 50px; }
  #app.scr-playing .grp-side { grid-area: side; display: block; }
  #app.scr-playing .grp-chat { grid-area: chat; display: block; }
  .top { padding: 4px 0; }
  .table-area { aspect-ratio: 1.15 / 1; max-width: calc((100vh - 110px) * 1.15); }
  .reacts { position: static; background: transparent; border: 0; backdrop-filter: none; padding: 2px 0 0; }
  .reacts button { font-size: 1.25rem; }
  .grp-side .panel:first-child { margin-top: 0; }
  .sticky-cta { padding-top: 8px; }
  .sheet { max-height: 96vh; }
  .sheet.editor { height: 96vh; }
  .ed-preview { width: 90px; flex-basis: 90px; }
}

/* ---------- scrollbar-uri în tema jocului (subțiri, mov, cu roz la hover) ---------- */
html { scrollbar-color: #5b3a9e #140a2a; }
* { scrollbar-width: thin; scrollbar-color: #5b3a9e transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-track { background: #140a2a; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #6c45b8, #4a2a86); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--pink2), var(--pink)); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.chat-log::-webkit-scrollbar, .ed-body::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 8px; }

/* textul din mijlocul mesei: compact, pe două rânduri */
.felt-info .who { line-height: 1.1; }
.felt-info .st { line-height: 1.2; }
.felt-info .res { font-size: 1em; font-weight: 800; }
.felt-info .timer { display: inline; margin-left: 4px; }
.felt-info { max-width: 46%; }
@media (max-width: 559px) { .felt-info .who { font-size: 1rem; } .felt-info .st { font-size: .74rem; } .felt-info { padding: 3px 10px; } }

.top-timer { display: none; font-weight: 800; white-space: nowrap; }
@media (orientation: landscape) and (max-height: 560px) and (min-width: 560px) and (max-width: 979px) {
  .felt-info { display: none; }
  .top-timer { display: inline; color: var(--txt); }
  .table-area { max-width: calc((100vh - 96px) * 1.15); }
}
