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

:root {
  --bg: #fffdf7;
  --text: #0f172a;
  --muted: #475569;
  --border: #0f172a;
  --panel: #dff4ff;
  --panel-2: #ffffff;
  --accent: #00a6fb;
  --accent-strong: #0077b6;
  --highlight: #ffd23f;
  --danger: #ff5d73;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 920px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 3px solid var(--border);
  padding-bottom: 20px;
}

h1,
h2,
h3,
button,
summary,
.back-button {
  font-family: 'Arial Black', Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 10px;
  line-height: 1;
  text-transform: uppercase;
}

h2 {
  font-size: 1.8rem;
  margin: 0 0 16px;
}

h3 {
  font-size: 1.35rem;
  margin: 0 0 14px;
}

p,
ul {
  margin-bottom: 16px;
}

.subtitle {
  color: var(--accent-strong);
  font-size: 1rem;
}

.back-button {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 15px;
  background: var(--highlight);
  color: var(--text);
  text-decoration: none;
  border: 3px solid var(--border);
}

.back-button:hover,
.action-button:hover {
  background: var(--text);
  color: #fff;
}

.info-box {
  background: var(--highlight);
  border: 3px solid var(--border);
  padding: 16px;
  margin: 20px 0;
}

.canvas-container {
  background: var(--panel);
  border: 3px solid var(--border);
  padding: 20px;
  margin: 30px 0;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.canvas-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.action-button {
  padding: 10px 14px;
  background: var(--danger);
  color: white;
  border: 3px solid var(--border);
  cursor: pointer;
  font: inherit;
}

.canvas-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 520px;
  overflow: auto;
  background: var(--panel-2);
  border: 3px solid var(--border);
  padding: 12px;
}

#canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  background: #000;
  outline: none;
  image-rendering: pixelated;
}

.canvas-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 15px;
  font-size: 0.95rem;
  color: var(--muted);
}

.canvas-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.canvas-options input {
  accent-color: var(--accent-strong);
}

.status {
  margin-top: 15px;
  min-height: 24px;
  color: var(--accent-strong);
  font-weight: 700;
}

progress {
  width: 100%;
  height: 18px;
  margin-top: 10px;
  border: 3px solid var(--border);
}

progress[hidden] {
  display: none;
}

details {
  margin-top: 15px;
}

summary {
  cursor: pointer;
}

.feature-list {
  padding-left: 24px;
}

.feature-list li {
  margin-bottom: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 10px;
  padding: 10px;
  border: 3px solid var(--border);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  resize: vertical;
  background: white;
  color: var(--text);
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 3px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  body {
    padding: 16px;
    font-size: 16px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .canvas-container {
    padding: 15px;
  }

  .canvas-shell {
    min-height: 360px;
  }
}
