* { box-sizing: border-box; }

/* Loading splash — logo with swaying eye tentacles, title, slogan, then fades to the viewer */
.splash {
  position: fixed; inset: 0; z-index: 60; background: #f4f1ec;
  display: flex; align-items: center; justify-content: center; overflow-y: auto;
  transition: opacity .6s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; animation: splash-rise .7s ease both; padding: 20px; }
.splash-logo { width: 200px; height: 200px; }
.splash .tentacle { transform-box: view-box; }
.splash .tent-l { transform-origin: 96px 132px; animation: tentacle-sway 1.9s ease-in-out infinite; }
.splash .tent-r { transform-origin: 152px 128px; animation: tentacle-sway 1.9s ease-in-out .35s infinite; }
.splash-title {
  font-size: 36px; font-weight: 700; color: #9c6642; letter-spacing: .5px;
  margin-top: 6px; animation: splash-fade .9s ease .25s both;
}
.splash-slogan {
  font-size: 15.5px; color: #6b4a2f; opacity: .85; margin-top: 6px;
  animation: splash-fade .9s ease .55s both;
}
.splash-hw {
  margin-top: 26px; animation: splash-fade .9s ease .85s both;
  display: flex; justify-content: center; align-items: flex-end; gap: 14px;
}
.splash-hw img { height: min(230px, 28vh, 43vw); width: auto; display: block; }
/* Entry gate — after the splash: choose About or Demo before the camera starts */
.gate {
  position: fixed; inset: 0; z-index: 55; background: #f4f1ec;
  display: flex; align-items: center; justify-content: center; overflow-y: auto;
}
.gate[hidden] { display: none; }
.gate-inner { text-align: center; padding: 20px; animation: splash-rise .7s ease both; }
.gate-logo { width: 120px; height: 120px; }
.gate-title { font-size: 30px; font-weight: 700; color: #9c6642; letter-spacing: .5px; margin-top: 6px; }
.gate-slogan { font-size: 15.5px; color: #6b4a2f; opacity: .85; margin-top: 6px; }
.gate-btns { display: flex; gap: 16px; justify-content: center; margin-top: 34px; }
.gate-btn {
  font-size: 18px; font-weight: 600; padding: 13px 38px; border-radius: 8px; cursor: pointer;
  color: #9c6642; background: transparent; border: 2px solid #9c6642; text-decoration: none;
  font-family: inherit; display: inline-block;
}
.gate-btn-primary { background: #9c6642; color: #fff; }
.gate-btn:hover { background: #87572f; border-color: #87572f; color: #fff; }
@keyframes tentacle-sway {
  0%, 100% { transform: rotate(-2.6deg); }
  50% { transform: rotate(3.2deg); }
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .splash .tent-l, .splash .tent-r, .splash-inner, .splash-title, .splash-slogan { animation: none; }
}
html, body { margin: 0; height: 100%; background: #000; font-family: Verdana, Geneva, Tahoma, sans-serif; }
.stage { position: fixed; inset: 0; overflow: hidden; background: #000; }

#cam {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; background: #111;
}
#master {
  position: absolute; top: 84px; right: 16px; z-index: 2;
  width: min(34vw, 460px); aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,.55);
  background: #000;
}
/* Switched: master full screen, cam small on top */
.stage.swapped #master { inset: 0; width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.stage.swapped #cam {
  inset: auto; top: 84px; right: 16px; z-index: 3;
  width: min(34vw, 460px); height: auto; aspect-ratio: 16 / 9;
  border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,.55);
}

.overlay-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 26px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
}
.logo { width: 46px; height: 46px; background: #f4f1ec; border-radius: 10px; padding: 3px; }
.app-name { font-size: 22px; font-weight: 700; line-height: 1.1; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.slogan { font-size: 12.5px; opacity: .92; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.kick-overlay {
  position: fixed; inset: 0; z-index: 70; background: #f4f1ec;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.kick-overlay[hidden] { display: none; }
.kick-title { font-size: 26px; font-weight: 700; color: #9c6642; }
.kick-text { color: #6b4a2f; margin: 8px 0 20px; }
#btnKickRestart {
  background: #9c6642; color: #fff; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 600; padding: 10px 22px; cursor: pointer;
}
.section-banner {
  margin-left: auto; text-align: right; font-size: 15px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.7); max-width: 46vw;
}
.section-banner .sub { display: block; font-size: 12px; font-weight: 400; opacity: .9; }

.verdict-badge {
  position: absolute; z-index: 6; left: 50%; bottom: 108px; transform: translateX(-50%);
  padding: 10px 22px; border-radius: 999px; color: #fff; font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); text-align: center; max-width: 86vw;
}
.verdict-badge .reason { display: block; font-size: 13px; font-weight: 400; margin-top: 2px; }
.verdict-badge.pass { background: #1f9d55; }
.verdict-badge.no-pass { background: #d64545; }
.verdict-badge.pending { background: #555f6e; }

.checklist {
  position: absolute; z-index: 5; left: 50%; bottom: 108px; transform: translateX(-50%);
  color: #fff; font-size: 13px; line-height: 1.5; text-align: center;
  background: rgba(0,0,0,.55); padding: 8px 16px; border-radius: 12px;
  max-width: 92vw;
}
.checklist .cl-title { font-weight: 700; display: block; margin-bottom: 2px; }
.checklist .cl-item { opacity: .92; }
.checklist .cl-item + .cl-item::before { content: "· "; }

.hint {
  position: absolute; z-index: 5; left: 50%; bottom: 74px; transform: translateX(-50%);
  color: #fff; font-size: 13.5px; text-shadow: 0 1px 4px rgba(0,0,0,.8);
  background: rgba(0,0,0,.35); padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 26px 12px 14px;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.62));
}
.controls button, .save-form button, #btnAgain {
  border: 1px solid rgba(255,255,255,.35); background: rgba(20,20,20,.72); color: #fff;
  font-size: 15px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
}
.controls button:hover:not(:disabled), .save-form button:hover { background: rgba(60,60,60,.85); }
.controls button:disabled { opacity: .38; cursor: default; }
.controls button.primary, .save-form button.primary { background: #9c6642; border-color: #9c6642; font-weight: 700; }
.controls button.capture { background: #1f9d55; border-color: #1f9d55; font-weight: 700; }

.album {
  position: absolute; inset: 0; z-index: 10; overflow: auto;
  background: rgba(10,10,10,.88); padding: 22px 14px 40px;
}
.album-card { max-width: 980px; margin: 0 auto; color: #fff; }
.album-card h2 { margin: 4px 0 14px; font-size: 22px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.shot { position: relative; border-radius: 10px; overflow: hidden; background: #1c1c1c; }
.shot img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.shot .mark {
  position: absolute; top: 8px; right: 8px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.shot .mark.pass { background: #1f9d55; }
.shot .mark.no-pass { background: #d64545; }
.shot .mark.none { background: #555f6e; }
.shot .cap { padding: 8px 10px; font-size: 12.5px; }
.shot .cap .r { display: block; opacity: .75; margin-top: 2px; }
.shot.empty { display: flex; align-items: center; justify-content: center; min-height: 130px; color: #999; font-size: 13px; }
.save-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-top: 20px; }
.save-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.save-form input {
  padding: 10px 12px; border-radius: 8px; border: 1px solid #555;
  background: #161616; color: #fff; font-size: 15px; min-width: 200px;
}
.save-status { margin-top: 14px; font-size: 14.5px; }
#btnAgain { margin-top: 12px; }
