/* Amaya's Montage — the live studio.
   Composition, type and colour follow the approved holding page. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #171511;
  color: #fff4d8;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ---------- the studio ---------- */
.studio {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: url('studio.png') center center / cover no-repeat;
}
.studio[hidden] { display: none; }

.studio::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #0005, transparent 40%, #0003);
}

/* ---------- arched title ---------- */
.arc {
  position: absolute;
  z-index: 3;
  top: 1vh;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(91vw, 1150px);
  font: 600 96px Georgia, serif;
  letter-spacing: 1px;
}
.arc svg {
  display: block;
  overflow: visible;
  width: 100%;
  fill: #fff1cf;
  filter: drop-shadow(0 3px 7px #0009);
}

/* ---------- Pip ---------- */
#stage {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #171511;
}
#stage[hidden] { display: none; }

#pip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  background: #171511;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.006); }
}


@keyframes lean    { 0%,100% { transform: translateY(-4px) rotate(-.8deg); }  50% { transform: translateY(-10px) rotate(.8deg); } }
@keyframes chatter { 0%,100% { transform: translateY(-4px) scaleY(1); }       50% { transform: translateY(-10px) scaleY(1.01); } }
@keyframes sway    { 0%,100% { transform: translateY(-3px) rotate(-1.3deg); } 50% { transform: translateY(-9px) rotate(1.3deg); } }


/* ---------- what Pip says — sits where "Coming Soon" sat ---------- */
#caption {
  position: absolute;
  z-index: 3;
  top: 44%;
  left: 4%;
  width: 48%;
  transform: translateY(-50%);
  margin: 0;
  font: 400 clamp(21px, 2.4vw, 36px)/1.35 Georgia, serif;
  color: #fff1cf;
  text-shadow: 0 3px 12px #000c;
}
#caption.error { font-size: clamp(15px, 1.5vw, 19px); color: #ffb3a4; font-family: Arial, sans-serif; }

/* ---------- controls ---------- */
#controls {
  position: absolute;
  z-index: 4;
  bottom: 6%;
  left: 4%;
  width: min(46%, 520px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#talk {
  width: 100%;
  min-height: 66px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffeccc, #f4ddac);
  color: #2b1a08;
  font: 700 19px Georgia, serif;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  cursor: pointer;
  box-shadow: 0 10px 30px #0008, 0 2px 0 #fff9 inset;
  transition: transform .12s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
#talk:active { transform: scale(.975); }
#talk:disabled { filter: grayscale(.55) brightness(.8); cursor: default; box-shadow: 0 6px 18px #0007; }
body.listening #talk {
  background: linear-gradient(180deg, #bdefff, #7fd8ef);
  box-shadow: 0 0 0 9px #7fd8ef26, 0 10px 30px #0008;
}

#type-form { display: flex; gap: 8px; }
#type-input {
  flex: 1;
  min-width: 0;
  padding: 13px 17px;
  font: 400 16px Arial, sans-serif;
  border: 1px solid #fff4d833;
  border-radius: 999px;
  background: #0f0d0a9e;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff4d8;
}
#type-input::placeholder { color: #fff4d875; }
#type-input:focus { outline: none; border-color: #f4ddac; }

#send {
  padding: 0 20px;
  border: 1px solid #fff4d833;
  border-radius: 999px;
  background: #0f0d0a9e;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f4ddac;
  font: 700 15px Georgia, serif;
  cursor: pointer;
}
#send:disabled { opacity: .45; cursor: default; }

#setup-toggle {
  position: absolute;
  z-index: 5;
  top: calc(8px + env(safe-area-inset-top));
  right: 10px;
  background: #0f0d0a73;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid #fff4d824;
  border-radius: 999px;
  color: #fff4d882;
  font: 400 12px Arial, sans-serif;
  cursor: pointer;
  padding: 6px 13px;
}

/* ---------- code word gate ---------- */
#lock { display: block; }
#lock[hidden], #stage[hidden] { display: none; }
#lock::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #171511b8;
}

#lock-form {
  position: absolute;
  z-index: 3;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 420px);
  text-align: center;
}

.lock-hint {
  margin: 0 0 22px;
  font: 400 clamp(15px, 1.6vw, 19px) Georgia, serif;
  color: #f4ddac;
  text-shadow: 0 2px 10px #000a;
}

#lock-input {
  width: 100%;
  padding: 16px 18px;
  font: 400 19px Arial, sans-serif;
  text-align: center;
  letter-spacing: 1px;
  border: 1px solid #fff4d840;
  border-radius: 14px;
  background: #0f0d0ad9;
  color: #fff4d8;
  margin-bottom: 12px;
}
#lock-input::placeholder { color: #fff4d85c; letter-spacing: .5px; }
#lock-input:focus { outline: none; border-color: #f4ddac; }

#lock-go {
  width: 100%;
  min-height: 58px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffeccc, #f4ddac);
  color: #2b1a08;
  font: 700 19px Georgia, serif;
  cursor: pointer;
  box-shadow: 0 10px 30px #0008;
}
#lock-go:active { transform: scale(.975); }
#lock-go:disabled { filter: grayscale(.55) brightness(.8); }

#lock-error {
  min-height: 1.4em;
  margin: 14px 0 0;
  font: 700 15px Arial, sans-serif;
  color: #ffb3a4;
  text-shadow: 0 2px 8px #000a;
}

/* ---------- setup panel ---------- */
#setup {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #0b0a08ed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
#setup[hidden] { display: none; }

.panel {
  background: #1f1b16;
  border: 1px solid #fff4d81f;
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 460px;
  min-width: 0;
  max-height: 88dvh;
  overflow-y: auto;
}
.panel h2 { margin: 0 0 14px; font: 400 22px Georgia, serif; color: #fff1cf; }
.panel h3 { margin: 22px 0 8px; font-size: 15px; color: #f4ddac; }
.panel label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 700; color: #f4ddac; }

.panel select, .panel button {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid #fff4d82e;
  background: #15120f;
  color: #fff4d8;
  margin-bottom: 8px;
}
.panel button { background: #f4ddac; color: #2b1a08; border: none; font-weight: 700; cursor: pointer; }
#setup-close { background: #2e2821; color: #fff4d8; margin-top: 16px; }

.note { font-size: 13px; color: #fff4d894; margin: 4px 0 0; line-height: 1.5; word-break: break-all; }

#status-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.status-row { display: flex; gap: 9px; align-items: baseline; }
.status-row .dot { font-size: 12px; }
.ok  { color: #8fe0a8; }
.bad { color: #ffb3a4; }

#transcript {
  font-size: 14px;
  line-height: 1.55;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid #fff4d81f;
  border-radius: 10px;
  padding: 10px 12px;
  background: #15120f;
}
#transcript p { margin: 0 0 9px; }
#transcript .who { font-weight: 700; color: #f4ddac; }
#transcript .who.her { color: #8fd4e0; }

/* ---------- phones ---------- */
@media (max-width: 650px) {
  .studio { background-position: 42% center; }

  .arc { top: 3vh; width: 98vw; font-size: 98px; }


  #caption {
    top: auto;
    bottom: 176px;
    left: 0;
    width: 100%;
    transform: none;
    padding: 0 16px;
    text-align: center;
    font-size: clamp(18px, 5vw, 24px);
    text-shadow: 0 2px 14px #000, 0 0 30px #000c;
  }

  #controls {
    bottom: calc(18px + env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    padding: 0 16px;
  }
}

/* ---------- short landscape ---------- */
@media (max-height: 600px) and (min-width: 651px) {
  .arc { width: 72vw; top: -3vh; }
  #caption { top: 46%; font-size: clamp(17px, 2vw, 24px); }
  #controls { bottom: 5%; }
  #talk { min-height: 54px; font-size: 17px; }
}
