:root{
  --bg: #07060a;
  --stone: rgba(16, 14, 18, 0.76);
  --stone2: rgba(26, 22, 30, 0.72);
  --ink: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --faint: rgba(255,255,255,0.46);
  --ember: rgba(255, 122, 44, 0.85);
  --ember2: rgba(255, 184, 90, 0.65);
  --blood: rgba(220, 60, 80, 0.75);
  --shadow: rgba(0,0,0,0.55);
  --ring: rgba(255, 184, 90, 0.25);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 800px at 30% 20%, rgba(255,184,90,0.06), transparent 55%),
              radial-gradient(900px 700px at 70% 80%, rgba(220,60,80,0.05), transparent 55%),
              var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

#starfield{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.wrap{
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.temple{
  width: min(1100px, 100%);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--stone), var(--stone2));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 30px 80px var(--shadow),
    0 0 0 1px rgba(255,184,90,0.08) inset,
    0 0 60px rgba(255,122,44,0.10);
  overflow: hidden;
}

.header{
  display:flex;
  gap: 14px;
  align-items:center;
  padding: 18px 18px 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(90deg, rgba(255,122,44,0.10), transparent 35%);
}

.sigil{
  width: 52px;
  height: 52px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 0 0 1px rgba(255,184,90,0.08) inset, 0 0 24px rgba(255,122,44,0.12);
  font-size: 20px;
}

.title{
  font-size: 20px;
  letter-spacing: 0.3px;
}
.subtitle{
  font-size: 13px;
  color: var(--muted);
}

.gate{
  padding: 18px;
}
.gateTitle{
  font-size: 16px;
  margin-bottom: 6px;
}
.gateHint{
  margin: 0 0 12px 0;
  color: var(--muted);
}
.gateInput{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink);
  outline: none;
}
.gateInput:focus{
  border-color: rgba(255,184,90,0.32);
  box-shadow: 0 0 0 4px var(--ring);
}

.gateMsg{
  min-height: 18px;
  margin: 10px 0 0 0;
  color: var(--faint);
}

.gateDetails{
  margin-top: 10px;
  color: var(--muted);
}
.gatePhrase{
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink);
  font-style: italic;
}

.room{
  padding: 18px;
}

.hidden{ display:none; }

.presence{
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: radial-gradient(600px 250px at 20% 0%, rgba(255,122,44,0.14), transparent 55%),
              rgba(0,0,0,0.22);
  box-shadow: 0 0 0 1px rgba(255,184,90,0.06) inset;
}
.presenceTitle{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.presenceText{
  font-size: 15px;
  line-height: 1.45;
}

.invocations{
  margin-top: 14px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.28);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  font-size: 13px;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,184,90,0.25);
  box-shadow: 0 0 0 4px rgba(255,184,90,0.10);
}
.btn:active{ transform: translateY(0px); }

.primary{
  background: linear-gradient(180deg, rgba(255,122,44,0.35), rgba(0,0,0,0.22));
  border-color: rgba(255,184,90,0.25);
}
.danger{
  border-color: rgba(220,60,80,0.30);
}
.danger:hover{
  box-shadow: 0 0 0 4px rgba(220,60,80,0.10);
}

.altar{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
}

@media (max-width: 900px){
  .altar{ grid-template-columns: 1fr; }
}

.card{
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  box-shadow: 0 0 0 1px rgba(255,184,90,0.05) inset;
}

.cardTitle{
  font-size: 14px;
  margin-bottom: 4px;
}
.cardSub{
  margin: 0 0 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.rawInput{
  width: 100%;
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  min-height: 72px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink);
  outline: none;
}
.rawInput:focus{
  border-color: rgba(255,184,90,0.32);
  box-shadow: 0 0 0 4px var(--ring);
}

.row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.logTitle{
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.log{
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.log li{
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  color: var(--ink);
  font-size: 13px;
}
.log time{
  display:block;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 4px;
}

.smallNote{
  margin-top: 10px;
  color: var(--faint);
  font-size: 12px;
}

.sunGrid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 520px){
  .sunGrid{ grid-template-columns: repeat(2, 1fr); }
}
.sunGrid img{
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset;
  filter: saturate(1.05) contrast(1.02);
}

.premise{
  line-height: 1.45;
  color: var(--ink);
}
.sealLine{
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.footer{
  margin-top: 12px;
  padding: 12px 2px 0 2px;
  color: var(--faint);
  font-size: 12px;
  display:flex;
  align-items:center;
  gap: 10px;
}
.footerDot{
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255,122,44,0.85);
  box-shadow: 0 0 18px rgba(255,122,44,0.35);
}

.srOnly{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.lightbox.hidden{ display:none; }

.lightboxInner{
  width: min(920px, 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 30px 90px rgba(0,0,0,0.70);
  background: rgba(0,0,0,0.30);
}

.lightboxImg{
  width: 100%;
  height: auto;
  display:block;
}

.lightboxCaption{
  padding: 10px 12px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  color: rgba(255,255,255,0.70);
  font-size: 12px;
}

.lightboxClose{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.90);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.sunGrid img{
  cursor: zoom-in;
}
/* Quiet Heat pulse */
.presence.quietPulse{
  animation: quietPulse 4.8s ease-in-out infinite;
}
@keyframes quietPulse{
  0%,100% { box-shadow: 0 0 0 1px rgba(255,184,90,0.06) inset, 0 0 26px rgba(255,122,44,0.10); }
  50%     { box-shadow: 0 0 0 1px rgba(255,184,90,0.10) inset, 0 0 44px rgba(255,122,44,0.18); }
}


