@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg:#090b0f;
  --panel:#11151c;
  --panel-2:#171c25;
  --line:rgba(205,166,88,.28);
  --gold:#d5ad63;
  --gold-bright:#f1d18d;
  --text:#f3eee4;
  --muted:#9d9a93;
  --accent:#c79a4a;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
}

body{
  min-height:100vh;
  overflow-x:hidden;
  color:var(--text);
  background:
    radial-gradient(circle at 50% 18%,rgba(93,69,32,.18),transparent 34rem),
    radial-gradient(circle at 50% 100%,rgba(30,52,74,.13),transparent 40rem),
    var(--bg);
  font-family:Inter,system-ui,sans-serif;
}

button,select{font:inherit}

.ambient{
  position:fixed;
  pointer-events:none;
  filter:blur(80px);
  opacity:.22;
  border-radius:50%;
}

.ambient-a{
  width:320px;
  height:320px;
  left:-160px;
  top:20%;
  background:#5d4724;
}

.ambient-b{
  width:280px;
  height:280px;
  right:-140px;
  bottom:12%;
  background:#263d54;
}

.npc-app{
  width:min(1320px,94vw);
  margin:0 auto;
  padding:26px 0 42px;
  position:relative;
  z-index:1;
}

.topbar{
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:0 4px 18px;
  border-bottom:1px solid rgba(255,255,255,.07);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:max-content;
}

.brand-mark{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:11px;
  color:var(--gold-bright);
  font-family:Cinzel,serif;
  font-weight:700;
  font-size:20px;
  background:linear-gradient(145deg,#211c14,#0e1014);
  box-shadow:0 0 28px rgba(213,173,99,.08);
}

.brand-name{
  font:700 19px Cinzel,serif;
  letter-spacing:.16em;
}

.brand-sub{
  margin-top:2px;
  color:#77756f;
  font-size:9px;
  letter-spacing:.27em;
}

.top-controls{
  display:flex;
  align-items:end;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.top-controls label{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.top-controls label span{
  padding-left:3px;
  color:#716f6a;
  font-size:9px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
}

select{
  min-width:118px;
  height:38px;
  padding:0 30px 0 12px;
  color:#ddd8ce;
  border:1px solid rgba(255,255,255,.09);
  border-radius:8px;
  outline:none;
  background:#11151b;
  box-shadow:inset 0 1px rgba(255,255,255,.03);
}

select:focus{
  border-color:var(--line);
}

.icon-button{
  width:40px;
  height:38px;
  margin-top:14px;
  display:grid;
  place-items:center;
  color:var(--gold-bright);
  border:1px solid var(--line);
  border-radius:8px;
  background:linear-gradient(180deg,#282116,#17130e);
  cursor:pointer;
  transition:.18s ease;
}

.icon-button:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:rgba(241,209,141,.55);
  box-shadow:0 7px 24px rgba(0,0,0,.28),0 0 18px rgba(213,173,99,.08);
}

.icon-button:disabled,
select:disabled{
  opacity:.38;
  cursor:not-allowed;
}

.scene{
  position:relative;
  height:650px;
  margin-top:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.075);
  border-radius:16px;
  background:
    radial-gradient(circle at 50% 52%,rgba(255,255,255,.035),transparent 22rem),
    linear-gradient(180deg,#10141a,#090b0e);
  box-shadow:
    0 28px 80px rgba(0,0,0,.32),
    inset 0 1px rgba(255,255,255,.035);
}

.scene::before,
.scene::after{
  content:"";
  position:absolute;
  inset:14px;
  pointer-events:none;
  border:1px solid rgba(213,173,99,.06);
  border-radius:11px;
}

.scene::after{
  inset:auto 0 0;
  height:35%;
  border:0;
  border-radius:0;
  background:linear-gradient(transparent,rgba(4,6,9,.75));
}

.scene-glow{
  position:absolute;
  width:430px;
  height:430px;
  left:50%;
  top:48%;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:radial-gradient(circle,rgba(216,183,111,.065),transparent 66%);
  pointer-events:none;
}

.scene-grid{
  position:absolute;
  inset:0;
  opacity:.16;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size:48px 48px;
  mask-image:linear-gradient(transparent 0%,black 30%,black 75%,transparent 100%);
  pointer-events:none;
}

canvas{
  display:block;
  width:100%;
  height:100%;
}

#npcCanvas{
  position:relative;
  z-index:2;
}

.loading{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#85827b;
  font-size:12px;
  letter-spacing:.08em;
  pointer-events:none;
}

.npc-badge{
  position:absolute;
  left:28px;
  top:26px;
  z-index:5;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  color:#bcb7ad;
  border:1px solid rgba(255,255,255,.07);
  border-radius:999px;
  background:rgba(8,10,14,.58);
  backdrop-filter:blur(10px);
  font-size:10px;
  font-weight:600;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.badge-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--gold);
  box-shadow:0 0 10px rgba(213,173,99,.5);
}

.dialogue-window{
  position:relative;
  margin:-92px 24px 0;
  z-index:10;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:12px;
  background:
    linear-gradient(180deg,rgba(25,29,36,.97),rgba(12,15,20,.98));
  box-shadow:
    0 26px 65px rgba(0,0,0,.5),
    inset 0 1px rgba(255,255,255,.045);
  backdrop-filter:blur(14px);
}

.dialogue-window::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg,transparent,rgba(213,173,99,.035),transparent);
}

.dialogue-header{
  min-height:72px;
  padding:15px 22px 13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,.065);
}

.npc-name{
  color:var(--gold-bright);
  font:600 22px Cinzel,serif;
  letter-spacing:.04em;
}

.npc-title{
  margin-top:3px;
  color:#797873;
  font-size:10px;
  font-weight:600;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.dialogue-decor{
  display:flex;
  gap:5px;
}

.dialogue-decor span{
  width:4px;
  height:4px;
  transform:rotate(45deg);
  border:1px solid rgba(213,173,99,.5);
}

.dialogue-body{
  display:flex;
  min-height:152px;
}

.conversation{
  width:100%;
  min-width:0;
  padding:22px 25px 16px;
}

.dialogue-text{
  min-height:46px;
  color:#ddd9d0;
  font-size:14px;
  line-height:1.75;
  letter-spacing:.005em;
}

.options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin-top:12px;
}

.dialogue-option{
  min-height:38px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 11px;
  text-align:left;
  color:#c7c3bb;
  border:1px solid rgba(255,255,255,.07);
  border-radius:7px;
  background:rgba(255,255,255,.025);
  cursor:pointer;
  transition:.16s ease;
}

.dialogue-option:hover{
  color:#f0dfb8;
  border-color:rgba(213,173,99,.35);
  background:rgba(213,173,99,.065);
  transform:translateX(2px);
}

.option-number{
  width:25px;
  color:#8c6c39;
  font-size:9px;
  font-weight:700;
  letter-spacing:.08em;
}

.option-label{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
}

.dialogue-footer{
  min-height:43px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  padding:7px 15px;
  border-top:1px solid rgba(255,255,255,.05);
  background:rgba(0,0,0,.12);
}

.continue-button{
  border:0;
  color:#8e8b84;
  background:transparent;
  cursor:pointer;
  font-size:10px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.continue-button span{
  color:var(--gold);
  font-size:18px;
  vertical-align:-2px;
}

.error{
  margin:14px 24px 0;
  padding:12px 14px;
  color:#dca5a5;
  border:1px solid rgba(180,85,85,.3);
  border-radius:8px;
  background:rgba(100,30,30,.12);
  font-size:12px;
}

@media(max-width:900px){
  .topbar{
    align-items:flex-start;
    flex-direction:column;
  }

  .top-controls{
    width:100%;
    justify-content:flex-start;
  }

  .scene{height:590px}

  .dialogue-window{
    margin:-72px 12px 0;
  }
}

@media(max-width:620px){
  .npc-app{
    width:100%;
    padding:14px 0 28px;
  }

  .topbar{
    padding:0 14px 14px;
  }

  .brand-name{font-size:16px}

  .top-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .top-controls label:first-child{
    grid-column:1/-1;
  }

  select{
    width:100%;
  }

  .icon-button{
    margin-top:14px;
  }

  .scene{
    height:500px;
    border-left:0;
    border-right:0;
    border-radius:0;
  }

  .dialogue-window{
    margin:-45px 8px 0;
    border-radius:10px;
  }

  .dialogue-header{
    padding:13px 15px 11px;
  }

  .dialogue-body{
    min-height:145px;
  }

  .conversation{
    padding:17px 15px 12px;
  }

  .options{
    grid-template-columns:1fr;
  }

  .npc-badge{
    left:15px;
    top:15px;
  }
}


/* Navegação entre os arquivos visuais */
.archive-nav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.archive-nav a{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:0 14px;
  color:#aaa49a;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.09);
  border-radius:8px;
  background:#11151b;
  font-size:11px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  transition:.18s ease;
}
.archive-nav a:hover,.archive-nav a.active{
  color:var(--gold-bright);
  border-color:var(--line);
  background:linear-gradient(180deg,#282116,#17130e);
}
.effects-tools{
  display:flex;
  align-items:end;
  gap:10px;
  flex-wrap:wrap;
  padding:14px 4px 0;
}
.effects-tools label{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.effects-tools label span{
  padding-left:3px;
  color:#716f6a;
  font-size:9px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.effects-tools input{
  width:min(320px,80vw);
  height:38px;
  padding:0 12px;
  color:#ddd8ce;
  border:1px solid rgba(255,255,255,.09);
  border-radius:8px;
  outline:none;
  background:#11151b;
}
.effects-tools input:focus{border-color:var(--line)}
.effects-layout{margin-top:18px}
.effects-hint{margin:12px 4px 0;color:#77756f;font-size:11px;line-height:1.6}
@media(max-width:620px){
  .archive-nav{width:100%}
  .archive-nav a{flex:1;justify-content:center}
  .effects-tools input{width:100%}
  .effects-tools label{width:100%}
}
