html {
  background: #020502;
  color: #39ff14;
  font-family: "Courier New", "Lucida Console", monospace;
  font-size: 16px;
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at center, rgba(31, 138, 38, 0.18), transparent 46%),
    linear-gradient(180deg, #031003 0%, #020502 100%);
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.85), 0 0 18px rgba(57, 255, 20, 0.35);
}

button {
  font: inherit;
}

.terminal-screen {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

.scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(57, 255, 20, 0.07),
    rgba(57, 255, 20, 0.07) 1px,
    transparent 1px,
    transparent 5px
  );
  inset: 0;
  opacity: 0.45;
  pointer-events: none;
  position: fixed;
}

.audio-activation {
  align-items: center;
  background: rgba(2, 5, 2, 0.72);
  border: 1px solid rgba(57, 255, 20, 0.72);
  box-shadow: inset 0 0 14px rgba(57, 255, 20, 0.18), 0 0 18px rgba(57, 255, 20, 0.22);
  color: #39ff14;
  cursor: pointer;
  display: flex;
  height: 3rem;
  justify-content: center;
  left: 50%;
  padding: 0;
  position: fixed;
  top: 1.25rem;
  transform: translateX(-50%);
  width: 3rem;
  z-index: 2;
}

.audio-activation img {
  filter: invert(80%) sepia(91%) saturate(1345%) hue-rotate(56deg) brightness(105%) contrast(106%);
  height: 1.5rem;
  width: 1.5rem;
}

.audio-activation:focus {
  outline: 1px solid #b7ffad;
  outline-offset: 3px;
}

.audio-activation[hidden] {
  display: none;
}

.terminal-menu {
  align-items: center;
  animation: crt-flicker 4.5s infinite steps(1, end);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  min-width: min(86vw, 32rem);
  position: relative;
  text-align: center;
  text-transform: uppercase;
  z-index: 1;
}

.terminal-title {
  border-bottom: 1px solid rgba(57, 255, 20, 0.5);
  font-size: clamp(1.1rem, 4vw, 2rem);
  letter-spacing: 0;
  padding-bottom: 0.75rem;
  width: 100%;
}

.terminal-menu ul {
  display: grid;
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.menu-item {
  background: transparent;
  border: 1px solid transparent;
  color: #39ff14;
  cursor: pointer;
  display: block;
  font-size: clamp(1.15rem, 2rem, 2.35rem);
  line-height: 1.08;
  min-height: 4.75rem;
  padding: 0.35rem 1rem;
  text-align: center;
  text-shadow: inherit;
  text-transform: uppercase;
  width: 100%;
}

.post-view {
  max-height: min(68vh, 44rem);
  overflow: auto;
  text-align: left;
  text-transform: none;
  width: min(86vw, 48rem);
}

.matrix-post:focus {
  outline: none;
}

.matrix-post-image {
  border: 1px solid rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 22px rgba(57, 255, 20, 0.22);
  display: block;
  image-rendering: auto;
  margin: 0 auto 1.25rem;
  max-height: 30vh;
  max-width: 100%;
  object-fit: contain;
}

.matrix-post-header {
  border-bottom: 1px solid rgba(57, 255, 20, 0.42);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  text-align: center;
  text-transform: uppercase;
}

.matrix-post-header h2 {
  font-size: clamp(1.25rem, 1.8rem, 2rem);
  line-height: 1.12;
  margin: 0 0 0.5rem;
}

.matrix-post-header time {
  color: rgba(57, 255, 20, 0.72);
  font-size: 0.95rem;
}

.matrix-post-body {
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.matrix-post-body a {
  color: #b7ffad;
}

.matrix-post-body img {
  max-width: 100%;
}

.terminal-error {
  border: 1px solid rgba(57, 255, 20, 0.62);
  max-width: min(86vw, 40rem);
  padding: 1rem;
  text-transform: none;
}

.menu-item:focus {
  outline: none;
}

.menu-item.is-active {
  background: rgba(57, 255, 20, 0.1);
  border-color: rgba(57, 255, 20, 0.78);
  box-shadow: inset 0 0 18px rgba(57, 255, 20, 0.22), 0 0 22px rgba(57, 255, 20, 0.28);
}

.menu-item.is-active::before {
  content: "> ";
}

.menu-item.is-active::after {
  content: " <";
}

.terminal-status {
  color: rgba(57, 255, 20, 0.72);
  font-size: clamp(0.9rem, 2.8vw, 1.15rem);
  min-height: 1.5rem;
}

.admin-screen {
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  padding: 1.25rem;
}

.terminal-admin-panel {
  animation: crt-flicker 4.5s infinite steps(1, end);
  background: rgba(2, 5, 2, 0.76);
  border: 1px solid rgba(57, 255, 20, 0.72);
  box-shadow: inset 0 0 18px rgba(57, 255, 20, 0.16), 0 0 26px rgba(57, 255, 20, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  padding: 1rem;
  position: relative;
  text-transform: none;
  width: min(100%, 78rem);
  z-index: 1;
}

.terminal-admin-login {
  align-self: center;
  width: min(100%, 30rem);
}

.terminal-admin-editor {
  width: min(100%, 70rem);
}

.terminal-admin-header {
  border-bottom: 1px solid rgba(57, 255, 20, 0.48);
  padding-bottom: 0.85rem;
}

.terminal-admin-header h1 {
  font-size: 1.4rem;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}

.terminal-admin-kicker {
  color: rgba(57, 255, 20, 0.68);
  font-size: 0.85rem;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.terminal-admin-toolbar {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.terminal-admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.terminal-admin-actions a,
.terminal-admin-actions button,
.terminal-delete-form button {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.72);
  color: #39ff14;
  cursor: pointer;
  display: inline-flex;
  line-height: 1;
  padding: 0.62rem 0.85rem;
  text-decoration: none;
  text-shadow: inherit;
  text-transform: uppercase;
}

.terminal-admin-actions a:focus,
.terminal-admin-actions button:focus,
.terminal-delete-form button:focus,
.terminal-admin-form input:focus,
.terminal-admin-form textarea:focus,
.terminal-admin-form select:focus {
  outline: 1px solid #b7ffad;
  outline-offset: 2px;
}

.terminal-inline-form {
  margin: 0;
}

.terminal-admin-table-wrap {
  overflow: auto;
}

.terminal-admin-table {
  border-collapse: collapse;
  min-width: 42rem;
  width: 100%;
}

.terminal-admin-table th,
.terminal-admin-table td {
  border-bottom: 1px solid rgba(57, 255, 20, 0.28);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.terminal-admin-table th {
  color: rgba(57, 255, 20, 0.72);
  font-weight: normal;
  text-transform: uppercase;
}

.terminal-admin-table a {
  color: #b7ffad;
}

.terminal-admin-form {
  display: grid;
  gap: 0.9rem;
}

.terminal-admin-form label {
  display: grid;
  gap: 0.35rem;
}

.terminal-admin-form label > span {
  color: rgba(57, 255, 20, 0.72);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.terminal-admin-form input,
.terminal-admin-form textarea,
.terminal-admin-form select {
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(57, 255, 20, 0.58);
  color: #d8ffd2;
  font: inherit;
  min-height: 2.45rem;
  padding: 0.55rem;
  text-shadow: none;
  width: 100%;
}

.terminal-admin-form input[type="file"] {
  min-height: 0;
}

.terminal-post-editor {
  line-height: 1.45;
  min-height: min(45vh, 32rem);
  resize: vertical;
}

.terminal-editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.terminal-editor-tools button {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.56);
  color: #39ff14;
  cursor: pointer;
  font: inherit;
  min-height: 2.2rem;
  padding: 0.45rem 0.65rem;
  text-shadow: inherit;
  text-transform: uppercase;
}

.terminal-editor-tools button:focus {
  outline: 1px solid #b7ffad;
  outline-offset: 2px;
}

.terminal-editor-preview {
  display: grid;
  gap: 0.35rem;
}

.terminal-editor-preview > span {
  color: rgba(57, 255, 20, 0.72);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.terminal-preview-output {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(57, 255, 20, 0.38);
  color: #d8ffd2;
  line-height: 1.45;
  max-height: 16rem;
  min-height: 5rem;
  overflow: auto;
  padding: 0.65rem;
  text-shadow: none;
}

.terminal-preview-output img {
  image-rendering: auto;
  max-width: 100%;
}

.terminal-editor-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal-field-wide {
  grid-column: 1 / -1;
}

.terminal-checkbox {
  align-content: center;
  display: flex;
  gap: 0.6rem;
}

.terminal-checkbox input {
  accent-color: #39ff14;
  height: 1.15rem;
  width: 1.15rem;
}

.terminal-admin-error {
  color: #b7ffad;
  margin: 0;
}

.terminal-delete-form {
  border-top: 1px solid rgba(57, 255, 20, 0.34);
  margin-top: 0.25rem;
  padding-top: 1rem;
}

@keyframes crt-flicker {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.96;
  }
}

@media (max-height: 520px) {
  .terminal-menu {
    gap: 1rem;
  }

  .menu-item {
    font-size: clamp(1.2rem, 7vw, 2.4rem);
    min-height: 3rem;
  }
}

@media (max-width: 760px) {
  .terminal-admin-toolbar {
    display: grid;
  }

  .terminal-editor-grid {
    grid-template-columns: 1fr;
  }

  .terminal-admin-panel {
    max-height: calc(100vh - 1rem);
    padding: 0.8rem;
  }

  .admin-screen {
    padding: 0.5rem;
  }
}
