/* style.css — Terminal Practice styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1a2e;
  --terminal-bg: #0d0d0d;
  --text-green: #00ff41;
  --text-white: #e0e0e0;
  --prompt-blue: #5eaeff;
  --prompt-user: #ff79c6;
  --key-bg: #3a3a4a;
  --key-bg-hover: #4a4a5a;
  --key-pressed: #00ff41;
  --key-text: #ccc;
  --key-border: #555;
  --keyboard-bg: #2a2a3a;
  --hint-bg: #1e3a5f;
  --hint-border: #2e6aaf;
  --success-bg: #1a3a1a;
  --success-border: #2a8a2a;
  --topbar-bg: #111;
  --topbar-border: #333;
  --topbar-title: #888;
  --vi-status-bg: #222;
}

/* ── Light Mode ── */
.light-mode {
  --bg: #f0f2f5;
  --terminal-bg: #ffffff;
  --text-green: #007a1f;
  --text-white: #1a1a1a;
  --prompt-blue: #0055bb;
  --prompt-user: #cc0066;
  --key-bg: #e2e2e2;
  --key-bg-hover: #d2d2d2;
  --key-pressed: #007a1f;
  --key-text: #333;
  --key-border: #bbb;
  --keyboard-bg: #d8d8d8;
  --hint-bg: #e4f0fd;
  --hint-border: #4a90d9;
  --success-bg: #e6f5e6;
  --success-border: #4a9a4a;
  --topbar-bg: #f8f8f8;
  --topbar-border: #ddd;
  --topbar-title: #666;
  --vi-status-bg: #ececec;
}
.light-mode .hint-toast.info    { background: #fff4e0; border-color: #cc8800; color: #885500; }
.light-mode .hint-toast.explain { background: #f5eeff; border-color: #9055c8; color: #5a2d8a; }
.light-mode .hint-toast.smart   { background: #fffbe0; border-color: #cc9900; color: #664400; }
.light-mode .hint-toast.success { color: #266026; }
.light-mode .error-line         { color: #cc2200; }
.light-mode .dir-color          { color: #0055bb; }
.light-mode .exec-color         { color: #007a1f; }
.light-mode .vi-tilde           { color: #0055bb; }
.light-mode #terminal::-webkit-scrollbar-thumb { background: #bbb; }
.light-mode .key                { box-shadow: 0 2px 0 #bbb; }

html, body { height: 100%; overflow: hidden; background: var(--bg); font-family: 'JetBrains Mono', monospace; color: var(--text-white); }
#app { display: flex; flex-direction: column; height: 100vh; }

/* ── Top bar ── */
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border); flex-shrink: 0; }
.top-bar .dots { display: flex; gap: 6px; }
.top-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #ffbd2e; } .dot-g { background: #28c840; }
.top-bar .title { font-size: 13px; color: var(--topbar-title); letter-spacing: 1px; }
.top-bar .mode-badge { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: var(--vi-status-bg); color: #aaa; border: 1px solid var(--topbar-border); }

/* ── Controls (lang + theme) ── */
.top-bar-controls { display: flex; align-items: center; gap: 6px; }
.lang-btn {
  font-size: 11px; padding: 2px 8px; border-radius: 8px; cursor: pointer; user-select: none;
  background: var(--vi-status-bg); color: #aaa; border: 1px solid var(--topbar-border);
  font-family: 'JetBrains Mono', monospace; transition: all .15s;
}
.lang-btn:hover  { color: var(--text-green); border-color: var(--text-green); }
.lang-btn.active { color: var(--text-green); border-color: var(--text-green); font-weight: 700; }
.theme-btn {
  font-size: 14px; padding: 2px 6px; border-radius: 8px; cursor: pointer; user-select: none;
  background: var(--vi-status-bg); border: 1px solid var(--topbar-border); line-height: 1.4; transition: all .15s;
}
.theme-btn:hover { border-color: var(--text-green); }

/* ── Terminal ── */
.terminal-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--terminal-bg); position: relative; overflow: visible; }
#terminal { flex: 1; overflow-y: auto; padding: 12px 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; scrollbar-width: thin; scrollbar-color: #333 transparent; }
#terminal::-webkit-scrollbar { width: 6px; }
#terminal::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.prompt-line   { color: var(--text-green); }
.prompt-user   { color: var(--prompt-user); }
.prompt-path   { color: var(--prompt-blue); }
.prompt-symbol { color: var(--text-green); }
.output-line   { color: var(--text-white); opacity: .9; }
.error-line    { color: #ff6b6b; }
.dir-color     { color: #5eaeff; font-weight: bold; }
.file-color    { color: var(--text-white); }
.exec-color    { color: var(--text-green); }
.vi-tilde      { color: var(--prompt-blue); }
.vi-status     { color: var(--text-white); background: var(--vi-status-bg); padding: 1px 0; }

.cursor-block { background: var(--text-green); color: #000; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Hint toasts ── */
.hint-container { position: absolute; top: 8px; right: 8px; z-index: 10; display: flex; flex-direction: column; gap: 6px; max-width: 400px; pointer-events: none; }
.hint-toast { padding: 10px 14px; border-radius: 8px; font-size: 12px; line-height: 1.6; animation: slideIn .3s ease; pointer-events: auto; transition: opacity .3s; }
.hint-toast.hint    { background: var(--hint-bg);    border: 1px solid var(--hint-border);    color: #8ecfff; }
.hint-toast.success { background: var(--success-bg); border: 1px solid var(--success-border); color: #6f6; }
.hint-toast.info    { background: #3a2a1a; border: 1px solid #8a6a2a; color: #ffd080; }
.hint-toast.explain { background: #2a1a3a; border: 1px solid #6a4a8a; color: #d0b0ff; }
.hint-toast.smart   { background: #2a2200; border: 1px solid #aa8800; color: #ffe066; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.hint-toast .hint-title { font-weight: 700; margin-bottom: 2px; font-size: 13px; }

/* ── Keyboard ── */
.keyboard-section { flex-shrink: 0; background: var(--keyboard-bg); border-top: 2px solid var(--topbar-border); padding: 8px 6px 10px; position: relative; }
.kb-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.key {
  display: flex; align-items: center; justify-content: center;
  min-width: 42px; height: 38px; padding: 0 6px;
  background: var(--key-bg); color: var(--key-text);
  border: 1px solid var(--key-border); border-radius: 6px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  cursor: pointer; user-select: none;
  transition: all .08s ease;
  position: relative;
  box-shadow: 0 2px 0 #222;
}
.key:hover { background: var(--key-bg-hover); }
.key.pressed { background: var(--key-pressed) !important; color: #000 !important; transform: translateY(2px); box-shadow: none; border-color: var(--key-pressed) !important; }
.key.modifier-active { border-color: #ff79c6 !important; color: #ff79c6 !important; background: #3a2a3a !important; }
.key.wide-1 { min-width: 60px; }  .key.wide-2 { min-width: 80px; }
.key.wide-3 { min-width: 100px; } .key.wide-4 { min-width: 130px; }
.key.space  { flex: 1; max-width: 340px; min-width: 200px; }
.key .sub  { position: absolute; top: 3px; left: 6px; font-size: 8px; color: #888; }
.key .main { font-size: 12px; }

/* ── Tips Button & Panel ── */
.tips-btn {
  position: fixed;
  bottom: 240px;
  right: 14px;
  z-index: 200;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(30, 30, 55, 0.82);
  border: 1px solid rgba(120, 120, 170, 0.5);
  color: #aaa;
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  opacity: 0.78;
  transition: opacity .2s, color .2s, border-color .2s, background .2s;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tips-btn:hover  { opacity: 1; color: var(--text-green); border-color: var(--text-green); }
.tips-btn.active { opacity: 1; color: var(--text-green); border-color: var(--text-green); background: rgba(0, 255, 65, 0.12); }

.tips-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(12, 12, 24, 0.97);
  border-top: 1px solid rgba(100, 100, 150, 0.4);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.tips-panel.open {
  opacity: 1;
  pointer-events: auto;
}

.tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(100, 100, 150, 0.3);
  flex-shrink: 0;
}
.tips-title { font-size: 12px; font-weight: 700; color: var(--text-green); letter-spacing: .5px; }
.tips-close {
  background: none; border: none; color: #666; font-size: 18px;
  cursor: pointer; line-height: 1; padding: 0 2px;
  font-family: 'JetBrains Mono', monospace;
  transition: color .15s;
}
.tips-close:hover { color: #ff6b6b; }

.tips-body {
  display: flex; flex-direction: row;
  flex: 1; min-height: 0;
  overflow-x: auto; overflow-y: auto;
  padding: 0;
  scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.tips-body::-webkit-scrollbar { height: 4px; }
.tips-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.tips-group {
  flex: 1; min-width: 160px;
  padding: 8px 12px 12px;
  border-right: 1px solid rgba(100, 100, 150, 0.2);
}
.tips-group:last-child { border-right: none; }
.tips-group-name {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: #555; padding: 2px 4px 6px; border-bottom: 1px solid #222; margin-bottom: 6px;
}
.tips-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 6px; cursor: pointer;
  transition: background .12s;
}
.tips-item:hover { background: rgba(0, 255, 65, 0.08); }
.tips-item:active { background: rgba(0, 255, 65, 0.15); }
.tips-key {
  flex-shrink: 0;
  min-width: 52px; text-align: center;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px; padding: 2px 6px;
  font-size: 11px; font-weight: 600; color: #ddd;
  white-space: nowrap;
}
.tips-desc {
  font-size: 11px; color: #888; line-height: 1.4;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tips-item:hover .tips-desc { color: #bbb; }

/* Light mode overrides for tips */
.light-mode .tips-btn  { background: rgba(240,240,250,0.88); border-color: rgba(100,100,180,0.4); color: #555; }
.light-mode .tips-btn:hover, .light-mode .tips-btn.active { color: var(--text-green); border-color: var(--text-green); background: rgba(0,120,30,0.08); }
.light-mode .tips-panel { background: rgba(248,248,252,0.97); border-top-color: rgba(150,150,200,0.4); }
.light-mode .tips-group-name { color: #999; border-bottom-color: #eee; }
.light-mode .tips-group { border-right-color: rgba(150,150,200,0.2); }
.light-mode .tips-key  { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: #333; }
.light-mode .tips-desc { color: #777; }
.light-mode .tips-item:hover { background: rgba(0,120,30,0.06); }
.light-mode .tips-item:hover .tips-desc { color: #333; }
.light-mode .tips-close:hover { color: #cc3300; }

/* ── Task Mode ── */
.task-mode-btn {
  font-size: 11px; padding: 2px 8px; border-radius: 8px; cursor: pointer; user-select: none;
  background: var(--vi-status-bg); color: #aaa; border: 1px solid var(--topbar-border);
  font-family: 'JetBrains Mono', monospace; transition: all .15s;
}
.task-mode-btn:hover  { color: #ffbd2e; border-color: #ffbd2e; }
.task-mode-btn.active { color: #ffbd2e; border-color: #ffbd2e; font-weight: 700; }

.task-bar {
  flex-shrink: 0;
  background: #161408;
  border-bottom: 1px solid #3a3410;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.task-bar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; cursor: pointer; user-select: none;
  transition: background .12s;
}
.task-bar-header:hover { background: rgba(255,189,46,0.05); }
.task-bar-label {
  flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  color: #ffbd2e; background: rgba(255,189,46,0.1); border: 1px solid #554a10;
  border-radius: 4px; padding: 1px 7px;
}
.task-bar-title { flex: 1; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-bar-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.task-expand-btn { color: #555; font-size: 10px; transition: transform .15s; }
.task-expand-btn.open { transform: rotate(180deg); }
.task-nav-btn {
  color: #777; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  border: 1px solid transparent; transition: all .12s; font-size: 11px;
}
.task-nav-btn:hover { color: #ffbd2e; border-color: #554a10; }

.task-bar-body { padding: 0 14px 10px; border-top: 1px solid #2a2408; }
.task-desc {
  color: #bbb; line-height: 1.7; padding: 8px 0 6px;
  white-space: pre-wrap;
}
.task-hint-line {
  font-size: 11px; color: #ffbd2e; background: rgba(255,189,46,0.07);
  border: 1px solid #443c0e; border-radius: 4px;
  padding: 5px 10px; margin-top: 6px; margin-bottom: 2px; font-weight: 600;
}
.task-footer { display: flex; gap: 8px; justify-content: flex-end; }

/* Reset button (subtler) */
.reset-btn { color: #555 !important; }
.reset-btn:hover { color: #e06060 !important; border-color: #5a2020 !important; }
.light-mode .reset-btn:hover { color: #c03030 !important; border-color: #e08080 !important; }

/* Theme selector */
.theme-selector { padding: 4px 0 6px; }
.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.theme-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 11px; border-radius: 6px; cursor: pointer;
  background: rgba(255,189,46,0.04); border: 1px solid #3a3410;
  transition: all .15s;
}
.theme-card:hover { background: rgba(255,189,46,0.1); border-color: #ffbd2e; }
.theme-card.done { border-color: #3a6030; background: rgba(80,180,60,0.05); }
.theme-card.done:hover { background: rgba(80,180,60,0.12); border-color: #6dc85a; }
.theme-card-icon { font-size: 18px; line-height: 1.3; }
.theme-card-name { color: #ddd; font-weight: 600; font-size: 12px; }
.theme-card-desc { color: #777; font-size: 10px; }
.theme-card-meta { color: #555; font-size: 10px; margin-top: 3px; }
.theme-card.done .theme-card-meta { color: #6dc85a; }

/* Light mode overrides for task bar */
.light-mode .task-bar { background: #fffbe8; border-bottom-color: #e0cc40; }
.light-mode .task-bar-header:hover { background: rgba(160,120,0,0.05); }
.light-mode .task-bar-label { color: #7a5c00; background: rgba(160,120,0,0.1); border-color: #c8a800; }
.light-mode .task-bar-title { color: #333; }
.light-mode .task-expand-btn { color: #aaa; }
.light-mode .task-nav-btn:hover { color: #7a5c00; border-color: #c8a800; }
.light-mode .task-bar-body { border-top-color: #ece4b0; }
.light-mode .task-desc { color: #444; }
.light-mode .task-hint-line { color: #6a4e00; background: rgba(160,120,0,0.07); border-color: #c8a800; }
.light-mode .theme-card { background: rgba(160,120,0,0.04); border-color: #d4c060; }
.light-mode .theme-card:hover { background: rgba(160,120,0,0.1); border-color: #a88000; }
.light-mode .theme-card.done { border-color: #5a9a40; background: rgba(60,150,40,0.06); }
.light-mode .theme-card-name { color: #333; }
.light-mode .theme-card-desc { color: #888; }
.light-mode .theme-card-meta { color: #aaa; }
.light-mode .theme-card.done .theme-card-meta { color: #4a8a30; }

/* ── Challenge Mode HUD ────────────────────────────────────────── */
#challenge-hud {
  flex: 1;
  display: none;
  flex-direction: column;
  background: var(--terminal-bg);
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-white);
}

/* Menu */
#ch-menu { padding: 20px 24px; flex-direction: column; }
.ch-menu-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ch-menu-title  { font-size: 16px; font-weight: 700; color: var(--text-green); letter-spacing: .5px; }
.ch-menu-sub    { font-size: 12px; color: #888; margin-bottom: 16px; }
.ch-close-btn   { background: none; border: 1px solid #555; color: #aaa; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: inherit; font-size: 12px; }
.ch-close-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }

.ch-cards { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.ch-card  { border: 1px solid var(--topbar-border); border-radius: 6px; padding: 12px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.ch-card:hover { border-color: var(--text-green); background: rgba(0,255,65,.05); }
.ch-card-title  { font-size: 14px; font-weight: 600; color: var(--text-white); margin-bottom: 3px; }
.ch-card-desc   { font-size: 12px; color: #888; margin-bottom: 6px; }
.ch-card-meta   { font-size: 11px; color: #666; display: flex; justify-content: space-between; }
.ch-card-best   { color: var(--text-green); }

/* Main challenge view */
#ch-main { padding: 0; }

.ch-info-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--topbar-border);
  flex-shrink: 0;
}
.ch-info-left   { display: flex; flex-direction: column; gap: 2px; }
.ch-title-text  { font-size: 14px; font-weight: 700; color: var(--text-green); }
.ch-desc-text   { font-size: 12px; color: #888; }
.ch-timer-box   { font-size: 13px; color: #aaa; white-space: nowrap; padding-top: 2px; }

.ch-target-area  { padding: 8px 16px 4px; flex-shrink: 0; }
.ch-section-label { font-size: 10px; letter-spacing: 1px; color: #666; padding: 4px 16px 2px; text-transform: uppercase; flex-shrink: 0; }
.ch-target-buf   { margin: 0; padding: 6px 10px; background: rgba(0,0,0,.25); border: 1px solid var(--topbar-border); border-radius: 4px; color: #aaa; font-size: 13px; font-family: inherit; white-space: pre-wrap; word-break: break-all; }

.ch-editor { flex: 1; overflow-y: auto; padding: 4px 16px 4px; min-height: 80px; }
.ch-cursor { background: var(--text-green); color: #000; }

.ch-stats-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 16px;
  border-top: 1px solid var(--topbar-border);
  font-size: 12px; color: #aaa;
  flex-shrink: 0;
}
.ch-stats-bar strong { color: var(--text-white); }
.ch-par-good     { color: var(--text-green); font-size: 12px; }
.ch-par-over     { color: #ffbd2e; font-size: 12px; }
.ch-par-ref-bar  { margin-left: auto; color: #555; font-size: 11px; }
.ch-exit-sm      { background: none; border: 1px solid #444; color: #666; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-family: inherit; font-size: 11px; }
.ch-exit-sm:hover { border-color: #ff6b6b; color: #ff6b6b; }

/* Result card */
#ch-result {
  flex-direction: column; gap: 8px;
  padding: 12px 16px;
  border-top: 2px solid var(--text-green);
  background: rgba(0,255,65,.04);
  flex-shrink: 0;
}
.ch-result-score { font-size: 14px; line-height: 1.7; }
.ch-par-ref      { font-size: 12px; color: #666; }
.ch-opp          { font-size: 13px; color: #ffbd2e; }
.ch-best         { font-size: 12px; color: #666; }
.ch-result-btns  { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-btn {
  background: none; border: 1px solid #555; color: var(--text-white);
  padding: 6px 14px; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 12px; transition: border-color .15s, color .15s;
}
.ch-btn:hover       { border-color: var(--text-green); color: var(--text-green); }
.ch-share-btn:hover { border-color: #4af; color: #4af; }
.ch-exit-btn:hover  { border-color: #ff6b6b; color: #ff6b6b; }

/* Light mode overrides */
.light-mode .ch-card:hover   { background: rgba(0,120,30,.05); }
.light-mode .ch-target-buf   { background: rgba(0,0,0,.04); color: #555; }
.light-mode #ch-result       { background: rgba(0,120,30,.04); border-color: var(--text-green); }

@media (max-width: 900px) {
  .key { min-width: 32px; height: 32px; font-size: 9px; }
  .key .sub { font-size: 7px; }
  .key.space { min-width: 140px; }
  #terminal { font-size: 12px; }
}

/* ── Level Mode ─────────────────────────────────────────── */
#level-hud {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
}

/* Map */
#lv-map-wrap { padding: 0 0 24px; }
.lv-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
}
.lv-map-title { font-size: 16px; font-weight: 700; color: var(--text-white); letter-spacing: .5px; }
.lv-quit-btn {
  background: none;
  border: 1px solid #555;
  border-radius: 6px;
  color: #aaa;
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lv-quit-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }

.lv-world-row {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.lv-world-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-green);
  margin-bottom: 16px;
  letter-spacing: .5px;
}
.lv-track {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  row-gap: 12px;
}
.lv-conn { color: #444; font-size: 18px; padding: 0 4px; user-select: none; }

.lv-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 64px;
  cursor: pointer;
}
.lv-node-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #888;
  background: rgba(255,255,255,.03);
  transition: border-color .15s, background .15s, color .15s;
}
.lv-node:hover .lv-node-icon { border-color: var(--text-green); color: var(--text-green); background: rgba(0,255,65,.06); }
.lv-node.lv-done .lv-node-icon { border-color: var(--text-green); color: var(--text-green); background: rgba(0,255,65,.1); }
.lv-node.lv-boss .lv-node-icon {
  border-radius: 8px;
  border-color: #f0a500;
  color: #f0a500;
  background: rgba(240,165,0,.08);
  font-size: 20px;
}
.lv-node.lv-boss:hover .lv-node-icon,
.lv-node.lv-boss.lv-done .lv-node-icon { border-color: #f0a500; background: rgba(240,165,0,.18); }

.lv-node-stars { font-size: 10px; color: #f0a500; letter-spacing: 1px; }
.lv-node-label { font-size: 9px; color: #666; text-align: center; max-width: 60px; line-height: 1.3; }
.lv-boss-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(240,165,0,.15);
  color: #f0a500;
  border: 1px solid rgba(240,165,0,.3);
  vertical-align: middle;
  margin-left: 4px;
}

/* Cursor play area */
.lv-play-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}
.lv-play-title-text { font-size: 16px; font-weight: 700; color: var(--text-white); }
.lv-play-desc { font-size: 13px; color: #bbb; line-height: 1.6; }
.lv-play-hint { font-size: 12px; color: var(--text-green); min-height: 18px; }

.lv-cursor-area {
  background: var(--terminal-bg);
  border-radius: 8px;
  border: 1px solid #333;
  padding: 16px 20px;
  margin-top: 8px;
}
.lv-cursor-buf {
  font-size: 14px;
  color: var(--text-white);
  white-space: pre;
  letter-spacing: .3px;
}
.lv-prompt { color: var(--text-green); }
.lv-play-footer { font-size: 12px; color: #666; }

/* Stars */
.lv-stars { font-size: 24px; color: #f0a500; letter-spacing: 4px; }
.lv-stars-empty { color: #444; }
.lv-result-stars { font-size: 36px; }
.lv-result-sub { font-size: 13px; color: #888; }
.lv-result-btns { display: flex; gap: 10px; }

/* Shell task bar */
#lv-shell-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(0, 30, 0, 0.92);
  border-bottom: 1px solid rgba(0,255,65,.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  gap: 12px;
  flex-shrink: 0;
}
.lv-shell-task { color: #ccc; flex: 1; }
.lv-shell-task strong { color: var(--text-green); }
.lv-hint-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(0,255,65,.1);
  border: 1px solid rgba(0,255,65,.25);
  color: var(--text-green);
}
.lv-shell-win {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-green);
  font-size: 14px;
  font-weight: 600;
}

/* Light mode overrides */
.light-mode #lv-shell-bar { background: rgba(0,80,0,.08); border-color: rgba(0,120,0,.2); }
.light-mode .lv-shell-task { color: #333; }
.light-mode .lv-shell-task strong { color: #1a6b1a; }
.light-mode .lv-world-row { border-color: rgba(0,0,0,.06); }
.light-mode .lv-node-icon { background: rgba(0,0,0,.03); }
.light-mode .lv-cursor-area { background: #fff; border-color: #ddd; }
.light-mode .lv-cursor-buf { color: #222; }
