* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:      #1e1e1e;
  --fg:      #d4d4d4;
  --dim:     #6b6b6b;
  --green:   #98c379;
  --yellow:  #e5c07b;
  --blue:    #61afef;
  --cyan:    #56b6c2;
  --red:     #e06c75;
  --magenta: #c678dd;
  --white:   #abb2bf;
}

html, body {
  height: 100%;
  background: #111;
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── WINDOW ── */
.window {
  max-width: 800px;
  height: calc(100vh - 64px);
  margin: 32px auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
}

.titlebar {
  background: #2d2d2d;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #111;
  user-select: none;
  flex-shrink: 0;
}

.btn { width: 12px; height: 12px; border-radius: 50%; }
.btn-close { background: #ff5f57; }
.btn-min   { background: #febc2e; }
.btn-max   { background: #28c840; }

.title-text {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #777;
}

/* ── TERMINAL BODY ── */
.term {
  background: var(--bg);
  flex: 1;
  overflow-y: auto;
  cursor: text;
  padding: 12px 16px 16px;
}

/* ── SPOILER SENSOR ── */
.censored {
  position: relative;
  display: inline-block;
  color: rgba(180,180,180,0.35);
  border-radius: 3px;
  cursor: default;
  user-select: none;
  filter: blur(3.5px) brightness(1.1);
  letter-spacing: 0.05em;
}

.censored::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: rgba(180,180,180,0.08);
  backdrop-filter: blur(2px);
  border-radius: 4px;
  pointer-events: none;
}

.censored::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.10) 35%,
    rgba(255,255,255,0.20) 50%,
    rgba(255,255,255,0.10) 65%,
    transparent 100%
  );
  background-size: 200% 100%;
  border-radius: 3px;
  animation: sensor-shimmer 2.5s linear infinite;
  pointer-events: none;
}

@keyframes sensor-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* scrollbar */
.term::-webkit-scrollbar { width: 5px; }
.term::-webkit-scrollbar-track { background: transparent; }
.term::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }
.term {
  scroll-behavior: auto;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: none;
}

/* ── LINES ── */
.ln {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.55em;
}

/* color helpers */
.g  { color: var(--green);   }
.y  { color: var(--yellow);  }
.b  { color: var(--blue);    }
.cy { color: var(--cyan);    }
.r  { color: var(--red);     }
.m  { color: var(--magenta); }
.d  { color: var(--dim);     }
.bd { font-weight: 700;      }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── INPUT ── */
.input-row {
  display: flex;
  align-items: flex-start;
  margin-top: 1px;
  position: relative;
}

.ps { white-space: pre; flex-shrink: 0; }

#inp {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  caret-color: #ffffff;
  padding: 0;
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 1.55em;
}

@media (max-width: 840px) {
  .window { margin: 0; border-radius: 0; height: 100dvh; box-shadow: none; }
  html, body { font-size: 12px; }
}

/* ── RICK ASCII OVERLAY ── */
#rick-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#rick-overlay.active {
  display: flex;
}

#rick-pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 5px;
  line-height: 1.1;
  color: #d4d4d4;
  white-space: pre;
  text-align: left;
}

#rick-close {
  position: fixed;
  top: 12px;
  right: 12px;
  color: #6b6b6b;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  z-index: 100000;
  user-select: none;
}

