/* Choopaboard back room. Flyer-wall energy, admin-panel usability. */
:root {
  --ink: #0d0b0a;
  --ink-2: #1b1714;
  --ink-3: #2a2420;
  --paper: #f6efe2;
  --paper-dim: #cfc6b6;
  --hot: #ff2e88;
  --sun: #ffd400;
  --flame: #ff5a1f;
  --mint: #3ef0b0;
  --danger: #ff6b6b;
  --display: "Bowlby One", "Arial Black", Impact, system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(246, 239, 226, 0.06) 1px, transparent 0);
  background-size: 6px 6px;
  color: var(--paper);
  font: 16px/1.5 var(--body);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--sun); color: var(--ink); padding: 8px 12px; border-radius: 6px; font-weight: 800;
}
.skip:focus { top: 8px; }

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

.display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
}

/* ---------- header */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 4px solid var(--hot);
  background: var(--ink);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--sun); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; }
.brand-word { font-family: var(--display); font-size: clamp(20px, 4vw, 28px); text-transform: uppercase; }
.tag {
  background: var(--hot); color: var(--ink); font-weight: 800; text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.12em; padding: 4px 8px; transform: rotate(-3deg);
}
#logout { margin-left: auto; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px;
  font: 800 15px/1 var(--body); text-transform: uppercase; letter-spacing: 0.06em;
  border: 3px solid var(--paper); border-radius: 999px;
  background: transparent; color: var(--paper); cursor: pointer; text-decoration: none;
  transition: transform 0.12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-hot { background: var(--sun); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--hot); }
.btn-ghost { border-color: var(--paper-dim); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 13px; border-width: 2px; }

label, .label { display: block; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.req { font-weight: 600; color: var(--sun); text-transform: none; letter-spacing: 0; margin-left: 4px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; padding: 11px 12px; min-height: 44px;
  font: 16px/1.4 var(--body); color: var(--paper);
  background: var(--ink-2); border: 2px solid #6d635a; border-radius: var(--radius);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--sun); }
textarea { resize: vertical; min-height: 120px; }
input[type=file] { font: 14px var(--body); color: var(--paper); max-width: 100%; }
input[type=file]::file-selector-button {
  font: 800 13px var(--body); text-transform: uppercase; margin-right: 10px;
  padding: 8px 12px; border-radius: 999px; border: 2px solid var(--paper-dim); background: transparent; color: var(--paper); cursor: pointer;
}
input[type=color] { width: 64px; height: 44px; border: 2px solid #6d635a; border-radius: var(--radius); background: var(--ink-2); padding: 3px; }
input[type=color]:disabled { opacity: 0.35; }
.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--hot); }
.hint { color: var(--paper-dim); font-size: 14px; margin: 6px 0 0; }
.msg { min-height: 1.5em; margin: 8px 0 0; font-weight: 600; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--mint); }
.stack > * + * { margin-top: 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline select { flex: 1; }

/* ---------- banner */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--sun); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--flame);
  padding: 14px 16px; margin-bottom: 24px; border-radius: var(--radius);
}
.banner svg { width: 28px; height: 28px; flex: none; }
.banner p { margin: 0; }

/* ---------- gate */
.gate { display: grid; place-items: center; min-height: 70vh; }
.gate-card {
  width: min(460px, 100%);
  background: var(--ink-2);
  border: 4px solid var(--paper);
  box-shadow: 10px 10px 0 var(--hot), 20px 20px 0 var(--sun);
  padding: 28px 22px;
  transform: rotate(-1deg);
}
.gate-card .display { font-size: clamp(40px, 10vw, 64px); color: var(--sun); }
.kicker { margin: 0 0 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; font-size: 13px; color: var(--hot); }
.lede { color: var(--paper); margin: 12px 0 20px; }

/* ---------- sections */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lots .display { font-size: clamp(36px, 7vw, 72px); color: var(--sun); text-shadow: 4px 4px 0 var(--hot); }
.designer { margin-top: 56px; padding-top: 32px; border-top: 4px dashed var(--ink-3); }
.designer .display { font-size: clamp(30px, 5vw, 52px); color: var(--paper); }
.editing { margin: 0; font-weight: 800; background: var(--hot); color: var(--ink); padding: 4px 10px; text-transform: uppercase; font-size: 13px; letter-spacing: 0.08em; }

/* ---------- lot list */
.lot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.lot {
  background: var(--ink-2); border: 3px solid var(--paper); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.lot.is-editing { border-color: var(--sun); box-shadow: 6px 6px 0 var(--hot); }
.lot-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.lot-title { font-family: var(--display); font-size: 22px; line-height: 1.05; margin: 0; text-transform: uppercase; overflow-wrap: anywhere; }
.lot-slug { margin: 0; font-size: 13px; color: var(--paper-dim); overflow-wrap: anywhere; }
.pill { flex: none; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px; background: var(--mint); color: var(--ink); }
.pill.closed { background: var(--danger); }
.pill.house { background: var(--hot); }
.lot-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; }
.lot-stats dt { color: var(--paper-dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.lot-stats dd { margin: 0; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.lot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.lot-empty { color: var(--paper-dim); }

/* ---------- designer */
.designer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .designer-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } .previews { position: sticky; top: 90px; align-self: start; } }
fieldset { border: 3px solid var(--ink-3); border-radius: var(--radius); margin: 0 0 18px; padding: 14px 14px 4px; min-width: 0; }
legend { font-family: var(--display); text-transform: uppercase; font-size: 20px; padding: 0 8px; color: var(--hot); }
.field { margin-bottom: 14px; min-width: 0; }
.row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .row { grid-template-columns: 1fr 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.image-now { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.image-now img { width: 96px; height: 72px; object-fit: cover; border: 2px solid var(--paper); border-radius: 6px; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.theme {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 8px; border: 3px solid var(--ink-3); border-radius: var(--radius);
  background: var(--ink-2); color: var(--paper); cursor: pointer;
  font: 800 13px var(--body); text-transform: uppercase; letter-spacing: 0.05em; text-align: left;
}
.theme[aria-checked=true] { border-color: var(--sun); box-shadow: 4px 4px 0 var(--hot); }
.swatch { display: flex; height: 30px; border-radius: 5px; overflow: hidden; border: 2px solid rgba(0, 0, 0, 0.5); }
.swatch i { flex: 1; }

/* ---------- previews */
.mini {
  --bg: #1b1714; --fg: #f6efe2; --accent: #ff2e88; --pop: #ffd400;
  background: var(--bg); color: var(--fg);
  border: 4px solid var(--fg); border-radius: 14px; overflow: hidden;
  box-shadow: 8px 8px 0 var(--accent);
  max-width: 420px;
}
.mini-art { position: relative; aspect-ratio: 16 / 10; background: var(--accent); color: var(--bg); display: grid; place-items: center; overflow: hidden; }
.mini-art img { width: 100%; height: 100%; object-fit: cover; }
.mini-placeholder { width: 46%; }
.mini-sticker {
  position: absolute; top: 12px; right: 12px; transform: rotate(8deg);
  background: var(--pop); color: #0d0b0a; font: 400 16px/1 var(--display); text-transform: uppercase;
  padding: 8px 10px; border: 3px solid #0d0b0a; border-radius: 6px;
}
.mini-sticker:empty { display: none; }
.mini-body { padding: 16px 18px 20px; }
.mini-title { font: 400 clamp(26px, 5vw, 36px)/1 var(--display); text-transform: uppercase; margin: 0 0 8px; overflow-wrap: anywhere; }
.mini-tagline { margin: 0 0 12px; overflow-wrap: anywhere; }
.mini-tagline:empty { display: none; }
.mini-price { margin: 0 0 14px; }
.mini-price span { text-transform: uppercase; font-size: 13px; letter-spacing: 0.08em; opacity: 0.85; }
.mini-price strong { font: 400 24px var(--display); }
.mini-cta {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--bg); font: 800 15px var(--body); text-transform: uppercase; letter-spacing: 0.06em;
  border: 3px solid var(--fg);
}

.frame-wrap { margin-top: 24px; }
.frame-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.frame-head .kicker { margin: 0; }
#frame { width: 100%; height: 560px; border: 3px solid var(--paper); border-radius: var(--radius); background: #000; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover, .btn:active { transform: none; }
}

/* small phones: header must not overflow */
.top { flex-wrap: nowrap; }
.brand { min-width: 0; }
#logout { white-space: nowrap; flex: none; }
@media (max-width: 520px) {
  .top { gap: 10px; padding: 10px 12px; }
  .top .tag { display: none; }
  .brand-mark { width: 28px; height: 28px; flex: none; }
  .brand-word { font-size: 18px; }
  #logout { min-height: 40px; padding: 8px 12px; font-size: 13px; }
}
