/* Idea Computer — full-window terminal. The page never scrolls; only the screen does. */
html, body { height: 100%; overflow: hidden; }
body.ic-body { background: #020403; }

#ic { height: 100dvh; display: flex; flex-direction: column; background: #020403; }

/* phosphor palettes */
#ic {
  --ph: #00ff66; --ph-dim: rgba(0,255,102,.55); --ph-faint: rgba(0,255,102,.28);
  --ph-glow: rgba(0,255,102,.35); --screen: #050806; --bezel: #0a0f0b; --warn2: #ffb000;
}
#ic[data-phosphor="amber"] {
  --ph: #ffb000; --ph-dim: rgba(255,176,0,.55); --ph-faint: rgba(255,176,0,.28);
  --ph-glow: rgba(255,176,0,.32); --screen: #0b0602; --bezel: #100b04; --warn2: #00ff66;
}
#ic[data-phosphor="mono"] {
  --ph: #e8e8e4; --ph-dim: rgba(232,232,228,.55); --ph-faint: rgba(232,232,228,.26);
  --ph-glow: rgba(232,232,228,.22); --screen: #070707; --bezel: #0d0d0c; --warn2: #ffb000;
}

/* ---- top bar ---- */
#icTop { height: 56px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bezel); border-bottom: 2px solid #000; color: var(--ph);
  font: 700 12px var(--fmono); letter-spacing: .1em; }
#icTop .lg { height: 26px; }
#icTop .lg path, #icTop .lg g { stroke: var(--ph); }
#icTop .lg .cell { fill: var(--ph); stroke: none; }
#icTop .ttl { text-transform: uppercase; }
#icTop .sep { flex: 1; }
#icTop .qk { color: var(--ph-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; display: flex; gap: 12px; }
#icTop .qk b { color: var(--ph); font-weight: 700; }
#icTop a, #icTop button.qa { color: var(--ph); text-decoration: none; font: inherit; letter-spacing: inherit;
  border: 1px solid var(--ph-dim); padding: 5px 10px; text-transform: uppercase; cursor: pointer; background: none; }
#icTop a:hover, #icTop button.qa:hover { background: var(--ph); color: #000; }
#icTop .cr { color: var(--ph); border-color: var(--ph-dim); padding: 5px 10px; }
@media (max-width: 760px) { #icTop .qk { display: none; } #icTop .ttl span.long { display: none; } }

/* ---- main split ---- */
#icMain { flex: 1; display: flex; min-height: 0; }

/* CRT bezel + screen */
#icBezel { flex: 1; min-width: 0; margin: 14px; border: 6px solid #000; border-radius: 14px;
  background: var(--bezel); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 20px 60px rgba(0,0,0,.6); }
#icScreenWrap { flex: 1; position: relative; margin: 10px; border-radius: 8px; background: var(--screen);
  overflow: hidden; box-shadow: inset 0 0 70px rgba(0,0,0,.6); }
#icScreenWrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px); }
#icScreenWrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 7;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.5) 100%); }
#ic.fx-off #icScreenWrap::before, #ic.fx-off #icScreenWrap::after, #ic.fx-off .sweepbar { display: none; }
.sweepbar { position: absolute; left: 0; right: 0; height: 90px; z-index: 5; pointer-events: none;
  background: linear-gradient(transparent, rgba(255,255,255,.045), transparent);
  animation: icroll 7s linear infinite; }
@keyframes icroll { from { top: -25%; } to { top: 110%; } }

#icScreen { position: absolute; inset: 0; overflow-y: auto; padding: 22px 26px 26px;
  font: 400 19px/1.42 var(--fcrt); color: var(--ph);
  text-shadow: 0 0 8px var(--ph-glow); scrollbar-width: thin; scrollbar-color: var(--ph-dim) transparent; }
#icScreen::-webkit-scrollbar { width: 8px; }
#icScreen::-webkit-scrollbar-thumb { background: var(--ph-faint); }

#icScreen .l { white-space: pre-wrap; word-break: break-word; margin: 0; min-height: 1.42em; }
#icScreen .dim { color: var(--ph-dim); }
#icScreen .faint { color: var(--ph-faint); }
#icScreen .warn { color: var(--warn2); text-shadow: 0 0 8px var(--ph-glow); }
#icScreen .err { color: #ff5f56; text-shadow: 0 0 8px rgba(255,95,86,.4); }
#icScreen .big { font-size: clamp(28px, 4.6vw, 44px); line-height: 1.1; letter-spacing: .02em; }
#icScreen a { color: var(--ph); text-decoration: underline; text-underline-offset: 3px; }
#icScreen a:hover { background: var(--ph); color: #000; text-shadow: none; }

/* dashed boxes drawn with characters */
#icScreen .box { border: 1px dashed var(--ph-dim); padding: 12px 16px; margin: 6px 0; }
#icScreen .box .bt { color: var(--ph); letter-spacing: .14em; }
#icScreen .box.warnbox { border-color: var(--warn2); color: var(--warn2); }
#icScreen .box.warnbox .bt { color: var(--warn2); }

/* progress bar line */
.pbar { letter-spacing: -1px; }

/* caret + input echo */
#icEcho { display: flex; flex-wrap: wrap; align-items: baseline; }
#icEcho .ps1 { color: var(--ph); margin-right: 10px; }
#icEchoTxt { white-space: pre-wrap; word-break: break-word; }
#icCaret { display: inline-block; width: 11px; height: 22px; background: var(--ph);
  box-shadow: 0 0 10px var(--ph-glow); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
#ic.mask #icCaret { margin-left: 0; }

/* hidden real input (keyboard + IME capture) */
#icHidden { position: fixed; left: -9999px; top: 0; opacity: 0; pointer-events: none; }

/* ---- monitor (pinned) ---- */
#icMonitor { flex: none; width: 300px; margin: 14px 14px 14px 0; border: 6px solid #000; border-radius: 14px;
  background: var(--bezel); display: flex; flex-direction: column; overflow: hidden; }
#icMonitor .mon-in { flex: 1; margin: 10px; background: var(--screen); border-radius: 8px; position: relative;
  box-shadow: inset 0 0 50px rgba(0,0,0,.55); padding: 14px; display: grid; grid-template-rows: repeat(6, 1fr);
  gap: 8px; overflow: hidden; }
#icMonitor .mon-in::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px); }
.mcell { border: 1px solid var(--ph-faint); padding: 8px 10px; display: flex; flex-direction: column; justify-content: center;
  font-family: var(--fcrt); color: var(--ph); text-shadow: 0 0 8px var(--ph-glow); min-height: 0; }
.mcell .k { font: 700 9.5px var(--fmono); letter-spacing: .16em; color: var(--ph-dim); text-shadow: none; text-transform: uppercase; }
.mcell .v { font-size: 21px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .v.sm { font-size: 15px; white-space: normal; }
.mcell.hi .v { color: var(--warn2); }
.mcell .mbar { height: 9px; border: 1px solid var(--ph-faint); margin-top: 4px; }
.mcell .mbar i { display: block; height: 100%; background: var(--ph); box-shadow: 0 0 8px var(--ph-glow); width: 0%; transition: width .5s linear; }
@media (max-width: 900px) { #icMonitor { display: none; } }

/* ---- chin / status line ---- */
#icChin { flex: none; display: flex; align-items: center; gap: 16px; padding: 8px 18px;
  background: var(--bezel); border-top: 2px solid #000; color: var(--ph-dim);
  font: 700 11px var(--fmono); letter-spacing: .1em; text-transform: uppercase; }
#icChin .st-mode { color: var(--ph); }
#icChin .led2 { width: 8px; height: 8px; background: var(--ph); box-shadow: 0 0 8px var(--ph-glow); animation: blink 1.6s steps(1) infinite; }
#icChin .led2.off { background: var(--ph-faint); box-shadow: none; animation: none; }
#icChin .sp { flex: 1; }
#icChin .qk2 { display: flex; gap: 14px; }
#icChin .qk2 b { color: var(--ph); }
@media (max-width: 760px) { #icChin .qk2 { display: none; } }

/* boot flash */
#icFlash { position: fixed; inset: 0; background: var(--ph); opacity: 0; pointer-events: none; z-index: 60; }
#icFlash.go { animation: flashgo .5s ease-out; }
@keyframes flashgo { 0% { opacity: .9; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sweepbar, #icCaret, #icChin .led2 { animation: none !important; }
  #icScreenWrap::before { display: none; }
}
