:root{
  --bg:#f7fbff;
  --ground:#cfeffd;
  --text:#0b2340;
}
* {
  box-sizing:border-box
}
html,body {
  height:100%;
  margin:0;
  margin-bottom: -1000px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial
}
body {
  background:var(--bg);
  color:var(--text);
}
#wrap {
  width:100%;
  max-width:100%;
  padding:0;
  position: relative;
}
canvas {
  width:100%;
  height:100vh;
  display:block;
  background:linear-gradient(#eaf6ff,#f7fbff);
}
#ui {
  display:flex;
  justify-content:space-between;
  padding:8px 6px;
  font-weight:600;
  align-items:center;
}
#left-ui {
  display:flex;
  flex-direction:column
}
#score {
  font-size:16px
}
#hint {
  font-size:13px;
  color:#3b556e
}
#right-ui {
  display:flex;
  flex-direction:column;
  align-items:flex-end
}
#chaos-ind { 
  font-size:13px;
  color:#b02a2a;
  font-weight:800
}
#high {
  font-size:13px;
  color:#254a6b
}
#overlay {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(3,10,18,0.36)
}
.hidden {
  display:none
}

#overlay-card{
    background:white;
    padding:22px;
    border-radius:10px;
    margin-top: -20rem;
    min-width:260px;
    max-width:480px;
    box-shadow:0 20px 50px rgba(2,18,38,0.18);
    text-align:center;
}
#overlay-card h1 {
  margin:0 0 8px;
  font-size:22px
}
#overlay-card p {
    margin:8px 0;
}
#overlay-msg {
    color: red;
}
#restart-btn {
  margin-top:12px;
  padding:10px 14px;
  border-radius:8px;
  border:0;
  background:#0b79ff;
  color:white;
  font-weight:700;
  cursor:pointer
}
#restart-btn:active { 
  transform:translateY(1px)
}
#log {
  position:absolute;
  right:18px;
  top:18px;
  width:220px;
  background:rgba(255,255,255,0.9);
  padding:10px;
  border-radius:8px;
  box-shadow:0 8px 20px rgba(2,18,38,0.06);
  font-size:12px;
  color:#123
}
#log-list {
  max-height:180px;
  overflow:auto;
   margin-top:8px
}
.speech{
  position:absolute;
  pointer-events:none;
  font-size:20px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,0.95);
  box-shadow:0 6px 18px    ││ rgba(2,18,38,0.08);
  border:1px solid rgba(2,18,38,0.06);
}
@keyframes fall {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100vh);
  }
}

#fake-update {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2%;
  background: transparent;
  animation: fall 12s linear infinite;
}

.update-card {
  background: #f3f6ff;
  padding: 18px;
  border-radius: 10px;
  width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(2, 18, 38, 0.25);
  transform: translateY(0);
}
.progress {
  height:10px;
  background:#e0e6ff;
  border-radius:6px;
  margin-top:12px;
  overflow:hidden
}
.progbar {
  height:100%;
  width:0%;
  background:#2f6cff;
  border-radius:6px;
  transition:width 0.2s linear
}
@media (max-width:520px) {
  #overlay-card {
    margin:12px
  }
  #score {
    font-size:14px
  }
  #log {
    display:none
  }
}
