:root{
  --gold:#f0c060;
  --gold2:#e8a830;
  --lilac:#9b7fc7;
  --sky:#7ec8e3;
  --cream:#fdf6e3;
  --dialog:#120d22;
  --dbord:#7755bb;
  --px:'Press Start 2P', monospace;
  --nu:'Nunito', sans-serif;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  min-height:100vh;
  background:radial-gradient(ellipse at 50% 0%, #2a1a4a 0%, #0d0820 65%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:var(--nu);
  overflow:hidden;
}

#wrap{
  width:100vw;
  height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  position:relative;
}

#topbar,
#hud{
  width:100vw;
  background:linear-gradient(90deg,#1e1235,#130d20,#1e1235);
  border:none;
  padding:10px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#topbar{
  border-bottom:1.5px solid #2d1a50;
  border-radius:0;
}

#hud{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#topbar-title,
#locname,
#ctrlhint,
#statbar,
#timerdisplay,
#dialogHint,
#startbtn,
.thint,
.teyebrow,
#tmain,
#mgprog{
  font-family:var(--px);
}

#topbar-title{
  color: #ffd95c;
  font-size: 14px;
  font-family: var(--px);
  text-shadow:
    0 0 8px rgba(255,217,92,.6),
    2px 2px 0 #5a3a00;
  letter-spacing: 2px;
}

#locname{
  color: #ffd95c;
  font-size: 14px;
  font-family: var(--px);
  text-shadow:
    0 0 8px rgba(255,217,92,.6),
    2px 2px 0 #5a3a00;
  letter-spacing: 2px;
}

#ctrlhint,
#statbar{
  font-size:5px;
}

#ctrlhint{
position: absolute;
left: 50%;
transform: translateX(-50%);
font-size: 8px;
color: #7a6aa0;
font-family: var(--px);
text-align: center;
}

#statbar,
#timerdisplay{
  text-align:right;
  min-width:120px;
}

#statbar{
  color:#f0a0b0;
}

#timerdisplay{
  font-size:6px;
  color:#ff5566;
  display:none;
}

#stepdots{
  display:flex;
  gap:5px;
  align-items:center;
}

.sdot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#1e1235;
  border:1.5px solid #3a2060;
  transition:all .3s ease;
}

.sdot.vis{
  background:#6a4aaa;
  border-color:#9b7fc7;
  box-shadow:0 0 5px rgba(155,127,199,.6);
}

.sdot.cur{
  background:var(--sky);
  border-color:#aae0f8;
  box-shadow:0 0 9px rgba(126,200,227,.9);
  transform:scale(1.3);
}

#gwin{
  position:relative;
  width:100vw;
  flex:1;
  overflow:hidden;
  image-rendering:pixelated;
  background:#000;
}

canvas{
  display:block;
  width:100%;
  height:100%;
  image-rendering:pixelated;
}

#dialogbox{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  background:var(--dialog);
  border:3px solid var(--dbord);
  border-radius:6px;
  padding:12px 16px 18px;
  display:none;
  z-index:100;
  min-height:84px;
  box-shadow:inset 0 0 0 1px rgba(119,85,187,.18),0 6px 28px rgba(0,0,0,.7);
}

#dspeaker{
  font-size:10px;
  margin-bottom:8px;
  color:var(--gold);
  text-shadow:0 0 8px rgba(240,192,96,.5);
  font-family:var(--px);
}

#dtext{
  font-size:13px;
  font-weight:700;
  color:#ddd4f8;
  line-height:1.55;
}

#dialogHint{
  position:absolute;
  right:12px;
  bottom:6px;
  font-size:5px;
  color:var(--lilac);
}

#drunk{
  position:absolute;
  inset:0;
  background:rgba(255,130,50,.08);
  pointer-events:none;
  display:none;
  z-index:50;
}

#titlescreen,
#mgover,
#transscreen,
#videoover{
  position:absolute;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  z-index:200;
  text-align:center;
  padding:20px;
}

#titlescreen{
  display:flex;
  position:absolute;
  inset:0;
  overflow:hidden;
  background:
    radial-gradient(circle at top, rgba(120,80,200,0.25), transparent 40%),
    radial-gradient(circle at 20% 30%, rgba(255,180,255,0.08), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(150,120,255,0.08), transparent 30%),
    linear-gradient(to bottom,
      #05030d 0%,
      #0d0820 20%,
      #1a1035 55%,
      #12081f 100%);
}

#titlebg,
#titlestars,
#titlehorizon{
  position:absolute;
  inset:0;
}

#titlestars{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0.9;
  pointer-events:none;
}

#titlebg::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 30% 70%, rgba(255,255,255,0.03), transparent 20%),
    radial-gradient(circle at 70% 60%, rgba(180,150,255,0.06), transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(255,200,255,0.04), transparent 20%);
  animation: floatMist 14s ease-in-out infinite alternate;
}

@keyframes floatMist{
  from{
    transform: translateY(0px);
  }
  to{
    transform: translateY(-20px);
  }
}

#titlehorizon{
  top:auto;
  height:110px;
  background:linear-gradient(0deg,rgba(180,100,50,.2) 0%,transparent 100%);
}

#titlecontent{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.teyebrow{
  font-size:11px;
  font-weight:800;
  color:var(--lilac);
  letter-spacing:3px;
  text-transform:uppercase;
  margin-bottom:14px;
}

#tmain{
  color:var(--gold);
  font-size:12px;
  line-height:2.3;
  margin-bottom:8px;
  text-shadow:0 0 22px rgba(240,192,96,.55);
}

#tsub{
  font-size:13px;
  font-weight:700;
  color:#7a6aa0;
  margin-bottom:30px;
  line-height:1.75;
}

#startbtn,
.mgb,
#closevid{
  background:#1a1030;
  border:2px solid var(--gold);
  color:white;
  padding:12px 20px;
  border-radius:8px;
  cursor:pointer;
}

#startbtn:hover,
.mgb:hover,
#closevid:hover{
  transform:translateY(-1px);
}

.thint{
  font-size:8px;
  color:#706293;
  margin-top:22px;
  line-height:2.5;
}

#mgover{
  background:rgba(8,5,18,.97);
}

#mgover h2,
#videoover h2,
.ttitle{
  font-family:var(--px);
  font-size:8px;
  line-height:2;
  text-align:center;
  color:var(--gold);
}

#mgprog{
  font-size:6px;
  color:var(--lilac);
  margin-bottom:16px;
}

.mgq{
  font-size:14px;
  font-weight:800;
  color:#ddd4f8;
  text-align:center;
  line-height:1.5;
  margin-bottom:18px;
  max-width:360px;
}

.mgopts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  width:100%;
  max-width:400px;
  margin-top:20px;
}

.mgb.ok{
  background:#091a0d;
  border-color:#4adf8a;
  color:#4adf8a;
}

.mgb.bad{
  background:#1a0909;
  border-color:#ff5566;
  color:#ff5566;
}

#mgscore{
  font-size:13px;
  font-weight:800;
  margin-top:14px;
  min-height:20px;
}

#transscreen{
  background:#06040f;
  z-index:300;
}

.temi{
  font-size:46px;
  margin-bottom:20px;
}

.tsub{
  font-size:12px;
  font-weight:700;
  color:#5a4888;
}

.tdots{
  margin-top:22px;
  display:flex;
  gap:7px;
}

.tdots span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--lilac);
}

#videoover{
  background:rgba(6,4,14,.98);
  z-index:400;
}

#vidph{
  width:100%;
  max-width:380px;
  min-height:630px;
  background:#0e0a1c;
  border:2px solid #2e1e50;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  padding:20px;
  text-align:center;
  margin:20px 0;
}

#vidph p{
  font-size:12px;
  font-weight:700;
  line-height:1.7;
  color:#5a4888;
}

#endingScreen{
  position:absolute;
  inset:0;
  display:none;
  justify-content:center;
  align-items:center;
  background:
    radial-gradient(circle at top,#2b2140 0%,#120f1d 70%);
  z-index:100;
}

#endingContent{
  text-align:center;
  max-width:700px;
  padding:40px;
  color:white;
  animation:fadeUp .8s ease;
}

.endingTitle{
  font-family:'Press Start 2P';
  font-size:32px;
  color:#ffd966;
  margin-bottom:40px;
  line-height:1.5;
}

.endingText{
  font-size:22px;
  line-height:1.8;
  font-weight:700;
  color:#f3ecff;
  margin-bottom:40px;
}

#endingContent button{
  background:#ffd966;
  border:none;
  padding:16px 28px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
  font-size:18px;
}
