:root{
  --ink: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --line: rgba(255,255,255,.12);

  --panel: rgba(10, 12, 22, .62);
  --panel2: rgba(10, 12, 22, .44);

  --shadow: 0 30px 90px rgba(0,0,0,.45);
  --shadow2: 0 14px 34px rgba(0,0,0,.35);

  --radius: 20px;
  --accent: rgba(175, 195, 255, .95);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: #040513; /* canvas will cover */
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  overflow:scroll;
}

/* Full background canvas */
#sky{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display:block;
}

/* UI layer */
.ui{
  position: relative;
  z-index: 5;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  user-select:none;
}
.dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(175,195,255,.16);
}
.brand-name{
  font-size: 13px;
  letter-spacing:.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

.ghost{
  appearance:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.84);
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
  cursor:pointer;
  backdrop-filter: blur(10px);
}
.ghost:hover{ background: rgba(255,255,255,.09); }

.panel{
  margin-top: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  backdrop-filter: blur(10px);
  max-width: 560px;
}

.kicker{
  margin:0;
  font-size: 12px;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.60);
}

.title{
  margin:8px 0 6px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing:-0.02em;
  line-height: 1.15;
}

.sub{
  margin:0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.stats{
  display:grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  box-shadow: var(--shadow2);
  color: rgba(255,255,255,.86);
  font-size: 14px;
  line-height: 1.55;
}

.controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top: 12px;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(175,195,255,.92);
  color: rgba(6,8,18,.92);
  padding: 11px 14px;
  border-radius: 999px;
  cursor:pointer;
  font-size: 14px;
  box-shadow: var(--shadow2);
}
.btn:hover{ filter: brightness(1.05); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn.secondary{
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
}

.action{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  max-width: 560px;
}
.actionTitle{
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  margin-bottom: 8px;
}
.actionBody{
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.92);
}
.actionWhy{
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,.68);
}

.note{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

@media (prefers-reduced-motion: reduce){
  /* canvas still renders but animation will be gentler (handled in JS) */
}

.picker{
  margin-top: 10px;
  display:grid;
  gap: 6px;
}

.pickLabel{
  font-size: 12px;
  color: rgba(255,255,255,.65);
  letter-spacing: .04em;
}

.pickSelect{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.90);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.pickSelect:focus{
  border-color: rgba(175,195,255,.55);
}

.moodTitle{
  margin: 6px 0 2px;
  font-size: 22px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.95);
}

.moodMeta{
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(255,255,255,.65);
}
.characterBar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;          /* higher so it sits above canvas/ui */
  padding: 10px 14px 14px;
  pointer-events: none; /* bar doesn’t block clicks except buttons */
}

.characterRow{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  pointer-events: auto; /* enable button clicks */
}

.charBtn{
  appearance:none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.92);
  border-radius: 16px;
  padding: 10px 12px;
  cursor:pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  gap: 10px;
}

.charArt{
  display:flex;
  align-items:center;
  justify-content:center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  flex: 0 0 34px;
}

.charImg{
  width: 28px;
  height: 28px;
  object-fit: contain;
  display:block;
}

.charName{
  font-size: 12px;
  letter-spacing: .04em;
  color: rgba(255,255,255,.78);
  white-space: nowrap;
}

.speech{
  margin-top: 10px;
  max-width: 720px;
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,12,22,.72);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
}

.speechName{
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  margin-bottom: 6px;
}

.speechText{
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,.92);
}

/* make sure panel content doesn't sit behind the bar */
@media (max-height: 720px){
  .ui{ padding-bottom: 120px; }
}
.characterStage{
  margin-top: 14px;
  display: grid;
  place-items: center;
  gap: 10px;
}

#characterBig{
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  display: grid;
  place-items: center;
  overflow: hidden;         
  border-radius: 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}


.characterBig:hover{
  border-color: rgba(175,195,255,.45);
}

.characterBig:active{
  transform: translateY(1px);
}

#characterBig img{
  max-width: 75%;
  max-height: 75%;
  width: 100%;
  height: 100%;
  object-fit: contain;       
  object-position: center;
  display: block;            
}

#characterBig > div,
#characterBig > span{
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  font-size: clamp(56px, 10vw, 110px);
  line-height: 1;
}

.speechCenter{
  width: min(720px, 92vw);
  text-align: center;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.topRight{
  display:flex;
  align-items:center;
  gap: 10px;
}

.topSelect{
  appearance:none;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.9);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 13px;
}
.tapHint{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  display:flex;
  align-items:center;
  gap: 8px;
}

.tapHint::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(175,195,255,.75);
  box-shadow: 0 0 18px rgba(175,195,255,.55);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse{
  0%,100%{ transform: scale(1); opacity:.55; }
  50%{ transform: scale(1.35); opacity:1; }
}
