/* Academia Arcană — joc de masă: masă de lemn, covoraș de joc, cartonașe cu ramă, jetoane fizice */
:root {
  --wood-1: #2c1a0d; --wood-2: #1d1108; --wood-3: #120a05;
  --mat-1: #1b2048; --mat-2: #10132e; --mat-3: #090b1c;
  --gold: #d9b26a; --gold-hi: #f7e3ad; --gold-lo: #7c5a24;
  --parch: #f5ebd3; --parch-2: #e6d3a8; --ink: #2a1c0f; --ink-soft: #5a4430;
  --text: #f1e8d4; --muted: #b1a8c0;
  --spell: #b3262f; --spell-2: #6e121b;
  --item: #c48a26; --item-2: #7a4f10;
  --ally: #2b5fae; --ally-2: #15315f;
  --vill: #3b4a3a; --vill-2: #141b15; --vill-acc: #9ad07a;
  --dark: #4a2a7a; --dark-2: #1c0f33;
  --blood: #d8364a; --life: #ff4f6a; --umbra: #8a5cf0; --ok: #57d39a;
  --cw: 128px; --ch: 184px; --dock-h: 236px;
  --title: 'Grenze Gotisch', 'Cormorant SC', Georgia, serif;
  --display: 'Cormorant SC', 'Palatino Linotype', Georgia, serif;
  --caps: 'Alegreya SC', 'Palatino Linotype', Georgia, serif;
  --body: 'Alegreya', 'Palatino Linotype', Georgia, serif;
  --gutter: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text); font-family: var(--body); font-size: 16px; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; background: #07070f;
}
/* camera: fundalul locației curente (ilustrație Meshy) acoperă ecranul ca object-fit: cover.
   Două straturi pentru trecerea lină între locații; luminile sunt puse în procente peste
   lumânările/felinarele găsite automat în imagine (ART_LIGHTS), iar stratul .room-amb are
   particulele ambientale ale locului: praf, licurici, zăpadă, ploaie, jar, ceață… */
.room { position: fixed; z-index: 0; left: 50%; top: 50%; width: max(100vw, 177.78vh); height: max(100vh, 56.25vw); transform: translate(-50%, -50%);
  pointer-events: none; overflow: hidden; background: #07070f; }
.room-bg { position: absolute; inset: -2%; opacity: 0; background: center / cover no-repeat; transition: opacity 1.8s ease;
  animation: roomDrift 70s ease-in-out infinite alternate; will-change: transform, opacity; }
.room-bg.on { opacity: 1; }
@keyframes roomDrift { from { transform: scale(1) translate(-.5%, .3%); } to { transform: scale(1.045) translate(.6%, -.6%); } }
.room::after { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(70% 65% at 50% 56%, rgba(4, 4, 10, .58), rgba(4, 4, 10, .16) 72%, rgba(4, 4, 10, .42)); }
.room-bg i { position: absolute; translate: -50% -50%; border-radius: 50%; aspect-ratio: 1; mix-blend-mode: screen; }
.room-bg .glow { background: radial-gradient(circle, var(--g1), var(--g2) 36%, transparent 68%); animation: candle var(--d, 2.7s) ease-in-out var(--dl, 0s) infinite; }
.room-bg .glow.cool { animation: glowPulse var(--d, 7s) ease-in-out var(--dl, 0s) infinite; }
.room-bg .eye { background: radial-gradient(circle, #ffd27a 30%, rgba(255, 170, 60, .5) 55%, transparent 72%); animation: owlBlink 7s infinite; }
@keyframes candle { 0%, 100% { opacity: .72; transform: scale(1); } 18% { opacity: 1; transform: scale(1.08); } 37% { opacity: .62; } 58% { opacity: .95; transform: scale(.96); } 79% { opacity: .8; } }
@keyframes glowPulse { 0%, 100% { opacity: .35; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes owlBlink { 0%, 88%, 100% { opacity: .55; transform: scaleY(1); } 91% { opacity: 0; transform: scaleY(.1); } 94% { opacity: .7; transform: scaleY(1); } }

.room-amb { position: absolute; inset: 0; z-index: 2; transition: opacity 1.2s ease; }
.room-amb.fade { opacity: 0; }
.room-amb i { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; opacity: 0; will-change: transform, opacity; }
/* praf auriu care plutește în lumină */
.room-amb .dust { background: #ffe2a8; box-shadow: 0 0 8px 2px rgba(255, 210, 130, .45); animation: ambDust var(--d) linear var(--dl) infinite; }
@keyframes ambDust { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .75; } 85% { opacity: .5; } 100% { transform: translate(var(--dx), -22vh); opacity: 0; } }
/* licurici care rătăcesc și clipesc */
.room-amb .fly { background: #f1ff9c; box-shadow: 0 0 10px 4px rgba(190, 255, 110, .5), 0 0 22px 8px rgba(150, 230, 90, .18); animation: ambFly var(--d) ease-in-out var(--dl) infinite; }
@keyframes ambFly { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 30% { transform: translate(var(--dx), var(--dy)); opacity: .25; } 45% { opacity: 1; }
  60% { transform: translate(calc(var(--dx) * -.6), calc(var(--dy) * 1.4)); opacity: .9; } 75% { opacity: .2; } 85% { opacity: .9; } 100% { transform: translate(0, 0); opacity: 0; } }
/* stele care sclipesc */
.room-amb .star { background: #fff; box-shadow: 0 0 6px 1px rgba(200, 220, 255, .8); animation: ambTwinkle var(--d) ease-in-out var(--dl) infinite; }
@keyframes ambTwinkle { 0%, 100% { opacity: .08; transform: scale(.6); } 50% { opacity: .95; transform: scale(1.15); } }
/* fulgi de zăpadă: cad (translate) și se leagănă (transform) */
.room-amb .snow { background: radial-gradient(circle, #fff 35%, rgba(255, 255, 255, .25) 70%, transparent); animation: ambFall var(--d) linear var(--dl) infinite, ambSway 3.4s ease-in-out var(--dl) infinite alternate; }
@keyframes ambFall { 0% { translate: 0 0; opacity: 0; } 8% { opacity: .9; } 92% { opacity: .8; } 100% { translate: var(--dx) 112vh; opacity: 0; } }
@keyframes ambSway { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
/* ploaie: dungi subțiri, oblice */
.room-amb .rain { width: 1.5px; height: var(--s); border-radius: 1px; background: linear-gradient(transparent, rgba(190, 210, 255, .55)); transform: rotate(14deg); animation: ambRain var(--d) linear var(--dl) infinite; }
@keyframes ambRain { 0% { translate: 0 0; opacity: 0; } 10% { opacity: .9; } 100% { translate: -28vh 115vh; opacity: .6; } }
/* jar care se ridică */
.room-amb .ember { background: #ffb35a; box-shadow: 0 0 8px 3px rgba(255, 120, 40, .55); animation: ambRise var(--d) ease-out var(--dl) infinite, ambSway 2.6s ease-in-out var(--dl) infinite alternate; }
@keyframes ambRise { 0% { translate: 0 0; opacity: 0; } 10% { opacity: 1; } 70% { opacity: .7; } 100% { translate: var(--dx) -62vh; opacity: 0; } }
/* fuioare violete (umbră, eclipsă) */
.room-amb .wisp { background: radial-gradient(circle, rgba(214, 170, 255, .9), rgba(150, 90, 255, .35) 45%, transparent 70%); filter: blur(1px); animation: ambRise var(--d) ease-in-out var(--dl) infinite, ambSway 4.2s ease-in-out var(--dl) infinite alternate; }
/* sclipiri de cristal în formă de stea */
.room-amb .spark { border-radius: 0; background: linear-gradient(transparent 44%, var(--c, #e6fbff) 50%, transparent 56%), linear-gradient(90deg, transparent 44%, var(--c, #e6fbff) 50%, transparent 56%);
  filter: drop-shadow(0 0 4px var(--c, #9ff)); animation: ambSpark var(--d) ease-in-out var(--dl) infinite; }
@keyframes ambSpark { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* ceață care trece încet prin cadru */
.room-amb .mist { border-radius: 50%; background: radial-gradient(closest-side, rgba(205, 215, 235, var(--o, .16)), transparent); animation: ambMist var(--d) ease-in-out var(--dl) infinite alternate; }
@keyframes ambMist { 0% { transform: translateX(-18%) scale(1); opacity: .5; } 50% { opacity: 1; } 100% { transform: translateX(22%) scale(1.15); opacity: .6; } }
/* rafale de vânt */
.room-amb .wind { height: 1.5px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(220, 235, 255, .45), transparent); animation: ambWind var(--d) linear var(--dl) infinite; }
@keyframes ambWind { 0% { translate: 0 0; opacity: 0; } 20% { opacity: .9; } 100% { translate: 70vw 4vh; opacity: 0; } }
#app { position: relative; z-index: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3 { margin: 0; }
img { display: block; }

/* ---------- jetoane în text ---------- */
.ic { font-style: normal; display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; line-height: 1; vertical-align: -.24em; margin: 0 .06em; font-size: .9em; }
.ic-a { color: #fff3c4; background: radial-gradient(circle at 35% 30%, #ff7a5a, #b3262f 60%, #5e0c14); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); font-size: .72em; width: 1.8em; height: 1.6em; }
.ic-i { border-radius: 50%; color: #6a4708; background: radial-gradient(circle at 35% 30%, #fff4c0, #e7b545 55%, #8a5f16); box-shadow: inset 0 0 0 1.5px #a0721e; font-size: .68em; width: 1.75em; height: 1.75em; }
.ic-h { color: var(--life); font-size: 1em; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.ic-c { border-radius: 50%; color: #e6dbff; background: radial-gradient(circle at 35% 30%, #a98af0, #4b2a8a 60%, #1e0f3a); box-shadow: inset 0 0 0 1.5px #2a1450; font-size: .66em; width: 1.75em; height: 1.75em; }

/* ---------- butoane ---------- */
.btn { position: relative; overflow: hidden; border: 1px solid #5a3e14; border-radius: 9px; padding: 11px 18px;
  background: linear-gradient(180deg, #f6d995 0%, #d6a64c 48%, #a8762a 100%); color: #2a1906;
  font-family: var(--caps); font-weight: 800; letter-spacing: .04em; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 3px 0 #5a3e14, 0 8px 18px rgba(0, 0, 0, .45); transition: transform .12s, filter .12s; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); }
.btn:hover:not(:disabled)::after { transition: transform .6s; transform: translateX(120%); }
.btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 #5a3e14; }
.btn.ghost { background: linear-gradient(180deg, rgba(40, 30, 60, .9), rgba(18, 14, 30, .95)); color: var(--gold-hi); border-color: rgba(217, 178, 106, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 0 rgba(0, 0, 0, .5); }
.btn.danger { background: linear-gradient(180deg, #ef7a83, #b3262f 55%, #7a121c); color: #fff; border-color: #4e0b12; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 #4e0b12; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn.icon { padding: 7px 10px; font-size: 15px; line-height: 1; }

/* ---------- covorașul de joc / zone imprimate ---------- */
.mat { position: relative; border-radius: 22px;
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(80, 96, 190, .18), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .6 0 0 0 0 .65 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, var(--mat-1), var(--mat-2) 55%, var(--mat-3));
  box-shadow: 0 2px 0 rgba(255, 255, 255, .05) inset, 0 0 0 1px #05060f, 0 0 0 4px #2a1a0c, 0 0 0 5px rgba(217, 178, 106, .45), 0 30px 70px rgba(0, 0, 0, .7); }
.mat::before { content: ''; position: absolute; inset: 9px; border-radius: 15px; pointer-events: none;
  border: 1.5px solid rgba(217, 178, 106, .45); box-shadow: inset 0 0 0 4px rgba(10, 12, 30, .6), inset 0 0 0 5px rgba(217, 178, 106, .18); }
.mat::after { content: ''; position: absolute; inset: 4px; pointer-events: none; border-radius: 18px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/svg%3E") left top / 34px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(-1 0 0 1 34 0)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") right top / 34px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(1 0 0 -1 0 34)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") left bottom / 34px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(-1 0 0 -1 34 34)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") right bottom / 34px no-repeat; }
.zone { position: relative; border-radius: 12px; padding: 40px 14px 14px;
  background: linear-gradient(180deg, rgba(16, 18, 38, .88), rgba(8, 9, 20, .92));
  box-shadow: 0 0 0 1px rgba(233, 207, 143, .6), 0 0 0 4px rgba(10, 8, 6, .85), 0 0 0 5px rgba(217, 178, 106, .32), 0 22px 50px rgba(0, 0, 0, .6); }
.zone::before { content: ''; position: absolute; inset: 6px; border-radius: 8px; pointer-events: none; border: 1px solid rgba(217, 178, 106, .18); }
.zone::after { content: ''; position: absolute; inset: 2px; pointer-events: none; z-index: 3; border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/svg%3E") left top / 26px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(-1 0 0 1 34 0)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") right top / 26px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(1 0 0 -1 0 34)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") left bottom / 26px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='matrix(-1 0 0 -1 34 34)'%3E%3Cpath d='M2 32V12C2 6.5 6.5 2 12 2H32M8 26V14C8 10.7 10.7 8 14 8H26M13 13l4 4M5 5l3 3' fill='none' stroke='%23d9b26a' stroke-width='1.3' opacity='.75'/%3E%3Ccircle cx='17' cy='17' r='2' fill='%23d9b26a' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") right bottom / 26px no-repeat; }
.zone > .zl { position: absolute; z-index: 2; top: 11px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; pointer-events: none; }
.zone > .zl b { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); white-space: nowrap; text-shadow: 0 1px 0 #000, 0 0 12px rgba(246, 210, 140, .25); }
.zone > .zl b::after { content: ''; display: block; height: 1px; margin-top: 3px; background: linear-gradient(90deg, rgba(217, 178, 106, .8), transparent); }
.zone > .zl small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* sala răufăcătorilor: ilustrație Meshy + ceață care plutește */
.zone.vwrap { overflow: hidden; background: linear-gradient(180deg, rgba(8, 9, 20, .45), rgba(8, 9, 20, .25) 40%, rgba(8, 9, 20, .7)), #0a0c18 url(art/bg-hall.webp) center / cover; }
.zone.vwrap .villains { position: relative; z-index: 1; }
.fog { position: absolute; z-index: 0; left: -50%; width: 200%; bottom: -5%; height: 65%; pointer-events: none; opacity: .6; filter: blur(12px);
  background: radial-gradient(22% 45% at 15% 80%, rgba(150, 130, 255, .38), transparent 70%), radial-gradient(20% 40% at 40% 92%, rgba(120, 175, 255, .32), transparent 70%),
    radial-gradient(24% 45% at 63% 78%, rgba(170, 120, 255, .34), transparent 70%), radial-gradient(18% 40% at 88% 90%, rgba(130, 160, 255, .3), transparent 70%);
  animation: fogDrift 26s ease-in-out infinite alternate; }
.fog.f2 { bottom: 18%; height: 50%; opacity: .35; animation-duration: 38s; animation-direction: alternate-reverse; }
@keyframes fogDrift { from { transform: translateX(-12%) scaleY(1); } to { transform: translateX(12%) scaleY(1.15); } }
.empty { color: var(--muted); font-style: italic; font-size: 14px; }

/* ---------- intrare ---------- */
.join { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 32px 16px; gap: 14px; position: relative; }
.join .hero-art { position: fixed; inset: 0; z-index: -1; opacity: .8; }
.join .hero-art img { width: 100%; height: 100%; object-fit: cover; animation: kb 30s ease-in-out infinite alternate; }
.join .hero-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 45%, rgba(8, 6, 16, .35), rgba(8, 6, 16, .92)); }
.crest { width: 120px; height: 140px; margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(246, 210, 140, .35)); animation: float 6s ease-in-out infinite; }
.crest-svg { width: 100%; height: 100%; }
.crest-svg .cr-star { transform-box: fill-box; transform-origin: center; animation: spin 30s linear infinite; }
.crest-svg .cr-glow { animation: pulse 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
.logo { font-family: var(--title); font-weight: 800; font-size: clamp(44px, 9vw, 88px); line-height: .95; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff4cf 0%, #e9c372 45%, #a8742a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #3a2408) drop-shadow(0 0 28px rgba(246, 200, 120, .35)); }
.join .tag { color: #d9cfe6; max-width: 480px; margin: 0 auto 10px; font-style: italic; font-size: 18px; text-shadow: 0 1px 2px #000; }
.join form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.join input { font: inherit; font-size: 18px; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(217, 178, 106, .5); background: rgba(8, 8, 20, .75); color: var(--text); min-width: 240px; outline: none; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.join input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 178, 106, .25); }
.status { color: var(--muted); min-height: 1.4em; }
.join .rejoin { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; margin: 0 auto; }
.join .rejoin:empty { display: none; }

/* ---------- lobby ---------- */
.lobby { max-width: 1120px; margin: 0 auto; padding: 24px var(--gutter-r) 60px var(--gutter); display: grid; gap: 26px; }
.lobby header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lobby header .logo { font-size: clamp(34px, 6vw, 54px); }
.lobby-zones { display: grid; gap: 26px; }
.share { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.share .url { font-weight: 800; font-size: clamp(20px, 3.6vw, 30px); color: var(--gold-hi); word-break: break-all; }
.share .qr { background: #fff; padding: 6px; border-radius: 8px; line-height: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.share .qr svg { width: 120px; height: 120px; }
.players { display: flex; flex-wrap: wrap; gap: 10px; }
.pchip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(217, 178, 106, .35); }
.pchip .dot { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.pchip .dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pchip .x { background: none; border: 0; color: var(--muted); padding: 0 2px; }
.heroes-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.hpick { --hc: #888; text-align: left; position: relative; padding: 0; border-radius: 14px; overflow: hidden; border: 0; color: var(--ink);
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); display: grid; grid-template-rows: auto 1fr;
  box-shadow: 0 0 0 3px #f8f0dc, 0 0 0 6px var(--hc), 0 0 0 7px rgba(0, 0, 0, .5), 0 16px 30px rgba(0, 0, 0, .55); transition: transform .18s, box-shadow .18s; }
.hpick:hover:not(:disabled) { transform: translateY(-4px) rotate(-.5deg); }
.hpick.mine { box-shadow: 0 0 0 3px #f8f0dc, 0 0 0 6px var(--hc), 0 0 0 9px var(--gold-hi), 0 0 30px rgba(246, 210, 140, .6), 0 16px 30px rgba(0, 0, 0, .55); }
.hpick:disabled { opacity: .55; filter: grayscale(.6); }
.hpick .hp-art { aspect-ratio: 4 / 3.4; position: relative; }
.hpick .hp-body { padding: 10px 14px 14px; display: grid; gap: 5px; }
.hpick .who { position: absolute; z-index: 3; top: 10px; right: 10px; font-family: var(--caps); font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: #2a1906; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.hpick h3 { font-family: var(--caps); font-weight: 800; font-size: 19px; color: var(--ink); }
.hpick .role { color: var(--hc); filter: brightness(.75); font-family: var(--caps); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.hpick .blurb { color: var(--ink-soft); font-style: italic; }
.hpick .ab { font-size: 14px; border-top: 1px dashed rgba(90, 68, 48, .4); padding-top: 7px; }
.hpick .ab b { color: #7a4f10; }
.chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.chap { text-align: left; padding: 12px; border-radius: 10px; border: 1px solid rgba(217, 178, 106, .35); background: rgba(255, 255, 255, .04); display: grid; gap: 4px; }
.chap .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff1d6;
  background: radial-gradient(circle at 35% 30%, #d0414c, #8a1520 60%, #4a0810); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), 0 3px 6px rgba(0, 0, 0, .5); }
.chap .nm { font-weight: 800; }
.chap .meta { color: var(--muted); font-size: 13px; }
.chap.sel { border-color: var(--gold-hi); background: rgba(217, 178, 106, .16); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px rgba(217, 178, 106, .25); }
.chap-intro { margin-top: 12px; color: var(--muted); font-style: italic; }
.seg { display: inline-flex; border: 1px solid rgba(217, 178, 106, .45); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 10px 16px; font-family: var(--caps); font-weight: 700; }
.seg button.sel { background: linear-gradient(180deg, #f6d995, #c69440); color: #2a1906; }
.startbar { display: flex; gap: 14px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.rules { color: #d6cde4; line-height: 1.5; }
.rules ol { padding-left: 20px; margin: 8px 0; }
.rules b { color: var(--gold-hi); }
.rules > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--caps); font-weight: 700; color: var(--gold-hi); }
.rules > summary::-webkit-details-marker { display: none; }
.rules > summary::before { content: '▸'; display: inline-block; transition: transform .2s; }
.rules[open] > summary { margin-bottom: 4px; }
.rules[open] > summary::before { transform: rotate(90deg); }
.chap-title { display: block; margin-bottom: 4px; font-family: var(--caps); font-style: normal; font-size: 17px; color: var(--gold-hi); }

/* alegerea eroului: chenare pătrate cu portretul; atingerea deschide fișa mare */
.hero-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 170px)); gap: 18px 16px; }
.htile { --hc: #888; position: relative; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); display: grid; gap: 3px; justify-items: center; text-align: center; }
.htile .ht-art { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #0b0814;
  box-shadow: 0 0 0 2px #f2e6c8, 0 0 0 4px var(--hc), 0 0 0 5px rgba(0, 0, 0, .6), 0 10px 22px rgba(0, 0, 0, .55); transition: transform .18s, box-shadow .18s; }
.htile .ht-art .living { position: absolute; inset: 0; transition: filter .25s; }
.htile .lv-img { object-position: 50% 18%; }
.htile:hover .ht-art { transform: translateY(-3px); }
.htile:focus-visible { outline: none; }
.htile:focus-visible .ht-art { box-shadow: 0 0 0 2px #f2e6c8, 0 0 0 4px var(--hc), 0 0 0 7px #fff, 0 10px 22px rgba(0, 0, 0, .55); }
.htile .ht-name, .htile .ht-role { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htile .ht-name { margin-top: 7px; font-family: var(--caps); font-weight: 800; font-size: 16px; line-height: 1.1; color: var(--gold-hi); }
.htile .ht-role { font-family: var(--caps); font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.htile .ht-who { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; padding: 3px 4px; font-family: var(--caps); font-weight: 800; font-size: 12px; color: var(--text);
  background: rgba(10, 8, 20, .86); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htile.mine .ht-art { box-shadow: 0 0 0 2px #f2e6c8, 0 0 0 4px var(--hc), 0 0 0 7px var(--gold-hi), 0 0 28px rgba(246, 210, 140, .7), 0 10px 22px rgba(0, 0, 0, .55); }
.htile.mine .ht-who { background: linear-gradient(180deg, #f6d995, #c69440); color: #2a1906; }
.htile.mine .ht-art::after { content: '✓'; position: absolute; z-index: 4; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #2a1906; background: var(--gold-hi); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.htile.taken .ht-art .living { filter: grayscale(.9) brightness(.55); }
.htile.taken .ht-name { color: var(--muted); }
.hero-sel { margin-top: 16px; color: var(--muted); font-style: italic; }
.hero-sel b { color: var(--gold-hi); font-style: normal; }

/* fișa mare a eroului */
.sheet.hero-sheet { width: min(460px, 100%); padding: 0 0 18px; gap: 14px; justify-items: stretch; text-align: left; }
.hero-sheet .hs-art { position: relative; aspect-ratio: 4 / 3.3; overflow: hidden; box-shadow: 0 2px 0 var(--hc); }
.hero-sheet .hs-art .living { position: absolute; inset: 0; }
.hero-sheet .hs-art .lv-img { object-position: 50% 22%; }
.hero-sheet .hs-art::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 2; pointer-events: none; background: linear-gradient(transparent, rgba(22, 13, 6, .85)); }
.hs-nav { position: absolute; z-index: 4; top: 50%; translate: 0 -50%; width: 42px; height: 42px; padding: 0 0 4px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; line-height: 1; color: var(--gold-hi); background: rgba(10, 8, 20, .72); border: 1px solid rgba(217, 178, 106, .6); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.hs-nav.prev { left: 10px; }
.hs-nav.next { right: 10px; }
.hero-sheet .hs-body { display: grid; gap: 8px; padding: 0 20px; }
.hero-sheet .role { justify-self: start; padding: 3px 11px; border-radius: 999px; background: var(--hc); color: #fff; font-family: var(--caps); font-weight: 800; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.hero-sheet h2 { font-size: 24px; }
.hero-sheet .blurb { margin: 0; color: #d6cde4; font-style: italic; line-height: 1.45; }
.hero-sheet .ab { font-size: 14.5px; line-height: 1.4; padding-top: 8px; border-top: 1px dashed rgba(217, 178, 106, .35); }
.hero-sheet .ab b, .hero-sheet .deck > b { color: var(--gold-hi); font-family: var(--caps); }
.hero-sheet .deck > b { display: block; margin-bottom: 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.hero-sheet .opts { padding: 0 20px; }

/* capul de pe telefon (locația pe scurt + file) există doar pe ecrane mici */
.hud, .pwarn, .phone-only { display: none; }
.mhint { margin-top: 12px; font-size: 14px; color: var(--muted); }
@keyframes tabHurt { 20%, 60% { background: rgba(216, 54, 74, .7); color: #fff; } }
@keyframes tabHeal { 30% { background: rgba(87, 211, 154, .55); color: #fff; } }

/* ---------- bara de sus ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px var(--gutter-r) 8px var(--gutter);
  background: linear-gradient(180deg, rgba(5, 5, 12, .94), rgba(5, 5, 12, .78)); border-bottom: 1px solid rgba(217, 178, 106, .25); box-shadow: 0 6px 20px rgba(0, 0, 0, .45); flex-wrap: wrap; }
.topbar .title { font-family: var(--title); font-weight: 800; font-size: 24px; line-height: 1; background: linear-gradient(180deg, #fff4cf, #d9a84a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .chapter { color: var(--muted); font-size: 14px; }
.topbar .spacer { flex: 1; }
.turnflag { font-family: var(--caps); font-weight: 800; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(217, 178, 106, .45); background: rgba(255, 255, 255, .05); white-space: nowrap; }
.turnflag.mine { background: linear-gradient(180deg, #f6d995, #c69440); color: #2a1906; border-color: #5a3e14; animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 20px rgba(246, 225, 160, .7); } }

/* ---------- tabla ---------- */
.board { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 24px; padding: 8px 0 0; max-width: 1380px; margin: 18px auto calc(var(--dock-h) + 20px); width: calc(100% - 32px); }
.col { display: grid; gap: 26px; align-content: start; min-width: 0; }
.col > * { min-width: 0; }

/* Locația — cartonaș orizontal */
.loc-card { position: relative; border-radius: 12px; overflow: hidden; background: #120c08; color: var(--text);
  box-shadow: 0 0 0 2px #f2e6c8, 0 0 0 5px #6b4a22, 0 0 0 6px #000, 0 14px 30px rgba(0, 0, 0, .6); }
.loc-card .l-art { position: relative; aspect-ratio: 16 / 8.2; overflow: hidden; }
.loc-card .l-art > img, .loc-card .l-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.loc-card .l-art > img { animation: kb 26s ease-in-out infinite alternate; }
.l-umbra { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; animation: umbraH 1.4s ease-out both;
  background: linear-gradient(to top, rgba(14, 5, 26, .96), rgba(60, 24, 120, .78) 55%, rgba(154, 100, 255, 0)); }
.l-umbra::before { content: ''; position: absolute; left: -10%; right: -10%; top: -14px; height: 28px; border-radius: 50%; filter: blur(6px); background: rgba(120, 70, 220, .45); animation: mist 7s ease-in-out infinite alternate; }
@keyframes umbraH { from { height: var(--from); } to { height: var(--to); } }
@keyframes mist { to { transform: translateX(8%) scaleY(1.3); } }
.loc-card .l-plate { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent); }
.loc-card .l-num { font-family: var(--caps); font-weight: 700; font-size: 12px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }
.loc-card h3 { font-family: var(--caps); font-weight: 800; font-size: 19px; color: #fff6e0; text-shadow: 0 2px 4px #000; }
.loc-card .l-body { padding: 10px 12px 12px; background: linear-gradient(180deg, #2a1c10, #1a1009); border-top: 1px solid rgba(217, 178, 106, .4); }
.loc-card .l-meta { font-size: 13.5px; color: #e0d2b8; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.track { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.track span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed rgba(203, 184, 255, .35); display: grid; place-items: center; font-size: 12px; color: transparent; background: rgba(0, 0, 0, .25); }
.track span.on { border: 0; color: #e9e0ff; background: radial-gradient(circle at 35% 30%, #b39af2, #5a33a8 55%, #23104a); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35), inset 0 0 0 2px #2a1450, 0 3px 6px rgba(0, 0, 0, .5), 0 0 12px rgba(138, 92, 240, .55); }
.track span.on.new { animation: tokenDrop .55s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes tokenDrop { from { transform: translateY(-40px) scale(1.4); opacity: 0; } }
.locdots { display: flex; gap: 6px; margin-top: 10px; }
.locdots i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.locdots i.lost { background: var(--umbra); }
.locdots i.cur { background: var(--gold); }
.warnings { display: grid; gap: 6px; margin-top: 10px; }
.warn { font-size: 13px; padding: 6px 8px; border-radius: 8px; background: rgba(216, 54, 74, .16); border: 1px solid rgba(216, 54, 74, .45); color: #ffd6dc; }

/* Evenimentele Umbrei */
.events { display: grid; gap: 10px; }
.ev-card { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 10px;
  background: linear-gradient(135deg, #2a1748, #120a22); color: #efe6ff;
  box-shadow: 0 0 0 1.5px #b79cf0, 0 0 0 4px var(--dark-2), 0 0 0 5px rgba(0, 0, 0, .6), 0 10px 22px rgba(0, 0, 0, .5); transform-origin: 50% 50%; }
.ev-card.enter { animation: evFlip .6s cubic-bezier(.2, .8, .3, 1.1) both; }
@keyframes evFlip { from { opacity: 0; transform: perspective(700px) rotateY(-100deg) translateX(-20px); } }
.ev-card .e-art { width: 62px; height: 62px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle, #5a2f9a, #1a0b30 70%); box-shadow: inset 0 0 0 1px rgba(200, 170, 255, .5); }
.ev-card .e-art img { width: 100%; height: 100%; object-fit: cover; }
.ev-card .e-art .emb { font-size: 30px; color: transparent; text-shadow: 0 0 0 #eadcff, 0 0 14px rgba(180, 140, 255, .85); }
.ev-card b { font-family: var(--caps); font-weight: 800; font-size: 14.5px; display: block; color: #e6d6ff; }
.ev-card span { font-size: 14px; line-height: 1.3; }
.die { display: inline-flex; gap: 10px; align-items: center; margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(217, 178, 106, .3); font-size: 14px; }
.die .cube { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 19px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .5); }
.die.light .cube { background: linear-gradient(145deg, #fff6d8, #e0b964); color: #4a3008; }
.die.dark .cube { background: linear-gradient(145deg, #4a3878, #170f2c); color: #e3d7ff; box-shadow: inset 0 0 0 1px #8a6ad8, 0 4px 10px rgba(0, 0, 0, .5); }
.die.enter .cube { animation: roll .9s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes roll { 0% { transform: translate(-60px, -30px) rotate(-540deg) scale(.5); } 70% { transform: translate(4px, 2px) rotate(15deg) scale(1.08); } }

.played { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: 13px; color: var(--ink);
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); box-shadow: 0 0 0 2px var(--tc, #888), 0 3px 6px rgba(0, 0, 0, .4); }
.chip.enter { animation: chipIn .4s ease-out both; }
.chip .ci { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--tc); font-size: 12px; }
.chip .ci img { width: 100%; height: 100%; object-fit: cover; }
.chip.t-spell { --tc: var(--spell); } .chip.t-item { --tc: var(--item); } .chip.t-ally { --tc: var(--ally); }
@keyframes chipIn { from { opacity: 0; transform: scale(.6); } }

/* ---------- portrete „vii” ---------- */
.living { position: absolute; inset: 0; overflow: hidden; background: #0b0814; isolation: isolate; }
.living .lv-kb { position: absolute; inset: 0; animation: kb 18s ease-in-out infinite alternate; }
.living .lv-img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 85%; animation: breathe 5.5s ease-in-out infinite; }
.living > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.living .lv-light { position: absolute; left: var(--lx, 50%); top: var(--ly, 50%); width: 70%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--lc, #ffcf8a) 70%, transparent), transparent 62%); mix-blend-mode: screen; animation: flicker 3.4s ease-in-out infinite; }
.living .lv-eyes { position: absolute; left: var(--ex, 50%); top: var(--ey, 40%); width: var(--ew, 20%); height: 9%; translate: -50% -50%; pointer-events: none; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--ec, #ff4040) 85%, transparent), transparent 70%); mix-blend-mode: screen; animation: eyes 4s ease-in-out infinite; }
.living .lv-sheen { position: absolute; inset: -20%; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .22) 48%, rgba(255, 255, 255, .05) 52%, transparent 58%); animation: sheen 9s ease-in-out infinite; }
.living .lv-motes { position: absolute; inset: 0; pointer-events: none; }
.living .lv-motes i { position: absolute; bottom: -4px; width: 3px; height: 3px; border-radius: 50%; background: var(--lc, #ffd27a); box-shadow: 0 0 6px 2px color-mix(in srgb, var(--lc, #ffd27a) 70%, transparent); opacity: 0; animation: moteUp 6s linear infinite; }
.living .lv-motes i:nth-child(1) { left: 12%; animation-delay: -1s; } .living .lv-motes i:nth-child(2) { left: 30%; animation-delay: -3.4s; animation-duration: 7s; }
.living .lv-motes i:nth-child(3) { left: 52%; animation-delay: -5s; } .living .lv-motes i:nth-child(4) { left: 68%; animation-delay: -2.2s; animation-duration: 8s; }
.living .lv-motes i:nth-child(5) { left: 84%; animation-delay: -4.1s; } .living .lv-motes i:nth-child(6) { left: 44%; animation-delay: -.4s; animation-duration: 9s; }
@keyframes kb { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
@keyframes breathe { 50% { transform: scale(1.012, 1.022); } }
@keyframes flicker { 0%, 100% { opacity: .55; } 30% { opacity: .85; } 45% { opacity: .5; } 60% { opacity: .8; } 80% { opacity: .62; } }
@keyframes eyes { 0%, 100% { opacity: .55; } 50% { opacity: 1; } 93% { opacity: .9; } 95% { opacity: 0; } 97% { opacity: .9; } }
@keyframes sheen { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
@keyframes moteUp { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(12px, -160px); opacity: 0; } }

/* portretele SVG desenate */
.portrait { display: block; }
.portrait .p-bg { animation: kbs 22s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes kbs { to { transform: scale(1.08) translate(-1.5px, -1px); } }
.portrait .p-light { animation: flick 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flick { 0%, 100% { opacity: .85; transform: scale(1); } 40% { opacity: 1; transform: scale(1.06); } 55% { opacity: .78; } 70% { opacity: .95; transform: scale(1.02); } }
.portrait .p-body { animation: breatheS 5.5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes breatheS { 50% { transform: translateY(-.6px) scale(1.012, 1.018); } }
.portrait .p-hair { animation: sway 6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes sway { 50% { transform: rotate(3deg); } }
.portrait .p-float { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2.5px); } }
.portrait .p-flame { animation: flame .9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes flame { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(1.08, 1.16) skewX(4deg); } }
.portrait .p-coin { animation: coin 2.6s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes coin { 0%, 50%, 100% { transform: scaleX(1); } 25%, 75% { transform: scaleX(.08); } }
.portrait .p-eyes { animation: blink 6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.portrait .p-wingL { transform-box: fill-box; transform-origin: 100% 30%; animation: wingL 1.6s ease-in-out infinite; }
.portrait .p-wingR { transform-box: fill-box; transform-origin: 0 30%; animation: wingR 1.6s ease-in-out infinite; }
@keyframes wingL { 50% { transform: rotate(-10deg) scaleY(.92); } }
@keyframes wingR { 50% { transform: rotate(10deg) scaleY(.92); } }
.portrait .p-spin { animation: spin 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.portrait .p-tongue { animation: tongue 3s infinite; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes tongue { 0%, 80%, 100% { transform: scaleY(0); } 85%, 95% { transform: scaleY(1); } }
.portrait .p-glint { animation: glint 3.5s ease-in-out infinite; }
@keyframes glint { 0% { transform: translateY(70px); opacity: 0; } 20% { opacity: 1; } 60% { transform: translateY(0); opacity: 0; } 100% { opacity: 0; } }
.portrait .p-mask { animation: maskfade 7s ease-in-out infinite; }
@keyframes maskfade { 0%, 45%, 100% { opacity: .95; } 50% { opacity: .2; } 55% { opacity: .9; } }
.portrait .p-wave { animation: wave 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes wave { 50% { transform: skewX(4deg) scaleY(1.03); } }
.portrait .p-twinkle, .scene .s-star { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .25; } }
.portrait .p-drift { animation: drift 20s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(30px); } }
.portrait .p-motes > * { opacity: 0; animation: mote 7s linear infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .95; } 80% { opacity: .6; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
/* scene */
.scene .s-cloud { animation: cloud 60s linear infinite; }
@keyframes cloud { from { transform: translateX(-120px); } to { transform: translateX(380px); } }
.scene .s-win { animation: winflick 5s ease-in-out infinite; }
@keyframes winflick { 0%, 100% { opacity: .95; } 50% { opacity: .55; } 70% { opacity: 1; } }
.scene .s-flame { animation: twinkle 1.1s ease-in-out infinite; }
.scene .s-candle { animation: bob 4.5s ease-in-out infinite; }
.scene .s-beacon, .scene .s-crystal { animation: pulse 2.4s ease-in-out infinite; }
.scene .s-shimmer { animation: shimmer 4s ease-in-out infinite alternate; }
@keyframes shimmer { to { transform: translateX(14px); opacity: .5; } }
.scene .s-swell { animation: waveX 8s linear infinite; } .scene .s-swell.s2 { animation-duration: 5s; }
.scene .s-corona { animation: pulse 3s ease-in-out infinite; }
.scene .umbra { animation: umbraY 1.4s ease-out both; }
@keyframes umbraY { from { transform: translateY(var(--from)); } to { transform: translateY(var(--to)); } }
.scene .umbra .wave { animation: waveX 9s linear infinite; }
.scene .umbra .w2 { animation-duration: 14s; animation-direction: reverse; }
@keyframes waveX { to { transform: translateX(-100px); } }

/* ---------- cartonașe ---------- */
.card { --tc: var(--spell); --tc2: var(--spell-2); position: relative; width: var(--cw); height: var(--ch); flex: 0 0 auto; border-radius: calc(var(--cw) * .075);
  padding: calc(var(--cw) * .035); color: var(--ink); user-select: none; transition: transform .18s, box-shadow .18s, filter .18s;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 85%, white) 0%, var(--tc) 35%, var(--tc2) 100%);
  box-shadow: 0 0 0 1.5px #f6eedb, 0 0 0 2.5px rgba(0, 0, 0, .55), 0 8px 18px rgba(0, 0, 0, .55); }
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 6px); }
.card .c-in { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: calc(var(--cw) * .05); overflow: hidden;
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); box-shadow: inset 0 0 0 1px rgba(80, 50, 20, .55); }
.card .c-title { flex: 0 0 auto; padding: calc(var(--cw) * .03) calc(var(--cw) * .05) calc(var(--cw) * .022); font-family: var(--caps); font-weight: 800;
  font-size: max(8.5px, calc(var(--cw) * .083)); line-height: 1.05; text-align: center; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #fffaf0, var(--parch)); border-bottom: 1px solid rgba(80, 50, 20, .35); }
.card .c-art { position: relative; flex: 0 0 auto; aspect-ratio: 1.42; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--tc) 55%, #fff6dc), var(--tc) 45%, color-mix(in srgb, var(--tc2) 70%, #000) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), inset 0 -10px 16px rgba(0, 0, 0, .25); }
.card .c-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .c-art .emb { font-size: calc(var(--cw) * .3); color: transparent; filter: hue-rotate(var(--h, 0deg));
  text-shadow: 0 0 0 #fff5dc, 1px 2px 0 rgba(0, 0, 0, .45), 0 0 16px rgba(255, 240, 200, .75); animation: embFloat 5s ease-in-out infinite; }
@keyframes embFloat { 50% { transform: translateY(-3px) scale(1.04); } }
.card .c-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .28) 47%, transparent 58%); transform: translateX(-120%); }
.card.playable:hover .c-art::after, .card.afford .c-art::after, .card.big .c-art::after { animation: artSheen 1.6s ease-out; }
@keyframes artSheen { to { transform: translateX(120%); } }
.card .c-type { flex: 0 0 auto; text-align: center; font-family: var(--caps); font-weight: 800; font-size: calc(var(--cw) * .058); letter-spacing: .2em; text-transform: uppercase;
  color: #fff6e0; background: linear-gradient(180deg, var(--tc), var(--tc2)); padding: 1px 0; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.card .c-text { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: calc(var(--cw) * .03) calc(var(--cw) * .05); text-align: center;
  font-size: max(8px, calc(var(--cw) * .082)); line-height: 1.17; overflow: hidden; }
.card .c-text span { display: block; }
.card .cost { position: absolute; z-index: 3; top: calc(var(--cw) * -.06); left: calc(var(--cw) * -.06); width: calc(var(--cw) * .27); height: calc(var(--cw) * .27); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: calc(var(--cw) * .14); color: #4a2f06;
  background: radial-gradient(circle at 35% 30%, #fff5c8, #e9b84a 55%, #8f6216); box-shadow: inset 0 0 0 2px #a8781e, inset 0 0 0 4px rgba(255, 240, 190, .5), 0 3px 8px rgba(0, 0, 0, .55); }
.card .cost.up { color: #8a0f1d; }
.card .cost.down { color: #0d5c33; }
.card.t-spell { --tc: var(--spell); --tc2: var(--spell-2); }
.card.t-item { --tc: var(--item); --tc2: var(--item-2); }
.card.t-ally { --tc: var(--ally); --tc2: var(--ally-2); }
.card.starter .c-art { filter: saturate(.85); }
.card.rare::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; mix-blend-mode: color-dodge; opacity: .55;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 230, 180, .5) 40%, rgba(160, 220, 255, .45) 50%, rgba(255, 160, 230, .4) 60%, transparent 75%); background-size: 260% 100%; animation: foil 5s ease-in-out infinite; }
@keyframes foil { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.card.playable { cursor: pointer; }
/* la alegerea cartonașului de decartat: cele cu efect „Dacă îl decartezi” sunt evidențiate */
.card.ondisc { box-shadow: 0 0 0 1.5px #f6eedb, 0 0 0 4px #5fd38a, 0 8px 18px rgba(0, 0, 0, .55), 0 0 22px rgba(95, 211, 138, .55); }
.card.ondisc::after { content: '♻ bonus'; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 3; padding: 1px 7px; border-radius: 999px;
  background: #1d5a36; color: #e9ffef; font: 700 10px/1.5 system-ui, sans-serif; letter-spacing: .04em; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.card.playable:hover { transform: translateY(-16px) rotate(0deg) scale(1.06) !important; z-index: 5; box-shadow: 0 0 0 1.5px #f6eedb, 0 0 0 4px var(--gold-hi), 0 18px 34px rgba(0, 0, 0, .6), 0 0 30px rgba(246, 225, 160, .55); }
.card.afford { cursor: pointer; box-shadow: 0 0 0 1.5px #f6eedb, 0 0 0 4px var(--gold-hi), 0 8px 18px rgba(0, 0, 0, .55), 0 0 22px rgba(246, 225, 160, .5); animation: affordPulse 2.4s ease-in-out infinite; }
@keyframes affordPulse { 50% { box-shadow: 0 0 0 1.5px #f6eedb, 0 0 0 4px var(--gold-hi), 0 8px 18px rgba(0, 0, 0, .55), 0 0 34px rgba(246, 225, 160, .8); } }
.card.dim { filter: saturate(.55) brightness(.75); }
.card.enter { animation: deal .5s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(8deg) scale(.85); } }
.card.big { --cw: 250px; --ch: 360px; }
.market .card { cursor: pointer; }
.card:has(> .cost) .c-title { padding-left: calc(var(--cw) * .2); }
.market .card:hover { transform: translateY(-6px); }

.market { display: grid; grid-template-columns: repeat(6, var(--cw)); gap: 16px; justify-content: space-between; padding-top: 8px; }
.mslot-empty { width: var(--cw); height: var(--ch); flex: 0 0 auto; border-radius: calc(var(--cw) * .075); background: #10122a url(art/back-card.webp) center / cover; box-shadow: 0 0 0 1.5px rgba(233, 207, 143, .55), 0 0 0 2.5px rgba(0, 0, 0, .6), 0 8px 18px rgba(0, 0, 0, .5); opacity: .85; }

/* ---------- răufăcători ---------- */
.villains { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 250px)); gap: 22px; justify-content: center; }
.villain { position: relative; border-radius: 14px; padding: 6px; color: var(--text); display: grid; gap: 0;
  background: linear-gradient(170deg, #3a2c18, #17110b 40%, #0b0807);
  box-shadow: 0 0 0 1.5px #e9cf8f, 0 0 0 3.5px #120c06, 0 0 0 4.5px rgba(217, 178, 106, .55), 0 18px 40px rgba(0, 0, 0, .7), 0 0 40px rgba(120, 100, 255, .15); }
.villain.enter { animation: vIn .7s cubic-bezier(.2, .8, .3, 1.1) both; }
.villain.boss { background: linear-gradient(160deg, #8a6ad0, #3a2370 35%, #12082a); box-shadow: 0 0 0 1.5px #f3e6ff, 0 0 0 3px #0a0612, 0 0 40px rgba(138, 92, 240, .45), 0 16px 34px rgba(0, 0, 0, .6); }
@keyframes vIn { from { opacity: 0; transform: translateY(-24px) rotateX(30deg) scale(.95); } }
.villain .v-art { position: relative; aspect-ratio: 4 / 3.6; border-radius: 9px 9px 2px 2px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
.villain .v-art .living { position: absolute; inset: 0; }
.villain .v-plate { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: linear-gradient(180deg, #221a10, #0e0a07); border-top: 1px solid rgba(233, 207, 143, .45); }
.villain.boss .v-plate { background: linear-gradient(180deg, #24123f, #120822); }
/* șeful protejat: un scut de lumină peste portret până cad toți ceilalți */
.villain.guarded .v-art .living { filter: saturate(.75) brightness(.85); }
.villain.guarded .v-art::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(214, 190, 255, .75), inset 0 0 34px rgba(160, 120, 255, .6); animation: guardPulse 3.2s ease-in-out infinite; }
@keyframes guardPulse { 50% { box-shadow: inset 0 0 0 2px rgba(214, 190, 255, .35), inset 0 0 18px rgba(160, 120, 255, .3); } }
.villain .v-guard { position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 2; white-space: nowrap;
  font-family: var(--caps); font-weight: 700; font-size: 11.5px; letter-spacing: .04em; color: #f1e6ff;
  background: rgba(30, 16, 56, .88); border: 1px solid rgba(214, 190, 255, .6); border-radius: 999px; padding: 4px 12px; }
.living .lv-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(44px, 8vw, 88px);
  background: radial-gradient(circle at 50% 42%, #3a2a52, #120c1c 72%); }
.villain h3 { font-family: var(--caps); font-weight: 800; font-size: 16px; line-height: 1.15; color: #f6e7c4; }
.villain .v-hp { flex: 0 0 auto; display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 4px; border-radius: 50%; font-family: var(--display); font-weight: 700; font-size: 17px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff8a96, #c42a3c 55%, #5e0c18); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .3), 0 3px 8px rgba(0, 0, 0, .5); }
.villain .v-dmg { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 8px; background: rgba(0, 0, 0, .35); }
.villain .v-dmg i { width: 18px; height: 16px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: rgba(255, 255, 255, .12); }
.villain .v-dmg i.d { background: radial-gradient(circle at 35% 30%, #ff9a7a, #b3262f 60%, #5e0c14); box-shadow: 0 0 8px rgba(255, 90, 60, .6); }
.villain .v-dmg i.d.new { animation: tokenDrop .45s cubic-bezier(.2, .9, .3, 1.4) .35s both; }
.villain .v-text { padding: 8px 10px; border-radius: 0 0 9px 9px; font-size: 14px; line-height: 1.35; color: var(--ink); background: linear-gradient(180deg, #f1e6c8, #d9c79c); display: grid; gap: 6px; }
.villain .v-text b { font-family: var(--caps); font-weight: 800; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; display: block; color: #6a1a22; }
.villain .v-text .rw { border-top: 1px dashed rgba(60, 40, 20, .35); padding-top: 6px; }
.villain .v-text .rw b { color: #6a4a08; }
.villain .hits { display: flex; gap: 8px; padding: 8px 2px 2px; }
.villain .hits .btn { flex: 1; padding: 8px 10px; font-size: 13.5px; }
.vslot-empty { position: relative; z-index: 1; border: 1.5px dashed rgba(217, 178, 106, .3); border-radius: 14px; display: grid; place-items: center; min-height: 160px; color: var(--muted); font-style: italic; padding: 12px; text-align: center; background: rgba(0, 0, 0, .18); }
.villain.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-6px) rotate(-1.5deg); } 45% { transform: translateX(5px) rotate(1deg); } 70% { transform: translateX(-3px); } }

/* ---------- planșele eroilor ---------- */
.heroes { display: grid; gap: 14px; }
.hero { --hc: #888; position: relative; display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--ink);
  background: linear-gradient(170deg, var(--parch), var(--parch-2));
  box-shadow: 0 0 0 2px var(--hc), 0 0 0 3.5px rgba(0, 0, 0, .55), 0 10px 22px rgba(0, 0, 0, .5); transition: box-shadow .3s, transform .3s; }
.hero.active { transform: translateX(-4px); box-shadow: 0 0 0 2px var(--hc), 0 0 0 5px var(--gold-hi), 0 0 26px rgba(246, 210, 140, .55), 0 10px 22px rgba(0, 0, 0, .5); }
.hero .h-por { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 0 0 2px #f8eed6, 0 0 0 4.5px var(--hc), 0 0 0 6px #5a3e14, 0 6px 14px rgba(0, 0, 0, .5); }
.hero .h-por .living { position: absolute; inset: 0; }
.hero.stunned .h-por { filter: grayscale(.85) brightness(.75); }
.hero.stunned .h-por::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 76 92'%3E%3Cpath d='M38 0L34 24L44 34L30 52L40 64L32 92M34 24L18 30M44 34L62 28M30 52L10 58M40 64L60 70' fill='none' stroke='%23fff' stroke-opacity='.7' stroke-width='1.2'/%3E%3C/svg%3E") center / cover; }
.hero.stunned .living * { animation-play-state: paused !important; }
.hero .h-info { min-width: 0; display: grid; align-content: start; gap: 3px; }
.hero .hn { font-family: var(--caps); font-weight: 800; font-size: 16px; line-height: 1.1; }
.hero .who { font-size: 13px; color: var(--ink-soft); }
.hero .off { color: #a3202e; font-size: 12px; }
.htrack { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; margin: 4px 0 2px; }
.htrack i { height: 17px; border-radius: 4px; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 10px; color: rgba(60, 30, 20, .55); background: rgba(80, 50, 20, .12); box-shadow: inset 0 0 0 1px rgba(80, 50, 20, .18); }
.htrack i.f { background: rgba(216, 54, 74, .22); color: rgba(120, 20, 30, .8); }
.htrack i.cur { position: relative; color: #fff; background: radial-gradient(circle at 35% 30%, #ff8a96, #d8364a 55%, #7a1020); box-shadow: 0 0 0 1px #5e0c18, 0 2px 6px rgba(0, 0, 0, .4); z-index: 1; transform: scale(1.18); }
.htrack i.cur.zero { background: radial-gradient(circle at 35% 30%, #8a8a8a, #444 60%, #222); }
.hero .meta { font-size: 12.5px; color: var(--ink-soft); display: flex; gap: 10px; flex-wrap: wrap; }
.hero .tag { position: absolute; top: -10px; right: 10px; font-family: var(--caps); font-weight: 800; font-size: 11px; letter-spacing: .12em; padding: 2px 9px; border-radius: 999px; background: var(--gold); color: #2a1906; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.hero .tag.st { background: var(--blood); color: #fff; }
.hero .ab { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); border-top: 1px dashed rgba(90, 68, 48, .35); padding-top: 6px; }
.hero .ab b { color: #7a4f10; }
.hero.flash-hurt { animation: hurt .7s ease-out; }
.hero.flash-heal { animation: heal .9s ease-out; }
@keyframes hurt { 15% { transform: translateX(-5px); box-shadow: 0 0 0 2px var(--hc), 0 0 0 6px #ff3048, 0 0 30px rgba(255, 48, 72, .8); } 35% { transform: translateX(4px); } 55% { transform: translateX(-2px); } }
@keyframes heal { 30% { box-shadow: 0 0 0 2px var(--hc), 0 0 0 6px #5fe08a, 0 0 30px rgba(95, 224, 138, .8); } }

/* ---------- dock: mâna jucătorului ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--dock-h); display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 14px; align-items: center;
  padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom)) var(--gutter);
  background: linear-gradient(180deg, rgba(6, 6, 14, 0), rgba(6, 6, 14, .93) 30px, rgba(4, 4, 10, .98)); }
.dock::before { content: ''; position: absolute; left: 0; right: 0; top: 28px; height: 2px; background: linear-gradient(90deg, transparent, rgba(217, 178, 106, .55), transparent); }
.res { display: grid; gap: 6px; position: relative; }
.res .lbl { font-size: 12.5px; color: var(--muted); }
.res .piles { display: flex; gap: 18px; }
.pile { display: grid; justify-items: center; gap: 2px; position: relative; }
.pile .stack { position: relative; width: 54px; height: 54px; }
.pile .stack i { position: absolute; left: 0; width: 54px; height: 46px; }
.pile.atk .stack i { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: radial-gradient(circle at 35% 30%, #ff9a7a, #b3262f 55%, #5e0c14); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3); }
.pile.inf .stack i { border-radius: 50%; width: 48px; height: 48px; left: 3px; background: radial-gradient(circle at 35% 30%, #fff5c8, #e9b84a 55%, #8f6216); box-shadow: inset 0 0 0 2px #a8781e, inset 0 -4px 0 rgba(0, 0, 0, .2); }
.pile .stack i.e { opacity: .18; filter: grayscale(1); }
.pile .stack b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 26px; z-index: 9; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.pile.atk .stack b { color: #fff3dc; }
.pile.inf .stack b { color: #4a2f06; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.pile small { font-family: var(--caps); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pile.bump .stack { animation: bump .45s; }
@keyframes bump { 40% { transform: scale(1.22) rotate(-4deg); } }
.hand-wrap { min-width: 0; display: grid; gap: 4px; }
.hand-wrap .lbl { font-size: 13px; color: var(--muted); text-align: center; }
.hand { display: flex; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 18px 20px 8px; scrollbar-width: thin; }
.hand > :first-child { margin-left: auto; }
.hand > :last-child { margin-right: auto; }
.hand .card { transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); transform-origin: 50% 130%; }
.hand .card + .card { margin-left: calc(var(--cw) * -.16); }
.hand.wide { justify-content: flex-start; }
.hand-toggle { display: none; }
.actions { display: grid; gap: 10px; }
.actions .btn { width: 100%; }
.actions .btn.end-turn { font-size: 16px; padding: 13px 16px; }

/* ---------- ferestre ---------- */
#modal:empty { display: none; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(6, 4, 10, .74); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(580px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 18px; padding: 24px 20px; display: grid; gap: 14px; justify-items: center; text-align: center; animation: rise .3s cubic-bezier(.2, .8, .3, 1.2);
  background: linear-gradient(170deg, #2a1c10, #160d06); color: var(--text); box-shadow: 0 0 0 1.5px var(--gold), 0 0 0 5px #120a05, 0 0 0 6px rgba(217, 178, 106, .4), 0 30px 80px rgba(0, 0, 0, .7); }
@keyframes rise { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.sheet h2 { font-family: var(--caps); font-weight: 800; font-size: 21px; color: var(--gold-hi); }
.sheet .opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sheet .opts .btn { min-width: 140px; }
.sheet .cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding-top: 6px; }
.waiting { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 12px); z-index: 35; padding: 10px 18px; border-radius: 999px; background: rgba(28, 16, 8, .96); border: 1px solid rgba(217, 178, 106, .5); font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); white-space: nowrap; }
.end .logo { font-size: 64px; }
.end .crest { width: 90px; height: 105px; }
.end.lost .logo { background: linear-gradient(180deg, #e9d8ff, #8a5cf0 60%, #3a1a7a); -webkit-background-clip: text; background-clip: text; }
.end .big-emoji { font-size: 76px; color: transparent; text-shadow: 0 0 0 #f7e3ad, 0 0 24px rgba(246, 210, 140, .7); }
.end.lost .big-emoji { text-shadow: 0 0 0 #c8b0ff, 0 0 24px rgba(138, 92, 240, .7); }

/* jurnal */
.logbox { max-height: 280px; overflow: auto; display: flex; flex-direction: column-reverse; gap: 4px; font-size: 14px; }
.logpanel .abandon { margin-top: 10px; width: 100%; color: #ffb3bd; border-color: rgba(255, 120, 140, .45); }
.logbox div { padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .07); }
.logbox .good { color: #a6ecc2; } .logbox .bad { color: #ffa6b2; font-weight: 600; } .logbox .dark { color: #cdbaff; }
.logbox .turn { color: var(--gold-hi); font-family: var(--caps); font-weight: 800; font-size: 13px; padding-top: 8px; } .logbox .sys { color: var(--gold); }

#toasts { position: fixed; top: 64px; right: 16px; z-index: 60; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 10px; background: #2a1016; border: 1px solid rgba(216, 54, 74, .6); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: rise .25s; max-width: 320px; }
.toast.info { background: #2a1c10; border-color: var(--gold-lo); }
.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 70; text-align: center; padding: 8px; background: #a72f3c; color: #fff; }

/* ---------- efecte ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }
#fx-dom { position: fixed; inset: 0; z-index: 46; pointer-events: none; }
.fx-ghost { position: fixed !important; margin: 0 !important; pointer-events: none; z-index: 46; }
.fx-ghost.card { --r: 0deg; --y: 0px; }
.fx-ghost.cast { animation: cast .75s cubic-bezier(.3, .7, .3, 1) forwards; }
@keyframes cast { 0% { transform: none; filter: none; } 55% { transform: translateY(-70px) scale(1.14); filter: brightness(1.4) drop-shadow(0 0 22px var(--glow)); opacity: 1; } 100% { transform: translateY(-80px) scale(.5); filter: brightness(3) blur(4px); opacity: 0; } }
.fx-ghost.drop { animation: drop .7s ease-in forwards; }
@keyframes drop { to { transform: translateY(90px) rotate(14deg) scale(.8); opacity: 0; filter: grayscale(1); } }
.fx-ghost.fly { animation: fly .85s cubic-bezier(.5, -0.2, .4, 1) forwards; }
@keyframes fly { 30% { transform: translateY(-30px) scale(1.1) rotate(-6deg); } 100% { transform: translate(var(--tx), var(--ty)) scale(.25) rotate(12deg); opacity: .3; } }
.fx-ghost.vanquish { animation: vanquish 1.3s ease-out forwards; }
@keyframes vanquish { 0% { filter: brightness(1); } 25% { filter: brightness(2.5) saturate(1.5); transform: scale(1.04); } 100% { filter: brightness(3) blur(10px); transform: scale(1.2) translateY(-30px); opacity: 0; } }
.fx-text { position: fixed; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 700; font-size: 26px; white-space: nowrap; pointer-events: none; animation: ftext 1.5s ease-out forwards; text-shadow: 0 2px 0 #000, 0 0 14px rgba(0, 0, 0, .8); }
.fx-text.hurt { color: #ff6a7a; } .fx-text.heal { color: #7dffa8; } .fx-text.gold { color: var(--gold-hi); } .fx-text.dark { color: #c8a8ff; }
.fx-text.big { font-family: var(--title); font-size: 46px; }
@keyframes ftext { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
/* bannerul de tură: apare repede, stă clar pe ecran cam o secundă și jumătate, apoi se stinge simplu (fără blur) */
.turn-banner { position: fixed; z-index: 47; left: 0; right: 0; top: 38%; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; animation: banner 1.9s ease forwards; }
.turn-banner .tb { display: flex; align-items: center; gap: 16px; max-width: 100%; padding: 10px 30px 10px 12px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 11, 5, .82), rgba(20, 11, 5, .97) 14%, rgba(20, 11, 5, .97) 86%, rgba(20, 11, 5, .82));
  box-shadow: 0 0 0 1px rgba(217, 178, 106, .6), 0 0 0 4px rgba(10, 6, 3, .55), 0 16px 40px rgba(0, 0, 0, .65); }
.turn-banner .tb-por { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; position: relative; box-shadow: 0 0 0 2px #f8eed6, 0 0 0 4px var(--hc, #9a7432); }
.turn-banner .tb-por .living { position: absolute; inset: 0; }
.turn-banner .tb-t { font-family: var(--title); font-weight: 800; font-size: 42px; line-height: 1; background: linear-gradient(180deg, #fff4cf, #d9a84a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.turn-banner .tb-s { font-size: 15px; color: var(--muted); }
@keyframes banner { 0% { opacity: 0; transform: translateY(12px) scale(.96); } 11% { opacity: 1; transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }

/* ---------- ecrane medii ---------- */
@media (max-width: 1240px) {
  .board { grid-template-columns: 260px minmax(0, 1fr); }
  .board .col.right { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .board .col.right .heroes { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .market { grid-template-columns: repeat(3, var(--cw)); justify-content: start; }
  .dock { grid-template-columns: 150px minmax(0, 1fr) 170px; }
  .hand .card + .card { margin-left: calc(var(--cw) * -.3); }
}

/* ---------- telefon, vertical ---------- */
@media (max-width: 760px) and (orientation: portrait), (max-width: 760px) and (min-height: 561px) {
  :root { --cw: 96px; --ch: 138px; --dock-h: 232px; --gutter: max(10px, env(safe-area-inset-left)); --gutter-r: max(10px, env(safe-area-inset-right)); }
  .board { display: flex; flex-direction: column; padding: 4px 0 14px; gap: 20px; width: calc(100% - 20px); margin-top: 10px; }
  .zone { padding: 36px 10px 10px; }
  .board .col { display: contents; }
  .board .locz { order: 1; } .board .vwrap { order: 2; } .board .evpanel { order: 3; } .board .mwrap { order: 4; }
  .board .heroz { order: 5; } .board .playedpanel { order: 6; } .board .logpanel { order: 7; }
  .mat::after { background-size: 24px, 24px, 24px, 24px; }
  .loc-card .l-art { aspect-ratio: 16 / 7; }
  .market { display: flex; overflow-x: auto; gap: 12px; padding: 14px 6px 8px; }
  .villains { grid-template-columns: 1fr; }
  .villain { grid-template-columns: 42% 1fr; }
  .villain .v-art { grid-row: 1 / span 3; aspect-ratio: auto; min-height: 150px; border-radius: 9px 2px 2px 9px; }
  .villain .v-text { border-radius: 0 0 9px 0; font-size: 13px; }
  .villain .hits { grid-column: 1 / -1; }
  .board .col.right .heroes, .heroes { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero { grid-template-columns: 1fr; padding: 7px; }
  .hero { justify-items: center; text-align: center; }
  .hero .h-por { width: 72px; height: 72px; }
  .hero .meta { justify-content: center; }
  .hero.active { transform: none; }
  .hero .ab { font-size: 12px; }
  .htrack i { height: 14px; font-size: 8.5px; }
  .dock { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 4px 10px; }
  .dock .res { grid-column: 1; grid-row: 1; }
  .dock .res .lbl, .dock .hand-wrap .lbl { display: none; }
  .res .piles { gap: 10px; }
  .pile { gap: 0; }
  .pile small { font-size: 9px; letter-spacing: .04em; }
  .pile .stack { width: 40px; height: 40px; }
  .pile .stack i { width: 40px; height: 34px; }
  .pile.inf .stack i { width: 36px; height: 36px; left: 2px; }
  .pile .stack b { font-size: 20px; }
  .dock .actions { grid-column: 2; grid-row: 1; grid-template-columns: auto auto; }
  .dock .actions { gap: 6px; }
  .dock .actions .btn { padding: 9px 9px; font-size: 12px; white-space: nowrap; }
  .dock .hand-wrap { grid-column: 1 / -1; grid-row: 2; }
  .hand { padding: 12px 10px 4px; justify-content: flex-start; }
  .topbar { padding-top: 6px; padding-bottom: 6px; gap: 6px; font-size: 14px; flex-wrap: nowrap; }
  .topbar .title { font-size: 17px; white-space: nowrap; }
  .topbar .turnflag { font-size: 12px; padding: 3px 8px; }
  .topbar .btn.small { padding: 6px 8px; font-size: 12px; }
  .topbar .chapter { display: none; }
  .card.big { --cw: 210px; --ch: 302px; }
  .waiting { white-space: normal; width: calc(100% - 24px); text-align: center; border-radius: 12px; }
  .turn-banner .tb-t { font-size: 30px; }
  .turn-banner .tb-por { width: 54px; height: 64px; }
}

/* ---------- telefon, orizontal ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --cw: 80px; --ch: 116px; --dock-h: 140px; --gutter: max(10px, env(safe-area-inset-left)); --gutter-r: max(10px, env(safe-area-inset-right)); }
  .topbar { padding-top: 4px; padding-bottom: 4px; gap: 10px; font-size: 13px; flex-wrap: nowrap; }
  .topbar .title { font-size: 18px; }
  .topbar .chapter { display: none; }
  .topbar .btn.small { padding: 5px 9px; font-size: 12px; }
  .board { display: grid; grid-template-columns: 190px minmax(0, 1fr) 176px; gap: 14px; padding: 4px 0 10px; width: calc(100% - 16px); margin: 10px auto calc(var(--dock-h) + 10px); }
  .board .col { display: grid; gap: 22px; }
  .board .col.right, .board .col.right .heroes { grid-column: auto; grid-template-columns: 1fr; }
  .mat { border-radius: 16px; }
  .mat::after { background-size: 22px, 22px, 22px, 22px; }
  .zone { padding: 30px 8px 8px; }
  .zone > .zl { top: 8px; left: 12px; }
  .zone > .zl b { font-size: 12px; }
  .zone > .zl small { display: none; }
  .loc-card .l-art { aspect-ratio: 16 / 9; }
  .loc-card h3 { font-size: 15px; }
  .loc-card .l-meta { font-size: 12px; }
  .track span { width: 20px; height: 20px; }
  .ev-card { grid-template-columns: 42px 1fr; gap: 7px; }
  .ev-card .e-art { width: 42px; height: 42px; }
  .ev-card b { font-size: 12.5px; } .ev-card span { font-size: 12px; }
  .villains { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
  .villain { grid-template-columns: 40% 1fr; padding: 4px; }
  .villain .v-art { grid-row: 1 / span 3; aspect-ratio: auto; min-height: 130px; border-radius: 9px 2px 2px 9px; }
  .villain h3 { font-size: 13.5px; }
  .villain .v-hp { min-width: 32px; height: 32px; font-size: 14px; }
  .villain .v-dmg i { width: 13px; height: 12px; }
  .villain .v-text { font-size: 12px; padding: 6px 8px; border-radius: 0 0 9px 0; }
  .villain .v-text b { font-size: 10px; }
  .villain .hits { grid-column: 1 / -1; }
  .villain .hits .btn { padding: 6px 8px; font-size: 12px; }
  .market { display: flex; overflow-x: auto; gap: 10px; padding: 12px 4px 6px; justify-content: flex-start; }
  .heroes { gap: 12px; }
  .hero { grid-template-columns: 46px 1fr; gap: 7px; padding: 6px; }
  .hero .h-por { width: 46px; height: 46px; }
  .hero .hn { font-size: 13px; }
  .hero .who, .hero .meta { font-size: 11px; }
  .hero .ab { display: none; }
  .hero.active { transform: none; }
  .htrack { gap: 1px; }
  .htrack i { height: 12px; font-size: 0; }
  .dock { grid-template-columns: 96px minmax(0, 1fr) 124px; gap: 8px; padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .dock::before { top: 4px; }
  .dock .res .lbl, .dock .hand-wrap .lbl { display: none; }
  .res .piles { flex-direction: column; gap: 6px; }
  .pile { grid-auto-flow: column; align-items: center; gap: 6px; justify-content: start; }
  .pile .stack { width: 34px; height: 34px; }
  .pile .stack i { width: 34px; height: 29px; }
  .pile.inf .stack i { width: 31px; height: 31px; left: 1px; }
  .pile .stack b { font-size: 17px; }
  .pile small { font-size: 10px; }
  .hand { padding: 10px 8px 2px; }
  .actions { gap: 6px; }
  .actions .btn { padding: 8px 8px; font-size: 12.5px; }
  .actions .btn.end-turn { font-size: 13px; padding: 10px 8px; }
  .card .c-title { font-size: 8px; }
  .card .c-text { font-size: 7.6px; line-height: 1.1; padding: 2px 3px; }
  .card.big .c-title, .card.big .c-text { font-size: calc(var(--cw) * .082); }
  .card.big { --cw: 168px; --ch: 242px; }
  .sheet { padding: 14px; gap: 10px; }
  .sheet .cards .card:not(.big) { --cw: 96px; --ch: 138px; }
  .waiting { bottom: calc(var(--dock-h) + 6px); font-size: 13px; padding: 6px 14px; }
  #toasts { top: 44px; }
  .turn-banner { top: 30%; }
  .turn-banner .tb-t { font-size: 28px; }
  .turn-banner .tb-por { width: 48px; height: 58px; }
  /* bara strânsă: doar resursele, butonul pentru mână și acțiunile, pe un singur rând */
  .dock.slim, body:has(.dock.slim) { --dock-h: 54px; }
  .dock.slim { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  .dock.slim .hand { display: none; }
  .dock.slim .res .piles { flex-direction: row; gap: 14px; }
  .dock.slim .actions { grid-template-columns: auto auto; }
  .dock.slim .actions .btn { padding: 8px 12px; white-space: nowrap; }
  .dock.slim .actions .btn.end-turn { padding: 8px 14px; }
  .hand-toggle { display: inline-block; justify-self: center; font-family: var(--caps); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; color: var(--gold-hi);
    background: rgba(22, 17, 34, .95); border: 1px solid rgba(217, 178, 106, .6); border-radius: 999px; padding: 6px 16px; cursor: pointer; white-space: nowrap; }
  .hand-toggle.none { color: var(--muted); background: none; border-color: transparent; cursor: default; font-family: inherit; font-style: italic; font-weight: 400; letter-spacing: 0; }
  /* cu mâna deschisă, butonul de ascuns stă ca o filă deasupra barei */
  .dock:not(.slim) .hand-toggle { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); z-index: 3; padding: 3px 14px; font-size: 11.5px; }
  .dock:not(.slim) .hand-toggle.none { display: none; }
}

/* ---------- telefon: bara de jos e opacă, cu o umbră deasupra, ca textul de dedesubt să nu se vadă prin butoane ---------- */
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  .dock { background: linear-gradient(180deg, rgba(9, 8, 18, .95), rgba(4, 4, 10, .985) 40px); }
  .dock::before { top: 0; }
  .dock::after { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; pointer-events: none; background: linear-gradient(180deg, rgba(6, 6, 14, 0), rgba(6, 6, 14, .8)); }
}

.living .lv-kb, .living .lv-img, .living .lv-light, .living .lv-eyes, .living .lv-sheen,
.portrait [class], .scene [class]:not(.umbra), .card .c-art .emb, .card.rare::after, .card.afford,
.loc-card .l-art > img, .l-umbra::before, .turnflag.mine, .fog { animation-delay: var(--ph, 0s); }

@media (prefers-reduced-motion: reduce) {
  .room-amb, .room-bg i { display: none; }
  .room-bg { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
/* ceața și vântul au alte proporții decât particulele rotunde */
.room-amb .mist { height: auto; aspect-ratio: 2.4 / 1; }
.room-amb .wind { width: var(--s); }

/* =====================================================================
   TELEFON — layout compact: în joc, locația stă într-o bară subțire sus,
   iar zonele sunt împărțite pe file (Luptă · Piață · Eroi · Jurnal).
   ===================================================================== */
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  .topbar .title, .topbar .chapter, .topbar .logbtn, .topbar .spacer { display: none; }
  .hud { display: flex; align-items: center; gap: 8px; min-width: 0; }

  .locbar { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 10px; overflow: hidden;
    background: linear-gradient(90deg, rgba(8, 8, 18, .94) 35%, rgba(8, 8, 18, .55)), var(--lb, linear-gradient(#1a1430, #0c0a18)) center / cover;
    box-shadow: 0 0 0 1px rgba(217, 178, 106, .5), 0 4px 10px rgba(0, 0, 0, .4); }
  .lb-txt { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.15; }
  .lb-txt b { font-family: var(--caps); font-weight: 800; font-size: 14px; color: var(--gold-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lb-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lb-ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
  .lb-ctl > i { width: 6px; height: 14px; border-radius: 2px; background: rgba(203, 184, 255, .12); box-shadow: inset 0 0 0 1px rgba(203, 184, 255, .32); }
  .lb-ctl > i.on { background: linear-gradient(180deg, #c3aaff, #5a33a8); box-shadow: 0 0 6px rgba(138, 92, 240, .75); }
  .lb-ctl > span { margin-left: 5px; font-family: var(--display); font-weight: 700; font-size: 14px; color: #e6dbff; white-space: nowrap; }

  .tabs { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1px rgba(217, 178, 106, .32); }
  .tabs button { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; border: 0; border-radius: 8px;
    background: transparent; color: #d8cfe4; font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: .03em; white-space: nowrap; }
  .tabs button.sel { background: linear-gradient(180deg, #f6d995, #c69440); color: #2a1906; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 #5a3e14; }
  .tabs .flash-hurt { animation: tabHurt .8s ease-out; }
  .tabs .flash-heal { animation: tabHeal .9s ease-out; }
  .badge { font-style: normal; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; display: inline-grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 11.5px; line-height: 1; }
  .badge.atk { color: #fff3dc; background: radial-gradient(circle at 35% 30%, #ff8a6a, #b3262f 60%, #5e0c14); }
  .badge.inf { color: #4a2f06; background: radial-gradient(circle at 35% 30%, #fff5c8, #e9b84a 55%, #8f6216); }
  .badge.hp { color: #ffd6dc; background: rgba(216, 54, 74, .22); box-shadow: inset 0 0 0 1px rgba(255, 106, 122, .45); }
  .tabs button.sel .badge.hp { color: #7a1020; background: rgba(255, 255, 255, .45); }
  .badge.hp.low, .tabs button.sel .badge.hp.low { color: #fff; background: var(--blood); animation: pulse 1.4s ease-in-out infinite; }
  .badge.warn { color: #fff; background: var(--blood); }

  /* doar fila aleasă e pe ecran; locația are bara ei sus */
  .board .locz, .board .zone[class*="tab-"], .board .pwarn { display: none; }
  .board[data-tab="board"] .tab-board, .board[data-tab="market"] .tab-market,
  .board[data-tab="heroes"] .tab-heroes, .board[data-tab="log"] .tab-log { display: block; }
  .board[data-tab="board"] .pwarn { display: grid; gap: 6px; }
  .pwarn .warn { padding: 5px 8px; font-size: 12.5px; }

  .zone { padding: 32px 10px 10px; }
  .zone > .zl { top: 9px; left: 14px; right: 14px; }
  .zone > .zl b { font-size: 13px; letter-spacing: .12em; }
  .zone > .zl small { display: block; font-size: 11px; }
  .zone::after { background-size: 20px, 20px, 20px, 20px; }

  .events { gap: 7px; }
  .ev-card { grid-template-columns: 44px 1fr; gap: 8px; padding: 5px 8px 5px 5px; }
  .ev-card .e-art { width: 44px; height: 44px; }
  .ev-card b { font-size: 13px; }
  .ev-card span { font-size: 12.5px; line-height: 1.25; }
  .die { margin-top: 8px; padding: 5px 9px; gap: 8px; font-size: 12.5px; }
  .die .cube { width: 30px; height: 30px; font-size: 15px; }

  .mwrap { --cw: min(118px, calc((100vw - 60px) / 3)); --ch: calc(var(--cw) * 1.4375); }
  .market { display: grid; grid-template-columns: repeat(3, var(--cw)); justify-content: space-evenly; gap: 14px 8px; overflow: visible; padding: 10px 0 2px; }
  .mhint { margin-top: 10px; font-size: 12.5px; text-align: center; }
  .logbox { max-height: max(200px, calc(100dvh - var(--dock-h) - 160px)); }

  /* mâna: butonul de arătat/ascuns */
  .hand-toggle { display: inline-block; justify-self: center; font-family: var(--caps); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; color: var(--gold-hi);
    background: rgba(22, 17, 34, .95); border: 1px solid rgba(217, 178, 106, .6); border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
  .hand-toggle.none { color: var(--muted); background: none; border-color: transparent; cursor: default; font-family: inherit; font-style: italic; font-weight: 400; letter-spacing: 0; }
  .dock:not(.slim) .hand-toggle { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); z-index: 3; padding: 3px 14px; font-size: 11.5px; }
  .dock:not(.slim) .hand-toggle.none { display: none; }
  .dock.slim .hand { display: none; }

  /* lobby */
  .lobby { gap: 14px; padding-top: 12px; padding-bottom: 0; }
  .lobby-zones { gap: 18px; }
  .lobby header { gap: 8px; }
  .lobby header .logo { font-size: 30px; }
  .lobby header .status { font-size: 13.5px; }
  .share { gap: 12px; flex-wrap: nowrap; font-size: 13.5px; }
  .share .qr svg { width: 76px; height: 76px; }
  .share .url { font-size: 17px; }
  .pchip { padding: 5px 10px; font-size: 14px; }
  .hero-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; }
  .htile .ht-art { border-radius: 10px; }
  .htile .ht-name { margin-top: 5px; font-size: 13px; }
  .htile .ht-role { font-size: 9.5px; letter-spacing: .03em; }
  .htile .ht-who { font-size: 10.5px; padding: 2px 3px; }
  .htile.mine .ht-art::after { top: 4px; right: 4px; width: 18px; height: 18px; font-size: 11px; }
  .hero-sel { margin-top: 12px; font-size: 14px; }
  .chapters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
  .chap { padding: 0; border: 0; border-radius: 50%; background: none; }
  .chap .nm, .chap .meta { display: none; }
  .chap .num { width: 40px; height: 40px; font-size: 16px; }
  .chap.sel { background: none; box-shadow: none; }
  .chap.sel .num { box-shadow: 0 0 0 2px #1a0e06, 0 0 0 4px var(--gold-hi), 0 0 16px rgba(246, 210, 140, .6); }
  .chap:disabled { opacity: .5; }
  .chap.sel:disabled { opacity: 1; }
  .chap-intro { margin-top: 10px; font-size: 14px; }
  .chap-title { font-size: 15px; }
  .seg button { padding: 8px 12px; font-size: 14px; }
  .startbar { position: sticky; bottom: 0; z-index: 10; justify-content: center; margin: 0 calc(var(--gutter-r) * -1) 0 calc(var(--gutter) * -1);
    padding: 14px var(--gutter-r) calc(12px + env(safe-area-inset-bottom)) var(--gutter); background: linear-gradient(180deg, rgba(6, 6, 14, 0), rgba(6, 6, 14, .94) 35%); }
  .startbar .btn { flex: 1; max-width: 420px; }
  .backdrop { padding: 10px; }
  .sheet.hero-sheet { padding-bottom: 14px; gap: 10px; }
  .hero-sheet .hs-body { padding: 0 14px; gap: 6px; }
  .hero-sheet h2 { font-size: 21px; }
  .hero-sheet .blurb { font-size: 14.5px; }
  .hero-sheet .ab { font-size: 13.5px; }
  .hero-sheet .opts { padding: 0 14px; }
  .hero-sheet .opts .btn { flex: 1; min-width: 0; }
}

/* ---------- telefon vertical: două rânduri sus (locația + tura, apoi filele) ---------- */
@media (max-width: 760px) and (orientation: portrait), (max-width: 760px) and (min-height: 561px) {
  :root { --cw: 88px; --ch: 127px; --dock-h: calc(204px + env(safe-area-inset-bottom)); }
  .dock.slim, body:has(.dock.slim) { --dock-h: calc(56px + env(safe-area-inset-bottom)); }
  /* grilă, nu flex: pe iPhone Pro (393 px) bula „Tura …” rămâne lângă locație, iar locația se scurtează cu „…” */
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "loc flag fs" "tabs tabs tabs"; align-items: center; gap: 6px 0; padding-top: 6px; padding-bottom: 6px; }
  .topbar .hud { display: contents; }
  .topbar .locbar { grid-area: loc; }
  .topbar .turnflag { grid-area: flag; margin-left: 8px; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn.icon { grid-area: fs; margin-left: 6px; }
  .topbar .tabs { grid-area: tabs; }
  #toasts { top: 96px; left: 10px; right: 10px; }
  .toast { max-width: none; }

  .board { gap: 14px; margin-top: 8px; }
  .board .pwarn { order: 0; } .board .evpanel { order: 1; } .board .vwrap { order: 2; } .board .playedpanel { order: 3; }

  .villains { gap: 12px; }
  .villain { grid-template-columns: 28% minmax(0, 1fr); padding: 4px; }
  .villain .v-dmg { display: none; }
  .villain .v-art { min-height: 0; }
  .villain .v-plate { padding: 4px 6px; }
  .villain h3 { font-size: 14px; }
  .villain .v-hp { min-width: 32px; height: 32px; font-size: 15px; }
  .villain .v-dmg { gap: 3px; padding: 5px 6px; }
  .villain .v-dmg i { width: 13px; height: 12px; }
  .villain .v-text { gap: 4px; padding: 6px 8px; font-size: 12px; line-height: 1.3; }
  .villain .v-text b { font-size: 10px; }
  .villain .hits { padding: 6px 0 0; }
  .villain .hits .btn { padding: 7px 8px; font-size: 13px; }
  .villain .v-guard { top: 10px; left: 10px; translate: none; max-width: calc(28% - 12px); white-space: normal; text-align: center; font-size: 10px; line-height: 1.2; padding: 4px 6px; border-radius: 8px; }
  .vslot-empty { min-height: 70px; }

  .dock { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .pile { grid-auto-flow: column; align-items: center; gap: 4px; }
  .pile small { display: none; }
  .pile .stack { width: 34px; height: 34px; }
  .pile .stack i { width: 34px; height: 29px; }
  .pile.inf .stack i { width: 31px; height: 31px; left: 1px; }
  .pile .stack b { font-size: 17px; }
  .hand { padding: 12px 8px 2px; }
  .dock.slim { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; gap: 10px; padding-top: 7px; padding-bottom: calc(7px + env(safe-area-inset-bottom)); }
  .dock.slim .res { grid-column: 1; grid-row: 1; }
  .dock.slim .hand-wrap { grid-column: 2; grid-row: 1; }
  .dock.slim .actions { grid-column: 3; grid-row: 1; grid-template-columns: auto; }
  .dock.slim .actions .btn:not(.end-turn) { display: none; }
}

/* ---------- telefon orizontal: un singur rând sus; Lupta are evenimentele în stânga și răufăcătorii în dreapta ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --dock-h: calc(138px + env(safe-area-inset-bottom)); }
  .dock.slim, body:has(.dock.slim) { --dock-h: calc(48px + env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; padding-top: 5px; padding-bottom: 5px; }
  .topbar .hud { flex: 1 1 auto; gap: 10px; }
  .topbar .locbar { flex: 0 1 310px; padding: 3px 9px; }
  .topbar .tabs { flex: 1 1 auto; max-width: 440px; }
  #toasts { top: 50px; }

  .board { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
  .board .col { gap: 12px; }
  .board[data-tab="board"] .col.right { display: none; }
  .board:not([data-tab="board"]) { grid-template-columns: minmax(0, 1fr); }
  .board:not([data-tab="board"]) .col.left,
  .board[data-tab="market"] .col.right, .board[data-tab="heroes"] .col.center, .board[data-tab="log"] .col.center { display: none; }
  .board .col.right { grid-column: auto; }

  .villains { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .villain, .vslot-empty { width: 100%; max-width: 230px; justify-self: center; }
  .villain { grid-template-columns: 1fr; padding: 4px; }
  .villain .v-art { grid-row: auto; aspect-ratio: 16 / 7.5; min-height: 0; border-radius: 9px 9px 2px 2px; }
  .villain .v-dmg { display: none; }
  .villain .v-text { border-radius: 0 0 9px 9px; font-size: 11.5px; }
  .villain .v-guard { top: 8px; width: max-content; max-width: calc(100% - 20px); white-space: normal; text-align: center; font-size: 10px; padding: 3px 8px; }
  .vslot-empty { min-height: 90px; }

  .mwrap { --cw: min(104px, calc((100vw - 2 * var(--gutter) - 70px) / 6)); }
  .market { grid-template-columns: repeat(6, var(--cw)); justify-content: space-between; gap: 8px; }
  .mwrap .card .c-title { font-size: max(8.5px, calc(var(--cw) * .083)); }
  .mwrap .card .c-text { font-size: max(8px, calc(var(--cw) * .082)); line-height: 1.17; padding: calc(var(--cw) * .03) calc(var(--cw) * .05); }

  .board .col.right .heroes, .heroes { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .hero .ab { display: block; font-size: 11.5px; }
  .hand { padding: 8px 8px 2px; }

  .hero-tiles { grid-template-columns: repeat(4, minmax(0, 118px)); justify-content: start; gap: 12px 18px; }
  .sheet.hero-sheet { width: min(720px, 100%); grid-template-columns: 38% minmax(0, 1fr); gap: 0 16px; padding: 0; align-items: start; }
  .hero-sheet .hs-art { grid-row: 1 / span 2; align-self: stretch; aspect-ratio: auto; min-height: 240px; box-shadow: 2px 0 0 var(--hc); }
  .hero-sheet .hs-art::after { display: none; }
  .hero-sheet .hs-body { padding: 14px 16px 0 0; }
  .hero-sheet .opts { padding: 10px 16px 14px 0; justify-content: flex-start; }
}

/* =====================================================================
   Zonele „sigure” ale telefonului (ceas/baterie sus, bara de acasă jos, colțurile rotunjite).
   Pe calculator toate sunt 0.
   ===================================================================== */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.conn { padding-top: calc(8px + var(--sat)); }
.join { padding-top: max(32px, calc(var(--sat) + 16px)); }
.lobby { padding-top: calc(24px + var(--sat)); }

/* =====================================================================
   TELEFON — ecranul de joc e ca o aplicație: pagina nu mai derulează (deci nimic nu mai
   intră sub ceasul telefonului); derulează doar masa dintre bara de sus și bara de jos.
   ===================================================================== */
@media (max-width: 760px), (orientation: landscape) and (max-height: 560px) {
  :root { --pad-l: max(10px, calc(var(--sal) - 12px)); --pad-r: max(10px, calc(var(--sar) - 12px)); }
  .lobby { padding-top: calc(12px + var(--sat)); }
  .backdrop { padding: calc(8px + var(--sat)) calc(8px + var(--sar)) calc(8px + var(--sab)) calc(8px + var(--sal)); }
  .sheet { max-height: calc(100dvh - var(--sat) - var(--sab) - 16px); }

  body.in-game { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  body.in-game #app { height: 100dvh; display: flex; flex-direction: column; }
  body.in-game .topbar { position: relative; flex: none; padding-top: calc(6px + var(--sat)); padding-left: var(--pad-l); padding-right: var(--pad-r); }
  body.in-game .board { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    width: auto; max-width: none; margin: 0; padding: 10px var(--pad-r) 18px var(--pad-l); align-content: start; }
  body.in-game .board .zone, body.in-game .board .pwarn { flex-shrink: 0; }
  .zone > .zl b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  body.in-game .dock { position: relative; flex: none; height: auto; padding-left: var(--pad-l); padding-right: var(--pad-r); }
}

/* vertical: bara de sus coboară sub ceas; mâna rămâne jos, în bara ei */
@media (max-width: 760px) and (orientation: portrait), (max-width: 760px) and (min-height: 561px) {
  body.in-game .board { padding-bottom: 30px; }
  body.in-game .dock { padding-bottom: calc(8px + var(--sab)); }
  body.in-game .dock.slim { padding-bottom: calc(7px + var(--sab)); }
  #toasts { top: calc(var(--sat) + 100px); }
}

/* orizontal: butoanele și resursele stau într-o coloană în dreapta, iar mâna e un sertar
   care se ridică peste masă; când n-ai cartonașe (sau îl ascunzi) masa e liberă și încape tot */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --side: 124px; --cw: 80px; --ch: 116px; }
  body.in-game #app { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  body.in-game .topbar { grid-column: 1 / -1; grid-row: 1; }
  body.in-game .board { grid-column: 1; grid-row: 2; padding: 8px 10px 14px var(--pad-l); }
  body.in-game .board[data-tab="board"] { grid-template-columns: minmax(140px, 168px) minmax(0, 1fr); gap: 10px; }

  body.in-game .dock { grid-column: 2; grid-row: 2; width: calc(var(--side) + var(--pad-r)); display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 10px;
    padding: 10px var(--pad-r) calc(10px + var(--sab)) 10px; background: linear-gradient(90deg, rgba(10, 9, 20, .93), rgba(4, 4, 10, .98));
    border-left: 1px solid rgba(217, 178, 106, .35); box-shadow: -10px 0 24px rgba(0, 0, 0, .45); }
  body.in-game .dock::before, body.in-game .dock::after { display: none; }
  body.in-game .dock .res .piles { flex-direction: column; gap: 8px; }
  body.in-game .dock .pile small { display: block; }
  body.in-game .dock .actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  body.in-game .dock .actions .btn { padding: 9px 6px; font-size: 12.5px; white-space: normal; }
  body.in-game .dock .actions .btn.end-turn { font-size: 13.5px; padding: 11px 6px; }
  body.in-game .dock.slim .hand-toggle { display: block; width: 100%; padding: 7px 4px; font-size: 11.5px; letter-spacing: 0; white-space: normal; text-align: center; }
  body.in-game .board .col.left .zone > .zl b { font-size: 11px; letter-spacing: .05em; }
  body.in-game .board .col.left .zone > .zl small { display: none; }
  body.in-game .dock.slim .hand-toggle.none { font-size: 12px; padding: 0; }
  /* sertarul cu mâna */
  body.in-game .dock:not(.slim) .hand-wrap { position: fixed; z-index: 31; left: 0; right: calc(var(--side) + var(--pad-r)); bottom: 0; display: block;
    padding: 14px 10px calc(4px + var(--sab)) var(--pad-l); background: linear-gradient(180deg, rgba(12, 10, 24, .97), rgba(4, 4, 10, .99));
    border-top: 1px solid rgba(217, 178, 106, .55); box-shadow: 0 -14px 30px rgba(0, 0, 0, .6); }
  body.in-game .dock:not(.slim) .hand-toggle { top: -13px; }
  body.in-game .dock:not(.slim) .hand { padding: 8px 8px 2px; }
  body.in-game:has(.dock:not(.slim)) .board { padding-bottom: calc(var(--ch) + 44px + var(--sab)); }
  body.in-game .waiting { bottom: calc(12px + var(--sab)); }

  /* Lupta: evenimentele într-o coloană îngustă, răufăcătorii mai scunzi ca să încapă pe ecran */
  body.in-game .ev-card { grid-template-columns: 36px 1fr; gap: 6px; padding: 4px 6px 4px 4px; }
  body.in-game .ev-card .e-art { width: 36px; height: 36px; }
  body.in-game .ev-card b { font-size: 12px; }
  body.in-game .ev-card span { font-size: 11.5px; line-height: 1.2; }
  body.in-game .chip { font-size: 12px; padding: 3px 8px 3px 3px; }
  body.in-game .chip .ci { width: 18px; height: 18px; }
  body.in-game .zone.vwrap { padding-top: 30px; }
  body.in-game .villains { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
  body.in-game .villain, body.in-game .vslot-empty { max-width: 220px; }
  body.in-game .villain .v-art { aspect-ratio: 16 / 6.5; }
  body.in-game .villain .v-plate { padding: 4px 6px; }
  body.in-game .villain h3 { font-size: 12.5px; }
  body.in-game .villain .v-hp { min-width: 28px; height: 28px; font-size: 13px; }
  body.in-game .villain .v-text { gap: 4px; padding: 5px 7px; font-size: 11px; line-height: 1.25; }
  body.in-game .villain .v-text b { font-size: 9.5px; }
  /* butoanele de atac stau peste partea de jos a portretului, ca să nu lungească cartonașul */
  body.in-game .villain .v-art { grid-row: 1; grid-column: 1; }
  body.in-game .villain .hits { grid-row: 1; grid-column: 1; align-self: end; z-index: 2; gap: 5px; padding: 0 6px 6px; }
  /* „Jucate în tură” pe orizontal: doar iconițele cartonașelor, ca să nu lungească coloana */
  body.in-game .board .col.left .played { gap: 5px; }
  body.in-game .board .col.left .chip { gap: 0; padding: 2px; font-size: 0; }
  body.in-game .board .col.left .chip .ci { width: 28px; height: 28px; font-size: 14px; }
  body.in-game .villain .hits .btn { padding: 5px 4px; font-size: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 #5a3e14, 0 4px 12px rgba(0, 0, 0, .7); }
  body.in-game .mwrap { --cw: min(104px, calc((100vw - var(--side) - var(--pad-l) - var(--pad-r) - 90px) / 6)); }
}

/* ---- mecanici noi: Împietrire, rezervă, efecte active în tură ---- */
.villain.stoned .v-art .living { filter: grayscale(.85) sepia(.25) brightness(.8) contrast(1.05); }
.villain.stoned .v-art::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(135deg, rgba(200, 190, 170, .10) 0 6px, transparent 6px 14px);
  box-shadow: inset 0 0 0 2px rgba(205, 195, 175, .7), inset 0 0 30px rgba(120, 110, 95, .55); }
.villain .v-guard.v-stone { top: auto; bottom: 10px; left: 50%; translate: -50% 0; width: max-content; max-width: calc(100% - 20px);
  color: #2b2418; background: rgba(222, 212, 190, .94); border-color: rgba(90, 76, 56, .7); }
.villain .v-art .v-guard.v-stone { z-index: 3; }
.hero .bank { grid-column: 1 / -1; margin-top: 4px; font-size: 12px; font-weight: 700; color: #6b4a12;
  background: rgba(232, 181, 46, .18); border: 1px dashed rgba(160, 120, 40, .55); border-radius: 8px; padding: 3px 8px; width: fit-content; }
.teffects { list-style: none; margin: 8px 0 0; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; line-height: 1.35;
  background: rgba(79, 141, 224, .12); border: 1px solid rgba(79, 141, 224, .35); color: var(--ink-soft); }
.teffects li + li { margin-top: 3px; }
.sheet .opts .btn .vopt { display: block; font-size: 11.5px; font-weight: 400; opacity: .85; margin-top: 2px; text-transform: none; letter-spacing: 0; }

/* =====================================================================
   CAMERE DE JOC — ecranul de intrare cu lista camerelor, butoanele gazdei
   ===================================================================== */
.join #nameForm { flex-direction: column; align-items: center; gap: 6px; }
.join .name-lbl { font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.rooms { width: min(560px, 100%); margin: 10px auto 0; display: grid; gap: 12px; text-align: left; }
.rooms-head { display: grid; gap: 2px; text-align: center; }
.rooms-head b { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 1px 0 #000, 0 0 12px rgba(246, 210, 140, .25); }
.rooms-head b::after { content: ''; display: block; width: 140px; height: 1px; margin: 5px auto 0; background: linear-gradient(90deg, transparent, rgba(217, 178, 106, .85), transparent); }
.rooms-head small { color: var(--muted); font-style: italic; font-size: 14px; }
.rooms-list { display: grid; gap: 14px; }
.rooms-list > .status { text-align: center; font-style: italic; padding: 4px; text-shadow: 0 1px 2px #000; }
.room-card { position: relative; display: grid; gap: 9px; padding: 13px 14px 13px 22px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 24, 50, .93), rgba(9, 10, 22, .96));
  box-shadow: 0 0 0 1px rgba(233, 207, 143, .55), 0 0 0 4px rgba(10, 8, 6, .85), 0 0 0 5px rgba(217, 178, 106, .25), 0 14px 30px rgba(0, 0, 0, .55); }
/* semnul de carte din stânga: auriu = poți intra, violet = partidă în desfășurare */
.room-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: linear-gradient(180deg, #f6d995, #a8762a); box-shadow: 1px 0 0 rgba(0, 0, 0, .5); }
.room-card.busy::before { background: linear-gradient(180deg, #c3aaff, #4a2a8a); }
.room-card.invited { padding-top: 34px; box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 5px rgba(10, 8, 6, .85), 0 0 26px rgba(246, 210, 140, .45), 0 14px 30px rgba(0, 0, 0, .55); }
.rc-inv { position: absolute; top: 0; left: 7px; right: 0; padding: 4px 14px; font-family: var(--caps); font-weight: 800; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: #2a1906; background: linear-gradient(90deg, #f6d995, #d6a64c 60%, rgba(214, 166, 76, 0)); }
.rc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.rc-head b { font-family: var(--caps); font-weight: 800; font-size: 18px; color: var(--gold-hi); }
.rc-head small { font-size: 13.5px; color: var(--muted); }
.room-card.busy .rc-head small { color: #cdbaff; }
.rc-who { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-who span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13.5px; color: var(--muted); background: rgba(255, 255, 255, .05); border: 1px solid rgba(217, 178, 106, .22); }
.rc-who span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5d5868; }
.rc-who span.on { color: var(--text); }
.rc-who span.on::before { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.rc-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rc-act .btn { padding: 8px 16px; font-size: 14px; }
.rc-act .status { font-size: 13.5px; font-style: italic; min-height: 0; }
.rooms .new-room { justify-self: center; margin-top: 4px; }

/* lobby și jurnal: butoanele gazdei */
.lobby-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.room-name { color: var(--gold-hi); font-family: var(--caps); font-weight: 800; }
.btn.ghost.danger-ghost { color: #ffb3bd; border-color: rgba(255, 120, 140, .5); }
.host-btns { display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(217, 178, 106, .3); }
.host-btns b { font-family: var(--caps); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.logpanel .host-btns .abandon { margin-top: 0; }

/* „Jucate în tură”: cartonașele sunt butoane — atingi și vezi cartonașul întreg */
button.chip { border: 0; margin: 0; font-family: inherit; line-height: 1.2; text-align: left; cursor: pointer; transition: transform .12s, filter .12s; }
button.chip:hover { filter: brightness(1.06); transform: translateY(-1px); }
button.chip:active { transform: scale(.95); }
.hint-sm { margin-top: 8px; font-size: 12px; font-style: italic; color: var(--muted); }

/* fila Piață: câte cartonașe îți permiți — verde, ca să nu se confunde cu monedele de influență (galbene) */
.badge.buy { color: #053620; background: radial-gradient(circle at 35% 30%, #d2ffe6, #4fdc96 55%, #178452); box-shadow: inset 0 0 0 1px rgba(6, 70, 40, .45), 0 0 6px rgba(87, 211, 154, .45); }

/* glisarea între file */
.board.slide-l { animation: slideInL .26s cubic-bezier(.2, .8, .3, 1); }
.board.slide-r { animation: slideInR .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes slideInL { from { opacity: .25; transform: translateX(40px); } }
@keyframes slideInR { from { opacity: .25; transform: translateX(-40px); } }

/* în joc documentul nu derulează deloc (doar masa), ca nimic să nu alunece sub ceasul telefonului */
html:has(body.in-game) { height: 100%; overflow: hidden; overscroll-behavior: none; }

/* =====================================================================
   iPhone în Safari (iOS 26+), vertical: pagina începe sub ceas și baterie, unde Safari
   estompează tot, iar env(safe-area-inset-top) dă 0. app.js pune clasa html.ios-browser și
   --sat-ios (înălțimea barei de stare). O fâșie fixă, opacă, stă sub ceas (Safari o folosește
   ca să coloreze bara de stare), iar bara de sus a jocului coboară sub ea, cu titlul jocului
   pe primul rând — acolo unde Safari mai poate estompa puțin marginea.
   ===================================================================== */
.sbar { display: none; }
@media (orientation: portrait) {
  html.ios-browser { --sat: var(--sat-ios, 59px); }
  html.ios-browser .sbar { display: block; position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: var(--sat); background-color: #07070f; }
}
@media (max-width: 760px) and (orientation: portrait), (max-width: 760px) and (min-height: 561px) {
  html.ios-browser body.in-game .topbar { grid-template-areas: "title title title" "loc flag fs" "tabs tabs tabs"; padding-top: var(--sat); }
  html.ios-browser body.in-game .topbar .title { display: block; grid-area: title; justify-self: center; padding: 3px 0 1px; font-size: 15px; letter-spacing: .06em; }
  html.ios-browser #toasts { top: calc(var(--sat) + 122px); }
}

/* =====================================================================
   TELEFON ORIZONTAL (refăcut): mâna e o fâșie joasă de cartonașe late, cu text lizibil, care
   nu mai acoperă jumătate de ecran; butonul „Arată / Ascunde mâna” stă mereu în coloana din
   dreapta; răufăcătorii sunt mai compacți (numele peste portret, etichetele pe același rând),
   ca abilitatea și recompensa să se vadă deasupra mâinii.
   ===================================================================== */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --side: 120px; --hand-card-w: 196px; --hand-card-h: 84px; }
  body.in-game { --hand-h: calc(var(--hand-card-h) + 16px + max(6px, calc(var(--sab) - 10px))); }

  /* coloana din dreapta: resursele sus, butonul pentru mână, apoi acțiunile */
  body.in-game .dock { justify-content: space-between; gap: 8px; padding-top: 10px; }
  body.in-game .dock .hand-wrap { display: block; }
  body.in-game .dock .hand-wrap .lbl { display: none; }
  body.in-game .dock .hand-toggle, body.in-game .dock:not(.slim) .hand-toggle { position: static; transform: none; display: block; width: 100%; padding: 7px 4px;
    font-size: 11.5px; letter-spacing: 0; white-space: normal; text-align: center; }
  body.in-game .dock:not(.slim) .hand-toggle { background: linear-gradient(180deg, #f6d995, #c69440); color: #2a1906; border-color: #5a3e14; }
  body.in-game .dock .hand-toggle.none { padding: 0; font-size: 12px; }

  /* mâna: doar rândul de cartonașe e fix, jos, la stânga coloanei */
  body.in-game .dock:not(.slim) .hand-wrap { position: static; padding: 0; background: none; border: 0; box-shadow: none; }
  body.in-game .dock:not(.slim) .hand { position: fixed; z-index: 31; left: 0; right: calc(var(--side) + var(--pad-r)); bottom: 0; height: var(--hand-h);
    display: flex; align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain;
    padding: 8px 10px max(6px, calc(var(--sab) - 10px)) var(--pad-l);
    background: linear-gradient(180deg, rgba(14, 12, 28, .97), rgba(4, 4, 10, .99)); border-top: 1px solid rgba(217, 178, 106, .55); box-shadow: 0 -12px 26px rgba(0, 0, 0, .55); }
  body.in-game .dock:not(.slim) .hand > :first-child { margin-left: 0; }
  body.in-game:has(.dock:not(.slim)) .board { padding-bottom: calc(var(--hand-h) + 12px); }

  /* cartonașul din mână, culcat: ilustrația în stânga, titlul și textul întreg în dreapta */
  body.in-game .hand .card { --cw: var(--hand-card-w); width: var(--hand-card-w); height: var(--hand-card-h); padding: 3px; border-radius: 10px; transform: none; margin: 0; }
  body.in-game .hand .card + .card { margin-left: 0; }
  body.in-game .hand .card.playable:hover { transform: translateY(-2px) !important; }
  body.in-game .hand .card .c-in { display: grid; grid-template-columns: 54px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border-radius: 7px; }
  body.in-game .hand .card .c-art { grid-row: 1 / span 2; grid-column: 1; aspect-ratio: auto; height: 100%; }
  body.in-game .hand .card .c-art .emb { font-size: 24px; }
  body.in-game .hand .card .c-type { display: none; }
  body.in-game .hand .card .c-title { grid-column: 2; padding: 4px 6px 3px; font-size: 11.5px; text-align: left; }
  body.in-game .hand .card .c-text { grid-column: 2; place-items: start; text-align: left; padding: 3px 6px 2px; font-size: 10.5px; line-height: 1.2; }

  /* răufăcătorii: portret scund cu numele și viața peste el; butoanele de atac sus, pe portret */
  body.in-game .board[data-tab="board"] { grid-template-columns: minmax(128px, 150px) minmax(0, 1fr); }
  body.in-game .zone.vwrap { padding: 26px 6px 6px; }
  body.in-game .zone.vwrap > .zl { top: 7px; }
  body.in-game .villains { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
  body.in-game .villain, body.in-game .vslot-empty { max-width: 240px; }
  body.in-game .villain { padding: 3px; }
  body.in-game .villain .v-art { grid-row: 1; grid-column: 1; aspect-ratio: 16 / 7; border-radius: 9px 9px 2px 2px; }
  body.in-game .villain .v-plate { grid-row: 1; grid-column: 1; align-self: end; z-index: 1; padding: 12px 6px 4px; border-top: 0; border-radius: 0;
    background: linear-gradient(180deg, transparent, rgba(10, 7, 4, .88) 48%); }
  body.in-game .villain.boss .v-plate { background: linear-gradient(180deg, transparent, rgba(18, 8, 34, .9) 48%); }
  body.in-game .villain h3 { font-size: 12.5px; text-shadow: 0 1px 2px #000; }
  body.in-game .villain .v-hp { min-width: 26px; height: 26px; font-size: 13px; }
  body.in-game .villain .hits { grid-row: 1; grid-column: 1; align-self: start; z-index: 2; gap: 5px; padding: 5px 5px 0; }
  body.in-game .villain .v-text { gap: 3px; padding: 5px 7px; font-size: 11px; line-height: 1.24; }
  body.in-game .villain .v-text b { display: inline; margin-right: 4px; font-size: 9px; letter-spacing: .08em; }
  body.in-game .villain .v-text .rw { padding-top: 3px; }
  body.in-game .villain .v-guard { top: 5px; }
  body.in-game .villain .v-guard.v-stone { top: 5px; bottom: auto; }
  body.in-game .vslot-empty { min-height: 80px; font-size: 12px; }

  /* evenimentele: coloană îngustă */
  body.in-game .board .col.left .zone { padding: 26px 6px 6px; }
  body.in-game .board .col.left .zone > .zl { top: 7px; left: 10px; right: 10px; }

  /* mesajul „Așteptăm alegerea…” sus, ca să nu acopere textul răufăcătorilor */
  body.in-game .waiting { top: 50px; bottom: auto; }
}

/* intrarea pe telefon orizontal: titlul în stânga, numele și camerele în dreapta (fără să derulezi ca să le vezi) */
@media (orientation: landscape) and (max-height: 560px) {
  .join { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-auto-rows: auto; align-content: center; align-items: start; gap: 8px 28px;
    padding: 14px max(16px, var(--sar)) calc(14px + var(--sab)) max(16px, var(--sal)); }
  .join .crest { grid-column: 1; grid-row: 1; width: 62px; height: 72px; }
  .join .logo { grid-column: 1; grid-row: 2; font-size: 42px; }
  .join .tag { grid-column: 1; grid-row: 3; font-size: 14px; margin-bottom: 0; }
  .join #nameForm { grid-column: 2; grid-row: 1; }
  .join .rooms { grid-column: 2; grid-row: 2 / span 3; margin-top: 2px; width: 100%; }
  .join input { min-width: 0; width: min(320px, 100%); padding: 9px 14px; font-size: 16px; }
}
