/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg: #0b1020;--panel: #121a33;--panel-2: #182241;--ink: #e7ecfb;--ink-dim: #9aa6cc;--accent: #7ee787;--accent-2: #5aa9ff;--warn: #ffcc66;--line: #25315c;--radius: 12px;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--ink)}.app{display:flex;flex-direction:column;height:100%}.topbar{display:flex;align-items:center;gap:14px;padding:10px 18px;background:linear-gradient(90deg,#0e1530,#141d3d);border-bottom:1px solid var(--line);flex:0 0 auto}.brand{font-weight:700;letter-spacing:.3px}.topbar-unit{color:var(--ink-dim);font-size:.9rem}.layout{flex:1 1 auto;display:flex;min-height:0}.terminal-pane{flex:1 1 auto;display:flex;min-width:0;padding:12px}.terminal-host{flex:1 1 auto;min-height:0;width:100%;background:#0b1020;border:1px solid var(--line);border-radius:var(--radius);padding:8px;overflow:hidden}.terminal-host .xterm{height:100%}.sidebar-pane{flex:0 0 390px;max-width:42vw;border-left:1px solid var(--line);background:var(--panel);display:flex;min-height:0}.sidebar{display:flex;flex-direction:column;width:100%;min-height:0}.sidebar-head{padding:18px 18px 12px;border-bottom:1px solid var(--line)}.unit-title{margin:0;font-size:1.15rem}.unit-subtitle{margin:4px 0 12px;color:var(--ink-dim);font-size:.85rem}.progress-text{font-size:.8rem;color:var(--accent-2);margin-bottom:6px;font-weight:600}.progress-bar{height:8px;background:var(--panel-2);border-radius:999px;overflow:hidden}.progress-fill{height:100%;background:linear-gradient(90deg,var(--accent-2),var(--accent));transition:width .35s ease}.sidebar-body{flex:1 1 auto;overflow-y:auto;padding:16px 18px}.task-title{margin:0 0 6px;font-size:1.25rem}.task-story{margin:0 0 10px;color:var(--ink-dim);font-style:italic}.task-instructions{margin:0 0 16px;font-size:1rem;line-height:1.5}.celebration{background:#7ee7871f;border:1px solid rgba(126,231,135,.5);color:var(--accent);padding:10px 12px;border-radius:var(--radius);margin-bottom:16px;font-weight:600;animation:pop .3s ease}.celebration-check{font-weight:800}@keyframes pop{0%{transform:scale(.96);opacity:0}to{transform:scale(1);opacity:1}}.reference{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;margin-bottom:16px}.reference h3{margin:0 0 10px;font-size:.78rem;text-transform:uppercase;letter-spacing:.6px;color:var(--ink-dim)}.ref-item{display:flex;flex-direction:column;gap:2px;padding:7px 0;border-top:1px solid var(--line)}.ref-item:first-of-type{border-top:none}code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Courier New,monospace}.ref-command{color:var(--accent);font-size:.95rem;font-weight:600}.ref-desc{font-size:.85rem;color:var(--ink)}.ref-example{font-size:.8rem;color:var(--warn)}.hint-button{background:var(--panel-2);color:var(--accent-2);border:1px solid var(--line);border-radius:999px;padding:7px 14px;font-size:.85rem;cursor:pointer}.hint-button:hover{background:#1d294f}.hint{font-size:.9rem;line-height:1.45;background:#5aa9ff14;border-left:3px solid var(--accent-2);padding:8px 10px;border-radius:6px;margin:10px 0 0}.completion{text-align:center;padding:10px 4px}.completion-title{font-size:1.4rem;color:var(--accent);margin:8px 0 14px;line-height:1.3}.completion-message{line-height:1.55;color:var(--ink)}.learned{margin-top:18px;text-align:left;background:var(--panel-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 16px}.learned-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.6px;color:var(--ink-dim)}.learned ul{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:10px 0 0;margin:0}.learned li code{background:#0e1733;border:1px solid var(--line);color:var(--accent);padding:3px 8px;border-radius:6px;font-size:.85rem}.sidebar-foot{flex:0 0 auto;padding:12px 18px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px}.reset-button{background:transparent;color:var(--ink-dim);border:1px solid var(--line);border-radius:8px;padding:8px 12px;cursor:pointer;font-size:.85rem}.reset-button:hover{color:var(--ink);border-color:var(--accent-2)}.foot-tip{font-size:.78rem;color:var(--ink-dim)}.foot-tip code{color:var(--warn)}@media(max-width:820px){.layout{flex-direction:column}.sidebar-pane{flex:1 1 auto;max-width:none;border-left:none;border-top:1px solid var(--line)}.terminal-pane{flex:1 1 50%;min-height:240px}}.pong-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#040712d1;display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}.pong-card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:16px;max-width:95vw;box-shadow:0 20px 60px #00000080}.pong-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.pong-title{font-weight:800;letter-spacing:4px;color:var(--accent);font-size:1.1rem}.pong-close{background:transparent;color:var(--ink-dim);border:1px solid var(--line);border-radius:8px;padding:6px 12px;cursor:pointer}.pong-close:hover{color:var(--ink);border-color:var(--accent-2)}.pong-stage{position:relative;line-height:0}.pong-canvas{width:min(640px,90vw);height:auto;border:1px solid var(--line);border-radius:10px;cursor:none;touch-action:none}.pong-winner{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:#0b1020b3;border-radius:10px}.pong-winner-text{font-size:2rem;font-weight:800;color:var(--accent)}.pong-again{background:var(--accent-2);color:#07122b;border:none;border-radius:999px;padding:10px 18px;font-weight:700;cursor:pointer}.pong-hint{margin:12px 2px 2px;color:var(--ink-dim);font-size:.85rem;line-height:1.4;text-align:center}.unit-select{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:.85rem;color:var(--ink-dim)}.unit-select select{background:var(--panel-2);color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:5px 8px;font-size:.85rem}.next-unit{margin-top:18px;background:var(--accent-2);color:#07122b;border:none;border-radius:999px;padding:10px 18px;font-weight:700;cursor:pointer}.next-unit:hover{filter:brightness(1.06)}
