:root {
  --bg: #0b0b0f;
  --fg: #e6e6ea;
  --accent: #8a2be2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  background: var(--bg);
  color: var(--fg);
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px max(12px, env(safe-area-inset-right)) 16px max(12px, env(safe-area-inset-left));
}

h1 {
  font-size: 36px;
  margin: 0;
  font-weight: 700;
  color: var(--accent);
  padding-bottom: 34px;
  text-shadow:
    0 0 10px rgba(138, 43, 226, 0.45),
    0 0 24px rgba(138, 43, 226, 0.25);
}

.terminalPromptCursor {
  display: inline-block;
  width: 0.6em;
  margin-left: 0.05em;
  color: var(--accent);
  animation: terminalCursorBlink 1s steps(2, start) infinite;
}

@keyframes terminalCursorBlink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.titleRow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 6px;
}

#countdown {
  padding-bottom: 38px;
  text-align: right;
  color: var(--accent);
  opacity: 1;
  font-size: 24px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(138, 43, 226, 0.45),
    0 0 24px rgba(138, 43, 226, 0.25);
}

#term {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  height: 70dvh;
  min-height: 360px;
  overflow: auto;
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
  font-size: clamp(12px, 1.7vw, 16px);
  line-height: 1.4;
}

.controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

input[type="text"] {
  flex: 1;
  font: inherit;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 12px;
  outline: none;
}

input[type="text"]:focus {
  border-color: rgba(138, 43, 226, 0.7);
}

button {
  font: inherit;
  color: var(--fg);
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  h1 {
    font-size: clamp(24px, 5vw, 34px);
    padding-bottom: 14px;
  }

  .titleRow {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
  }

  #countdown {
    font-size: clamp(17px, 4.2vw, 24px);
    padding-bottom: 0;
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .wrap {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  #term {
    height: 62dvh;
    min-height: 300px;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.35;
  }

  .controls {
    flex-direction: column;
  }

  input[type="text"],
  button {
    width: 100%;
    min-height: 44px;
  }

  button {
    padding: 10px 12px;
  }
}
