:root {
  --bg: #0b1123;
  --panel: #d7d7cf;
  --panel-shadow: #7f7f78;
  --panel-highlight: #fcfcea;
  --text: #111111;
  --accent: #003cff;
  --danger: #ae0000;
  --success: #0b6b2a;
  --border: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Verdana, Geneva, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 35% 80%, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 20, 80, 0.5), rgba(0, 0, 0, 0.7));
  background-size: 160px 160px, 200px 200px, 220px 220px, 100% 100%;
}

.page-shell {
  width: min(980px, calc(100vw - 24px));
  margin: 14px auto;
  padding-bottom: 24px;
}

.masthead {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 2px solid #ffffff;
  background: linear-gradient(180deg, #091133, #1d347d);
  color: #ffffff;
  box-shadow: 4px 4px 0 #000000;
}

.masthead h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: "Times New Roman", Times, serif;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 6px;
  font: 700 12px/1.2 "Courier New", Courier, monospace;
  text-transform: uppercase;
  color: #8fffd8;
}

.chrome {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1fr);
  gap: 14px;
}

.window {
  border: 2px solid var(--border);
  background: var(--panel);
  box-shadow:
    inset 2px 2px 0 var(--panel-highlight),
    inset -2px -2px 0 var(--panel-shadow),
    4px 4px 0 #000000;
}

.window-title {
  padding: 7px 10px;
  background: linear-gradient(90deg, #003cff, #5f89ff);
  color: #ffffff;
  font: 700 12px/1.1 "Courier New", Courier, monospace;
  text-transform: uppercase;
}

.window-body {
  padding: 14px;
}

.intro {
  margin: 0 0 14px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  font: 700 13px/1.2 "Courier New", Courier, monospace;
  text-transform: uppercase;
}

textarea,
input[type="file"] {
  width: 100%;
  border: 2px inset #ffffff;
  padding: 10px;
  background: #ffffff;
  color: #111111;
  font: 14px/1.45 "Courier New", Courier, monospace;
}

textarea {
  resize: vertical;
  min-height: 220px;
}

button {
  min-width: 150px;
  padding: 9px 12px;
  border: 2px outset #ffffff;
  background: #d9d9d9;
  color: #111111;
  font: 700 13px/1 "Courier New", Courier, monospace;
  text-transform: uppercase;
  cursor: pointer;
}

button:active {
  border-style: inset;
}

button[disabled] {
  cursor: wait;
  opacity: 0.75;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 4px;
}

.fine-print {
  font-size: 12px;
  line-height: 1.4;
}

.status-panel {
  margin-top: 16px;
  padding: 10px 12px;
  border: 2px dashed #444444;
  background: #f6f3d8;
}

.status-panel.success {
  border-color: var(--success);
  background: #dbf1df;
}

.status-panel.error {
  border-color: var(--danger);
  background: #f7dddd;
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.small-window .window-body {
  min-height: 150px;
}

.pixel-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-items: end;
  height: 120px;
  margin-bottom: 10px;
  padding: 10px;
  border: 2px inset #ffffff;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.07), rgba(255, 255, 255, 0.24)),
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.05) 0 6px,
      rgba(255, 255, 255, 0.05) 6px 12px
    );
}

.meter-bar {
  display: block;
  width: 100%;
  border: 1px solid #101010;
  background: linear-gradient(180deg, #8dff8d, #00a722);
  animation: pulse 1.6s ease-in-out infinite alternate;
}

.bar-1 { height: 30%; animation-delay: 0.1s; }
.bar-2 { height: 55%; animation-delay: 0.2s; }
.bar-3 { height: 85%; animation-delay: 0.3s; }
.bar-4 { height: 60%; animation-delay: 0.4s; }
.bar-5 { height: 40%; animation-delay: 0.5s; }

.footer {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #9bb7ff;
  background: rgba(5, 17, 48, 0.88);
  color: #dfe7ff;
  text-align: center;
  font: 12px/1.3 "Courier New", Courier, monospace;
}

@keyframes pulse {
  from {
    filter: brightness(0.9);
  }
  to {
    filter: brightness(1.15);
  }
}

@media (max-width: 800px) {
  .chrome {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100vw - 16px, 980px);
    margin: 8px auto;
  }

  .masthead h1 {
    font-size: 2rem;
  }

  .window-body {
    padding: 12px;
  }
}
