/* ===== Base ===== */
:root {
  --navy: #07173a;
  --navy-deep: #030a1c;
  --gold: #e6bf6a;
  --gold-light: #fff1c2;
  --gold-dark: #9a6f1f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; color: #fff; }
#viewport { position: fixed; inset: 0; overflow: hidden; }
#viewport.idle { cursor: none; }

/* ===== Palco 16:9 ===== */
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, #12306a 0%, #0a1d45 45%, var(--navy-deep) 100%);
}
#camera { position: absolute; inset: 0; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

/* ===== Mural ===== */
#mural {
  position: relative;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, #153572 0%, #0c2250 55%, #081836 100%);
  border: 4px solid var(--gold);
  border-image: linear-gradient(135deg, #fff1c2, #c99a3a 30%, #7a5514 55%, #f2d27c 80%, #b98a2c) 1;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 40px 120px rgba(0,0,0,.7), 0 0 80px rgba(230,191,106,.12);
}
#mural::before { /* filete interno dourado discreto */
  content: ""; position: absolute; inset: 22px; border: 1px solid rgba(230,191,106,.35); pointer-events: none;
}
#frame-glow { /* luz dourada percorrendo a moldura (Cena 3) */
  --a: 0deg; position: absolute; inset: -4px; padding: 6px; opacity: 0; pointer-events: none; z-index: 500;
  background: conic-gradient(from var(--a), transparent 0 78%, rgba(255,226,140,.0) 80%, rgba(255,232,160,1) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  filter: drop-shadow(0 0 14px rgba(255,214,120,.9));
}
.slot {
  position: absolute; background: rgba(255,255,255,.025);
  border: 1px solid rgba(230,191,106,.10);
}

/* ===== Fotografias ===== */
.photo {
  position: absolute; background: #fff; opacity: 0;
  box-shadow: 0 3px 7px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.5);
  will-change: transform, opacity; backface-visibility: hidden;
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo .lift { position: absolute; inset: 0; box-shadow: 0 46px 80px rgba(0,0,0,.65); opacity: 0; z-index: -1; }
.photo .glow {
  position: absolute; inset: -4px; opacity: 0; pointer-events: none;
  box-shadow: 0 0 26px 8px rgba(255,214,120,.95); border: 2px solid rgba(255,235,170,.9);
}

/* ===== Camadas de efeito ===== */
#particles { position: absolute; inset: 0; width: 1920px; height: 1080px; pointer-events: none; }
#veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(5,14,36,.80) 0%, rgba(3,8,22,.96) 100%);
}
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 85% 85% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* ===== Cena 1 ===== */
#intro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; text-align: center;
}
#num20 {
  position: relative; font-family: Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 520px; line-height: .95; opacity: 0;
  background: linear-gradient(180deg, #fff6d0 0%, #f5cf6b 28%, #b88428 52%, #f8dd8e 74%, #84590f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,200,90,.55));
}
#num20::after { /* reflexo de luz passando */
  --sx: 220%;
  content: attr(data-text); position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,.95) 50%, transparent 58%) no-repeat;
  background-size: 300% 100%; background-position-x: var(--sx);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#intro-title {
  margin-top: 10px; font-weight: 300; font-size: 84px; letter-spacing: .08em; color: #f8ebc3; opacity: 0;
  text-shadow: 0 4px 30px rgba(0,0,0,.6), 0 0 40px rgba(230,191,106,.25);
}
#intro-msg {
  margin-top: 22px; font-weight: 300; font-size: 40px; letter-spacing: .14em; color: rgba(255,255,255,.85); opacity: 0;
}

/* ===== Cena 3 ===== */
#finale-title {
  position: absolute; left: 0; right: 0; top: 38px; text-align: center; opacity: 0;
  font-weight: 300; font-size: 76px; letter-spacing: .22em; padding-left: .22em;
  background: linear-gradient(180deg, #fff6d0, #e6bf6a 60%, #b98a2c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.6));
}
#finale-msg {
  position: absolute; left: 0; right: 0; bottom: 38px; text-align: center; opacity: 0;
  font-weight: 300; font-size: 34px; letter-spacing: .06em; color: rgba(255,248,225,.92);
  text-shadow: 0 3px 16px rgba(0,0,0,.7);
}

/* ===== Tela inicial ===== */
#start-screen {
  position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #12306a 0%, #091a3e 55%, var(--navy-deep) 100%);
}
.start-20 {
  font-family: Georgia, serif; font-weight: 700; font-size: 280px; line-height: 1;
  background: linear-gradient(180deg, #fff6d0, #f5cf6b 30%, #b88428 55%, #f8dd8e 75%, #84590f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255,200,90,.4));
}
.start-sub { font-size: 34px; font-weight: 300; letter-spacing: .5em; padding-left: .5em; color: #f2dfa4; margin-bottom: 70px; }
#btn-start {
  font: 500 30px "Segoe UI", Arial, sans-serif; letter-spacing: .25em; padding: 22px 64px; cursor: pointer;
  color: #1a1204; border: 0; border-radius: 4px;
  background: linear-gradient(135deg, #fff1c2, #e6bf6a 45%, #b98a2c);
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 30px rgba(230,191,106,.3);
  transition: transform .2s, box-shadow .2s, opacity .3s;
}
#btn-start:hover:not(:disabled) { transform: scale(1.04); box-shadow: 0 10px 50px rgba(0,0,0,.5), 0 0 50px rgba(230,191,106,.55); }
#btn-start:disabled { opacity: .35; cursor: default; }
#load-info { margin-top: 28px; font-size: 20px; letter-spacing: .1em; color: rgba(255,255,255,.55); height: 26px; }

/* ===== Controles discretos ===== */
#controls {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 10px); z-index: 200;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 30px;
  background: rgba(3,10,28,.7); border: 1px solid rgba(230,191,106,.25);
  opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s;
}
#controls.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#controls button {
  font: 400 15px "Segoe UI", Arial, sans-serif; color: #f2dfa4; background: transparent; border: 0; padding: 6px 12px; cursor: pointer;
  border-radius: 16px;
}
#controls button:hover { background: rgba(230,191,106,.15); }
#controls .sep { width: 1px; height: 18px; background: rgba(230,191,106,.3); }

/* ===== Slideshow em loop ===== */
#slideshow { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #12306a 0%, #0a1d45 45%, var(--navy-deep) 100%); }
#particles { z-index: 4; }
#vignette { z-index: 5; }
.ss-layer { position: absolute; inset: 0; opacity: 0; display: flex; align-items: center; justify-content: center; }
.ss-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover;
  filter: blur(40px) brightness(.35) saturate(1.1); }
.ss-kb { position: relative; will-change: transform; }
.ss-photo { display: block; border: 12px solid #fff; box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 6px 14px rgba(0,0,0,.5); }

/* ===== Logotipo vetorial da abertura ===== */
#logo { width: 1560px; height: auto; overflow: visible; filter: drop-shadow(0 0 22px rgba(246,200,92,.28)); }
#logo .ln { stroke-dasharray: 1.01 2; stroke-dashoffset: 1.01; }
#t-anos, #t-de, #logo-tag text, #logo-tag .tag-rule { opacity: 0; }
#logo-tag .tag-rule { fill: none; }

/* Nome do empregado sob a foto */
.photo .nome {
  position: absolute; left: -10px; right: -10px; top: 100%; margin-top: 5px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
  font-weight: 500; letter-spacing: .03em; color: var(--gold-light); text-shadow: 0 1px 4px rgba(0,0,0,.8);
  pointer-events: none;
}

/* Tela inicial: somente o botão (mensagem só em caso de erro) */
#load-info { display: none; }
#load-info.erro { display: block; }

