/* Fazan — paletă „penaj de fazan”: noapte verde-petrol, aramă, auriu, roșu de creastă */
:root {
  --bg: #0e1518;
  --bg2: #142026;
  --panel: #18262c;
  --line: #27393f;
  --ink: #f6efe1;
  --muted: #93a6a2;
  --copper: #e07a3a;
  --copper2: #b85a24;
  --gold: #f2c14e;
  --teal: #2bb39a;
  --red: #e2483d;
  --felt1: #1f5a52;
  --felt2: #123631;
  --radius: 16px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --D: 280px;
  --seat: 58px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(180deg, #11201f 0%, var(--bg) 45%, #120f0d 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }

.screen {
  position: fixed; inset: 0;
  height: var(--appH, 100dvh);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- butoane ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 650; letter-spacing: .01em;
  transition: transform .12s ease, background .2s, opacity .2s, box-shadow .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary {
  background: linear-gradient(180deg, #ef8c48, var(--copper2));
  border-color: #f29a5c; color: #1a0f08;
  box-shadow: 0 6px 18px -6px rgba(224,122,58,.7), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.big { min-height: 54px; font-size: 1.08rem; border-radius: 14px; width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.grow { flex: 1; }
.btn.danger { background: var(--red); border-color: #f0675d; color: #fff; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); font-weight: 800;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.armed { background: var(--red); border-color: var(--red); }
.link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 10px; }

/* ---------- ACASĂ ---------- */
#home { justify-content: center; align-items: center; overflow-y: auto; }
.home-inner { width: min(420px, 100%); padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; z-index: 1; }
.logo { margin: 0; display: flex; gap: .06em; font-size: clamp(64px, 22vw, 108px); font-weight: 800; line-height: .9; letter-spacing: -.02em; }
.logo span {
  display: inline-block; color: var(--ink);
  animation: drop .9s cubic-bezier(.2,1.4,.4,1) both;
  text-shadow: 0 6px 0 var(--copper2), 0 14px 30px rgba(0,0,0,.5);
}
.logo span:nth-child(1) { animation-delay: .05s; color: var(--copper); text-shadow: 0 6px 0 #7a3410, 0 14px 30px rgba(0,0,0,.5); }
.logo span:nth-child(2) { animation-delay: .15s; }
.logo span:nth-child(3) { animation-delay: .25s; color: var(--gold); text-shadow: 0 6px 0 #8a6510, 0 14px 30px rgba(0,0,0,.5); }
.logo span:nth-child(4) { animation-delay: .35s; }
.logo span:nth-child(5) { animation-delay: .45s; color: var(--teal); text-shadow: 0 6px 0 #0f5246, 0 14px 30px rgba(0,0,0,.5); }
.logo:hover span, .logo.wiggle span { animation: wob .6s ease both; }
.logo.wiggle span:nth-child(2) { animation-delay: .05s } .logo.wiggle span:nth-child(3) { animation-delay: .1s }
.logo.wiggle span:nth-child(4) { animation-delay: .15s } .logo.wiggle span:nth-child(5) { animation-delay: .2s }
.tag { margin: 6px 0 14px; color: var(--muted); font-size: 1.05rem; text-align: center; animation: fadeUp .6s .6s both; }
.card {
  width: 100%; padding: 18px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
  animation: fadeUp .6s .75s both;
}
.invite-note { margin: 0; font-size: 1.02rem; text-align: center; }
.invite-note b { color: var(--gold); letter-spacing: .12em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: .85rem; color: var(--muted); font-weight: 600; }
input {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px;
  background: #0b1215; border: 1.5px solid var(--line); outline: none;
  font-size: 1.05rem; transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--copper); box-shadow: 0 0 0 4px rgba(224,122,58,.18); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.code-row { display: flex; gap: 8px; }
.code-row input { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; }
.code-row .btn { min-height: 50px; }
.feathers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.feathers i { position: absolute; top: -40px; font-style: normal; opacity: .22; animation: fall linear infinite; }

/* ---------- BARA ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; min-height: 56px; }
.bar-title { display: flex; align-items: center; gap: 8px; }
.mini-logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--copper); }
.code-pill { padding: 5px 10px; border-radius: 999px; background: rgba(242,193,78,.1); border: 1px solid rgba(242,193,78,.35); color: var(--gold); font-weight: 600; font-size: .9rem; }
.code-pill b { letter-spacing: .14em; }
.bar-right { display: flex; gap: 6px; }
.offline { position: absolute; top: calc(60px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; padding: 6px 14px; border-radius: 999px; background: var(--red); font-weight: 700; font-size: .85rem; animation: pulse 1.2s infinite; }

/* ---------- MASA ---------- */
.stage { position: relative; flex: 1; min-height: 170px; }
.table {
  position: absolute; left: 50%; top: 50%;
  width: var(--D); height: var(--D);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  transition: width .35s ease, height .35s ease;
}
.felt {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.08), transparent 55%),
    repeating-radial-gradient(circle at 50% 50%, rgba(0,0,0,.05) 0 2px, transparent 2px 5px),
    radial-gradient(circle, var(--felt1), var(--felt2) 72%);
  box-shadow:
    0 0 0 calc(var(--D) * .028) #6b3b1d,
    0 0 0 calc(var(--D) * .04) #3d2010,
    0 24px 60px -10px rgba(0,0,0,.75),
    inset 0 0 calc(var(--D) * .12) rgba(0,0,0,.55);
}
.table.my-turn .felt { animation: feltGlow 1.8s ease-in-out infinite; }
.ring { position: absolute; inset: 17%; width: 66%; height: 66%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 3.2; }
.ring-bg { stroke: rgba(0,0,0,.25); }
.ring-fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 0; transition: stroke .4s; opacity: 0; filter: drop-shadow(0 0 4px currentColor); }
.ring-fg.on { opacity: 1; }
.ring-fg.warn { stroke: var(--gold); }
.ring-fg.danger { stroke: var(--red); }

.center {
  position: absolute; inset: 22%;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 2px;
}
.c-inner { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.c-small { font-size: calc(var(--D) * .045); color: rgba(246,239,225,.7); font-weight: 600; line-height: 1.15; max-width: 100%; }
.c-small b { color: var(--gold); }
.c-big {
  font-size: calc(var(--D) * .2); font-weight: 800; line-height: .95; letter-spacing: .02em;
  color: var(--ink); text-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.c-big.pair { color: var(--gold); }
.c-code { font-size: calc(var(--D) * .14); font-weight: 800; letter-spacing: .12em; color: var(--gold); line-height: 1; }
.c-last { font-size: calc(var(--D) * .06); font-weight: 700; color: rgba(246,239,225,.85); cursor: pointer; border-bottom: 1px dashed rgba(246,239,225,.35); padding: 0 2px; }
.c-last mark { background: none; color: var(--gold); }
.c-who { font-size: calc(var(--D) * .05); font-weight: 700; margin-top: 4px; }
.c-who.me { color: var(--copper); animation: pulse 1s ease-in-out infinite; }
.c-secs { font-size: calc(var(--D) * .045); color: var(--muted); font-variant-numeric: tabular-nums; }
.c-anim { animation: centerIn .28s cubic-bezier(.2,1.3,.4,1) both; }

.spin-btn {
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--copper), var(--gold), var(--teal), var(--copper));
  padding: calc(var(--D) * .012);
  animation: breathe 1.6s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(242,193,78,.35);
}
.spin-btn span {
  width: 100%; height: 100%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 35%, #2a4b46, #10282a);
  font-weight: 800; font-size: calc(var(--D) * .075); line-height: 1.05;
}
.spin-btn span small { display: block; font-size: .55em; font-weight: 600; color: var(--muted); }
.spin-wait { width: 64%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed rgba(242,193,78,.5); animation: spin 6s linear infinite; position: absolute; }

.reel {
  width: 62%; aspect-ratio: 1; border-radius: 22%;
  background: linear-gradient(180deg, #0b1214, #1d2f33 50%, #0b1214);
  border: 2px solid rgba(242,193,78,.6);
  display: grid; place-items: center; overflow: hidden; position: relative;
  box-shadow: inset 0 10px 18px rgba(0,0,0,.7), inset 0 -10px 18px rgba(0,0,0,.7), 0 0 30px rgba(242,193,78,.25);
}
.reel b { font-size: calc(var(--D) * .26); font-weight: 800; color: var(--gold); line-height: 1; }
.reel.blur b { filter: blur(1.5px); transform: scaleY(1.15); }
.reel.land { animation: land .6s cubic-bezier(.2,1.6,.4,1); border-color: var(--gold); box-shadow: 0 0 60px rgba(242,193,78,.7), inset 0 0 20px rgba(242,193,78,.25); }

/* ---------- LOCURI ---------- */
.seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--seat) + 30px);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transform: translate(calc(-50% + var(--cx) * var(--R)), calc(-50% + var(--cy) * var(--R)));
  transition: transform .45s cubic-bezier(.3,1.25,.5,1), opacity .25s;
  pointer-events: auto;
  --R: calc(var(--D) / 2 + 6px);
}
.seat.enter .av { animation: popIn .6s cubic-bezier(.2,1.6,.4,1) both; }
.seat.exit { opacity: 0; transition: opacity .35s; }
.av {
  width: var(--seat); height: var(--seat); border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 30%, #2b3c42, #141e22);
  border: 3px solid var(--c);
  box-shadow: 0 6px 14px rgba(0,0,0,.5);
  font-size: calc(var(--seat) * .5);
  transition: transform .3s, box-shadow .3s;
}
.seat.current .av { transform: scale(1.14); box-shadow: 0 0 0 4px rgba(0,0,0,.25), 0 0 24px var(--c), 0 0 0 0 var(--c); animation: seatPulse 1.4s ease-out infinite; }
.seat.offline .av { filter: grayscale(1) brightness(.6); }
.seat.offline .nm::after { content: ' · offline'; color: var(--muted); font-weight: 500; }
.seat.hit .av { animation: hit .6s ease; }
.av .crown { position: absolute; top: -13px; right: -6px; font-size: 16px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.nm {
  max-width: calc(var(--seat) + 30px); font-size: 12.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 7px; border-radius: 999px; background: rgba(8,14,16,.75);
}
.seat.me .nm { background: var(--copper); color: #1a0f08; }
.lt { display: flex; gap: 2px; }
.lt i {
  font-style: normal; font-size: 9.5px; font-weight: 800; width: 13px; height: 15px;
  display: grid; place-items: center; border-radius: 3px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.4);
}
.lt i.on { background: var(--red); color: #fff; box-shadow: 0 0 6px rgba(226,72,61,.6); }
.lt i.new { animation: stampSmall .7s cubic-bezier(.2,1.6,.4,1); }
.kick {
  position: absolute; top: -6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 800; font-size: 14px; line-height: 1;
  display: none; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.can-kick .kick { display: grid; }
.typing {
  position: absolute; top: -20px; display: flex; gap: 3px; padding: 5px 8px; border-radius: 10px;
  background: var(--ink); opacity: 0; transform: scale(.6); transition: .2s; z-index: 2;
}
.typing.on { opacity: 1; transform: scale(1); }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--bg); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s } .typing i:nth-child(3) { animation-delay: .3s }
.compact { --seat: 44px; }
.compact .nm { font-size: 11px; }
.tiny .nm, .tiny .lt { display: none; }

/* ---------- efecte ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.fly {
  position: absolute; left: 0; top: 0; padding: 8px 14px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 1.05rem;
  white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.fly::after { content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.floaty { position: absolute; font-size: 30px; will-change: transform, opacity; }
.stamp {
  position: absolute; left: 50%; top: 50%; padding: 8px 18px;
  border: 5px solid var(--red); border-radius: 12px; color: var(--red);
  font-weight: 800; font-size: calc(var(--D) * .14); letter-spacing: .06em;
  background: rgba(14,21,24,.85); white-space: nowrap;
  animation: stamp 1.1s cubic-bezier(.2,1.4,.4,1) both;
}
.shake { animation: shake .5s ease; }

/* ---------- istoric ---------- */
.history {
  display: flex; gap: 8px; padding: 6px 12px; min-height: 52px; align-items: center;
  overflow-x: auto; scrollbar-width: none; justify-content: flex-start;
}
.history > :first-child { margin-left: auto; }
.history > :last-child { margin-right: auto; }
.history::-webkit-scrollbar { display: none; }
.history .hlabel { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px 7px 7px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 700; font-size: .9rem;
  animation: chipIn .5s cubic-bezier(.2,1.4,.4,1) both;
  transition: opacity .3s, transform .3s;
}
.chip:active { transform: scale(.95); }
.chip .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--c); }
.chip.last { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,193,78,.12); }
.chip .i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font-size: 10px; display: grid; place-items: center; font-style: italic; font-weight: 800; }

/* ---------- dock ---------- */
.dock { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.composer { display: flex; gap: 8px; }
.composer input { font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; min-height: 54px; }
.composer input:disabled { opacity: .8; }
input::placeholder { color: #8fa29e; opacity: 1; }
.composer.mine input { border-color: var(--copper); box-shadow: 0 0 0 4px rgba(224,122,58,.18); }
.send {
  flex: none; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(180deg, #ef8c48, var(--copper2)); color: #1a0f08;
  transition: transform .12s, opacity .2s;
}
.send:active { transform: scale(.92); }
.send:disabled { opacity: .3; }
.send svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.msg { min-height: 20px; font-size: .9rem; font-weight: 600; color: var(--muted); text-align: center; padding: 0 4px; }
.msg.err { color: #ff8a80; animation: shake .45s; }
.msg.ok { color: var(--teal); }
.play-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.play-row .btn.armed { background: var(--red); border-color: var(--red); color: #fff; }
.reacts { display: flex; gap: 2px; }
.reacts button { font-size: 22px; width: 38px; height: 38px; border-radius: 10px; transition: transform .15s; }
.reacts button:active { transform: scale(1.35); background: rgba(255,255,255,.06); }

.invite { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(242,193,78,.06); border: 1px dashed rgba(242,193,78,.4); }
.invite-link { font-size: .85rem; color: var(--gold); text-align: center; word-break: break-all; font-weight: 600; }
.invite-actions { display: flex; gap: 8px; justify-content: center; }
.invite-actions .btn { flex: 1; }
.host-ctrl { display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: #0b1215; border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg-l { font-size: .75rem; color: var(--muted); padding: 0 6px; font-weight: 700; white-space: nowrap; }
.seg button { flex: 1; min-height: 34px; padding: 0 8px; border-radius: 9px; font-size: .85rem; font-weight: 700; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--copper); }
.host-row { display: flex; gap: 8px; }
.host-row .btn { min-height: 52px; }
.wait-host { margin: 4px 0; text-align: center; color: var(--muted); font-weight: 600; }
.wait-host::after { content: ''; display: inline-block; width: 1em; text-align: left; animation: ell 1.4s steps(4) infinite; }

/* ---------- sheet (DEX, reguli) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(4,8,10,.6); opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 78dvh; display: flex; flex-direction: column;
  background: #f7f0e2; color: #1d2326; border-radius: 24px 24px 0 0;
  transform: translateY(105%); transition: transform .42s cubic-bezier(.2,1.1,.3,1);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
}
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { padding: 10px 0 4px; display: flex; justify-content: center; cursor: pointer; }
.sheet-grip::before { content: ''; width: 44px; height: 5px; border-radius: 9px; background: #cbbfa9; }
.sheet-body { overflow-y: auto; padding: 6px 20px 22px; }
.sheet-title { margin: 6px 0 12px; font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.sheet-title small { display: block; font-size: .8rem; font-weight: 700; color: #9a6a3c; letter-spacing: .12em; text-transform: uppercase; }
.def { padding: 12px 0; border-top: 1px solid #e3d7c1; line-height: 1.5; font-size: .98rem; animation: fadeUp .4s both; }
.def b { font-weight: 800; }
.def .src { display: inline-block; margin-top: 6px; font-size: .72rem; font-weight: 800; color: #9a6a3c; letter-spacing: .06em; text-transform: uppercase; }
.dex-link { display: inline-flex; margin-top: 10px; color: #b85a24; font-weight: 700; }
.skel { height: 14px; border-radius: 7px; margin: 10px 0; background: linear-gradient(90deg, #e8dcc6 25%, #f3ead9 50%, #e8dcc6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.rules { padding-left: 20px; line-height: 1.55; margin: 0; }
.rules li { margin-bottom: 10px; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 10px; }
.qr svg { width: min(260px, 70vw); height: auto; border-radius: 14px; background: #fff; padding: 6px; }

/* ---------- overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: none; place-items: center;
  background: radial-gradient(circle at 50% 42%, rgba(48,16,12,.94), rgba(6,9,11,.97) 70%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 24px; text-align: center; overflow-y: auto;
}
.overlay.show { display: grid; animation: fade .3s both; }
.overlay.out { animation: fadeOut .35s both; }
.ov-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; width: 100%; }
.ov-av { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 48px; border: 4px solid var(--c); background: #1a2529; animation: popIn .6s cubic-bezier(.2,1.6,.4,1) both; }
.ov-name { font-size: 1.6rem; font-weight: 800; }
.ov-why { color: var(--muted); font-weight: 600; font-size: 1.05rem; min-height: 1.4em; }
.ov-why b { color: var(--ink); }
.ov-letters { display: flex; gap: 8px; margin: 10px 0; }
.ov-letters i {
  font-style: normal; width: 52px; height: 62px; border-radius: 12px; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; background: rgba(255,255,255,.06); color: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.1);
}
.ov-letters i.on { background: var(--red); color: #fff; border-color: #ff7a70; box-shadow: 0 8px 24px rgba(226,72,61,.45); }
.ov-letters i.new { animation: stampBig .9s .5s cubic-bezier(.2,1.5,.4,1) both; }
.ov-title {
  font-size: clamp(64px, 20vw, 120px); font-weight: 800; line-height: .9; letter-spacing: -.01em; display: flex; gap: .03em;
}
.ov-title span { display: inline-block; color: var(--red); text-shadow: 0 6px 0 #7a1a14, 0 20px 40px rgba(0,0,0,.6); animation: drop .8s cubic-bezier(.2,1.5,.4,1) both; }
.rank { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rank div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.05); font-weight: 700; animation: fadeUp .4s both; }
.rank div .pos { width: 22px; color: var(--gold); }
.rank div .nm2 { flex: 1; text-align: left; }
.rank div .lt2 { color: var(--red); letter-spacing: .1em; font-size: .9rem; }
.rank div.loser { background: rgba(226,72,61,.15); }
.ov-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 12px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .92rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .4s cubic-bezier(.2,1.4,.4,1) both; max-width: 100%; text-align: center; }
.toast.err { background: var(--red); color: #fff; }
.toast.out { animation: toastOut .3s both; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }

/* ---------- keyframes ---------- */
@keyframes drop { 0% { transform: translateY(-120%) rotate(-12deg); opacity: 0 } 60% { opacity: 1 } 100% { transform: none } }
@keyframes wob { 0%,100% { transform: none } 30% { transform: translateY(-14%) rotate(-6deg) } 60% { transform: translateY(4%) rotate(4deg) } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes fade { from { opacity: 0 } }
@keyframes fadeOut { to { opacity: 0 } }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg) } }
@keyframes pulse { 50% { opacity: .55 } }
@keyframes popIn { 0% { transform: scale(0) rotate(-30deg) } 100% { transform: none } }
@keyframes seatPulse { 0% { box-shadow: 0 0 0 0 var(--c), 0 0 24px var(--c) } 100% { box-shadow: 0 0 0 16px transparent, 0 0 24px var(--c) } }
@keyframes hit { 0%,100% { transform: none } 20% { transform: translateX(-8px) rotate(-8deg) } 40% { transform: translateX(8px) rotate(8deg) } 60% { transform: translateX(-5px) } 80% { transform: translateX(5px) } }
@keyframes dot { 0%,100% { transform: none; opacity: .5 } 50% { transform: translateY(-3px); opacity: 1 } }
@keyframes breathe { 0%,100% { transform: scale(1) } 50% { transform: scale(1.06) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes land { 0% { transform: scale(1.25) } 100% { transform: none } }
@keyframes centerIn { from { opacity: 0; transform: scale(.7) } to { opacity: 1; transform: none } }
@keyframes stamp { 0% { transform: translate(-50%,-50%) scale(3.2) rotate(-18deg); opacity: 0 } 18% { transform: translate(-50%,-50%) scale(1) rotate(-10deg); opacity: 1 } 80% { transform: translate(-50%,-50%) scale(1) rotate(-10deg); opacity: 1 } 100% { transform: translate(-50%,-50%) scale(1.1) rotate(-10deg); opacity: 0 } }
@keyframes stampSmall { 0% { transform: scale(2.6); } 100% { transform: none } }
@keyframes stampBig { 0% { transform: scale(3) rotate(-25deg); opacity: 0 } 60% { opacity: 1 } 100% { transform: none; opacity: 1 } }
@keyframes shake { 0%,100% { transform: none } 20% { transform: translateX(-9px) } 40% { transform: translateX(8px) } 60% { transform: translateX(-6px) } 80% { transform: translateX(4px) } }
@keyframes chipIn { from { opacity: 0; transform: translateX(30px) scale(.6) } to { opacity: 1; transform: none } }
@keyframes feltGlow { 0%,100% { filter: brightness(1) } 50% { filter: brightness(1.18) } }
@keyframes shimmer { to { background-position: -200% 0 } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9) } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) } }
@keyframes ell { 0% { content: '' } 25% { content: '.' } 50% { content: '..' } 75% { content: '...' } }

@media (min-width: 720px) {
  :root { --seat: 66px; }
  .dock, .history { max-width: 560px; width: 100%; margin: 0 auto; }
  .nm { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  /* păstrăm animațiile de joc, oprim doar buclele infinite */
  .spin-btn, .spin-wait, .seat.current .av, .table.my-turn .felt, .c-who.me, .feathers i { animation: none !important; }
}

/* ---------- ajustări ecrane mici ---------- */
.history .hlabel { white-space: normal; text-align: center; font-size: .78rem; }
.kick { width: 19px; height: 19px; top: -4px; left: -4px; font-size: 12px; }
.play-row .btn { white-space: nowrap; flex: none; }
.reacts { min-width: 0; overflow: hidden; justify-content: flex-end; }
.reacts button { flex: none; }
@media (max-width: 380px) {
  .reacts button { width: 33px; font-size: 20px; }
  .reacts button:nth-child(n+6) { display: none; }
  .seg button { min-height: 30px; font-size: .8rem; padding: 0 6px; }
  .host-row .btn { min-height: 46px; }
  .invite { padding: 8px; gap: 6px; }
  .invite-actions .btn { min-height: 34px; }
}
@media (max-height: 700px) {
  .bar { min-height: 48px; padding: 4px 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .composer input, .send { min-height: 48px; height: 48px; }
  .send { width: 48px; }
}

/* ---------- fără zoom / selecție la tap-uri repetate ---------- */
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { touch-action: manipulation; }
.screen, button, .chip, .seat { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, .sheet-body .def, .invite-link { -webkit-user-select: text; user-select: text; }

/* roșu mai închis unde e text alb pe el (contrast) */
.btn.danger, .icon-btn.armed, .play-row .btn.armed, .toast.err, .offline { background: #c4352b; border-color: #c4352b; }

/* ---------- MASA 3D ---------- */
.stage .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.three .table { left: 0; top: 0; width: var(--D); height: var(--D); transition: none; transform: translate(-999px, -999px); will-change: transform; }
.three .felt, .three .ring { display: none; }
.three .center { inset: 21%; }
.three .c-small, .three .c-secs { color: rgba(246,239,225,.88); }
.three .c-inner { text-shadow: 0 2px 6px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9); }
.three .seat {
  left: 0; top: 0; width: auto; min-width: 64px; gap: 2px;
  transform: translate(-200px, -200px);
  transition: opacity .3s; will-change: transform; cursor: pointer;
}
.three .seat .av { position: static; width: 0; height: 0; border: 0; background: none; box-shadow: none; animation: none !important; transform: none !important; font-size: 0; }
.three .seat .emo { display: none; }
.three .seat .crown { position: absolute; top: -12px; right: -4px; font-size: 15px; }
.three .seat .kick { top: -10px; left: -8px; }
.three .seat .typing { top: -24px; left: 50%; margin-left: -22px; }
.three .nm { border: 1.5px solid var(--c); background: rgba(8,14,16,.82); box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.three .seat.me .nm { background: var(--copper); border-color: #f29a5c; }
.three .seat.current .nm { background: var(--c); color: #10181b; border-color: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.25), 0 0 18px var(--c); }
.three .seat.offline { opacity: .55; }
.three .seat.enter { animation: fade .6s .25s both; }
.three .seat.hit .nm { animation: hit .6s ease; }
.three .lt i { background: rgba(8,14,16,.7); color: rgba(255,255,255,.5); }
.three .lt i.on { background: var(--red); color: #fff; }
.view-btn { font-size: .78rem; letter-spacing: .02em; }

/* ---------- vot pentru scoatere ---------- */
.vote-bar {
  position: relative; z-index: 20; margin: 0 12px 4px; padding: 8px 8px 10px 14px;
  display: flex; align-items: center; gap: 10px; overflow: hidden;
  border-radius: 14px; background: #2a1613; border: 1px solid #6e2b23;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.7);
}
.vote-bar.vb-in { animation: toastIn .45s cubic-bezier(.2,1.4,.4,1) both; }
.vb-text { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; line-height: 1.25; }
.vb-text b { color: var(--gold); }
.vb-text small { display: block; color: #c9b6ae; font-weight: 600; font-size: .78rem; margin-top: 2px; }
.vb-btns { display: flex; gap: 6px; flex: none; }
.vb-btns button { min-width: 52px; min-height: 40px; border-radius: 10px; font-weight: 800; border: 1.5px solid #6e2b23; background: rgba(255,255,255,.04); transition: transform .12s, background .2s; }
.vb-btns button:active { transform: scale(.92); }
.vb-yes.on { background: #c4352b; border-color: #ff7a70; color: #fff; }
.vb-no.on { background: var(--teal); border-color: #6fe0c8; color: #08201b; }
.vb-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; animation: vbTime linear both; }
@keyframes vbTime { from { transform: scaleX(1) } to { transform: scaleX(0) } }
@media (min-width: 720px) { .vote-bar { max-width: 560px; width: calc(100% - 24px); margin: 0 auto 4px; } }

/* ---------- fișa jucătorului ---------- */
.pl-card { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px; }
.pl-av { flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: #1d2a2f; border: 4px solid var(--c); animation: popIn .5s cubic-bezier(.2,1.6,.4,1) both; }
.pl-lt { margin: 8px 0 0; gap: 5px; }
.pl-lt i { width: 30px; height: 36px; font-size: 19px; border-radius: 8px; background: #e6dac4; color: #b3a58c; border-color: #d6c8ae; }
.pl-lt i.on { background: #c4352b; color: #fff; border-color: #c4352b; box-shadow: none; }
.pl-actions { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.pl-actions .btn:not(.danger) { background: #1d2326; color: #f7f0e2; border-color: #1d2326; }
.pl-note { margin: 2px 0; color: #6b5a44; font-size: .9rem; text-align: center; }

/* ---------- acasă: subtitlu, linkuri legale; fișa jucătorului: rând de acțiuni ---------- */
.logo-sub { margin: -2px 0 0; font-weight: 700; font-size: 1.35rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); animation: fadeUp .6s .5s both; }
.legal { display: flex; gap: 8px; font-size: .82rem; color: var(--muted); }
.legal a { color: var(--muted); text-underline-offset: 3px; }
.pl-row { display: flex; gap: 8px; }
.pl-row .btn { flex: 1; min-height: 44px; font-size: .9rem; padding: 0 8px; }

/* ---------- logo ---------- */
.home-icon { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); animation: popIn .7s cubic-bezier(.2,1.5,.4,1) both; margin-bottom: 4px; }
.mini-logo { display: inline-flex; align-items: center; gap: 7px; }
.mini-logo img { width: 26px; height: 26px; border-radius: 7px; }

/* ---------- butoane pe scenă: clasament, chat ---------- */
.stage-btn {
  position: absolute; bottom: 10px; z-index: 8; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(14,21,24,.82); border: 1px solid var(--line); box-shadow: 0 8px 20px -6px rgba(0,0,0,.7);
  transition: transform .15s;
}
.stage-btn:active { transform: scale(.9); }
.score-btn { left: 12px; }
.chat-btn { right: 12px; }
.chat-btn.off { opacity: .55; }
.chat-btn.ping { animation: popIn .45s cubic-bezier(.2,1.6,.4,1); }
.chat-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #c4352b; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* ---------- panoul de chat ---------- */
.chat-panel {
  position: absolute; left: 8px; right: 8px; bottom: 62px; z-index: 9; max-height: min(62%, 360px);
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: #0c1316; border: 1px solid var(--line); box-shadow: 0 20px 50px -12px rgba(0,0,0,.85);
}
.chat-panel.cp-in { animation: fadeUp .3s cubic-bezier(.2,1.2,.4,1) both; }
@media (min-width: 720px) { .chat-panel { left: auto; width: 360px; } }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.cp-head > b { font-size: 1rem; }
.cp-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cp-tool { font-size: .78rem; font-weight: 700; color: var(--muted); padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04); white-space: nowrap; }
.cp-x { width: 32px; height: 32px; border-radius: 8px; font-size: 22px; line-height: 1; color: var(--muted); }
.cp-list { flex: 1; min-height: 90px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-user-select: text; user-select: text; }
.cp-empty { margin: auto; color: var(--muted); font-size: .88rem; text-align: center; padding: 10px; }
.cm { align-self: flex-start; max-width: 88%; padding: 6px 10px 5px; border-radius: 12px 12px 12px 4px; background: color-mix(in srgb, var(--c) 13%, #18262b); font-size: .92rem; line-height: 1.3; animation: chipIn .3s both; }
.cm.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: color-mix(in srgb, var(--c) 20%, #1f2f35); }
.cm-who { display: block; font-size: .72rem; font-weight: 800; color: var(--c); padding: 0; }
.cm-t { word-break: break-word; }
.cm i { margin-left: 6px; font-style: normal; font-size: .66rem; color: var(--muted); }
.cp-note { margin: 0; padding: 4px 12px; font-size: .8rem; color: #ffb4ab; }
.cp-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.cp-form input { min-height: 42px; font-size: 1rem; }
.cp-form button { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, #ef8c48, var(--copper2)); color: #1a0f08; }
.cp-form button:disabled { opacity: .35; }
.cp-form svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* bula de chat deasupra jucătorului */
.seat .bub {
  position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%) scale(.6); transform-origin: bottom center;
  max-width: 170px; width: max-content; padding: 6px 10px; border-radius: 12px; background: #f6efe1; color: #10181b;
  font-size: .8rem; font-weight: 700; line-height: 1.25; text-align: center; opacity: 0; pointer-events: none; z-index: 3;
  box-shadow: 0 8px 20px rgba(0,0,0,.45); transition: opacity .2s, transform .25s cubic-bezier(.2,1.5,.4,1); word-break: break-word;
}
.seat .bub::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #f6efe1; }
.seat .bub.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* a ieșit din joc */
.av .eye { position: absolute; bottom: -6px; right: -8px; font-size: 16px; animation: pulse 1.2s infinite; }
.three .seat .eye { position: absolute; top: -12px; left: -6px; bottom: auto; right: auto; }
.seat.away .nm { outline: 2px dashed #f2c14e; outline-offset: 1px; }

/* puncte */
.pts { font-size: 10.5px; font-weight: 800; color: var(--gold); letter-spacing: .02em; min-height: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.tiny .pts { display: none; }
.pts-fly { position: absolute; z-index: 6; font-weight: 800; font-size: 22px; color: var(--gold); text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 12px rgba(242,193,78,.6); pointer-events: none; white-space: nowrap; }
.pts-fly.hot { color: #ffd76a; font-size: 26px; }
.pts-fly.close { color: #ff8a7a; }
.pl-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 12px; font-size: .88rem; color: #5b4a36; }
.pl-stats b { color: #1d2326; }

/* clasament */
.scores { width: 100%; border-collapse: collapse; font-size: .92rem; }
.scores th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #9a6a3c; padding: 6px 4px; }
.scores td { padding: 8px 4px; border-top: 1px solid #e3d7c1; }
.scores tr.me td { background: #f1e3c9; }
.scores td:first-child { width: 28px; font-weight: 800; }
.scores .lt3 { color: #c4352b; font-weight: 800; letter-spacing: .08em; font-size: .8rem; }
.sb-av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; margin-right: 6px; background: #1d2a2f; border: 2px solid var(--c); font-size: 13px; vertical-align: middle; }
.rank div .sc2 { min-width: 48px; text-align: right; color: var(--gold); font-weight: 800; }
.awards { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.awards div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(242,193,78,.08); border: 1px solid rgba(242,193,78,.25); text-align: left; animation: fadeUp .4s 1.3s both; }
.awards b { font-size: .78rem; color: var(--gold); }
.awards span { font-size: .85rem; font-weight: 600; }
.awards .sus { grid-column: 1 / -1; background: rgba(226,72,61,.1); border-color: rgba(226,72,61,.35); }
.awards .sus b { color: #ff9a8e; }

/* tura de pace */
.c-peace { font-size: calc(var(--D) * .042); font-weight: 800; color: #6ee7a2; letter-spacing: .02em; animation: pulse 1.8s ease-in-out infinite; }
.stage.peace .felt { box-shadow: 0 0 0 calc(var(--D) * .028) #6b3b1d, 0 0 0 calc(var(--D) * .04) #3d2010, 0 0 60px 6px rgba(69,212,131,.45), inset 0 0 calc(var(--D) * .12) rgba(0,0,0,.45); }
.stage.peace .ring-fg:not(.danger) { stroke: #45d483; }
.stage.peace::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(69,212,131,.12), transparent 60%); animation: pulse 2.4s ease-in-out infinite; }
.peace-banner {
  position: absolute; z-index: 7; transform: translate(-50%, -50%); width: min(300px, 84vw); padding: 12px 16px; border-radius: 16px; text-align: center;
  background: rgba(13,46,31,.94); border: 2px solid #45d483; box-shadow: 0 0 40px rgba(69,212,131,.45);
  display: flex; flex-direction: column; gap: 4px; pointer-events: none; animation: peaceIn 2.2s cubic-bezier(.2,1.2,.4,1) both;
}
.peace-banner b { color: #8ff0b8; font-size: 1.15rem; }
.peace-banner span { color: #d4f7e2; font-size: .85rem; font-weight: 600; }
@keyframes peaceIn { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7) } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.04) } 20% { transform: translate(-50%, -50%) scale(1) } 85% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.96) } }
.stamp.attack { font-size: calc(var(--D) * .085); border-color: #ff6b3d; color: #ff8a5b; }

/* ---------- câmpul de jos: cuvânt sau chat ---------- */
.composer { position: relative; }
.mode-chip { position: absolute; left: 12px; top: -9px; z-index: 2; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; background: var(--bg); color: var(--muted); pointer-events: none; }
.mode-chip:empty { display: none; }
.composer.mine .mode-chip { color: #1a0f08; background: var(--copper); }
.composer.chat-mode .mode-chip { color: #06201b; background: #4fd1c5; }
.composer.chat-mode input { border-color: #2f8f86; background: #0a1918; font-weight: 600; font-size: 1.05rem; }
.composer.chat-mode input:focus { border-color: #4fd1c5; box-shadow: 0 0 0 4px rgba(79,209,197,.16); }
.composer.chat-mode .send { background: linear-gradient(180deg, #4fd1c5, #2a9d93); }
.appeal-btn { align-self: center; background: rgba(242,193,78,.12); border-color: rgba(242,193,78,.5); color: var(--gold); }
.appeal-btn.pop { animation: popIn .4s cubic-bezier(.2,1.6,.4,1); }
.seg-theme { flex-wrap: nowrap; }
.seg-theme button { flex: none; }
.c-theme { font-size: calc(var(--D) * .042); font-weight: 800; color: var(--gold); padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.25); }

/* ---------- chat-ul ocupă partea de jos (masa rămâne vizibilă) ---------- */
#game > .chat-panel {
  position: relative; left: auto; right: auto; bottom: auto; width: auto; z-index: 9;
  flex: none; height: min(48vh, 420px); max-height: none; margin: 0 8px calc(8px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) { #game > .chat-panel { max-width: 560px; width: calc(100% - 16px); margin: 0 auto 10px; } }
#game.chat-open #dock, #game.chat-open #history { display: none; }
#game.chat-open .chat-btn { background: var(--teal); color: #06201b; }
.cp-live { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px 8px 14px; background: #10201f; border-bottom: 1px solid var(--line); font-size: .9rem; }
.cp-live .cl-main { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cp-live .cl-last { flex-basis: 100%; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-live button { flex: none; padding: 6px 14px; border-radius: 10px; font-weight: 800; background: linear-gradient(180deg, #ef8c48, var(--copper2)); color: #1a0f08; }
.cp-live.mine { background: #3a2312; animation: liveMine 1.2s ease-in-out infinite; }
.cp-live.mine .cl-main { color: #ffc48f; }
@keyframes liveMine { 50% { background: #4a2b14; } }
/* butonul „Scrie în chat” când nu e rândul tău */
.chat-open-btn { display: none; }
.composer.chat-mode input, .composer.chat-mode .send { display: none; }
.composer.chat-mode .chat-open-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 12px;
  background: #0a1918; border: 1.5px solid #2f8f86; color: #9ff0e6; font-weight: 800; font-size: 1.02rem; text-align: left;
}
.composer.chat-mode .chat-open-btn span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.composer.chat-mode .chat-open-btn:active { transform: scale(.98); }

/* ---------- chat compact: ocupă doar locul zonei de jos ---------- */
#game > .chat-panel { height: 220px; margin: 0 8px 8px; }
.cp-top { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: #10201f; }
.cp-top .cp-live { flex: 1; min-width: 0; border-bottom: 0; padding: 6px 6px 6px 12px; }
.cp-top .cp-x { flex: none; width: 40px; height: auto; font-size: 24px; }
.cp-live .cl-main { font-size: .86rem; }
.cp-live .cl-last { font-size: .76rem; }
.cp-live button { padding: 5px 12px; font-size: .85rem; }
.cp-list { min-height: 0; padding: 6px 10px; gap: 4px; }
.cm { padding: 4px 9px; font-size: .88rem; }
.cp-form { padding: 6px; gap: 5px; align-items: center; }
.cp-form input { min-height: 40px; }
.cp-form .cp-tool { flex: none; width: 36px; height: 40px; padding: 0; font-size: 17px; display: grid; place-items: center; border-radius: 10px; }
.cp-note { padding: 2px 10px; font-size: .76rem; }
html, body { background: var(--bg); }

/* masa 2D: tremurul păstrează centrarea (altfel sărea din loc la „ÎNCHIS!” și „ÎNCEP ATACURILE!”) */
.table.shake { animation: tableShake .5s ease; }
@keyframes tableShake {
  0%, 100% { transform: translate(-50%, -50%) }
  20% { transform: translate(calc(-50% - 9px), -50%) }
  40% { transform: translate(calc(-50% + 8px), -50%) }
  60% { transform: translate(calc(-50% - 6px), -50%) }
  80% { transform: translate(calc(-50% + 4px), -50%) }
}

/* ---------- câmpul de cuvânt fără sugestii de tastatură (tip parolă + oglindă) ---------- */
.word-field { position: relative; flex: 1; min-width: 0; display: flex; }
.word-field input { flex: 1; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; -webkit-text-security: none; letter-spacing: 0; }
.word-field input::placeholder { color: #8fa29e; -webkit-text-fill-color: #8fa29e; }
.word-field input::-ms-reveal, .word-field input::-ms-clear { display: none; }
.word-mirror {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 16px; pointer-events: none; overflow: hidden;
  font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); white-space: pre;
}
.wm-caret { width: 2px; height: 1.25em; margin-left: 1px; background: var(--copper); opacity: 0; }
.word-field:focus-within .wm-caret { animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@media (max-height: 700px) { .word-mirror { font-size: 1.1rem; } }

.composer.chat-mode .word-field { display: none; }
.word-mirror { padding: 0 15.5px; }

/* ---------- chat pe tot ecranul, cu rezumatul jocului sus ---------- */
#game.chat-open .stage { display: none; }
#game.chat-open > .chat-panel { flex: 1; height: auto; min-height: 0; margin: 0 8px 8px; }
#game.chat-open .cp-live { padding: 10px 8px 10px 14px; }
#game.chat-open .cp-live .cl-main { font-size: 1rem; }
#game.chat-open .cp-live .cl-last { font-size: .84rem; }
#game.chat-open .cp-live button { padding: 8px 16px; font-size: .95rem; }
.cp-list { flex: 1; }

/* ---------- spectatori (au făcut FAZAN) ---------- */
.seat.out { opacity: .55; }
.seat.out .nm::after { content: ' · 👀'; }
.seat.out .av { filter: grayscale(.9); }
.scores tr.out td { opacity: .55; }
.rank div.winner { background: rgba(242,193,78,.16); }
.ov-title.win { font-size: clamp(56px, 18vw, 96px); animation: popIn .7s cubic-bezier(.2,1.5,.4,1) both; }
.home-hint { margin: -2px 0 0; text-align: center; color: var(--muted); font-size: .86rem; }
.play-row .btn.hidden { display: none; }

/* oglinda: selecție vizibilă + iOS folosește câmpul real */
.wm-sel { background: rgba(224,122,58,.45); border-radius: 3px; }
.word-mirror.has-sel .wm-caret { display: none; }
.word-field.native input { color: var(--ink); -webkit-text-fill-color: var(--ink); caret-color: var(--copper); }
.word-field.native .word-mirror { display: none; }

/* tastatura se deschide/închide lin (fără sărituri) */
.screen { transition: height .24s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .screen { transition: none; } }
.history, .reacts { transition: opacity .2s ease, transform .2s ease; }

/* ---------- acasă: cont + setări ---------- */
.home-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.acc-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .9rem; }
.acc-btn.on { border-color: rgba(224,122,58,.6); }
.acc-dot { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--copper); color: #1b120b; font-weight: 800; font-size: .95rem; flex: none; }
.acc-btn:not(.on) .acc-dot { background: rgba(255,255,255,.1); font-size: .9rem; }
.icon-btn.muted { opacity: .55; }

/* ---------- setări ---------- */
.set-group { background: #fffaf0; border: 1px solid #e6d9c2; border-radius: 16px; padding: 4px 14px; margin-bottom: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid #efe4d1; font-weight: 700; }
.set-row:last-child { border-bottom: 0; }
.set-row span { display: flex; flex-direction: column; }
.set-row small { font-weight: 500; font-size: .78rem; color: #7d7466; margin-top: 2px; }
.set-row.sub { min-height: 44px; font-weight: 600; color: #4c4740; }
.set-cap { padding: 10px 0 6px; font-weight: 700; font-size: .9rem; }
.set-cap small { font-weight: 500; color: #7d7466; }
.sw { position: relative; width: 52px; height: 30px; flex: none; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: #d9cdb8; transition: background .2s; pointer-events: none; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,1.4,.5,1); }
.sw input:checked + i { background: var(--teal); }
.sw input:checked + i::after { transform: translateX(22px); }
.sw input:focus-visible + i { outline: 3px solid rgba(224,122,58,.5); outline-offset: 2px; }
.rng { width: 46%; accent-color: var(--copper2); height: 28px; }
.set-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #efe4d1; }
.style-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: #f1e7d5; border: 2px solid transparent; font-weight: 700; font-size: .78rem; color: #3a352e; transition: transform .15s, border-color .2s, background .2s; }
.style-chip b { font-size: 1.5rem; line-height: 1.2; }
.style-chip.on { border-color: var(--copper); background: #fde8d6; }
.style-chip:active { transform: scale(.94); }
.set-acc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: #1d2326; color: #f6efe1; text-align: left; }
.set-acc span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.set-acc small { color: #a9b5b2; font-size: .8rem; }
.set-acc i { font-style: normal; font-size: 1.6rem; color: var(--copper); }

/* ---------- cont ---------- */
.acc-lead { margin: 0 0 14px; line-height: 1.5; color: #3f3a33; }
.acc-fine { margin: 14px 0 0; font-size: .8rem; line-height: 1.45; color: #7d7466; }
.acc-fine a { color: #b85a24; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-bottom: 10px; border-radius: 14px; font-weight: 700; font-size: 1rem; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.auth-btn.apple { background: #000; color: #fff; border-color: #000; }
.auth-btn:active { transform: scale(.98); }
.acc-who { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.acc-av { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--copper); color: #1b120b; font-weight: 800; font-size: 1.4rem; }
.acc-id { display: flex; flex-direction: column; min-width: 0; }
.acc-id small { color: #7d7466; overflow: hidden; text-overflow: ellipsis; }
.acc-rename { display: flex; gap: 8px; margin-bottom: 14px; }
.acc-rename input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #d9cdb8; background: #fff; color: #1d2326; font-weight: 700; }
.acc-rename .btn { min-height: 40px; background: #1d2326; color: #f6efe1; }
.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-tile { background: #fffaf0; border: 1px solid #e6d9c2; border-radius: 14px; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; animation: fadeUp .35s both; }
.st-tile b { font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.st-tile span { font-size: .72rem; color: #7d7466; line-height: 1.25; }
.st-tile.big { grid-column: span 1; background: #1d2326; border-color: #1d2326; color: #f6efe1; }
.st-tile.big b { font-size: 1.7rem; color: var(--gold); }
.st-tile.big span { color: #a9b5b2; }
.st-grid .st-tile.big:first-child { grid-column: span 2; }
.acc-h { margin: 18px 0 8px; font-size: 1.1rem; }
.h-list { display: flex; flex-direction: column; gap: 6px; }
.h-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fffaf0; border: 1px solid #e6d9c2; }
.h-row.won { background: #fff4d6; border-color: #f0d68e; }
.h-pl { font-size: 1.4rem; width: 30px; text-align: center; font-weight: 800; }
.h-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h-mid small { color: #7d7466; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sc { font-weight: 800; font-size: 1.05rem; }
.h-sc small { font-size: .7rem; color: #7d7466; margin-left: 1px; }
.acc-empty { color: #7d7466; text-align: center; padding: 14px 0; margin: 0; }
.acc-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.acc-actions .btn { width: 100%; background: #ece1cd; color: #1d2326; }
.link-btn.danger { color: #c0392b; font-weight: 700; }
@media (max-width: 360px) { .set-styles { grid-template-columns: repeat(2, 1fr); } .st-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- abandon ---------- */
.seat.out.abandoned .nm::after { content: ' · 🏳️'; }
.h-row.ab { opacity: .75; }

/* ---------- PC: masa în stânga, controalele în dreapta ---------- */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  #game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 32vw, 460px);
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  #game > .bar { grid-column: 1 / -1; grid-row: 1; }
  #game > .vote-bar { grid-column: 1; grid-row: 2; align-self: start; }
  #game > .stage { grid-column: 1; grid-row: 2 / span 2; min-height: 0; }
  #game > .history, #game > .dock { grid-column: 2; max-width: none; width: auto; margin: 0; background: rgba(0, 0, 0, .18); border-left: 1px solid var(--line); }
  #game > .history { grid-row: 2; flex-wrap: wrap; justify-content: center; overflow: visible; padding: 10px 14px; }
  #game > .dock { grid-row: 3; overflow-y: auto; padding: 10px 14px 16px; justify-content: flex-start; }
  #game > .chat-panel { grid-column: 2; grid-row: 2 / span 2; height: auto !important; max-width: none; width: auto; margin: 0 10px 10px; flex: none; }
  #game.chat-open .stage { display: block; }
  #game > .dock .seg { flex-wrap: wrap; overflow: visible; }
  #game > .dock .seg-theme button { flex: none; }
}
