:root{
  --bg:#0f1116;
  --panel:#171a22;
  --panel2:#1f2330;
  --text:#e9ecf1;
  --muted:#a4adbd;
  --accent:#7dd3fc;
  --danger:#fb7185;
  --ok:#86efac;
  --warn:#fbbf24;
  --line:#2a3040;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 700px at 30% 0%, #1a1f2e, var(--bg));
  color:var(--text);
}

#app{min-height:100%; display:flex; flex-direction:column}
.topbar{
  padding:14px 16px;
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}
.brand .title{font-size:18px; font-weight:800; letter-spacing:0.3px}
.brand .sub{font-size:12px; color:var(--muted)}
.muted{color:var(--muted)}
.fileLabel{font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center}
.fileLabel input{max-width:240px}

.layout{
  display:grid;
  grid-template-columns: 1fr 340px;
  gap:14px;
  padding:14px;
  align-items:start;
}

.stageWrap{
  position:relative;
  border:1px solid var(--line);
  background: rgba(0,0,0,0.2);
  border-radius:14px;
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
#game{
  width:100%;
  height: calc(100vh - 110px);
  display:block;
  background:#0b0d12;
}
.hint{
  position:absolute;
  left:12px;
  bottom:12px;
  background:rgba(0,0,0,0.55);
  border:1px solid rgba(255,255,255,0.12);
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
  color:var(--text);
  pointer-events:none;
  max-width:60%;
}

.panel{display:flex; flex-direction:column; gap:12px}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
}
.cardTitle{font-weight:800; margin-bottom:8px}
.row{
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:13px;
  margin:4px 0;
}
.label{color:var(--muted)}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(125, 211, 252, 0.12);
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  text-align:center;
}
.btn:hover{background: rgba(125, 211, 252, 0.18); border-color: rgba(125, 211, 252, 0.35)}
.btn:active{transform: translateY(1px)}
.btn.secondary{
  background: rgba(255,255,255,0.06);
}
.btn.secondary:hover{background: rgba(255,255,255,0.09)}
.btn.disabled, .btn:disabled{
  opacity:0.5; cursor:not-allowed;
}
.small{font-size:12px; line-height:1.35}
hr{border:none; border-top:1px solid var(--line); margin:10px 0}

.log{
  max-height: 190px;
  overflow:auto;
  font-size:12px;
  color:var(--text);
  padding-right:6px;
}
.log .entry{padding:6px 8px; border:1px solid rgba(255,255,255,0.08); border-radius:12px; margin:6px 0; background: rgba(0,0,0,0.25)}
.log .entry b{color:var(--accent)}
.log .entry .bad{color:var(--danger); font-weight:800}
.log .entry .ok{color:var(--ok); font-weight:800}
.log .entry .warn{color:var(--warn); font-weight:800}

.pill{display:inline-block; width:10px; height:10px; border-radius:999px; margin-right:6px; vertical-align:middle}
.pill.fry{background:#a78bfa}
.pill.beer{background:#fbbf24}
.pill.spear{background:#fb7185}

.modal{
  position:fixed; inset:0;
  background: rgba(0,0,0,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.hidden{display:none}
.modalInner{
  width:min(680px, 100%);
  background: var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.modalTitle{font-size:16px; font-weight:900; margin-bottom:8px}
.modalBody{color:var(--text); font-size:13px; line-height:1.45}
.modalBody p{margin:8px 0}
.modalActions{display:flex; justify-content:flex-end; margin-top:10px}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr; }
  #game{height: 62vh;}
}

.soundsGrid{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.soundRow{display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; color:var(--text)}
.soundRow span{color:var(--muted)}
.soundRow input{max-width:170px}

.artGrid{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.artSectionTitle{font-size:12px; font-weight:800; color:var(--text); margin-top:6px}
.artRow{display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px}
.artRow span{color:var(--muted)}
.artRow input{max-width:170px}
