#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tb-hud {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-dim, #8b93ad);
  align-items: center;
}

#list-view, #puzzle-view {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
}

/* ---------- home list ---------- */
.ll-progress {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ll-progress .sub { font-weight: 400; color: var(--fg-dim, #8b93ad); font-size: 13px; }

.pcard {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel, #1a2033);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.pcard:active { transform: scale(0.98); }
.pcard .pnum {
  font-size: 12px;
  color: var(--fg-dim, #8b93ad);
  min-width: 22px;
}
.pcard .ptitle { flex: 1; font-size: 15px; }
.pcard .pstatus { font-size: 14px; color: #ffd75e; min-width: 30px; text-align: right; }

/* ---------- puzzle screen ---------- */
#pz-head { display: flex; align-items: baseline; gap: 10px; }
#pz-num { color: var(--fg-dim, #8b93ad); font-size: 13px; }
#pz-title { font-size: 20px; margin: 4px 0; flex: 1; }
#pz-stars { color: #ffd75e; font-size: 14px; }
#pz-text { line-height: 1.5; font-size: 15px; color: #cfd5ea; }

#answer-area { margin: 12px 0; }
.opt-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel, #1a2033);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.opt-btn.sel { border-color: var(--accent, #6ea8ff); background: rgba(110, 168, 255, 0.12); }
.opt-btn.right { border-color: #4caf50; }
.opt-btn.wrong { border-color: #e05454; }

.ans-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel, #1a2033);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 11px 14px;
  color: inherit;
  font: inherit;
  font-size: 16px;
}

#pz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
#pz-actions .btn { flex: 1 1 auto; }

.pz-box {
  background: var(--panel, #1a2033);
  border-left: 3px solid var(--accent, #6ea8ff);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.45;
}
#pz-explain { border-left-color: #4caf50; }

/* ---------- sims ---------- */
.sim {
  background: var(--panel, #1a2033);
  border-radius: 14px;
  padding: 14px 12px;
  margin: 12px 0;
}
.sim-btn {
  background: rgba(110, 168, 255, 0.14);
  border: 1px solid rgba(110, 168, 255, 0.4);
  color: inherit;
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  margin: 2px;
}
.sim-btn:disabled { opacity: 0.4; }
.sim-info { font-size: 13px; color: var(--fg-dim, #8b93ad); margin-top: 8px; }
.sim-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* jugs */
.jugs-row { display: flex; gap: 28px; justify-content: center; }
.jug { position: relative; width: 70px; }
.jug-fill {
  height: 0%;
  background: linear-gradient(180deg, #4d9fff, #2b6dd1);
  border-radius: 0 0 8px 8px;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  transition: height 0.2s;
}
.jug::before {
  content: '';
  display: block;
  height: 110px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top: none;
  border-radius: 0 0 10px 10px;
}
.jug-cap { position: absolute; top: 50px; width: 100%; text-align: center; font-size: 12px; font-weight: 700; z-index: 1; }
.jug-btns { display: flex; flex-direction: column; margin-top: 6px; }

/* river + bridge */
.river-row, .bridge-row { display: flex; gap: 6px; align-items: stretch; }
.bank { flex: 1; background: rgba(255, 255, 255, 0.04); border-radius: 8px; padding: 8px; min-height: 70px; }
.bank-label { font-size: 11px; color: var(--fg-dim, #8b93ad); margin-bottom: 6px; text-align: center; }
.bank-items, .bridge-people { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.river-item { font-size: 24px; background: none; border: none; cursor: pointer; padding: 2px; }
.boat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; }
.boat-icon { font-size: 26px; }
.person-btn {
  background: rgba(110, 168, 255, 0.14);
  border: 1px solid rgba(110, 168, 255, 0.4);
  border-radius: 8px; color: inherit; font: inherit;
  padding: 8px 10px; cursor: pointer;
}
.person-btn.sel { background: var(--accent, #6ea8ff); color: #0f1320; font-weight: 700; }
.bridge-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; min-width: 44px; }
.light-side { font-size: 12px; }
.cross-btn { width: 100%; margin-top: 8px; padding: 10px; }

/* switches */
.sw-toggles { display: flex; gap: 10px; justify-content: center; }
.sw-toggle {
  flex: 1;
  padding: 14px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit; font: inherit; cursor: pointer;
}
.sw-toggle.on { background: #ffd75e; color: #111; font-weight: 700; }
.bulb-view { text-align: center; font-size: 20px; margin: 12px 0; }
.sw-guess { display: flex; gap: 8px; justify-content: center; }

/* scale */
.scale-beam { display: flex; align-items: flex-end; justify-content: space-between; transition: transform 0.3s; margin-bottom: 8px; }
.scale-beam.tilt-l { transform: rotate(-4deg); }
.scale-beam.tilt-r { transform: rotate(4deg); }
.beam-bar { flex: 1; height: 2px; background: rgba(255, 255, 255, 0.3); margin: 0 4px 20px; }
.pan { width: 110px; min-height: 56px; border: 1px dashed rgba(255, 255, 255, 0.3); border-radius: 8px; padding: 4px; }
.pan-items, .balls-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.balls-row { margin: 8px 0; }
.ball-btn { font-size: 22px; background: none; border: none; cursor: pointer; }
.ball-btn.pick { background: rgba(255, 215, 94, 0.2); border-radius: 50%; }

/* coinsDark */
.coins-display { font-size: 16px; text-align: center; margin: 8px 0; }
.coins-slider, .bact-slider { flex: 1; }

/* monty */
.doors-row { display: flex; gap: 12px; justify-content: center; }
.door-btn {
  font-size: 44px;
  background: var(--panel, #252c45);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  width: 84px; height: 100px;
  cursor: pointer;
}
.door-btn.picked { border-color: var(--accent, #6ea8ff); }
.door-btn:disabled { opacity: 0.7; }

/* ropes */
.rope-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.rope-end { font-size: 18px; background: none; border: none; cursor: pointer; }
.rope-bar {
  flex: 1; height: 14px;
  background: repeating-linear-gradient(45deg, #8d6e4c, #8d6e4c 6px, #7a5f42 6px, #7a5f42 12px);
  border-radius: 7px; overflow: hidden; position: relative;
}
.rope-burned { height: 100%; background: #1a1a1a; transition: width 0.3s; }

/* eggs */
.eggs-tower {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}
.floor-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-dim, #8b93ad);
  border-radius: 4px;
  font-size: 10px;
  padding: 5px 0;
  cursor: pointer;
}
.floor-btn.break { background: #5a2b2b; color: #fff; }
.floor-btn.safe { background: #2b4a2b; color: #fff; }

/* bacteria */
.jar {
  height: 120px; width: 90px; margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top: none;
  border-radius: 0 0 12px 12px;
  position: relative; overflow: hidden;
}
.jar-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, #7ed957, #3d8b2f);
}
