/* TSCPP Terminal Style */
:root {
  color-scheme: dark;
  font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
  background: #0b0c10;
  color: #d3d3d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #2a2d35 0%, #101214 55%, #060708 100%);
  min-height: 100vh;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.15));
  pointer-events: none;
}

.terminal-shell {
  width: min(100%, 1024px);
  max-width: 98vw;
  padding: 24px;
}

.terminal-window {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(16, 18, 21, 0.96);
  box-shadow: 0 36px 120px rgba(0,0,0,0.45);
  overflow: hidden;
  animation: glow 4s ease-in-out infinite;
  max-height: 92vh;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(32, 34, 39, 0.95);
  padding: 14px 20px;
}

.sound-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #d3d3d3;
  font: inherit;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sound-toggle:hover,
.sound-toggle:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sound-toggle--off {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
  color: #8ea8b3;
}

.title-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.title-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.title-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.knobs {
  display: flex;
  gap: 10px;
}

.knob {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(196,196,196,0.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.title-text {
  color: #b3b3b3;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-screen {
  position: relative;
  padding: 32px 28px 28px;
  min-height: 72vh;
  max-height: 72vh;
  overflow-y: auto;
  background: radial-gradient(circle at top left, rgba(200,200,200,0.04), transparent 25%),
              linear-gradient(180deg, #141618 0%, #0d0f12 100%);
}

body.console-mode {
  background: #020602;
}

body.console-mode .terminal-window {
  background: rgba(2, 12, 5, 0.96);
  box-shadow: 0 30px 100px rgba(0, 255, 150, 0.08);
  border-color: rgba(0, 255, 150, 0.15);
}

body.console-mode .terminal-screen {
  background: radial-gradient(circle at top left, rgba(40,255,150,0.06), transparent 20%),
              linear-gradient(180deg, #03110b 0%, #020602 100%);
  border: 1px solid rgba(0, 255, 150, 0.12);
}

body.console-mode .terminal-content,
body.console-mode .terminal-content .line {
  color: #8fffc6;
  text-shadow: 0 0 8px rgba(143, 255, 198, 0.18);
}

body.console-mode .title-bar {
  background: rgba(6, 20, 12, 0.95);
}

.boot-overlay {
  position: absolute;
  inset: 0;
  padding: 32px 28px 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  background: rgba(0, 2, 3, 0.98);
}

.boot-lines {
  display: grid;
  gap: 0.35rem;
}

.boot-line {
  color: #5af7cd;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.boot-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.theme-blue.console-mode .terminal-screen {
  background: radial-gradient(circle at top left, rgba(160, 220, 255, 0.06), transparent 20%),
              linear-gradient(180deg, #05131e 0%, #020608 100%);
}

body.theme-green.console-mode .terminal-screen {
  background: radial-gradient(circle at top left, rgba(160, 255, 180, 0.06), transparent 20%),
              linear-gradient(180deg, #04180a 0%, #020604 100%);
}

body.theme-red.console-mode .terminal-screen {
  background: radial-gradient(circle at top left, rgba(255, 140, 140, 0.06), transparent 20%),
              linear-gradient(180deg, #120a0a 0%, #050202 100%);
}

body.console-mode .scanlines {
  opacity: 0.2;
}

body.console-mode .prompt {
  color: #b8ffda;
}

body.console-mode .status.online {
  color: #73ff96;
}

body.console-mode .green-text,
body.console-mode .timestamp,
body.console-mode .status {
  color: #9dfebb;
}

body.console-mode .input-line input::placeholder {
  color: rgba(159, 255, 187, 0.5);
}

body.console-mode .terminal-cursor {
  background: #ccffe7;
}

body.theme-blue.console-mode .terminal-cursor {
  background: #d4f3ff;
}

body.theme-green.console-mode .terminal-cursor {
  background: #c8ffd2;
}

body.theme-red.console-mode .terminal-cursor {
  background: #ffd7d7;
}

body.console-mode .terminal-cursor {
  opacity: 0.95;
}

body.theme-blue.console-mode .status.online,
body.theme-green.console-mode .status.online,
body.theme-red.console-mode .status.online {
  text-shadow: 0 0 14px rgba(143, 255, 198, 0.24);
}

body.console-mode .terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(144, 255, 207, 0.18);
}

body.console-mode .terminal-screen::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
}

body.theme-blue.console-mode .terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(166, 225, 255, 0.18);
}

body.theme-green.console-mode .terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(160, 255, 180, 0.18);
}

body.theme-red.console-mode .terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(255, 175, 175, 0.18);
}

body.console-mode .terminal-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.04), transparent 10%);
  pointer-events: none;
}

body.console-mode .terminal-window {
  border-radius: 12px;
}

body.console-mode .terminal-shell {
  width: min(100%, 960px);
}

body.console-mode .terminal-content {
  min-height: auto;
}

body.console-mode .terminal-screen {
  padding-top: 26px;
}

body.console-mode .terminal-screen .timer-line {
  font-size: 0.9rem;
}

body.console-mode .input-line {
  gap: 0.2rem;
}

body.console-mode .scanlines {
  background-size: 100% 8px;
}

body.console-mode .terminal-screen {
  border-radius: 0 0 14px 14px;
}

body.console-mode .terminal-screen {
  backdrop-filter: blur(0.6px);
}

body.console-mode .terminal-content {
  filter: drop-shadow(0 0 1px rgba(0,255,170,0.08));
}

body.console-mode .line.typing.active {
  opacity: 1;
  visibility: visible;
}

body.console-mode .prompt {
  font-weight: 700;
}

body.console-mode .timer-line {
  color: #86ffa9;
}

body.console-mode .boot-line {
  font-size: 0.96rem;
}

body.console-mode .terminal-screen {
  transition: background 0.3s ease;
}

body.console-mode .terminal-content {
  transition: filter 0.3s ease;
}

body.console-mode .boot-overlay {
  z-index: 4;
}

body.console-mode .boot-overlay {
  pointer-events: none;
}

body.console-mode .terminal-content.hidden {
  visibility: hidden;
}

body.console-mode .terminal-screen {
  overflow: hidden;
}

body.console-mode .terminal-screen.show-content {
  overflow-y: auto;
}

@media (max-width: 720px) {
  body.console-mode .terminal-screen {
    padding: 20px 16px 16px;
  }
}

body.theme-blue.console-mode .boot-line {
  color: #a3dfff;
}

body.theme-green.console-mode .boot-line {
  color: #b7ffd0;
}

body.theme-red.console-mode .boot-line {
  color: #ffc8c8;
}

body.console-mode .boot-overlay .line {
  margin: 0;
}

body.console-mode .boot-overlay .terminal-cursor {
  display: none;
}

body.console-mode .terminal-screen .scanlines {
  opacity: 0.12;
}

body.console-mode .terminal-screen .terminal-content {
  position: relative;
}

body.console-mode .terminal-screen:before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.console-mode .terminal-screen:after {
  pointer-events: none;
}

body.console-mode .terminal-window {
  border: 1px solid rgba(0,255,165,0.14);
}

body.console-mode .line {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.04em;
}

body.console-mode .line.typing.prompt {
  color: #c7ffd5;
}

body.console-mode .boot-overlay {
  animation: boot-fade-in 0.35s ease;
}

@keyframes boot-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  body.console-mode .terminal-screen {
    padding: 18px 12px 12px;
  }
}

@media (max-width: 420px) {
  body.console-mode .terminal-shell {
    padding: 10px;
  }
}

body.console-mode .terminal-screen .scanlines {
  display: block;
}

body.console-mode .terminal-screen {
  border: 1px solid rgba(0, 255, 170, 0.10);
}

body.console-mode .title-text {
  letter-spacing: 0.1em;
}

body.console-mode .title-icon {
  background: rgba(32, 55, 45, 0.22);
}

body.console-mode .knob {
  background: rgba(180, 255, 199, 0.4);
}

body.console-mode .knob::before {
  content: '';
}

body.console-mode .title-bar {
  border-bottom: 1px solid rgba(0,255,180,0.08);
}

body.console-mode .terminal-window {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

body.console-mode .input-line input {
  caret-color: transparent;
}

body.console-mode .terminal-screen {
  overflow: hidden;
}

body.console-mode .terminal-screen.show-content {
  overflow-y: auto;
}

body.console-mode .terminal-content {
  padding-bottom: 10px;
}

body.console-mode .terminal-content.hidden {
  visibility: hidden;
}

body.console-mode .boot-overlay {
  background: rgba(0, 5, 6, 0.96);
}

body.console-mode .boot-line {
  font-family: 'Courier New', Courier, monospace;
}

body.console-mode .terminal-cursor {
  background: rgba(255,255,255,0.85);
}

body.console-mode .terminal-cursor.hidden {
  display: none;
}

body.console-mode .terminal-screen {
  backdrop-filter: blur(0.6px);
}

body.console-mode .terminal-shell {
  padding-top: 18px;
}

body.console-mode .terminal-window {
  border-radius: 16px;
}

body.console-mode .terminal-screen {
  padding-top: 24px;
}

body.console-mode .terminal-content {
  min-height: calc(72vh - 40px);
}

body.console-mode .terminal-screen .scanlines {
  opacity: 0.08;
}

body.console-mode .terminal-screen::after {
  background: radial-gradient(circle at top left, rgba(255,255,255,0.02), transparent 10%);
}

body.console-mode .line.typing.active {
  opacity: 1;
}

body.console-mode .boot-overlay {
  pointer-events: none;
}

body.console-mode .boot-line {
  letter-spacing: 0.06em;
}

body.console-mode .title-text {
  font-size: 0.9rem;
}

body.console-mode .terminal-screen {
  margin: 0;
}

body.console-mode .terminal-shell {
  width: min(100%, 960px);
}

body.console-mode .terminal-screen {
  max-height: 90vh;
}

body.console-mode .terminal-window {
  border: 1px solid rgba(0,255,160,0.15);
}


body.theme-blue .terminal-window {
  background: rgba(11, 20, 35, 0.96);
  box-shadow: 0 36px 120px rgba(4, 14, 30, 0.45);
}

body.theme-blue .title-bar {
  background: rgba(18, 30, 46, 0.95);
}

body.theme-blue .terminal-screen {
  background: radial-gradient(circle at top left, rgba(150, 190, 255, 0.06), transparent 25%),
              linear-gradient(180deg, #0e1a2d 0%, #07101e 100%);
}

body.theme-green {
  background: radial-gradient(circle at top, #1b3c1b 0%, #0b160b 55%, #030704 100%);
  color: #dfffe2;
}

body.theme-green .terminal-window {
  background: rgba(10, 24, 14, 0.96);
  box-shadow: 0 36px 120px rgba(0, 20, 10, 0.45);
}

body.theme-green .title-bar {
  background: rgba(18, 34, 18, 0.95);
}

body.theme-green .terminal-screen {
  background: radial-gradient(circle at top left, rgba(180, 255, 180, 0.06), transparent 25%),
              linear-gradient(180deg, #0c1b0c 0%, #07120b 100%);
}

body.theme-red {
  background: radial-gradient(circle at top, #3a1717 0%, #180808 55%, #070202 100%);
  color: #ffe1dd;
}

body.theme-red .terminal-window {
  background: rgba(25, 12, 12, 0.96);
  box-shadow: 0 36px 120px rgba(40, 8, 8, 0.45);
}

body.theme-red .title-bar {
  background: rgba(43, 16, 16, 0.95);
}

body.theme-red .terminal-screen {
  background: radial-gradient(circle at top left, rgba(255, 160, 160, 0.06), transparent 25%),
              linear-gradient(180deg, #1a0d0d 0%, #0a0505 100%);
}

.terminal-screen::-webkit-scrollbar {
  width: 10px;
}

.terminal-screen::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}

.terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

.terminal-screen::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.20);
}

.scanlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 6px;
  pointer-events: none;
  opacity: 0.35;
  animation: scanlineShift 15s linear infinite;
}

.terminal-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  color: #c6c6c6;
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.05));
  min-height: 68vh;
}

.line {
  font-size: 0.95rem;
  line-height: 1.55;
}

.timer-line {
  color: #facc15;
  font-weight: 700;
}

#timeoutTimer {
  color: #fff3bf;
}

.line.typing {
  opacity: 0;
  visibility: hidden;
}

.line.typing.active {
  opacity: 1;
  visibility: visible;
}

.input-line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.25rem 0;
}

.output-lines {
  display: grid;
  gap: 10px;
}

.command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border: 1px dashed rgba(122, 252, 255, 0.8);
  border-radius: 0.35rem;
  color: #7afcff;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.command-chip:hover,
.command-chip:focus {
  background: rgba(122, 252, 255, 0.14);
  color: #bbf7d0;
  transform: translateY(-1px);
}

.input-line input {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  width: min(100%, 100%);
  outline: none;
  caret-color: transparent;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}

.terminal-cursor {
  position: absolute;
  top: 0.18rem;
  left: 0;
  width: 0.85ch;
  height: 1.22em;
  background: currentColor;
  opacity: 0.8;
  animation: blinkCursor 1s steps(1) infinite;
  pointer-events: none;
  z-index: 0;
}

.terminal-cursor.hidden {
  display: none;
}

.terminal-cursor-measure {
  position: absolute;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  white-space: pre;
  font: inherit;
  letter-spacing: inherit;
}

@keyframes blinkCursor {
  0%, 50% { opacity: 0.8; }
  50.1%, 100% { opacity: 0; }
}

.input-line input::-webkit-input-placeholder {
  color: rgba(211,211,211,0.55);
}

.input-line input:-ms-input-placeholder {
  color: rgba(211,211,211,0.55);
}

.input-line input::placeholder {
  color: rgba(211,211,211,0.55);
}

.prompt {
  color: #d3d3d3;
}

.green-text,
.status,
.timestamp {
  color: #b0b0b0;
}

.warningnote {
  color: #ffd900;
}

.warningnote2 {
  color: rgb(255, 209, 109);
}

.status {
  font-weight: 700;
  text-shadow: 0 0 14px rgba(176, 176, 176, 0.35);
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}

.status.online {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.75);
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .terminal-shell {
    padding: 16px;
  }

  .terminal-window {
    border-radius: 14px;
    max-height: 95vh;
  }

  .title-bar {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 12px 16px;
  }

  .title-text {
    font-size: 0.85rem;
  }

  .terminal-screen {
    padding: 24px 18px 18px;
    min-height: 62vh;
    max-height: 80vh;
  }

  .terminal-content {
    gap: 8px;
    min-height: auto;
  }

  .line {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .input-line {
    gap: 0.25rem;
  }

  .terminal-screen::-webkit-scrollbar {
    width: 8px;
  }
}

@media (max-width: 520px) {
  .terminal-shell {
    padding: 12px;
  }

  .title-bar {
    padding: 10px 14px;
    gap: 0.6rem;
  }

  .title-brand {
    gap: 0.7rem;
  }

  .title-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  .knob {
    width: 10px;
    height: 10px;
  }

  .terminal-screen {
    padding: 20px 14px 14px;
    min-height: 58vh;
    max-height: 78vh;
  }

  .title-text {
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .terminal-shell {
    padding: 10px;
  }

  .terminal-window {
    border-radius: 12px;
  }

  .title-bar {
    padding: 10px 12px;
    gap: 0.5rem;
  }

  .terminal-screen {
    padding: 16px 12px 12px;
    max-height: 75vh;
  }

  .line {
    font-size: 0.88rem;
  }

  .terminal-cursor {
    top: 0.15rem;
  }
}

.status.warning {
  color: #facc15;
  text-shadow: 0 0 22px rgba(250, 204, 21, 0.75);
  animation: pulse 2s ease-in-out infinite;
}

.status.error,
.status.critical,
.line.terminal-error {
  color: #f87171;
  text-shadow: 0 0 24px rgba(248, 113, 113, 0.85);
  animation: shake 0.85s ease-in-out infinite;
}

.status.critical {
  color: #fb7185;
  text-shadow: 0 0 28px rgba(251, 113, 133, 0.95), 0 0 60px rgba(255, 0, 0, 0.35);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 22px rgba(250, 204, 21, 0.75);
  }
  50% {
    transform: scale(1.03);
    text-shadow: 0 0 32px rgba(250, 204, 21, 0.95);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-1px); }
  20%, 40%, 60%, 80% { transform: translateX(1px); }
}

.cursor {
  display: inline-block;
  width: 10px;
  animation: blink 1s steps(2, start) infinite;
  color: #d1d1d1;
}

.terminal-window::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(255,255,255,0.02);
  mix-blend-mode: screen;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 36px 120px rgba(0,0,0,0.45); }
  50% { box-shadow: 0 36px 160px rgba(0,0,0,0.55); }
}

@keyframes scanlineShift {
  from { background-position: 0 0; }
  to { background-position: 0 100%; }
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 24%, 55% {
    opacity: 0.85;
  }
}

.terminal-screen {
  animation: flicker 8s linear infinite;
}

@media (max-width: 640px) {
  .terminal-window {
    border-radius: 14px;
  }

  .terminal-screen {
    padding: 20px 16px 16px;
  }
}
