:root {
  color-scheme: light dark;
  --bg: #f3f2ee;
  --panel: #ffffff;
  --ink: #1c1d1f;
  --muted: #5d6066;
  --line: #dddbd4;
  --accent: #0b5f73;
  --on-accent: #ffffff;
  --ok: #1d7a4a;
  --warn: #9a5b00;
  --focus: #1a73e8;
  --checker: #e7e5df;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --panel: #1d1f22;
    --ink: #eceae4;
    --muted: #a2a5ab;
    --line: #34373c;
    --accent: #5fb6c9;
    --on-accent: #0b1a1f;
    --ok: #6fcf97;
    --warn: #f0b45a;
    --checker: #26282c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button {
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.top h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.top p {
  margin: 0;
  max-width: 44rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.layout {
  display: grid;
  gap: 24px;
  padding: 24px;
  align-items: start;
}

@media (min-width: 64rem) {
  .layout {
    grid-template-columns: 22rem minmax(0, 1fr);
  }

  .setup {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
}

/* ---- Form */
.setup {
  display: grid;
  gap: 16px;
}

fieldset {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  display: grid;
  gap: 12px;
}

legend {
  padding: 0 6px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  font-size: 0.93rem;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.86rem;
}

input:not([type]),
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}

textarea {
  resize: vertical;
}

input[type="file"] {
  font-size: 0.86rem;
  max-width: 100%;
}

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

.colors label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
}

input[type="color"]:disabled {
  opacity: 0.4;
}

output {
  font-weight: 400;
  color: var(--muted);
}

.screen-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.screen-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.screen-list img {
  grid-row: span 2;
  width: 44px;
  height: 78px;
  object-fit: cover;
  object-position: top;
  border-radius: 5px;
  border: 1px solid var(--line);
}

.screen-list .row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.86rem;
}

.screen-list .row button {
  padding: 2px 8px;
  font-size: 0.82rem;
  font-weight: 500;
}

.screen-list .row label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
}

/* ---- Preview */
.preview {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.asset {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 16px;
}

.asset > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.asset h2 {
  margin: 0;
  font-size: 1.05rem;
}

.asset h2 span {
  margin-left: 6px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: repeating-conic-gradient(var(--checker) 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}

/* Preview the icon the way Play masks it. */
.icon-canvas {
  width: 192px;
  border-radius: 20%;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.shot {
  display: grid;
  gap: 6px;
  align-content: start;
}

.shot canvas {
  width: 100%;
}

.shot button {
  justify-self: start;
  padding: 3px 10px;
  font-size: 0.85rem;
}

.status {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.shot .status {
  margin: 0;
}

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

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

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

.foot {
  padding: 0 24px 32px;
  color: var(--muted);
  font-size: 0.86rem;
}

.foot a {
  color: var(--accent);
}

/* ---- About / FAQ (crawlable copy) */
.about {
  margin: 0 24px 24px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.about h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.about h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.about p,
.about ul {
  margin: 0 0 12px;
  color: var(--muted);
}

.about ul {
  padding-left: 1.2em;
}

.about-grid {
  display: grid;
  gap: 8px 28px;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.noscript {
  margin: 0;
  padding: 12px 24px;
  background: var(--warn);
  color: var(--bg);
  font-weight: 600;
}
