/* ═══════════════════════════════════════════════
   themes/terminal.css — 터미널 테마 (2.0.0)

   운영 > 설정에서 '터미널'을 고른 사이트에서만 style.css 뒤에 불러온다.
   어두운 바탕 · 고정폭 글꼴 · 초록과 호박색 · 모서리 없음 · 그림 대신 글자 기호.
   늘 어두운 화면이다 (밝은 화면이 따로 없다).

   하는 일은 두 가지뿐이다.
     ① style.css 의 쓰임새 변수 값을 바꾼다 (색 · 모서리 · 글꼴)
     ② 메뉴의 [ ] · 제목의 $ · 구역 제목의 ## · 분류의 # 같은 기호를 덧붙인다
   화면 배치는 바꾸지 않는다.

   글꼴 나눔고딕코딩 (SIL OFL 1.1, fonts/NanumGothicCoding-OFL.txt) — 한글도 고정폭으로 보이게.
   코드창 · 예시의 글꼴(--mono)은 기본 테마와 같은 것을 쓴다.
   ═══════════════════════════════════════════════ */

@font-face{
  font-family:'Nanum Gothic Coding'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/NanumGothicCoding-Regular.woff2') format('woff2');
}
@font-face{
  font-family:'Nanum Gothic Coding'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/NanumGothicCoding-Bold.woff2') format('woff2');
}

html[data-theme="terminal"]{
  color-scheme:dark;
  --g:#5BE37D;                       /* 초록 */
  --a:#F2B84B;                       /* 호박색 */
  --sans:'Nanum Gothic Coding',"D2Coding","Cascadia Mono",Consolas,"DejaVu Sans Mono","Malgun Gothic",monospace;

  /* 글자 */
  --ink:#CFE0D3; --ink-2:#9DB3A3; --ink-3:#7F9787;
  --title:#DDF9E3; --head:#B6F5C5; --accent-ink:#8CF0A4; --link:#5BE37D; --sub:#74B088;
  --faint:#5E8A6C; --faint-2:#5E8A6C; --on-accent:#0A0E0B; --on-ok:#0A0E0B;
  /* 바탕 */
  --bg:#0A0E0B; --surface:#0F1511; --fill:#111A14; --fill-2:#142018; --fill-3:#1A2A20;
  --accent:#5BE37D; --accent-2:#8CF0A4; --accent-3:#B6F5C5; --accent-dim:#2C4636; --meter:#5BE37D;
  /* 선 · 초점 */
  --line:#2A3F31; --line-2:#18251C;
  --edge:#18251C; --edge-2:#35503E; --edge-3:#5BE37D; --edge-4:#5BE37D;
  --focus:#5BE37D; --focus-ring:rgba(91,227,125,.25);
  /* 판정 · 알림 */
  --ok:#5BE37D; --ok-soft:#10301B; --ok-soft-2:#154024; --ok-line:#2C6E42; --ok-line-0:#2C6E42;
  --bad:#FF7B7B; --bad-soft:#3A1515; --bad-soft-0:#241012; --bad-soft-2:#301416;
  --bad-line-0:#6A2C2C; --bad-line:#6A2C2C; --bad-line-2:#8A3A3A;
  --warn:#F2B84B; --warn-soft:#33270C; --warn-line:#6A5320; --warn-line-2:#6A5320;
  --re:#C9A0F2; --re-soft:#2A1E45; --tle:#FF9E7A; --tle-soft:#3A2412;
  /* 교사 메뉴 띠 — 호박색으로 구분 */
  --bar:#14100A; --bar-ink:#D9C894; --on-bar:#F2B84B; --bar-hover:rgba(242,184,75,.12); --bar-line:#F2B84B;
  --play:#F2B84B; --play-on-bar:#7FD8E8;
  --demo:#33270C; --demo-ink:#F2B84B; --demo-line:#6A5320; --hero-dot:rgba(91,227,125,.10);
  /* 그림자 */
  --shadow-fab:rgba(0,0,0,.6); --shadow-pop:rgba(0,0,0,.7); --shadow-pop-2:rgba(0,0,0,.4);
  /* 모서리 없음 */
  --r4:0px; --r5:0px; --r6:0px; --r7:0px; --r8:0px; --r9:0px; --r10:0px; --r11:0px;
  --r12:0px; --r14:0px; --r-pill:0px;
  /* 코드 문법 색 */
  --ed-sel:#1F4A2C;
  --tk-kw:#F2B84B; --tk-def:#8CF0A4; --tk-str:#9BE8B0; --tk-num:#FF9E7A;
  --tk-com:#6F8776; --tk-bi:#7FD8E8; --tk-meta:#F2B84B;
}

/* ── 바탕 · 글자 ────────────────────────────── */
html[data-theme="terminal"] body{font-size:14.5px; line-height:1.7}
html[data-theme="terminal"] ::selection{background:#1F4A2C; color:#DDF9E3}

/* ── 위쪽 메뉴 ──────────────────────────────── */
html[data-theme="terminal"] .top{background:var(--bg); border-bottom:1px solid var(--line)}
html[data-theme="terminal"] .top-in{gap:14px}
html[data-theme="terminal"] .brand{color:var(--g); font-weight:700; letter-spacing:0}
html[data-theme="terminal"] .brand:hover{color:var(--accent-2)}
html[data-theme="terminal"] .brand:not(.haslogo)::before{content:"~/"; color:var(--ink-3); font-weight:400}
/* 깜빡이는 커서 */
html[data-theme="terminal"] .brand:not(.haslogo)::after{content:""; display:inline-block; width:.55em; height:1.05em;
  margin-left:3px; vertical-align:-.16em; background:var(--g); animation:kc-term-blink 1.1s steps(1) infinite}
@keyframes kc-term-blink{ 50%{opacity:0} }
html[data-theme="terminal"] .brand.haslogo{background:#fff; padding:5px 9px}
html[data-theme="terminal"] .mainnav{gap:0}
html[data-theme="terminal"] .mainnav a{color:var(--ink-2); font-size:13.5px; font-weight:400; padding:6px 5px; white-space:nowrap}
html[data-theme="terminal"] .mainnav a::before{content:"["; color:var(--edge-2); margin-right:2px}
html[data-theme="terminal"] .mainnav a::after{content:"]"; color:var(--edge-2); margin-left:2px}
html[data-theme="terminal"] .mainnav a:hover{background:var(--fill-3); color:var(--head)}
html[data-theme="terminal"] .mainnav a.on{background:var(--g); color:var(--bg); font-weight:700}
html[data-theme="terminal"] .mainnav a.on::before,
html[data-theme="terminal"] .mainnav a.on::after{color:var(--bg)}
html[data-theme="terminal"] .mainnav a.navplay{color:var(--a); font-weight:700}
html[data-theme="terminal"] .who b{color:var(--head)}
html[data-theme="terminal"] .top .util{gap:11px}
/* 좁은 화면에서는 [ ] 를 빼 한 줄에 들어가게 */
@media(max-width:1120px){
  html[data-theme="terminal"] .mainnav a::before,
  html[data-theme="terminal"] .mainnav a::after{content:none}
  html[data-theme="terminal"] .mainnav a{padding:6px 7px}
}
/* 교사 메뉴 띠 — 호박색 */
html[data-theme="terminal"] .top.is-admin{background:var(--bar); border-bottom:1px solid var(--a)}
html[data-theme="terminal"] .top.is-admin .brand{color:var(--a)}
html[data-theme="terminal"] .top.is-admin .brand:not(.haslogo)::after{background:var(--a)}
html[data-theme="terminal"] .top.is-admin .mainnav a.on{background:var(--a); color:var(--bg)}
html[data-theme="terminal"] .top.is-admin .mainnav a:hover{color:var(--a)}
html[data-theme="terminal"] .top.is-admin .who b{color:var(--a)}

/* ── 제목 ───────────────────────────────────── */
html[data-theme="terminal"] .phead h1{font-size:21px; letter-spacing:0}
html[data-theme="terminal"] .phead > h1::before{content:"$ "; color:var(--g)}
html[data-theme="terminal"] .pno{color:var(--a)}
html[data-theme="terminal"] h2.ph{border-bottom:1px dashed var(--edge-2); font-size:15px}
html[data-theme="terminal"] h2.ph .emo,
html[data-theme="terminal"] .sec > h2 .emo{display:none}
html[data-theme="terminal"] h2.ph::before,
html[data-theme="terminal"] .sec > h2::before,
html[data-theme="terminal"] .subhead2::before{content:"## "; color:var(--a); font-weight:700}
html[data-theme="terminal"] .homecol > h2::before{content:"> "; color:var(--a)}

/* ── 단추 · 입력칸 ──────────────────────────── */
html[data-theme="terminal"] .btn{background:var(--surface); border-color:var(--edge-2); color:var(--accent-ink)}
html[data-theme="terminal"] .btn:not(:disabled):hover{background:var(--fill-3); border-color:var(--g)}
html[data-theme="terminal"] .btn.primary{background:var(--g); border-color:var(--g); color:var(--bg)}
html[data-theme="terminal"] .btn.primary:not(:disabled):hover{background:var(--accent-2); border-color:var(--accent-2)}
html[data-theme="terminal"] .btn.danger{color:var(--bad); border-color:var(--bad-line)}
html[data-theme="terminal"] .chip:has(input:checked){background:var(--fill-3); border-color:var(--g); color:var(--head)}

/* ── 분류 딱지 · 판정 배지 ──────────────────── */
html[data-theme="terminal"] .tag{background:none; border-color:var(--line); color:var(--a)}
html[data-theme="terminal"] .tag::before{content:"#"}
html[data-theme="terminal"] a.tag:hover{background:var(--a); border-color:var(--a); color:var(--bg)}
html[data-theme="terminal"] .v{background:none !important; border:1px solid currentColor}
/* .stat .v 는 판정 배지가 아니라 통계 칸의 큰 숫자 — 테두리를 두지 않는다 */
html[data-theme="terminal"] .stat .v{border:0}
html[data-theme="terminal"] .v-AC{color:var(--ok)}
html[data-theme="terminal"] .v-open{color:#7FD8E8}
html[data-theme="terminal"] .v-wait{color:var(--ink-3)}
html[data-theme="terminal"] .tagbar .bar span{background:var(--g)}

/* ── 표 ─────────────────────────────────────── */
html[data-theme="terminal"] table.list th{color:var(--ink-3); border-bottom:1px dashed var(--edge-2); font-weight:400}
html[data-theme="terminal"] table.list td{border-bottom:1px dashed var(--line-2)}
html[data-theme="terminal"] table.list .title a{color:var(--accent-ink)}

/* ── 코드창 ─────────────────────────────────── */
html[data-theme="terminal"] .CodeMirror{color:var(--ink)}
html[data-theme="terminal"] .CodeMirror-scrollbar-filler,
html[data-theme="terminal"] .CodeMirror-gutter-filler{background-color:var(--surface)}
html[data-theme="terminal"] .CodeMirror-gutters{background:var(--surface); border-right:1px dashed var(--line)}
html[data-theme="terminal"] .cm-s-default .cm-comment{font-style:normal}
html[data-theme="terminal"] .edframe{border-color:var(--edge-2)}

/* ── 그 밖 ──────────────────────────────────── */
html[data-theme="terminal"] .heroname{color:var(--g)}
html[data-theme="terminal"] .md blockquote{border-left-color:var(--a)}
html[data-theme="terminal"] .foot{background:var(--bg)}

/* ═══ 첫 화면 (home_theme.php · home.js) ═════
   글자가 흘러내리는 바탕 위에 명령을 친 것처럼 소개글과 갈 곳 몇 개. 로그인 전에는 화면 가득, 로그인 후에는 낮게. */
html[data-theme="terminal"] .thome{position:relative; overflow:hidden; background:var(--bg)}
html[data-theme="terminal"] .thome.full{min-height:max(540px, calc(100vh - 57px)); display:flex}
html[data-theme="terminal"] .thome canvas{position:absolute; inset:0; width:100%; height:100%; display:block}
/* 글 쪽(왼쪽)은 바탕을 어둡게 덮어 읽기 편하게, 오른쪽은 글자가 잘 보이게 */
html[data-theme="terminal"] .thome::after{content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(90deg, rgba(10,14,11,.80) 0%, rgba(10,14,11,.68) 45%, rgba(10,14,11,.12) 78%, rgba(10,14,11,.2) 100%)}
html[data-theme="terminal"] .thome-in{position:relative; z-index:1; width:100%; max-width:var(--w); margin:0 auto;
  padding:56px 20px 70px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start}
html[data-theme="terminal"] .thome.half .thome-in{padding:36px 20px 52px}
html[data-theme="terminal"] .thome ~ .foot{margin-top:0}
html[data-theme="terminal"] .tline{color:var(--ink); font-size:15px; white-space:pre-wrap}
html[data-theme="terminal"] .tline.gap{margin-top:22px}
html[data-theme="terminal"] .tp{color:var(--g)}
html[data-theme="terminal"] pre.tlogo{margin:8px 0 4px; font:700 13px/1.0 var(--sans); color:var(--g); white-space:pre;
  max-width:100%; overflow:hidden; text-shadow:0 0 12px rgba(91,227,125,.45)}
html[data-theme="terminal"] pre.tlogo:empty{display:none}
html[data-theme="terminal"] .tmsg{font-weight:700; font-size:clamp(36px, 5.2vw, 74px); line-height:1.2; margin:14px 0 0;
  color:var(--title); max-width:15em; word-break:keep-all; text-wrap:balance; letter-spacing:0; text-shadow:0 0 22px rgba(91,227,125,.35)}
html[data-theme="terminal"] .thome.half .tmsg{font-size:clamp(26px, 3.4vw, 46px); max-width:20em}
html[data-theme="terminal"] .tcur{display:inline-block; width:.5em; height:.95em; margin-left:.12em; vertical-align:-.1em;
  background:var(--g); animation:kc-term-blink 1.1s steps(1) infinite}
html[data-theme="terminal"] .tcta{display:flex; gap:12px; flex-wrap:wrap; margin-top:30px}
html[data-theme="terminal"] .tbtn{display:inline-block; font-weight:700; font-size:17px; padding:12px 20px;
  border:1px solid var(--edge-2); background:var(--surface); color:var(--accent-ink)}
html[data-theme="terminal"] .tbtn::before{content:"[ "}
html[data-theme="terminal"] .tbtn::after{content:" ]"}
html[data-theme="terminal"] .tbtn:hover{text-decoration:none; border-color:var(--g); background:var(--fill-3)}
html[data-theme="terminal"] .tbtn.go{background:var(--g); border-color:var(--g); color:var(--bg)}
html[data-theme="terminal"] .tbtn.go:hover{background:var(--accent-2); border-color:var(--accent-2)}
html[data-theme="terminal"] .tbtn.pl{color:var(--a); border-color:var(--warn-line)}
html[data-theme="terminal"] .tbtn.sm{font-size:14.5px; padding:7px 12px}
html[data-theme="terminal"] .tfeed{margin-top:32px; max-width:100%; font-size:15px}
html[data-theme="terminal"] .thome.half .tfeed{margin-top:20px}
html[data-theme="terminal"] .tnote{display:flex; gap:12px; align-items:baseline; padding:3px 0; color:var(--ink); max-width:820px}
html[data-theme="terminal"] .tnote:hover{text-decoration:none}
html[data-theme="terminal"] .tnote:hover .tnote-t{color:var(--g); text-decoration:underline}
html[data-theme="terminal"] .tlab{color:var(--a); flex:none}
html[data-theme="terminal"] .tlab::before{content:"["}
html[data-theme="terminal"] .tlab::after{content:"]"}
html[data-theme="terminal"] .tnote-t{order:3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
html[data-theme="terminal"] .tnote-d{order:2; color:var(--ink-3); flex:none}
html[data-theme="terminal"] .tgo{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; margin-top:10px;
  width:100%; max-width:860px}
html[data-theme="terminal"] .tgocard{display:flex; align-items:center; border:1px solid var(--edge-2); background:var(--surface);
  padding:14px 16px; color:var(--ink); min-width:0}
html[data-theme="terminal"] .tgocard:hover{text-decoration:none; border-color:var(--g); background:var(--fill-2)}
html[data-theme="terminal"] .tgo-ic, html[data-theme="terminal"] .tgo-a{display:none}
html[data-theme="terminal"] .tgo-b{display:flex; flex-direction:column; min-width:0}
html[data-theme="terminal"] .tgo-k{color:var(--a); font-size:13.5px}
html[data-theme="terminal"] .tgo-n{font-size:19px; font-weight:700; color:var(--title); margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
html[data-theme="terminal"] .tgo-n::before{content:"> "; color:var(--g)}
html[data-theme="terminal"] .tlinks{display:flex; gap:10px; flex-wrap:wrap; margin-top:18px}
@media(max-width:760px){ html[data-theme="terminal"] .tgo{grid-template-columns:1fr} }
