:root {
  --bg: #0a0c10;
  --surface: #12151c;
  --border: #252a35;
  --text: #e8eaed;
  --muted: #8b939e;
  --accent: #5ac4db;
  --accent-dim: #3a8fa3;
  --ok: #6ee7a0;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

header {
  margin-bottom: 28px;
}

.brand {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 650;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.lead {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover,
.drop.dragover {
  border-color: var(--accent);
  background: rgba(90, 196, 219, 0.06);
}

.drop p {
  margin: 0;
  color: var(--muted);
}

.drop strong {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

input[type="file"] {
  display: none;
}

.controls {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="range"],
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #061016;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.preview {
  margin-top: 18px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.preview.visible {
  display: grid;
}

@media (max-width: 520px) {
  .preview.visible {
    grid-template-columns: 1fr;
  }
}

.preview figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.preview img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.4em;
}

.status.ok {
  color: var(--ok);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.tool-link {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s;
}

.tool-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.tool-link span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.seo {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.seo h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.seo p,
.seo li {
  color: var(--muted);
  font-size: 0.95rem;
}

.seo ul {
  padding-left: 1.2rem;
}

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.dev-credit {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dev-credit .fleet13-mark {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dev-credit a {
  color: var(--muted);
  text-decoration: none;
}

.dev-credit a:hover {
  color: var(--accent);
}

.wrap-wide {
  max-width: 960px;
}

.editor-wrap {
  position: relative;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  touch-action: none;
}

.editor-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.tool-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
  min-width: 120px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 4px;
}

.check-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.check-row .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.progress-wrap {
  margin-top: 12px;
  display: none;
}

.progress-wrap.visible {
  display: block;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 0;
}
