
body {
  --cream: #fff0d9;
  --muted: #d9b3a9;
  --gold: #ffdc93;
  background: radial-gradient(ellipse at 50% 0%, #4d1520, #210c12 50%, #15090e 100%);
}
.world {
  --edge: clamp(12px, 2.6vw, 34px);
  --bottom-ui: 84px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: clip;
}
.masthead {
  position: absolute; z-index: 10; inset: 0 0 auto;
  display: flex; align-items: start; justify-content: space-between; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(var(--edge), env(safe-area-inset-right, 0px))
    30px max(var(--edge), env(safe-area-inset-left, 0px));
  background: linear-gradient(#17060ed4, #17060e43 63%, transparent);
  pointer-events: none;
}
.world-heading {text-shadow: 0 2px 11px #2b0818;}
.brand {font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; color: var(--gold);}
.brand span {padding: 0 .22em; color: #d57670;}
h1 {font: 500 clamp(34px, 5.0vw, 72px)/.99 Georgia, serif; margin-top: 5px; letter-spacing: -.043em;}
h1 em {color: var(--gold); font-weight: inherit;}
.controls {display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; pointer-events: auto;}
.plain {background: #45202b; border-color: #e7ae746b; border-radius: 8px; min-height: 40px; color: #fff0d9;}
.plain:hover {background: #61303d;}
.plain[aria-pressed=true] {background: #673139;}
.stage {
  position: absolute; isolation: isolate; inset: 0;
  overflow: hidden;
  background: #6f0b15;
}
.stage-art, .stage-light, .actors, .shape-guide {position:absolute; inset:0; width:100%; height:100%; pointer-events:none;}
/* Keep the decorations and floor. The image's bottom label sits beyond the stage. */
.stage-art {object-fit:fill; height:110.5%; max-width:none;}
.stage-light {z-index: 1; opacity: .6; background: radial-gradient(ellipse at 50% 70%, #ffc86722, transparent 53%), linear-gradient(180deg, #2c030b00 73%, #17010491);}
.stage[data-show] .stage-light {opacity: 1; background: radial-gradient(ellipse at 50% 66%, #ffd68ba0, transparent 49%), linear-gradient(180deg, #26000a11, #26000a8c);}
.hotspot {
  position: absolute; z-index: 5; left: var(--x); top: var(--y);
  translate: -50% -50%; width: clamp(44px, 8%, 100px); height: clamp(44px, 13%, 100px);
  border-radius: 50%; border: 1px solid transparent; background: transparent; color: #ffefbe;
}
.hotspot.disco {width: clamp(62px, 16%, 185px); height: clamp(62px, 17%, 122px);}
.hotspot:hover, .hotspot:focus-visible, .hotspot[aria-pressed=true] {
  background: #ffda822f; box-shadow: 0 0 20px #ffe179a3, inset 0 0 18px #ffed9f77; border-color: #ffde8a;
}
.hotspot::after {
  content: attr(aria-label); opacity: 0; position: absolute; bottom: -5px; left: 50%; translate: -50% 100%;
  width: max-content; max-width: 110px; border-radius: 8px; padding: 4px 8px;
  background: #34121a; font-size: 12px; pointer-events: none;
}
.hotspot:hover::after, .hotspot:focus-visible::after {opacity: 1;}
.actors {z-index: 3;}
.actor {
  position: absolute; left: 0; top: 0; width: var(--w); height: var(--h);
  transform-origin: 50% 100%; will-change: transform;
}
.actor img {
  display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 3px 3px #2b070bba) drop-shadow(0 0 1px #fff0ce);
}
.shape-guide {z-index: 2;}
.shape-guide canvas {display:block; width:100%; height:100%;}
.scene-status {
  position: absolute; z-index: 6; inset: auto 10px calc(var(--bottom-ui) + var(--safe-bottom) + 12px); width: max-content; max-width: calc(100% - 20px); margin-inline: auto;
  background: #37121cee; border: 1px solid #f8c7858c; border-radius: 30px;
  padding: 6px 14px; color: #fff0d9; font-size: 13px; text-align: center;
}
.guest {position:absolute; z-index: 4; bottom: max(11%, calc(var(--bottom-ui) + var(--safe-bottom) + 14px)); left: 50%; translate: -50% 0; display:grid; justify-items:center; pointer-events:none;}
.performer {position:relative; width: clamp(77px, 12vw, 160px); aspect-ratio: 10/13; filter: drop-shadow(0 0 18px #ffe4a8); animation: groove .56s ease-in-out infinite alternate;}
.performer div {position:absolute;}
.performer-face {inset: 12% 36% 65%; background: linear-gradient(120deg,#ffe2b8,#c68a64 80%); border-radius: 34% 42% 45% 47%; z-index: 2;}
.performer-face::before {content:""; position:absolute; width:84%; height:26%; top:29%; left:9%; background:#221a23; border-radius:4px;}
.performer-face::after {content:""; position:absolute; top: 66%; left: 44%; width: 37%; height: 15%; border-radius: 0 0 50% 50%; background:#401b1c; animation: vocal .28s steps(2) infinite alternate;}
.performer-hair {inset: 8% 33% 74%; background:#291d28; border-radius: 67% 29% 43% 42%; z-index: 3; rotate: -10deg;}
.performer-jacket {inset: 32% 29% 22%; clip-path: polygon(14% 7%,45% 0,56% 2%,85% 11%,95% 83%,67% 100%,44% 91%,16% 99%,4% 86%); background:linear-gradient(125deg,#fff9e8,#d68b75 52%,#801a43 53%,#3a1529 62%,#ffe8ae 92%); z-index:1;}
.performer-leg {top: 68%; height: 30%; width: 15%; background:#2b1927; border-radius: 25% 18% 8% 20%;}
.performer-leg-left {left:35%; rotate: 17deg;} .performer-leg-right {right:33%; rotate:-15deg;}
.performer-arm {top: 36%; height: 28%; width: 14%; background:linear-gradient(#ffd5a9,#ba5c58); border-radius: 36%; transform-origin: 50% 10%;}
.performer-arm-left {left:30%; rotate: 60deg;} .performer-arm-right {right:29%; rotate:-132deg; z-index:3;}
.performer-mic {top:24%; left:67%; width: 10%; height: 21%; border-radius: 30%; background:linear-gradient(#fef0d2 20%,#50333b 24%); rotate: -56deg; z-index:4;}
.guest-caption {
  text-align:center; font: 700 clamp(13px, 2vw, 20px)/1.16 Georgia, serif; white-space:nowrap;
  color:#1f0d13; background:#ffdd94; box-shadow:0 5px 14px #54132288; padding:6px 13px; border-radius:6px;
}
.guest-caption span {display:block; font: 600 .67em/1.3 system-ui,sans-serif;}
@keyframes groove {from {rotate:-6deg; translate:0 0;} to {rotate:6deg; translate:0 -3%;}}
@keyframes vocal {to {scale:1 .45;}}
.stage[data-calm] .performer, .stage[data-calm] .performer-face::after {animation:none;}
.station {
  position: absolute; z-index: 10; inset: auto 0 0;
  display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 16px;
  padding: 13px max(var(--edge), env(safe-area-inset-right, 0px)) calc(12px + var(--safe-bottom))
    max(var(--edge), env(safe-area-inset-left, 0px));
  background: linear-gradient(transparent, #1c0714bd 46%, #17070fe8);
  pointer-events: none;
}
.station a, .station button {pointer-events: auto;}
.instructions {display:grid; gap:3px; text-shadow:0 1px 4px #17050d;}
.instructions p:first-child {font-weight:700; color: var(--cream);}
.instructions p:not(:first-child) {font-size:13px; color:var(--muted);}
.instructions #qr-instruction {color:var(--gold);}
.upload {display:flex; align-items:center; gap:9px;}
#qr-link {display:block; padding:5px; border-radius:8px; background:#fff;}
#qr-link img {display:block; width:56px; height:56px;}
.upload-actions {display:grid; grid-template-columns:1fr; justify-items:start;}
.primary {display:inline-flex; align-items:center; justify-content:center; text-decoration:none; color:#31141b; background:#ffdc92; padding:9px 14px; min-height:42px;}
.primary:hover {background:#ffedbd;}
.report-link {margin:0; padding:4px; color:var(--muted, #d9b3a9);}
.upload-actions .report-link {margin:1px auto 0;}
.station-tools {display:grid; gap:2px;}
.music-panel {
  position: absolute; z-index: 12; right: max(var(--edge), env(safe-area-inset-right, 0px));
  bottom: calc(var(--bottom-ui) + var(--safe-bottom) + 8px);
  width: min(650px, calc(100% - var(--edge) * 2)); max-height: min(54dvh, 440px); overflow: auto;
  display:flex; flex-wrap:wrap; gap:14px; align-items:center; padding:14px;
  background:#331721f5; border:1px solid #a4625f77; border-radius:14px;
}
.music-player:empty {display:none;}
.music-player iframe {display:block; border:0; width:min(320px,calc(100vw - 62px)); height:200px;}
.music-details {display:grid; justify-items:start; gap:7px; color:var(--muted); font-size:14px;}
.music-details h2 {font:500 23px Georgia,serif;color:var(--cream);}
.music-details a {color:var(--gold);}
.popup {background:#301923; border-color:#b77f6b; color:#fff0d9;}
.popup::backdrop {background:#15080bd1;}
.qr-popup a {display:block; background:#fff; border-radius:10px; padding:6px;}
.popup .dialog-note {color:#e4bfb0;}
.parts-list:empty::after {content:'На сцене пока нет актёров.';}
.editor .tabs {display:flex; gap:8px; margin:0 0 10px;}
.editor .tabs button {background:#45202b; border:1px solid #b7796d75; padding:8px 13px; border-radius:8px;}
.editor .tabs button[aria-pressed=true] {color:#ffdc93; border-color:currentColor;}
#draw-panel canvas {display:block; width:100%; height:auto; margin-bottom:8px; background:#f3eadf; border-radius:9px; touch-action:none;}
.toast {background:#361623; color:#fff0cf;}
@media (max-width:650px) {
  .world {--bottom-ui: 100px;}
  .masthead {flex-flow:column; gap:8px; padding-top:calc(10px + env(safe-area-inset-top, 0px));}
  .controls {justify-content:start;}
  .controls button {font-size:12px; min-height:36px;}
  .station {grid-template-columns:1fr auto; gap:6px 10px; padding-top:10px;}
  .instructions {grid-column:1/-1;}
  .instructions p:first-child {font-size:13px;}
  .instructions p:not(:first-child) {font-size:12px;}
  #stage-help {display:none;}
  #qr-link img {width:47px; height:47px;}
}
@media (max-height:500px) and (orientation:landscape) {
  .world {--bottom-ui: 61px; --edge: 12px;}
  .masthead {flex-direction:row; gap:7px; padding-top:calc(6px + env(safe-area-inset-top, 0px)); padding-bottom:16px;}
  h1 {font-size:clamp(25px, 5vw, 40px);}
  .brand {font-size:9px;}
  .controls button {min-height:32px; padding:4px 8px; font-size:12px;}
  .station {grid-template-columns:1fr auto auto; padding-top:5px; padding-bottom:calc(5px + var(--safe-bottom));}
  .instructions {grid-column:auto;}
  .instructions p:first-child {font-size:12px;}
  #stage-help {display:none;}
  #qr-link img {width:40px; height:40px;}
  .upload-actions .primary {min-height:34px; padding:5px 9px; font-size:13px;}
}
/* Fullscreen world 20261125 */
.world { --fs-edge:clamp(10px,2vw,30px);--fs-top:max(var(--fs-edge),env(safe-area-inset-top));--fs-right:max(var(--fs-edge),env(safe-area-inset-right));--fs-bottom:max(var(--fs-edge),env(safe-area-inset-bottom));--fs-left:max(var(--fs-edge),env(safe-area-inset-left));position:relative!important;isolation:isolate!important;display:block!important;width:100%!important;min-width:0!important;max-width:none!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:hidden!important; }
.world[hidden] { display:none!important }
.world #stage { position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;min-width:0!important;max-height:none!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;aspect-ratio:auto!important; }
.world .stage-art { position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important; }
.world .masthead { position:absolute!important;z-index:40!important;inset:var(--fs-top) var(--fs-right) auto var(--fs-left)!important;margin:0!important;padding:0!important;width:auto!important;max-width:none!important;min-height:0!important;background:none!important;border:0!important;box-shadow:none!important;color:#fffaf0!important;text-shadow:0 1px 3px #101d16,0 2px 12px #101d16;pointer-events:none;display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:8px 14px!important;flex-wrap:wrap!important; }
.world .masthead h1 { font-size:clamp(1.35rem,3.8vw,3.1rem)!important;line-height:1.06!important;margin:0!important;color:#fffaf0!important; }
.world .masthead p { max-width:min(56ch,100%);color:inherit!important; }
.world .masthead :is(button,a,select,input) { pointer-events:auto; }
.world .station { position:absolute!important;z-index:42!important;inset:auto var(--fs-right) var(--fs-bottom) var(--fs-left)!important;margin:0!important;padding:0!important;width:auto!important;max-width:none!important;min-height:0!important;border:0!important;background:none!important;box-shadow:none!important;pointer-events:none;display:flex!important;justify-content:space-between!important;align-items:flex-end!important;gap:8px 12px!important;flex-wrap:wrap!important; }
.world .instructions, .world .upload { border:1px solid #d4dbbd60!important;border-radius:13px!important;background:#16261eec!important;box-shadow:0 3px 14px #07151342!important;color:#fff7e5!important;padding:8px 10px!important;margin:0!important;max-width:min(440px,100%)!important;min-width:0!important;pointer-events:auto;font-size:clamp(.72rem,1.35vw,.94rem)!important; }
.world .instructions p, .world .upload p { color:inherit!important;line-height:1.24!important;margin-block:2px!important; }
.world .instructions h2, .world .upload h2 { color:inherit!important;line-height:1.14!important;font-size:clamp(.9rem,1.7vw,1.16rem)!important;margin-block:2px!important; }
.world .instructions :is(img[id*="qr" i],img[alt*="QR" i]), .world .upload :is(img[id*="qr" i],img[alt*="QR" i]) { width:clamp(50px,7vw,88px)!important;height:auto!important;aspect-ratio:1!important; }
.world :is(.view-controls, .world .top-tools, .world .tools, .world .controls, .world .screen-tools, .world .game-nav, .world nav.view-tools) button { min-height:33px; }
.world :is(.world-upload, .world .upload-card, .world .qr-card, .world .boarding, .world .join-box)[hidden] { display:none!important }
.world :is(section,aside,button,p,div)[hidden] { display:none!important }
@media(max-width:680px){.world .station { gap:5px!important; }.world .instructions, .world .upload { padding:5px 7px!important;font-size:.75rem!important; }.world .instructions :is(img[id*="qr" i],img[alt*="QR" i]), .world .upload :is(img[id*="qr" i],img[alt*="QR" i]) { width:54px!important; }.world .masthead h1 { font-size:clamp(1.25rem,5.5vw,1.8rem)!important; }}
.world .station{align-items:center!important}.world .station-tools{pointer-events:auto}.world #music-panel{z-index:55!important}.world .stage-art{object-position:center!important}