:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  background: #0f1115;
  color: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(88, 141, 255, 0.2), transparent 28%),
    #0f1115;
}

button,
input,
select {
  font: inherit;
}

code {
  font-family: "SFMono-Regular", ui-monospace, monospace;
}

#app {
  width: 100%;
}

/* Layout */

.layout {
  width: min(700px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Hero */

.hero {
  margin-bottom: 0.25rem;
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.lede {
  margin: 0;
  color: #c9d2e3;
}

/* Card */

.card {
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(18, 22, 31, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #90a6ff;
}

/* Source row */

.source-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.file-label {
  flex: 1;
  min-width: 0;
}

.file-label input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111722;
  color: inherit;
  cursor: pointer;
}

#paste-btn {
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(88, 141, 255, 0.15);
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

#paste-btn:hover {
  background: rgba(88, 141, 255, 0.28);
}

.status {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #c9d2e3;
}

/* Settings */

.settings-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.settings-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #c9d2e3;
}

.settings-grid input,
.settings-grid select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111722;
  color: inherit;
}

.settings-grid input[type="color"] {
  padding: 0.3rem 0.4rem;
  height: 2.5rem;
  cursor: pointer;
}

/* Sliders */

.sliders {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #c9d2e3;
  margin-bottom: 0.3rem;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: #588dff;
  cursor: pointer;
}

/* Previews */

.preview-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.preview-card {
  display: flex;
  flex-direction: column;
}

.canvas-frame {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 0.75rem;
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.canvas-frame canvas {
  width: 100%;
  max-width: 100%;
  image-rendering: pixelated;
  border-radius: 6px;
  background: #fff;
}

/* Summary */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.summary div {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary dt {
  color: #90a6ff;
  font-size: 0.8rem;
}

.summary dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

/* Transport details */

details.card > summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #c9d2e3;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

details.card > summary::-webkit-details-marker {
  display: none;
}

details.card > summary::before {
  content: "\25b8";
  font-size: 0.75em;
  color: #90a6ff;
}

details[open].card > summary::before {
  content: "\25be";
}

.meta {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #c9d2e3;
  word-break: break-all;
}

@media (max-width: 480px) {
  .layout {
    width: calc(100% - 1.5rem);
    padding-top: 1.5rem;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }
}
