:root {
  --t-bg: #0c0c0c;
  --t-fg: #d4d4d4;
  --t-dim: #7a7a7a;
  --t-green: #8ae234;
  --t-blue: #729fcf;
  --t-red: #ef2929;
  --t-yellow: #e9b96e;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--t-bg);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

a:hover {
  color: var(--t-fg);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

input {
  outline: none;
}

::selection {
  background: #3a3a3a;
  color: var(--t-fg);
}

.desktop-bg {
  min-height: 100dvh;
  background: url('/wallpaper.jpg') center / cover no-repeat, #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.window {
  width: min(880px, 100%);
  height: min(620px, calc(100dvh - 32px));
  border-radius: 10px;
  overflow: hidden;
  background: var(--t-bg);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-size: 14px;
  line-height: 1.4;
  color: var(--t-fg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.08), 0 24px 70px rgba(0,0,0,0.55);
}

.titlebar {
  position: relative;
  height: 28px;
  flex-shrink: 0;
  background: linear-gradient(#3d3e42, #35363a);
  border-bottom: 1px solid #222225;
  display: flex;
  align-items: center;
}

.traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-left: 10px;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.tl-red { background: #ff5f57; }
.tl-yellow { background: #febc2e; }
.tl-green { background: #28c840; }

.window-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: #b6b6b6;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Helvetica Neue', sans-serif;
  pointer-events: none;
}

.output {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.line {
  min-height: 1.4em;
}

.t-green { color: var(--t-green); font-weight: 700; }
.t-blue { color: var(--t-blue); font-weight: 700; }
.dollar { white-space: pre; }

.prompt-row {
  display: flex;
  align-items: baseline;
  padding-bottom: 8px;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--t-fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  caret-color: var(--t-fg);
  padding: 0;
  margin: 0;
}

.cursor-block {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--t-fg);
  animation: blink 1s step-end infinite;
  transform: translateY(3px);
}

.out-line {
  min-height: 1.4em;
}

.out-line span {
  white-space: pre-wrap;
  word-break: break-word;
}

.chips {
  flex-shrink: 0;
  border-top: 1px solid #262626;
  background: #111111;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  background: transparent;
  border: none;
  color: var(--t-fg);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 10px 10px;
  cursor: pointer;
  min-height: 44px;
}

.chip:active {
  background: #262626;
}

.chip .bracket {
  color: var(--t-dim);
}

/* ---------------- mobile: fullscreen terminal, no wallpaper/window chrome ---------------- */

body.is-mobile .desktop-bg {
  padding: 0;
  display: block;
  background: var(--t-bg);
}

body.is-mobile .window {
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

body.is-mobile .titlebar {
  height: 30px;
  justify-content: center;
}

body.is-mobile .traffic-lights {
  display: none;
}

body.is-mobile .output {
  padding: 10px 12px;
}

body.is-mobile .chips {
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  justify-content: center;
}
