:root {
  --gold: #ba8732;
  --gold-dark: #8f6522;
  --ink: #1d2433;
  --muted: #5d6475;
  --line: #e6e1d8;
  --paper: #f7f4ee;
  --card: #fff;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.6 var(--serif); color: var(--ink); background: var(--paper); }
body.embedded { background: transparent; }
a { color: var(--gold-dark); }
img { max-width: 100%; }

.top { border-bottom: 1px solid var(--line); background: #fff; }
.top__inner { max-width: 1080px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font: 600 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
.brand strong { color: var(--ink); letter-spacing: .04em; font-size: 16px; text-transform: none; margin-left: 8px; }
.embedded .top { display: none; }

main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }
.embedded main { padding: 8px 0 24px; }
.narrow { max-width: 720px; }

.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; margin: 10px 0 12px; font-weight: 400; }
h2 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; font-weight: 400; }
.lede { color: var(--muted); font-size: 19px; margin: 0 0 32px; max-width: 640px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 14px 26px; background: var(--gold); color: #fff; font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--gold-dark); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn--ghost { background: transparent; color: var(--gold-dark); border: 1.5px solid var(--gold); }
.btn--ghost:hover { background: #fbf5ea; }
.btn--small { padding: 8px 14px; font-size: 14px; }
.btn--danger { background: transparent; color: #a33; border: 1.5px solid #e2b8b8; }
.btn--danger:hover { background: #fdf1f1; }
.btn--big { width: 100%; padding: 18px; font-size: 18px; }

/* Board */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 10px 30px rgba(29, 36, 51, .08); transform: translateY(-2px); }
.card__img { aspect-ratio: 4 / 3; background: #111; display: block; width: 100%; object-fit: cover; }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-size: 20px; line-height: 1.3; margin: 0; }
.card__meta { font: 14px/1.4 var(--sans); color: var(--muted); margin-top: auto; padding-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-block; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 99px; background: #f2ead9; color: var(--gold-dark); align-self: flex-start; }
.pill--closed { background: #eceef2; color: var(--muted); }

.empty { text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 56px 24px; color: var(--muted); }

/* Challenge detail */
.back { font: 15px var(--sans); text-decoration: none; display: inline-block; margin-bottom: 20px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 28px; } }
.gallery__main { display: block; width: 100%; border-radius: 10px; background: #111; max-height: 70vh; object-fit: contain; cursor: zoom-in; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gallery__thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #111; cursor: pointer; width: 76px; height: 76px; }
.gallery__thumbs button.is-active { border-color: var(--gold); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.question { white-space: pre-wrap; margin: 0 0 24px; }
.byline { font: 14px var(--sans); color: var(--muted); margin: 0 0 20px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.panel + .panel { margin-top: 24px; }
.panel h3 { margin: 0 0 16px; font-size: 20px; font-weight: 400; }

.choices { display: grid; gap: 10px; margin-bottom: 18px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font: 16px/1.3 var(--sans); background: #fff; }
.choice:hover { border-color: var(--gold); }
.choice input { accent-color: var(--gold); width: 20px; height: 20px; margin: 0; }
.choice:has(input:checked) { border-color: var(--gold); background: #fbf5ea; }

label.field { display: block; font: 600 14px/1.3 var(--sans); margin: 0 0 14px; }
label.field span.hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="password"], textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; font: 16px/1.4 var(--sans); color: var(--ink); background: #fff; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(186, 135, 50, .18); }
textarea { min-height: 120px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.msg { font: 15px/1.4 var(--sans); padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; }
.msg--error { background: #fdf1f1; color: #8a2222; }
.msg--ok { background: #eef7ee; color: #23602a; }

.reveal { display: block; margin-top: 14px; font: 14px var(--sans); text-align: center; background: none; border: 0; color: var(--gold-dark); cursor: pointer; text-decoration: underline; width: 100%; }

.bars { display: grid; gap: 12px; margin-bottom: 8px; }
.bar__label { display: flex; justify-content: space-between; font: 15px/1.3 var(--sans); margin-bottom: 4px; gap: 12px; }
.bar__track { height: 10px; background: #f0ebe1; border-radius: 99px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.total { font: 14px var(--sans); color: var(--muted); }

.opinions { list-style: none; margin: 0; padding: 0; }
.opinion { padding: 16px 0; border-top: 1px solid var(--line); }
.opinion:first-child { border-top: 0; padding-top: 0; }
.opinion__who { font: 600 15px/1.3 var(--sans); }
.opinion__who span { font-weight: 400; color: var(--muted); }
.opinion__choice { margin-top: 6px; }
.opinion__text { margin: 6px 0 0; white-space: pre-wrap; }
.opinion__del { float: right; }

.lightbox { position: fixed; inset: 0; background: rgba(10, 12, 18, .92); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Posting page */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #d8c7a6; border-radius: 12px; padding: 40px 20px; text-align: center; background: #fffdf9; cursor: pointer; font-family: var(--sans); transition: background .15s, border-color .15s; }
.drop:hover, .drop.is-over { background: #fbf5ea; border-color: var(--gold); }
.drop__icon { font-size: 40px; line-height: 1; }
.drop strong { font-size: 18px; }
.drop span { color: var(--muted); font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 14px 0 0; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #111; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 16px; cursor: pointer; line-height: 1; }
.thumb.is-loading::after { content: "Preparing…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font: 13px var(--sans); background: rgba(0, 0, 0, .5); }
.step { font: 600 13px/1 var(--sans); color: var(--gold); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.option-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-row input { margin-top: 0; }
.link-btn { background: none; border: 0; color: var(--gold-dark); font: 600 15px var(--sans); cursor: pointer; padding: 6px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font: 15px/1.4 var(--sans); background: #fbf5ea; border-radius: 8px; padding: 14px 16px; margin: 6px 0 18px; cursor: pointer; }
.check input { accent-color: var(--gold); width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.manage { list-style: none; padding: 0; margin: 0; }
.manage li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-family: var(--sans); font-size: 15px; flex-wrap: wrap; }
.manage li:first-child { border-top: 0; }
.manage img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #111; }
.manage .grow { flex: 1; min-width: 160px; }
.manage .grow a { font-weight: 600; text-decoration: none; color: var(--ink); }
.manage .grow div { color: var(--muted); font-size: 13px; }
.share { display: flex; gap: 8px; margin: 16px 0; }
.share input { margin-top: 0; }
.muted { color: var(--muted); font-family: var(--sans); font-size: 14px; }
