/* Simulator page layout */
.play-main { padding-block: 22px 40px; }
.play-shell {
  width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start;
}
@media (max-width: 980px) { .play-shell { grid-template-columns: 1fr; } }

.play-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 16px; position: sticky; top: 80px; max-height: calc(100vh - 100px);
  overflow-y: auto;
}
@media (max-width: 980px) { .play-side { position: static; max-height: none; } }

.side-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.side-tabs .tab-btn { flex: 1; background: transparent; border: 0; padding: 8px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.side-tabs .tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

.side-h { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.side-h:first-child { margin-top: 0; }

/* Experience switch (Beginner vs Experienced) */
.exp-switch { padding: 12px; margin-bottom: 14px; border: 1px solid var(--brand-100); border-radius: var(--radius-sm); background: var(--brand-050); }
.exp-switch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.exp-change { background: transparent; border: 0; cursor: pointer; color: var(--brand-700); font-size: .72rem; font-weight: 600; text-decoration: underline; padding: 0; }
.exp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.exp-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 6px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink-soft); transition: border-color .15s, background .15s, color .15s;
}
.exp-opt:hover { border-color: var(--brand-300); }
.exp-opt.active { border-color: var(--brand); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.exp-opt-t { font-weight: 650; font-size: .82rem; }
.exp-opt-s { font-size: .66rem; color: var(--muted); }
.exp-opt.active .exp-opt-s { color: var(--brand-700); }
.exp-note { margin: 8px 0 0; }

/* Experience chooser modal cards */
.exp-cards { display: grid; gap: 10px; margin-top: 16px; }
.exp-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  transition: border-color .15s, background .15s, transform .1s;
}
.exp-card:hover { border-color: var(--brand-300); background: var(--brand-050); transform: translateY(-1px); }
.exp-card-emoji { font-size: 1.5rem; }
.exp-card-t { font-weight: 700; font-size: 1rem; }
.exp-card-d { font-size: .82rem; color: var(--muted); line-height: 1.4; }
#exp-modal .exp-close { background: transparent; border: 0; cursor: pointer; color: var(--muted); width: 100%; margin-top: 12px; padding: 6px; font-size: .82rem; }

.preset-list { list-style: none; display: grid; gap: 8px; }
.preset-list li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font-size: .85rem; transition: border-color .15s, background .15s;
}
.preset-list li:hover { border-color: var(--brand-300); background: var(--brand-050); }
.preset-list .badge { flex: 0 0 auto; }

/* Campaign */
.stage { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.stage-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; cursor: pointer; background: var(--surface-2); font-weight: 650; font-size: .9rem; }
.stage-body { padding: 8px; display: none; }
.stage-blurb { font-size: .8rem; color: var(--muted); padding: 4px 4px 8px; }
.level-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 6px; cursor: pointer; transition: border-color .15s; }
.level-card:hover { border-color: var(--brand-300); }
.level-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .85rem; }
.d-badge { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: .72rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: .68rem; padding: 1px 7px; border-radius: 999px; background: var(--brand-050); color: var(--brand-700); border: 1px solid var(--brand-100); }
.chip.lock { background: #fff4e8; color: #a4610a; border-color: #ffe1bd; }
.level-obj { font-size: .76rem; color: var(--muted); margin-top: 6px; }
.check { color: var(--ok); }

.level-detail { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.ld-head { display: flex; justify-content: space-between; gap: 10px; }
.ld-title { font-size: 1.05rem; }
.ld-close { background: transparent; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; }
.ld-obj { font-size: .84rem; color: var(--ink-soft); margin: 10px 0; }
.ld-section { margin-top: 12px; } .ld-section h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.goals { padding-left: 18px; font-size: .85rem; color: var(--ink-soft); } .goals li { margin-bottom: 4px; }
.ld-actions { margin-top: 12px; } .ld-msg { font-size: .8rem; color: var(--muted); margin-top: 6px; }
/* Sealed hints */
.try-first { font-size: .82rem; color: var(--ink-soft); background: var(--brand-050); border: 1px solid var(--brand-100); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.hint-list { display: grid; gap: 8px; }
.hint-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.hint-card.locked { background: var(--surface-2); border-style: dashed; }
.hint-card.ready { border-color: var(--brand-300); background: var(--brand-050); }
.hint-card.open { background: var(--surface); }
.hint-top { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.hint-n { font-weight: 650; font-size: .82rem; }
.hint-lock-msg, .hint-ready-msg { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint-bar { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.hint-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--violet)); border-radius: 999px; transition: width .9s linear; }
@media (prefers-reduced-motion: reduce) { .hint-bar span { transition: none; } }

.walk { padding-left: 18px; font-size: .82rem; } .walk-step { margin-bottom: 12px; }
.walk-meta { display: flex; gap: 6px; } .phase, .tech { font-size: .66rem; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--brand-700); }
.walk-label { font-weight: 600; margin: 3px 0; } .cmd { margin: 3px 0; } .cmd code { font-family: var(--mono); background: #0b1020; color: #cfe0ff; padding: 2px 6px; border-radius: 5px; font-size: .78rem; }
.cmd-tag { font-size: .64rem; color: var(--muted); margin-right: 6px; } .walk-exp { color: var(--muted); }

/* Saved */
.saved-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 6px; }
.saved-main { flex: 1; cursor: pointer; } .saved-title { font-weight: 600; font-size: .88rem; } .saved-meta { font-size: .76rem; color: var(--muted); }
.saved-del { background: transparent; border: 0; cursor: pointer; font-size: .95rem; padding: 4px; border-radius: 6px; }
.saved-del:hover { background: var(--surface-2); }

/* Stage / terminal */
.play-stage { min-width: 0; }
.obj-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); margin-bottom: 12px; flex-wrap: wrap; }
.obj-left { display: flex; align-items: center; gap: 8px; }
.obj-mid { flex: 1; min-width: 120px; color: var(--ink-soft); }
.obj-right { display: flex; align-items: center; gap: 10px; }
#conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
#conn-dot.connected { background: var(--ok); box-shadow: 0 0 0 3px rgba(20,164,77,.18); }
#conn-dot.error { background: var(--danger); }

.xterm-host { height: 60vh; min-height: 380px; }
.next-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 16px; background: linear-gradient(110deg,#eafaf0,var(--brand-050)); border: 1px solid #c7eed5; border-radius: var(--radius); font-weight: 600; }
.next-bar .btn { margin-left: auto; }
.hidden { display: none; }
