/* Welding Technician exhibit. Stage is a fixed 1920x1080 canvas scaled to fit the window. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #000; overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.hide-cursor, body.hide-cursor * { cursor: none !important; }

/* Font: the original uses SMGSans (Science Museum Group). Drop licensed SMGSans files in
   assets/fonts and they are picked up first; otherwise a neutral grotesque is used. */
@font-face { font-family: "SMGSans"; src: local("SMGSans-Regular"), url("assets/fonts/SMGSans-Regular.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "SMGSans"; src: local("SMGSans-Fat"), url("assets/fonts/SMGSans-Fat.woff2") format("woff2"); font-weight: 800; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  font-family: "SMGSans", "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif; color: #fff; background: #111; }
#stage img { -webkit-user-drag: none; pointer-events: none; }

#bg { position: absolute; inset: 0; width: 1920px; height: 1080px; }

/* Workpiece */
#weldComp { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transition: transform .5s ease-in-out, opacity .5s ease-in-out; }
#weldComp.out { transform: translateX(500px); opacity: 0; }
#weldComp.in { transition-duration: .8s; }
#plate, #weldComp canvas, #dim { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
#discolorCanvas { mix-blend-mode: color-burn; opacity: .9; }
#dim { background: #000; opacity: 0; }
#glowCanvas { mix-blend-mode: screen; }

#dottedLine { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .3s; pointer-events: none; }
#crosshair { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; opacity: 0; transform: scale(0); }
#sparkCanvas { position: absolute; left: 0; top: 0; pointer-events: none; mix-blend-mode: screen; }

/* Indicator (follows the touch). Offsets converted from the Unity scene. */
#indicator { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; }
#burst { position: absolute; width: 1400px; height: 1400px; left: -700px; top: -700px; opacity: 0; }
#torchShadow { position: absolute; width: 612px; height: 569px; left: calc(245px - 306px); top: calc(255px - 284px + 40px);
  transform: rotate(13deg); opacity: .55; }
#torch { position: absolute; width: 450px; height: 426px; left: calc(265px - 225px - 40px); top: calc(142px - 213px + 6px); }
#meter { position: absolute; width: 248px; height: 104px; left: calc(50px - 124px); top: calc(-225px - 52px); }
#needlePivot { position: absolute; left: 50px; top: -120px; width: 0; height: 0; }
#needle { position: absolute; width: 29px; height: 78px; left: -14.5px; top: -128px; transform-origin: 14.5px 128px; }
#feedback { position: absolute; width: 260px; left: -130px; top: -340px; text-align: center; font-size: 30px; font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,.6); }

/* Payoff video */
#payoff { position: absolute; inset: 0; width: 1920px; height: 1080px; object-fit: cover; display: none; clip-path: circle(0% at 70% 50%); }
#payoff.show { display: block; transition: clip-path .7s ease-out; clip-path: circle(150% at 70% 50%); }

/* Chat */
#chat { position: absolute; left: 59px; top: 56px; width: 561px; height: 640px; transition: opacity .2s; }
#chatTop { position: absolute; left: 0; top: 0; right: 0; height: 70px; display: flex; align-items: center; gap: 14px; padding-left: 6px;
  background: rgba(20,20,20,.92); border-radius: 14px 14px 0 0; }
#chatTop img { width: 62px; height: 62px; border-radius: 50%; }
#chatName { font-size: 22px; font-weight: 800; }
#chatRole { font-size: 22px; opacity: .85; }
#chatScroll { position: absolute; left: 0; right: 0; top: 70px; bottom: 0; overflow: hidden; background: rgba(20,20,20,.55);
  border-radius: 0 0 14px 14px; padding: 14px 14px 14px 18px; }
#chatContent { display: flex; flex-direction: column; gap: 12px; position: relative; transition: transform .3s cubic-bezier(.65,0,.35,1); }
.msg { display: flex; transform: scale(0); transition: transform .3s cubic-bezier(.65,0,.35,1); }
.msg.show { transform: scale(1); }
.msg.expert { justify-content: flex-start; transform-origin: 0 0; }
.msg.player { justify-content: flex-end; transform-origin: 100% 0; }
.bubble { position: relative; font-size: var(--chat-font, 30px); max-width: 489px; padding: 14px 20px; border-radius: 18px; line-height: 1.22; white-space: pre-line; }
.msg.expert .bubble { background: #df5308; }
.msg.player .bubble { background: #e18820; }
.msg.choice .bubble { background: #000; pointer-events: auto; cursor: pointer; }
.msg.choice.checked .bubble { background: #e18820; }
.msg.tail.expert .bubble { border-top-left-radius: 4px; }
.msg.tail.player .bubble { border-top-right-radius: 4px; }
.bubble b { font-weight: 800; }
.bubble img { display: block; max-width: 439px; max-height: 330px; margin-top: 12px; border-radius: 8px; }
.dots span { display: inline-block; animation: dot 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* Scorebox */
#scorebox { position: absolute; left: 987px; top: 608px; width: 674px; height: 258px; background: url(assets/img/score_popup.png) center/100% 100%;
  border-radius: 6px; opacity: 0; transition: opacity .5s; padding: 0 26px; }
.sb-title { height: 43px; line-height: 43px; font-size: 31px; font-weight: 800; }
.sb-row { display: flex; align-items: center; height: 92px; gap: 18px; font-size: 31px; }
.sb-row > img { width: 62px; height: 62px; object-fit: contain; }
.sb-row > span { width: 150px; }
.sb-rule { height: 1px; background: rgba(255,255,255,.35); margin: 0 4px; }
#stars { display: flex; gap: 18px; }
#stars img { width: 56px; height: 53px; }
#speedBar { position: relative; width: 350px; height: 52px; }
#speedBar > img:first-child { width: 350px; height: 52px; border-radius: 26px; }
#speedMark { position: absolute; top: -14px; width: 29px; height: 78px; margin-left: -14.5px; transition: left .6s ease-out; }

/* Attract (original: solid orange #DE5307, white Start_button sprite; text boxes from the scene) */
#attract { position: absolute; inset: 0; background: #de5307; transition: opacity .3s; }
#title { position: absolute; left: 162.5px; top: 115.5px; width: 1595px; height: 437px; display: flex; align-items: center;
  justify-content: center; font-size: 148px; line-height: 1; font-weight: 800; text-align: center; white-space: pre-line; }
#subtitle { position: absolute; left: 148px; top: 502.5px; width: 1624px; height: 227px; display: flex; align-items: center;
  justify-content: center; font-size: 54.5px; text-align: center; }
#startBtn { position: absolute; left: 758px; top: 806px; width: 404px; height: 98px; background: url(assets/img/start_button.png) center/100% 100%;
  color: #000; font-size: 43.6px; display: flex; align-items: center; justify-content: center; }

/* General UI */
#restartBtn { position: absolute; right: 0; top: 15px; width: 144px; height: 81px; background: url(assets/img/Restart_backdrop.png) center/100% 100%;
  color: #000; font-size: 18.84px; display: none; align-items: center; justify-content: flex-end; padding-right: 22px; cursor: pointer; }
#restartBtn::before { content: "\21BB"; position: absolute; left: 28px; font-size: 34px; }
#restartBtn.on { display: flex; }
.popup-wrap { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.popup-wrap.on { display: flex; } .popup-wrap.vis { opacity: 1; }
.popup { background: #1b1b1b; border-radius: 20px; text-align: center; position: relative; }
.popup.quit { width: 643px; height: 265px; }
.popup.timeout { width: 487px; height: 417px; }
.p-title { font-size: 40px; padding: 44px 30px 0; }
.p-buttons { position: absolute; left: 0; right: 0; bottom: 72px; display: flex; justify-content: center; gap: 44px; }
.p-buttons button { width: 150px; height: 56px; border: 0; border-radius: 28px; font: inherit; font-size: 26px; background: #fff; color: #000; }
.p-buttons button:active { background: #e18820; }
#toRing { position: absolute; left: 50%; top: 50%; width: 151px; height: 151px; margin: -60px 0 0 -75.5px; }
#toRing svg { width: 151px; height: 151px; transform: rotate(-90deg); }
#toRing circle { fill: none; stroke-width: 8; } #toRing .track { stroke: rgba(255,255,255,.2); }
#toArc { stroke: #fff; stroke-dasharray: 276.46; stroke-linecap: round; }
#toCount { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 800; }
#toTouch { position: absolute; left: 0; right: 0; bottom: 30px; font-size: 30px; }
#blackout { position: absolute; inset: 0; background: #000; opacity: 1; transition: opacity .3s; pointer-events: none; }
