/* Potion Pour — dark IQ house style, solid pink #FF00C6 accents. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #1b1030 0%, #0b0b10 55%) fixed, #0b0b10;
  color: #f4f1fa; font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh; overflow-x: hidden;
}
#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }
.hidden { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-flask { width: 40px; height: 40px; filter: drop-shadow(0 0 8px rgba(255,0,198,.55)); }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: 2px; font-weight: 800; }
.brand .tag { margin: 0; font-size: 10px; letter-spacing: 3px; color: #FF00C6; font-weight: 700; }
.icon-btn {
  background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; min-width: 48px; min-height: 48px; font-size: 20px; cursor: pointer;
}
.icon-btn:active { transform: scale(.94); }

.how {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 12px 14px; font-size: 14.5px; line-height: 1.5; color: #ddd6ee;
}
.how b { color: #fff; }
.home-actions { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.big-btn {
  flex: 1 1 150px; background: #FF00C6; color: #fff; border: none; border-radius: 14px;
  padding: 15px 12px; font-size: 17px; font-weight: 800; letter-spacing: .5px; cursor: pointer;
  box-shadow: 0 6px 22px rgba(255,0,198,.35);
}
.big-btn.alt { background: rgba(255,255,255,.07); border: 1px solid rgba(255,0,198,.55); box-shadow: none; }
.big-btn:active { transform: scale(.97); }
.pill {
  background: #FF00C6; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800;
  padding: 2px 8px; margin-left: 4px; vertical-align: middle;
}
.pill.done { background: #2ecc71; }
.sec-title { font-size: 13px; letter-spacing: 3px; color: #bdb2d9; margin: 18px 0 10px; }
.level-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.lvl-cell {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px;
}
.lvl-cell .st { font-size: 10px; color: #ffd94d; letter-spacing: 1px; min-height: 12px; }
.lvl-cell.locked { opacity: .35; cursor: default; }
.lvl-cell.daily { border-color: rgba(255,0,198,.6); }
.foot { color: #8f86ad; font-size: 12.5px; margin-top: 16px; line-height: 1.5; }

.game-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lvl-label { flex: 1; }
#lvlTitle { font-size: 20px; font-weight: 800; letter-spacing: .5px; display: block; }
.lvl-meta { font-size: 12px; color: #bdb2d9; }
.moves-box { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 9px 13px; font-size: 14px; }
.moves-box b { color: #FF00C6; font-size: 17px; }

#boardWrap { position: relative; padding: 26px 2px 8px; }
#board {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 14px;
}
#streamLayer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.stream {
  position: absolute; border-radius: 0 0 8px 8px; transform-origin: top center;
  box-shadow: 0 0 10px rgba(255,255,255,.15) inset;
}

/* --- the flask --- */
.flask {
  position: relative; width: 62px; cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .18s ease;
}
.flask .glass {
  position: relative; height: 148px; border-radius: 10px 10px 26px 26px / 8px 8px 30px 30px;
  background: linear-gradient(100deg, rgba(255,255,255,.14), rgba(255,255,255,.03) 40%, rgba(255,255,255,.10));
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: inset 0 0 18px rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.45);
  overflow: hidden; display: flex; flex-direction: column-reverse;
}
.flask .glass::after { /* glass shine */
  content: ""; position: absolute; top: 6px; bottom: 14px; left: 7px; width: 9px; border-radius: 6px;
  background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.05)); pointer-events: none; z-index: 5;
}
.flask .neck {
  height: 14px; margin: 0 14px; border: 2px solid rgba(255,255,255,.35); border-bottom: none;
  border-radius: 6px 6px 0 0; background: rgba(255,255,255,.07);
}
.flask.selected { transform: translateY(-16px); }
.flask.selected .glass { border-color: #FF00C6; box-shadow: 0 0 0 2px #FF00C6, 0 14px 24px rgba(255,0,198,.35); }
.flask.solved .glass { border-color: #2ecc71; box-shadow: 0 0 14px rgba(46,204,113,.5); }
.flask.solved::after {
  content: "✓"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  color: #2ecc71; font-weight: 900; font-size: 18px;
}
.flask.shake { animation: shake .3s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.flask.hint-glow .glass { border-color: #ffd94d; box-shadow: 0 0 0 2px #ffd94d, 0 0 18px rgba(255,217,77,.5); }
.seg {
  width: 100%; flex: 0 0 auto; position: relative;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 6px rgba(0,0,0,.25);
}
.seg .sym {
  font-size: 17px; color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.55);
  font-weight: 900; line-height: 1; pointer-events: none;
}
.seg.top-seg::before { /* liquid surface shine */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: rgba(255,255,255,.45); border-radius: 0 0 50% 50%;
}

.toast {
  margin: 10px auto 0; max-width: 420px; text-align: center; background: rgba(20,8,26,.92);
  border: 1px solid #FF00C6; color: #ffd7f4; border-radius: 12px; padding: 10px 14px; font-size: 14.5px;
}
.controls { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.ctl-btn {
  background: rgba(255,255,255,.07); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; padding: 12px 13px; font-size: 14.5px; font-weight: 700; cursor: pointer; min-height: 48px;
}
.ctl-btn:active { transform: scale(.95); }
.ctl-btn:disabled { opacity: .35; cursor: default; }
.rule-line { text-align: center; color: #8f86ad; font-size: 12.5px; margin-top: 12px; }

.modal {
  position: fixed; inset: 0; background: rgba(4,2,10,.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px;
}
.modal-card {
  background: linear-gradient(170deg, #221238, #120a20); border: 1px solid rgba(255,0,198,.5);
  border-radius: 22px; padding: 26px 22px; text-align: center; max-width: 380px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.win-flasks { font-size: 40px; }
.modal-card h2 { margin: 8px 0 2px; font-size: 30px; letter-spacing: 1px; }
.stars { font-size: 34px; color: #ffd94d; letter-spacing: 6px; min-height: 42px; }
.stars .off { color: rgba(255,255,255,.18); }
#winStats { color: #cfc6e8; font-size: 15px; line-height: 1.55; }
.modal-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

@media (max-width: 430px) {
  .flask { width: 54px; }
  .flask .glass { height: 132px; }
  .level-grid { grid-template-columns: repeat(5, 1fr); }
  .brand h1 { font-size: 22px; }
}
