/* Big screen: a fixed 1920x1080 stage scaled to fit any TV / projector / laptop */
:root {
  --gold: #ffcf5a;
  --gold-deep: #c98a1a;
  --ink: #fff7e8;
  --panel: rgba(28, 16, 8, 0.78);
  --panel-edge: rgba(255, 207, 90, 0.35);
  --good: #6fe36f;
  --bad: #ff5a4a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0604; overflow: hidden; }
body { font-family: Rubik, system-ui, sans-serif; color: var(--ink); }
#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; background: #000; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* name tags live under the HUD (cards, banners, panels always win), and step back while a big card is up */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: opacity 0.25s; }
#labels.dim, #labels.dim-b, #labels.dim-p { opacity: 0; }
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
#hud button, #lobby { pointer-events: auto; }
.hidden { display: none !important; }

/* name tags over the 3D heroes */
.hero-tag { font: 600 21px Rubik, sans-serif; color: #fff; background: rgba(20, 10, 4, 0.72); border: 1px solid var(--panel-edge); padding: 3px 12px 3px 10px; border-radius: 14px; white-space: nowrap; display: flex; gap: 8px; align-items: center; text-shadow: 0 1px 2px #000; }
.hero-tag .lvl { background: var(--gold); color: #3a1c00; border-radius: 10px; padding: 0 8px; font-weight: 800; }
.mon-tag { border-color: rgba(255, 90, 74, 0.6); }
.mon-tag .lvl { background: #ff6a4a; color: #fff; }
.hero-tag.dead { opacity: 0.5; text-decoration: line-through; }
.hero-tag.free { opacity: 0.75; }
.hero-tag .free-t { font-weight: 500; font-size: 17px; color: #e7cfa6; }
.hero-tag.active { border: 2px solid var(--gold); background: rgba(60, 32, 6, 0.85); }
.float-num { font: 900 54px Rubik, sans-serif; color: var(--gold); text-shadow: 0 3px 0 #5a2a00, 0 0 18px rgba(0, 0, 0, 0.8); white-space: nowrap; }
.float-num.bad { color: var(--bad); text-shadow: 0 3px 0 #4a0000, 0 0 18px rgba(0, 0, 0, 0.8); }
.float-num.good { color: var(--good); text-shadow: 0 3px 0 #0a3a0a, 0 0 18px rgba(0, 0, 0, 0.8); }
.float-num.small { font-size: 34px; }
.speech { font: 600 26px Rubik, sans-serif; background: #fff8e8; color: #2a1606; padding: 8px 16px; border-radius: 18px; box-shadow: var(--shadow); white-space: nowrap; }

/* players bar */
#players { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 12px; justify-content: center; }
.pcard { position: relative; width: 290px; height: 112px; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 18px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; box-shadow: var(--shadow); backdrop-filter: blur(4px); transition: transform 0.3s, border-color 0.3s; }
.pcard.active { border: 3px solid var(--gold); transform: translateY(4px) scale(1.05); background: rgba(52, 28, 8, 0.9); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6); }
.pcard.dead .face { filter: grayscale(1) brightness(0.6); }
.pcard .face { width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--c, var(--gold)); background: #2a1608 center/cover no-repeat; flex: none; }
.pcard .info { flex: 1; min-width: 0; }
.pcard .name { font: 700 24px Rubik, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; } /* clear of the level badge */
.pcard .tags { font-size: 16px; color: #f2dcb5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 20px; }
.pcard .row { display: flex; gap: 12px; margin-top: 4px; font-size: 18px; color: #f8e6c4; align-items: center; }
.pcard .row b { color: #fff; }
.pcard .lvl { position: absolute; right: -8px; top: -10px; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 45%, var(--gold-deep)); color: #3a1c00; font: 900 28px Rubik, sans-serif; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.pcard .ring { position: absolute; inset: -3px; border-radius: 20px; pointer-events: none; }
.pcard .timebar { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.pcard .timebar i { display: block; height: 100%; background: var(--gold); width: 100%; }
.pcard .curse { color: #d6a2ff; }

/* combat meter */
#meter { position: absolute; top: 210px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 22px; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 26px; padding: 10px 30px; box-shadow: var(--shadow); }
#meter .side { display: flex; align-items: center; gap: 12px; }
#meter .lbl { font: 700 20px Rubik, sans-serif; letter-spacing: 2px; color: #f2dcb5; }
#meter b { font: 900 64px Rubik, sans-serif; min-width: 70px; text-align: center; }
#meter .heroes b { color: #9fe3ff; }
#meter .monsters b { color: #ff9a7a; }
#meter .vs { font-size: 46px; }
#meter.winning { border: 3px solid var(--good); }
#meter.losing { border: 3px solid var(--bad); }
#m-stage { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); font: 700 22px Rubik, sans-serif; color: var(--gold); white-space: nowrap; text-shadow: 0 2px 4px #000; }

/* big banners */
#banner { position: absolute; left: 0; right: 0; top: 400px; text-align: center; font: 400 120px Lobster, Georgia, serif; color: var(--gold); text-shadow: 0 6px 0 #5a2a00, 0 0 40px rgba(0, 0, 0, 0.9); opacity: 0; white-space: nowrap; }
#banner small { display: block; font: 700 40px Rubik, sans-serif; color: var(--ink); text-shadow: 0 3px 8px #000; }

/* card reveal */
#cardzone { position: absolute; inset: 0; perspective: 1600px; }
#cardzone .card { position: absolute; left: 0; top: 0; transform-style: preserve-3d; backface-visibility: hidden; }
#cardzone .peek { position: absolute; left: 0; top: 0; font: 700 26px Rubik, sans-serif; color: var(--ink); text-shadow: 0 2px 6px #000; white-space: nowrap; }

/* dice */
#dice { position: absolute; left: 430px; top: 320px; width: 330px; padding: 16px 18px 18px; perspective: 900px; text-align: center; background: rgba(28, 16, 6, 0.98); border: 2px solid var(--panel-edge); border-radius: 22px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55); }
#dice .die-head { font: 600 24px Rubik, sans-serif; color: #fbe9c8; margin-bottom: 14px; }
#dice .die-head b { color: var(--gold); }
.die { width: 190px; height: 190px; position: relative; transform-style: preserve-3d; margin: 0 auto; }
.die .f { position: absolute; width: 190px; height: 190px; background: radial-gradient(circle at 30% 25%, #fffef8, #f2e6c8); border: 4px solid #c9b48a; border-radius: 30px; box-shadow: inset 0 -10px 24px rgba(0, 0, 0, 0.16); }
.die .f::before { content: ''; position: absolute; inset: 0; background-repeat: no-repeat; }
.die .f1 { transform: rotateY(0deg) translateZ(95px); }
.die .f2 { transform: rotateY(90deg) translateZ(95px); }
.die .f3 { transform: rotateX(90deg) translateZ(95px); }
.die .f4 { transform: rotateX(-90deg) translateZ(95px); }
.die .f5 { transform: rotateY(-90deg) translateZ(95px); }
.die .f6 { transform: rotateY(180deg) translateZ(95px); }
.die .pip { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7a1010, #2a0000); }
.die-note { margin-top: 18px; font: 800 40px Rubik, sans-serif; text-shadow: 0 3px 8px #000; min-height: 48px; }
.die-note.ok { color: var(--good); }
.die-note.bad { color: var(--bad); }

/* event ticker */
#ticker { position: absolute; left: 22px; bottom: 22px; width: 470px; display: flex; flex-direction: column; gap: 6px; }
#ticker .t { background: rgba(20, 10, 4, 0.72); border: 1px solid var(--panel-edge); padding: 6px 14px; border-radius: 10px; font: 500 22px Rubik, sans-serif; color: #fbe9c8; text-shadow: 0 1px 2px #000; }
/* centred between the ticker (bottom-left, 22..492 px) and the wizard: long lines shrink instead of running into the ticker */
#waiting { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); max-width: 880px; width: max-content; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 30px; padding: 10px 28px; font: 600 28px/1.25 Rubik, sans-serif; box-shadow: var(--shadow); text-align: center; }

/* the wizard narrator */
#wizard { position: absolute; right: 0; bottom: -10px; width: 430px; height: 420px; }
#wiz-body { position: absolute; right: 10px; bottom: 0; width: 410px; transform-origin: 70% 90%; }
#wiz-img { width: 100%; display: block; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.6)); }
#wiz-mouth { position: absolute; opacity: 0; pointer-events: none; }
#bubble { position: absolute; right: 330px; bottom: 250px; width: max-content; max-width: 640px; background: #fffaf0; color: #2a1606; font: 600 30px/1.25 Rubik, sans-serif; padding: 16px 24px; border-radius: 26px; box-shadow: var(--shadow); border: 3px solid #e8c37a; }
#bubble::after { content: ''; position: absolute; right: -22px; bottom: 26px; border: 14px solid transparent; border-left: 24px solid #fffaf0; }
#bubble { z-index: 2; } /* over the wizard's staff: in Hebrew the line starts on that side */

/* lobby */
#lobby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding-top: 40px; background: linear-gradient(180deg, rgba(12, 6, 2, 0.72) 0%, rgba(12, 6, 2, 0.45) 45%, rgba(12, 6, 2, 0) 62%); pointer-events: none; }
#lobby .lobby-join, #lobby button { pointer-events: auto; }
.lobby-title { font: 400 140px Lobster, Georgia, serif; color: var(--gold); text-shadow: 0 8px 0 #5a2a00, 0 0 50px rgba(0, 0, 0, 0.9); line-height: 1; }
.lobby-sub { font: 600 34px Rubik, sans-serif; margin-top: 6px; text-shadow: 0 3px 8px #000; }
.lobby-join { margin-top: 34px; display: flex; gap: 36px; align-items: center; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 30px; padding: 26px 40px; box-shadow: var(--shadow); }
#qr { width: 260px; height: 260px; background: #fff; border-radius: 18px; padding: 10px; }
.join-step { font: 700 34px Rubik, sans-serif; }
.join-or { margin-top: 10px; font-size: 24px; color: #e7cfa6; }
.join-url { font: 800 40px Rubik, sans-serif; color: var(--gold); margin-top: 4px; }
.join-code { margin-top: 18px; font-size: 30px; }
.join-tv { margin-top: 14px; font-size: 22px; color: #e7cfa6; }
.join-tv b { color: #fff; font-size: 26px; }
.join-code b { font-size: 60px; letter-spacing: 6px; color: #fff; }
#lobby-players { margin-top: 28px; display: flex; gap: 18px; min-height: 150px; }
.lp { width: 150px; text-align: center; font: 700 24px Rubik, sans-serif; text-shadow: 0 2px 6px #000; }
.lp .face { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 8px; border: 4px solid var(--c, var(--gold)); background: #2a1608 center/cover no-repeat; box-shadow: var(--shadow); }
.lp.off { opacity: 0.5; }
.lobby-actions { margin-top: 22px; display: flex; gap: 16px; align-items: center; }
#lobby-count { font: 600 24px Rubik, sans-serif; color: #e7cfa6; margin-left: 6px; }
.lobby-actions button { font: 700 28px Rubik, sans-serif; padding: 14px 30px; border-radius: 40px; border: 2px solid var(--panel-edge); background: var(--panel); color: var(--ink); cursor: pointer; }
.lobby-actions button.primary { background: linear-gradient(180deg, #ffd978, #e09a1c); color: #3a1c00; border-color: #fff2c4; box-shadow: 0 6px 0 #8a5000, var(--shadow); }
.credits { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 17px; color: #e7d3b0; text-shadow: 0 1px 3px #000; }

/* game over */

#sound-hint { font: 600 22px Rubik, sans-serif; color: #fff4e0; padding: 12px 20px; border-radius: 40px; cursor: pointer; white-space: nowrap;
  background: rgba(30, 18, 8, 0.85); border: 2px solid var(--gold); box-shadow: var(--shadow); animation: hint-pulse 1.8s ease-in-out infinite; }
@keyframes hint-pulse { 50% { border-color: var(--panel-edge); transform: scale(0.97); } }
.start-title { font: 400 96px Lobster, Georgia, serif; color: var(--gold); }
#conn { position: absolute; top: 140px; left: 50%; transform: translateX(-50%); background: #7a1010; padding: 10px 24px; border-radius: 20px; font: 600 26px Rubik, sans-serif; }

/* volume: three channels + mute, on the left edge */
/* top-left corner (left of the player cards): mid-left it sat on the "this turn" cards and the nearest hero's name tag */
#vol { position: absolute; left: 18px; top: 18px; z-index: 30; pointer-events: auto; display: flex; align-items: flex-start; gap: 14px; direction: ltr; }
[dir=rtl] #vol-panel { direction: rtl; }
#sound-hint { position: absolute; left: 0; top: 88px; padding: 6px 14px; font-size: 17px; }
/* tutorial: one card per step, everyone's check-in chips under it; the road and the heroes stay behind */
#tutorial { position: absolute; inset: 0; pointer-events: none; }
#tutorial .tut-head { position: absolute; top: 22px; left: 0; right: 0; text-align: center; }
#tutorial .tut-title { font: 400 58px/1.1 Lobster, Georgia, serif; color: #ffcf5a; text-shadow: 0 5px 0 #5a2a00, 0 8px 20px #000a; }
#tutorial .tut-step { font: 600 24px Rubik, sans-serif; color: #f2dcb5; margin-top: 6px; text-shadow: 0 2px 4px #000; }
#tut-skip { position: absolute; top: 26px; right: 30px; pointer-events: auto; font: 700 22px Rubik, sans-serif; color: #f3dfbf; padding: 10px 20px; border-radius: 30px; background: rgba(30, 18, 8, 0.85); border: 2px solid var(--panel-edge); cursor: pointer; }
/* centred with margins, not a transform: the entry animation owns the transform (a -50% shift left it off-screen) */
#tutorial .tut-head { display: none; }
#tutorial .tut-n { font: 700 22px Rubik, sans-serif; color: #f2dcb5; opacity: 0.85; margin-bottom: 4px; }
#tutorial .tut-card { position: absolute; top: 300px; left: 0; right: 0; margin: 0 auto; width: 1180px; background: rgba(34, 18, 6, 0.95); border: 3px solid var(--gold); border-radius: 30px; padding: 26px 44px 30px; box-shadow: var(--shadow); text-align: center; }
#tutorial .tut-t { font: 400 60px/1.1 Lobster, Georgia, serif; color: #ffcf5a; margin-bottom: 14px; }
#tutorial .tut-b { font: 500 31px/1.45 Rubik, sans-serif; color: #fff1d6; }
#tutorial .tut-b b { color: var(--gold); }
#tutorial .tut-res { font: 700 30px Rubik, sans-serif; color: #fff; margin-top: 14px; }
#tutorial .tut-res:empty { display: none; }
#tutorial .tut-flow { display: flex; justify-content: center; gap: 18px; margin: 4px 0 18px; }
#tutorial .tut-flow i { font-style: normal; font-weight: 700; font-size: 28px; padding: 14px 20px; border-radius: 18px; background: #4a2a0e; border: 2px solid #c9902e; max-width: 340px; }
#tutorial .tut-meter { display: flex; justify-content: center; align-items: center; gap: 26px; margin: 4px 0 16px; }
#tutorial .tut-meter b { font: 900 84px Rubik, sans-serif; } #tutorial .tut-meter .h { color: #9fe3ff; } #tutorial .tut-meter .m { color: #ff9a7a; }
#tutorial .tut-meter i { font-style: normal; font-size: 56px; }
#tutorial .tut-tip { display: block; margin: 0 auto 16px; max-width: 760px; padding: 14px 20px; border-radius: 16px; background: linear-gradient(180deg, #3a2a14, #2a1d0f); border: 2px solid #8a6a2c; font-size: 27px; }
#tutorial .tut-tip em { font-style: normal; font-weight: 800; color: #2a1406; background: var(--gold); border-radius: 12px; padding: 4px 14px; margin-inline-start: 10px; }
/* who has answered: a row inside the card (outside it, it ran under the wizard's bubble) */
#tutorial .tut-players { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
#tutorial .tut-p { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 40px; background: rgba(60, 34, 12, 0.9); border: 3px solid #7a5a32; font: 700 22px Rubik, sans-serif; color: #fbe9c8; }
#tutorial .tut-p .f { width: 48px; height: 48px; border-radius: 50%; background: #2a1608 center/cover no-repeat; border: 2px solid var(--c, var(--gold)); }
#tutorial .tut-p .s { font-size: 28px; }
#tutorial .tut-p.done { border-color: var(--good); background: rgba(20, 50, 20, 0.9); }
#tutorial .tut-p.nudge { animation: tut-nudge 0.5s ease-in-out 3; }
@keyframes tut-nudge { 25% { transform: translateX(-10px) rotate(-3deg); } 75% { transform: translateX(10px) rotate(3deg); } }
#btn-start.pulse { animation: hint-pulse 1.2s ease-in-out infinite; }
/* the tour: the panel being named glows, the rest steps back (the wizard stays bright, he is talking) */
/* filter, not opacity: it multiplies with an element's own fade, so a title that already faded out (opacity 0) stays
   gone (the !important opacity brought the old "התור של אבא" back at 25% over the tutorial's fight, 10-08) */
#hud.tour > :not(#players):not(#wizard):not(#tutorial):not(.tut-hl):not(#vol):not(#cardzone), #hud.tour #players .pcard:not(.tut-hl) { filter: opacity(0.25); transition: filter 0.3s; }
.tut-hl { outline: 5px solid #ffd877; outline-offset: 8px; border-radius: 18px; box-shadow: 0 0 46px 14px rgba(255, 216, 119, 0.75) !important; animation: tut-hl 1.1s ease-in-out infinite; }
@keyframes tut-hl { 50% { outline-color: #ff9a40; box-shadow: 0 0 60px 20px rgba(255, 154, 64, 0.8); } }
#tutorial.chaos .tut-card, #tutorial.chaos .tut-players { visibility: hidden; } /* the montage has the screen to itself */
/* live steps (put on, kick, fight, throw): the dungeon is the picture; the card sits low on the left, chips under it */
#tutorial.live .tut-head { display: none; }
#hud.tut #ticker, #hud.tut #waiting { display: none; }
#tutorial.live .tut-card { top: auto; bottom: 120px; left: 24px; right: auto; margin: 0; width: 640px; padding: 18px 26px 20px; text-align: start; }
#tutorial.live .tut-t { font-size: 44px; margin-bottom: 8px; }
#tutorial.live .tut-b { font-size: 25px; }
#tutorial.live .tut-card { bottom: 40px; }
#tutorial.live .tut-players { justify-content: flex-start; gap: 8px; margin-top: 12px; }
#tutorial.live .tut-p { font-size: 18px; padding: 4px 12px 4px 4px; } #tutorial.live .tut-p .f { width: 36px; height: 36px; }
#boot { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at 50% 40%, #3a2410, #120a04 70%); pointer-events: none; }
#boot .boot-title { font: 400 110px/1 Lobster, Georgia, serif; color: #ffcf5a; text-shadow: 0 6px 0 #5a2a00; }
#boot .boot-sub { font: 400 54px/1 Lobster, Georgia, serif; color: #f3b843; direction: rtl; }
#boot .boot-bar { width: 520px; height: 14px; margin-top: 26px; border-radius: 7px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#boot .boot-bar i { display: block; height: 100%; width: 100%; border-radius: 7px; background: linear-gradient(90deg, #ff6a2a, #ffcf5a); transform: scaleX(0.04); transform-origin: left center; transition: transform 0.3s; }
#boot .boot-note { font: 600 24px Rubik, sans-serif; color: #e8d5a8; opacity: 0.8; }
#vol-btn { width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--panel-edge); background: var(--panel); color: var(--ink); font-size: 34px; cursor: pointer; box-shadow: var(--shadow); }
#vol-btn:hover { border-color: var(--gold); }
#vol-panel { background: rgba(28, 16, 8, 0.94); border: 2px solid var(--panel-edge); border-radius: 24px; padding: 18px 24px 20px; box-shadow: var(--shadow); width: 520px; }
.vol-title { font: 400 40px Lobster, Georgia, serif; color: var(--gold); margin-bottom: 8px; }
.vol-row { display: grid; grid-template-columns: 190px 1fr 64px; align-items: center; gap: 14px; font: 600 24px Rubik, sans-serif; padding: 10px 0; cursor: pointer; }
.vol-row b { text-align: right; color: var(--gold); font-weight: 800; }
.vol-row input { width: 100%; height: 36px; accent-color: var(--gold); cursor: pointer; }
#vol-mute { margin-top: 10px; width: 100%; font: 700 24px Rubik, sans-serif; padding: 12px; border-radius: 16px; border: 2px solid var(--panel-edge); background: #3a2210; color: var(--ink); cursor: pointer; }
#vol-mute.on { background: #7a1a10; border-color: #ff8a6a; }
/* the music licence (CC BY) wants the composer named: here, not on the lobby */
.vol-credit { margin-top: 12px; font: 400 14px Rubik, sans-serif; color: #c9b08a; opacity: 0.8; }
#lobby { z-index: 5; }
#wizard { z-index: 6; }
#gameover { z-index: 8; }

/* language of this screen (top corner of the lobby) */
#lang-pick { position: absolute; top: 36px; inset-inline-end: 44px; display: flex; gap: 12px; pointer-events: auto; }
#lang-pick .lang-b { font: 700 28px Rubik, sans-serif; min-height: 60px; padding: 8px 26px; border-radius: 999px; cursor: pointer;
  color: #f3dfbf; background: rgba(30, 18, 8, 0.82); border: 2px solid #7a5a32; }
#lang-pick .lang-b.on { color: #2a1406; background: #f3b843; border-color: #ffd877; }

/* this turn: one row per card (newest on top) with who played it and whom it serves, colour-coded */
/* just under the 🔊 button, at most 4 rows: lower down it covered the name tag of the hero on the front-left seat */
#turnlog { position: absolute; left: 24px; top: 150px; width: 320px; pointer-events: none; }
#turnlog .tl-head { font: 700 17px Rubik, sans-serif; color: #f2dcb5; letter-spacing: 1px; margin-bottom: 6px; text-shadow: 0 2px 4px #000; }
#turnlog .tl-list { display: flex; flex-direction: column; gap: 5px; }
#turnlog .tl-row { --k: #a08c6c; display: flex; align-items: center; gap: 9px; padding: 4px 9px 4px 5px; border-radius: 11px;
  background: rgba(20, 10, 4, 0.86); border: 1px solid var(--panel-edge); border-color: color-mix(in srgb, var(--k) 60%, transparent); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
#turnlog .tl-row.k-good { --k: #4fd36a; }
#turnlog .tl-row.k-bad { --k: #ff5a3c; }
#turnlog .tl-row.k-evil { --k: #b46cff; }
#turnlog .tl-row.old { opacity: 0.82; }
#turnlog .tl-art { width: 40px; height: 40px; flex: none; border-radius: 7px; background: radial-gradient(circle at 50% 40%, #fffaf0, #e8d5a8 70%); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 0 0 2px var(--k); }
#turnlog .tl-art img { max-width: 37px; max-height: 37px; object-fit: contain; }
#turnlog .tl-txt { min-width: 0; }
#turnlog .tl-l1 { font: 600 16px/1.2 Rubik, sans-serif; color: #fbe9c8; }
#turnlog .tl-l1 b { color: var(--gold); }
#turnlog .tl-l1 i { font-style: normal; color: #fff4dc; }
#turnlog .tl-chip { font: 700 14px/1.2 Rubik, sans-serif; color: var(--k); margin-top: 1px; }
#turnlog .tl-chip b { color: inherit; }
#turnlog .tl-note { color: #fff; }

/* Hebrew screens: the 3D name tags are placed from the left by the label renderer, so that layer stays
   left-to-right while the words inside each tag read right-to-left; addresses always read left-to-right */
#labels, #labels > div { direction: ltr; }
[dir=rtl] #labels > div > * { direction: rtl; }
#join-url, #tv-url, #room-code { direction: ltr; unicode-bidi: isolate; }

/* under each player card: race/class powers and the items they wear */
.pcard .extra { position: absolute; left: 6px; right: 6px; top: calc(100% + 6px); display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border-radius: 12px; background: rgba(20, 10, 4, 0.78); border: 1px solid var(--panel-edge); }
.pcard .extra.empty { display: none; }
.pcard .powers:empty, .pcard .gear:empty { display: none; }
.pcard .powers { display: flex; flex-direction: column; gap: 2px; font: 500 15px/1.25 Rubik, sans-serif; color: #f2dcb5; }
.pcard .powers b { color: var(--gold); font-weight: 700; }
.pcard .gear { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .gi.off img { filter: grayscale(1) brightness(0.7); }
.pcard .gi.off i { background: #6b1d1d; text-decoration: line-through; }
.pcard .gi.off::after { content: '✖'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 900 26px Rubik, sans-serif; color: #ff5a4a; text-shadow: 0 1px 3px #000; }
.pcard .gear-off:empty { display: none; }
.pcard .gear-off { font: 500 14px/1.25 Rubik, sans-serif; color: #ffb4a4; }
.pcard .gi { position: relative; width: 40px; height: 40px; border-radius: 8px; background: #f3e3bf; display: flex; align-items: center; justify-content: center; }
.pcard .gi img { max-width: 36px; max-height: 36px; object-fit: contain; }
.pcard .gi i { position: absolute; right: -4px; bottom: -4px; font: 800 12px Rubik, sans-serif; font-style: normal; color: #fff; background: #1d6b1d; border-radius: 6px; padding: 0 3px; }

/* what the player on turn can choose (door / chest / trouble); the picked tile lights up */
#choices { position: absolute; left: 0; right: 640px; bottom: 165px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
#choices .ch-head { font: 700 28px Rubik, sans-serif; color: #fbe9c8; text-shadow: 0 2px 6px #000; }
#choices .ch-row { display: flex; gap: 28px; }
#choices .ch-tile { width: 300px; padding: 14px 16px 16px; text-align: center; border-radius: 22px; background: rgba(28, 16, 6, 0.88); border: 2px solid var(--panel-edge); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55); }
#choices .ch-tile.picked { border: 4px solid var(--gold); background: rgba(70, 40, 8, 0.95); }
#choices .ch-ico { font-size: 64px; line-height: 80px; height: 80px; }
#choices .ch-ico img { height: 80px; width: auto; object-fit: contain; }
#choices .ch-t { font: 700 32px Rubik, sans-serif; color: var(--gold); margin-top: 4px; }
#choices .ch-s { font: 500 21px Rubik, sans-serif; color: #f2dcb5; margin-top: 2px; }

/* last chance to step in: big and clear */
#lastcall { position: absolute; left: 0; right: 0; margin: 0 auto; top: 300px; width: 980px; text-align: center; padding: 18px 30px 22px;
  background: rgba(58, 14, 6, 0.98); border: 3px solid #ff9a40; border-radius: 26px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
#lastcall .lc-t { font: 400 76px/1.05 Lobster, Georgia, serif; color: #ffcf5a; text-shadow: 0 5px 0 #5a2a00; }
#lastcall .lc-s { font: 600 30px/1.3 Rubik, sans-serif; color: #fff1d6; margin-top: 8px; }
#lastcall .lc-bar { height: 14px; margin-top: 16px; border-radius: 7px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
#lastcall .lc-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff6a2a, #ffcf5a); transform-origin: left center; }

/* winner screen: a clear panel on the left, the dancing winner stays visible; the rest of the HUD steps away */
#gameover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-start; padding-left: 90px;
  background: linear-gradient(90deg, rgba(10, 5, 2, 0.9) 0%, rgba(10, 5, 2, 0.65) 36%, rgba(10, 5, 2, 0) 56%); }
#gameover .go-card { width: 640px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
#gameover .go-title { font: 400 120px/1 Lobster, Georgia, serif; color: var(--gold); text-shadow: 0 8px 0 #5a2a00, 0 0 40px #000; }
#gameover .go-name { font: 800 58px/1.1 Rubik, sans-serif; color: #fff4e0; text-shadow: 0 4px 10px #000; margin-bottom: 14px; }
#gameover .go-stats { display: flex; flex-direction: column; gap: 10px; }
#gameover .go-row { display: grid; grid-template-columns: 52px 1fr 64px auto; align-items: center; gap: 14px; padding: 10px 18px;
  background: rgba(36, 22, 13, 0.92); border: 2px solid var(--panel-edge); border-radius: 16px; font: 600 28px Rubik, sans-serif; color: #fbe9c8; }
#gameover .go-row.w { border-color: var(--gold); background: rgba(80, 48, 10, 0.95); }
#gameover .go-rank { font: 800 30px Rubik, sans-serif; color: var(--gold); text-align: center; }
#gameover .go-pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gameover .go-pl { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 28px Rubik, sans-serif; color: #3a1c00;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 45%, var(--gold-deep)); }
#gameover .go-ex { font: 500 22px Rubik, sans-serif; color: #e8d2ad; white-space: nowrap; }
#gameover .again { pointer-events: auto; align-self: flex-start; margin-top: 18px; font: 700 34px Rubik, sans-serif; padding: 16px 44px; border-radius: 40px; border: 2px solid #fff2c4;
  background: linear-gradient(180deg, #ffd978, #e09a1c); color: #3a1c00; cursor: pointer; box-shadow: 0 6px 0 #8a5000; }
/* the last-chance banner says who is winning; the meter's own stage line would sit on its top edge */
#hud.lastcall #m-stage { display: none; }
#choices { transition: opacity 0.2s; }
#hud.bigcard #choices { visibility: hidden; } /* (its own fade sets an inline opacity, which beat an opacity rule) */
#hud.over #meter, #hud.over #turnlog, #hud.over #choices, #hud.over #lastcall, #hud.over #ticker, #hud.over #waiting, #hud.over #banner { display: none !important; }

/* language switch inside the volume panel (works mid-game) */
.vol-lang { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 22px Rubik, sans-serif; color: #f2dcb5; }
.vol-lang .lang-pick { display: flex; gap: 10px; }
.vol-lang .lang-b { font: 700 22px Rubik, sans-serif; min-height: 48px; padding: 6px 18px; border-radius: 999px; cursor: pointer; color: #f3dfbf; background: rgba(30, 18, 8, 0.82); border: 2px solid #7a5a32; }
.vol-lang .lang-b.on { color: #2a1406; background: #f3b843; border-color: #ffd877; }

/* during a fight, top-right: what losing costs and what winning gives */
#moninfo { position: absolute; right: 40px; top: 250px; width: 390px; padding: 12px 16px 14px; border-radius: 18px; pointer-events: none;
  background: rgba(44, 10, 6, 0.9); border: 2px solid #c0504a; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); }
#moninfo .mi-head { font: 700 20px Rubik, sans-serif; color: #ffb59a; margin-bottom: 6px; }
#moninfo .mi-row + .mi-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 160, 140, 0.3); }
#moninfo .mi-name { font: 700 24px Rubik, sans-serif; color: #fff1d6; display: flex; align-items: center; gap: 8px; }
#moninfo .mi-lvl { font: 800 18px Rubik, sans-serif; color: #fff; background: #c0302a; border-radius: 10px; padding: 1px 8px; }
#moninfo .mi-bad { font: 500 19px/1.35 Rubik, sans-serif; color: #f6dccb; margin-top: 4px; }
#moninfo .mi-win { font: 600 18px Rubik, sans-serif; color: #ffd877; margin-top: 6px; }
#hud.over #moninfo { display: none !important; }

/* countdown clock (waiting line and choice tiles): who has to act, and how many seconds are left */
.clock-slot { display: none; position: relative; width: 58px; height: 58px; flex: none; vertical-align: middle; margin-inline-end: 12px; }
.clock-slot.on { display: inline-block; }
.clock-slot svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.clock-slot .cb { fill: rgba(0, 0, 0, 0.35); stroke: rgba(255, 255, 255, 0.18); stroke-width: 3.5; }
.clock-slot .cf { fill: none; stroke: #ffcf5a; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 97.4; transition: stroke-dashoffset 0.25s linear; }
.clock-slot b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 23px Rubik, sans-serif; color: #fff4e0; }
.clock-slot.low .cf { stroke: #ff5a3a; }
.clock-slot.low b { color: #ffb3a0; }
#waiting { display: flex; align-items: center; }
#choices .ch-head { display: flex; align-items: center; }

#hud.fight .pcard .extra { display: none; } /* the fight meter needs the room */
/* a character speaking (thief, hero): caption over their head with their name */
.say-hero { white-space: normal; max-width: 460px; text-align: center; background: #2a1440; color: #f6eaff; border: 2px solid #b48cf0; font: 600 24px/1.3 Rubik, sans-serif; }
.say-hero .say-who { display: block; font: 800 18px Rubik, sans-serif; color: #e0c8ff; margin-bottom: 2px; }

#moninfo .mi-und { font: 600 18px Rubik, sans-serif; color: #d6c6ff; margin-top: 4px; }
.mon-tag .und { margin-inline-end: 6px; }
#moninfo .mi-why { font: 600 17px Rubik, sans-serif; color: #ffd0a8; margin-top: 3px; }

#fs-btn { width: 64px; height: 64px; border-radius: 50%; font-size: 30px; cursor: pointer; color: #fff4e0; background: rgba(30, 18, 8, 0.85); border: 2px solid var(--panel-edge); }

#hud.bigcard #bubble { opacity: 0 !important; } /* the big card is the star; the wizard keeps talking */
.pcard .name { unicode-bidi: plaintext; }
.pcard .name.long { font-size: 19px; }

/* video call: the player's own face on their hero (player bar circle + a bubble above the 3D hero) */
.pcard .face { position: relative; overflow: hidden; }
.pcard .face video.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.pcard .face.cam-talk, .cam3d-in.cam-talk { box-shadow: 0 0 0 4px #4fd36a, 0 0 18px 4px rgba(79, 211, 106, 0.7); }
.cam3d { pointer-events: none; }
.cam3d-in { position: relative; width: 96px; height: 96px; transform: translateY(-82px); border-radius: 50%; overflow: hidden; border: 3px solid #ffcf5a; background: #2a1608; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6); transition: box-shadow 0.2s; }
.cam3d-in video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-hushed::after { content: '🔇'; position: absolute; right: 2px; bottom: 2px; font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 2px #000); }
