/* ---------- H$G Wall theme: black + metallic gold ---------- */
:root {
  --bg: #000;
  --panel: #0b0b0b;
  --panel-2: #121110;
  --text: #ece7da;
  --muted: #a39d8f;
  --gold-1: #C9A646;
  --gold-2: #E8C873;
  --gold-3: #8f7429;
  --gold: linear-gradient(135deg, #E8C873 0%, #C9A646 45%, #f3dc95 60%, #b8952f 100%);
  --danger: #e07a6a;
  --ok: #9fd79a;
  --radius: 14px;
  --serif: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
body { min-width: 300px; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

.wall-app { max-width: 1200px; margin: 0 auto; padding: 24px 16px 32px; }

/* Masthead */
.masthead { text-align: center; padding: 8px 0 18px; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--muted); }
.title { margin: 6px 0 4px; font-family: var(--serif); font-weight: 900; letter-spacing: .08em; line-height: 1.05;
  font-size: clamp(30px, 8vw, 64px); }
.title span, .gold-text { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(201,166,70,.25)); }
.subtitle { margin: 0; color: var(--text); font-size: clamp(14px, 2.6vw, 18px); font-style: italic; opacity: .9; }
.counter-row { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.counter { font-family: "Courier New", ui-monospace, monospace; font-weight: 700; font-size: 15px; letter-spacing: .25em;
  padding: 3px 4px 3px 8px; color: #111; background: var(--gold); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }

/* Marquee */
.marquee { overflow: hidden; border-top: 1px solid var(--gold-3); border-bottom: 1px solid var(--gold-3); margin: 6px 0 22px;
  background: linear-gradient(90deg, #000, #15120a 50%, #000); }
.marquee-track { display: flex; width: max-content; animation: scroll 38s linear infinite; }
.marquee-track span { padding: 7px 0; white-space: nowrap; font-family: var(--serif); font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-2); padding-right: 40px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Panels */
.panel { background: var(--panel); border-radius: var(--radius); padding: 20px; position: relative;
  border: 1px solid transparent; background-image: linear-gradient(var(--panel), var(--panel)), var(--gold);
  background-origin: border-box; background-clip: padding-box, border-box; }
.panel-title { font-family: var(--serif); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 20px;
  margin: 0 0 14px; color: var(--gold-2); }
.center { text-align: center; }
.total { font-family: var(--sans); font-size: 12px; letter-spacing: .05em; color: var(--muted); text-transform: none; }

/* Form */
.sign { max-width: 760px; margin: 0 auto 32px; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: block; position: relative; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.field em { color: var(--gold-2); font-style: normal; }
.field i { color: var(--muted); font-weight: 400; }
input[type="text"], input:not([type]), textarea {
  width: 100%; background: #050505; color: var(--text); border: 1px solid #3a3326; border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus { border-color: var(--gold-1); outline: none; box-shadow: 0 0 0 3px rgba(201,166,70,.18); }
.count { position: absolute; right: 8px; top: 0; font-size: 11px; color: var(--muted); }
.count.warn { color: var(--danger); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.tab { background: transparent; color: var(--text); border: 1px solid #3a3326; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.tab.active { border-color: var(--gold-1); color: var(--gold-2); background: rgba(201,166,70,.08); }
.tab-panel { margin-bottom: 12px; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; padding: 14px;
  border: 2px dashed #3a3326; border-radius: 12px; cursor: pointer; text-align: center; color: var(--muted); font-size: 14px; }
.drop:hover { border-color: var(--gold-1); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop img { max-width: 100%; max-height: 260px; border-radius: 8px; }
.link-btn { background: none; border: 0; color: var(--gold-2); text-decoration: underline; cursor: pointer; padding: 4px 0; font-size: 13px; }

.draw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.swatches, .sizes { display: flex; gap: 6px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #333; cursor: pointer; padding: 0; }
.swatch.active { border-color: var(--gold-2); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold-1); }
.size { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #3a3326; background: #050505; cursor: pointer; display: grid; place-items: center; padding: 0; }
.size i { display: block; background: var(--text); border-radius: 50%; }
.size.active { border-color: var(--gold-1); }
.tool { background: #050505; color: var(--text); border: 1px solid #3a3326; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.tool[aria-pressed="true"] { border-color: var(--gold-1); color: var(--gold-2); }
#pad { width: 100%; aspect-ratio: 8 / 5; background: #000; border-radius: 10px; border: 1px solid var(--gold-3); touch-action: none; cursor: crosshair; display: block; }

.fine { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status { margin: 0; font-size: 14px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

/* Gold pill buttons (matches thisishsg.com) */
.pill { appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: 11px 26px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; font-size: 13px; color: #141006; background: var(--gold); box-shadow: 0 4px 18px rgba(201,166,70,.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s; }
.pill:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 6px 24px rgba(201,166,70,.35); }
.pill:disabled { opacity: .55; cursor: wait; transform: none; }
.pill.ghost { background: transparent; color: var(--gold-2); box-shadow: inset 0 0 0 1.5px var(--gold-1); }
.pill.small { padding: 6px 14px; font-size: 11px; }

/* Guestbook entries */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: stretch; }
.entry { display: flex; flex-direction: column; position: relative; background: var(--panel-2); border-radius: 12px; padding: 16px 16px 12px;
  border: 1px solid #2b261b; box-shadow: 0 0 0 4px #000, 0 0 0 5px #2b261b; animation: pop .35s ease both; }
.entry::before { content: ""; position: absolute; inset: 6px; border: 1px dashed rgba(201,166,70,.22); border-radius: 8px; pointer-events: none; }
.entry.fresh { border-color: var(--gold-3); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.who { min-width: 0; }
.who strong { display: block; font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .04em; color: var(--gold-2);
  overflow-wrap: anywhere; }
.who .place { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.new-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #141006; background: var(--gold);
  border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.thumb { display: block; margin-top: 10px; padding: 0; border: 1px solid #2b261b; border-radius: 8px; overflow: hidden; background: #000; cursor: zoom-in; width: 100%; }
.thumb img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.entry-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.report { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 0; }
.report:hover { color: var(--danger); }
.report:disabled { cursor: default; color: #5d584d; }
.kind { letter-spacing: .1em; text-transform: uppercase; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.wall .center { margin-top: 20px; }

.foot { margin-top: 32px; text-align: center; font-size: 12px; color: var(--muted); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50; padding: 24px; }
.lightbox.in-frame { position: absolute; bottom: auto; height: 680px; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 8px; border: 1px solid var(--gold-3); }
.lightbox p { color: var(--muted); font-size: 13px; margin: 10px 0 0; text-align: center; }
.lb-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--gold-2); font-size: 38px; line-height: 1; cursor: pointer; }

@media (max-width: 560px) {
  .wall-app { padding: 16px 10px 24px; }
  .row.two { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 16px 14px; }
  .posts { grid-template-columns: 1fr; }
  .tab { padding: 6px 11px; font-size: 12.5px; }
  .tabs { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .new-badge, .entry { animation: none; }
}
