/* app.css — Secrets Place. Mobile-first, light/dark. Palette inspired by Canvas "NFT marketplace". */

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f5fb;
  --bg-glow: radial-gradient(1200px 600px at 80% -10%, rgba(232, 92, 49, .10), transparent 60%),
             radial-gradient(900px 500px at -10% 10%, rgba(80, 48, 160, .10), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f0eef7;
  --text: #16142b;
  --muted: #5f5b76;
  --border: rgba(22, 20, 43, .12);
  --accent: #e85c31;
  --accent-2: #a72531;
  --accent-text: #ffffff;
  --grad: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  --ok: #1f9d63;
  --warn: #c98a12;
  --danger: #d13b3b;
  --focus: #6c4cf5;
  --shadow: 0 10px 30px rgba(22, 20, 43, .08), 0 2px 6px rgba(22, 20, 43, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07081b;
    --bg-glow: radial-gradient(1200px 600px at 85% -10%, rgba(232, 92, 49, .18), transparent 60%),
               radial-gradient(900px 600px at -10% 0%, rgba(87, 41, 170, .28), transparent 60%);
    --surface: #12122e;
    --surface-2: #1b1840;
    --text: #eceaf8;
    --muted: #a19dbd;
    --border: rgba(255, 255, 255, .10);
    --focus: #b9a8ff;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07081b;
  --bg-glow: radial-gradient(1200px 600px at 85% -10%, rgba(232, 92, 49, .18), transparent 60%),
             radial-gradient(900px 600px at -10% 0%, rgba(87, 41, 170, .28), transparent 60%);
  --surface: #12122e;
  --surface-2: #1b1840;
  --text: #eceaf8;
  --muted: #a19dbd;
  --border: rgba(255, 255, 255, .10);
  --focus: #b9a8ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
main:focus, main:focus-visible { outline: none; } /* focused programmatically after navigation */
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.block { display: block; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; letter-spacing: .02em; }
.lead { font-size: 1.125rem; }
.eyebrow { text-transform: uppercase; font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); margin-bottom: .75rem; }
.gradient-text { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-icon { font-size: 4rem; color: var(--muted); margin: 0; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 16px 56px; }
.container.narrow { max-width: 720px; }
.section { padding-top: 24px; padding-bottom: 24px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 1.1rem; margin-right: auto; }
.brand b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mainnav { display: flex; gap: 4px; }
.mainnav a {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem;
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current] { color: var(--text); background: var(--surface-2); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { background: var(--surface-2); }

/* Mobile: bottom tab bar */
@media (max-width: 640px) {
  /* backdrop-filter on an ancestor would trap the fixed bottom bar inside the top bar */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mainnav a { flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 10px; border-radius: 12px; }
  .mainnav a i { font-size: 1.25rem; }
  body { padding-bottom: 72px; }
  .brand span { font-size: 1rem; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 16px; text-align: center; font-size: .875rem; color: var(--muted); }
.footer p { max-width: 640px; margin: 0 auto .5em; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: transform .12s ease, background-position .3s ease, opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background-image: var(--grad); background-size: 200% auto; color: var(--accent-text); box-shadow: 0 6px 18px rgba(232, 92, 49, .3); }
.btn-primary:hover { background-position: right center; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn.danger { color: var(--danger); }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions.center { justify-content: center; }
.wizard .actions { justify-content: space-between; }

/* ---------- Cards & badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); vertical-align: middle; margin-left: 6px;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges .badge { margin: 0; }
.badge-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

.note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.note.error, .warn { color: var(--danger); }
.warn { font-weight: 600; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .label { font-weight: 600; font-size: .95rem; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; }
.counter { white-space: nowrap; }
input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="datetime-local"], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; min-height: 46px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input:user-invalid, textarea:user-invalid { border-color: var(--danger); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-prefix input { padding-left: 28px; }
.row-2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.safety { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 20px; background: var(--surface); }
.safety legend { font-weight: 700; padding: 0 6px; }

.subhead { margin-top: 8px; margin-bottom: 16px; }

/* Choice cards */
.choices { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 640px) { .choices { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice-body {
  display: grid; gap: 4px; height: 100%; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--border); transition: border-color .15s, transform .15s;
}
.choice:hover .choice-body { transform: translateY(-1px); }
.choice input:checked + .choice-body { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-icon { font-size: 1.4rem; color: var(--accent); }
.choice-title { font-weight: 700; }
.choice-text { font-size: .875rem; color: var(--muted); }
.choice.is-disabled { cursor: not-allowed; opacity: .55; }

/* More options */
.more { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 18px 0; }
.more > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "\F282"; font-family: bootstrap-icons; margin-left: auto; transition: transform .2s; }
.more[open] > summary::after { transform: rotate(180deg); }
.more-body { padding: 0 16px 8px; }
.auction-fields .more { background: var(--surface-2); }

/* Disabled "coming soon" drop zone */
.dropzone {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px;
  border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); margin-bottom: 18px;
}
.dropzone i { font-size: 1.5rem; }
.dropzone.small { padding: 14px; }
.dropzone.is-disabled { opacity: .7; }

/* Stepper */
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); font-size: .95rem; }
.stepper li span {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); font-size: .875rem;
}
.stepper li::after { content: ""; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.stepper li:last-child::after { display: none; }
.stepper li.is-active { color: var(--text); }
.stepper li.is-active span { background-image: var(--grad); color: #fff; border-color: transparent; }
.stepper li.is-done span { background: var(--ok); color: #fff; border-color: transparent; }

/* Box picker */
.picker { display: grid; gap: 8px; }
.pick-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.pick-row:has(input:checked) { border-color: var(--accent); }
.pick-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.pick-row-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Copy row */
.copy-row { display: flex; gap: 8px; margin: 8px 0 12px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }

/* ---------- Create chooser ---------- */
.pick-grid { display: grid; gap: 16px; margin: 24px 0; }
@media (min-width: 640px) { .pick-grid { grid-template-columns: 1fr 1fr; } }
.pick-card {
  display: grid; gap: 8px; justify-items: start; padding: 24px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.pick-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.pick-title { font-size: 1.25rem; font-weight: 800; }
.pick-go { margin-top: 8px; color: var(--accent); font-weight: 700; }

/* ---------- Success ---------- */
.success { display: grid; justify-items: center; gap: 8px; }
.success .share { width: 100%; max-width: 560px; text-align: left; }

/* ---------- Home ---------- */
.hero { padding: 24px 0 8px; }
.hero-inner { display: grid; gap: 32px; align-items: center; padding-bottom: 16px; }
@media (min-width: 860px) { .hero-inner { grid-template-columns: 1.2fr .8fr; } }
.hero-title { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; }
.hero-box { display: grid; place-items: center; }
.how { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .how { grid-template-columns: repeat(4, 1fr); } }
.how-step { position: relative; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.how-num { position: absolute; top: 14px; right: 16px; font-weight: 800; font-size: 2rem; color: var(--border); }
.how-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background-image: var(--grad); color: #fff; font-size: 1.25rem; margin-bottom: 12px; }
.types { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 760px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type-card { padding: 24px; text-align: center; }
.pillars { display: grid; gap: 16px; }
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .pillars { grid-template-columns: repeat(4, 1fr); } }
.pillar { padding: 8px; }
.pillar-icon { font-size: 1.75rem; color: var(--accent); }

/* ---------- My stuff ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }

/* Explore */
#explore .page-head input[type="search"] { max-width: 320px; }
.explore-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { font: inherit; font-size: .9rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.is-active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.clamp-2 { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 20px; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--muted); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.item-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
.item-card.is-dim .item-thumb { opacity: .55; }
.item-thumb { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.item-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item-thumb img.item-thumb-art { object-fit: contain; }
.item-body { min-width: 0; display: grid; gap: 6px; align-content: start; }
.item-title { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; }
.item-meta { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.item-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.item-actions .btn { padding: 4px 10px; min-height: 32px; border-color: transparent; }

.empty { text-align: center; padding: 40px 16px; display: grid; justify-items: center; gap: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.list-row a, .list-row > span:nth-child(2) { flex: 1; font-weight: 600; }

/* ---------- Item page ---------- */
.item-hero { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .item-hero { grid-template-columns: .8fr 1.2fr; } }
.facts { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }

/* ---------- 3D box (Atropos "game box", ported from css/secrets.css) ---------- */
.box3d { width: 100%; margin: 8px auto 16px; }
.box3d-sm { max-width: 160px; }
.box3d-md { max-width: 240px; }
.box3d-lg { max-width: 300px; }
.game-box { width: 100%; --side-color: #6b2a1d; --side-size: 32px; --border-size: 8px; }
.game-box .atropos-inner { z-index: 1; border-radius: 4px; }
.game-box img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; display: block; z-index: 1; transform-style: preserve-3d; }
.game-box img.game-box-bg { left: -5%; top: -5%; width: 110%; height: 110%; object-fit: cover; }
.game-box img.game-box-size { position: relative; width: 100%; height: auto; visibility: hidden; }
.game-box .atropos-shadow { opacity: .5; transform: translateZ(-1px); }
.game-box .atropos-rotate::before {
  content: ""; position: absolute; left: calc(var(--border-size) / -2); top: calc(var(--border-size) / -2);
  width: calc(100% + var(--border-size)); height: calc(100% + var(--border-size)); background: var(--accent); border-radius: 6px;
}
.game-box-price {
  position: absolute; z-index: 2; top: 12px; left: 0; right: 0; text-align: center;
  font-weight: 800; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.box3d-sm .game-box-price { font-size: 1.1rem; }
.game-box-b, .game-box-l, .game-box-r, .game-box-t { transform-style: preserve-3d; backface-visibility: hidden; position: absolute; background: var(--side-color); }
.game-box-t, .game-box-b { width: calc(100% + var(--border-size)); height: var(--side-size); left: calc(var(--border-size) / -2); }
.game-box-t { top: calc(var(--border-size) / -2); transform: translateZ(calc(var(--side-size) * -1)) rotateX(90deg); transform-origin: center top; }
.game-box-b { bottom: calc(var(--border-size) / -2); transform: translateZ(calc(var(--side-size) * -1)) rotateX(-90deg); transform-origin: center bottom; }
.game-box-l, .game-box-r { width: var(--side-size); height: calc(100% + var(--border-size)); top: calc(var(--border-size) / -2); }
.game-box-r { right: calc(var(--border-size) / -2); transform: translateZ(calc(var(--side-size) * -1)) rotateY(90deg); transform-origin: right center; }
.game-box-l { left: calc(var(--border-size) / -2); transform: translateZ(calc(var(--side-size) * -1)) rotateY(-90deg); transform-origin: left center; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(5, 5, 20, .6); backdrop-filter: blur(4px); }
.dialog-inner { padding: 24px; }
.dialog-title { font-size: 1.35rem; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.age-icon { font-size: 2.5rem; color: var(--accent); margin: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
@media (max-width: 640px) { .toasts { bottom: 88px; } }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: toast-in .25s ease;
}
.toast-success i { color: var(--ok); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--accent); }
.toast-out { opacity: 0; transform: translateY(8px); transition: .3s; }

/* ---------- Loading ---------- */
.loading { display: grid; place-items: center; padding: 64px 0; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Item page extras ---------- */
.item-info { display: grid; gap: 12px; align-content: start; }
.item-info h1, .item-info p { margin-bottom: 0; }
.item-info .eyebrow { margin-bottom: 0; }
.box-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.facts-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.facts-grid dt { color: var(--muted); }
.facts-grid dd { margin: 0; font-weight: 700; }
.bids { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 2px; }
.report { justify-self: start; color: var(--muted); border-color: transparent; }
.account-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: -8px 0 16px; }
.group-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 4px; }

/* ---------- Wallet, buying, reveal ---------- */
.action-area { display: grid; gap: 8px; }
.action-area .btn-lg { justify-self: stretch; }
@media (min-width: 640px) { .action-area .btn-lg { justify-self: start; } }
.wallet-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: -8px 0 16px; }
.wallet-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text);
}
.wallet-pill i { color: var(--accent); }
.amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 12px 0; }
.amount { position: relative; cursor: pointer; }
.amount input { position: absolute; opacity: 0; inset: 0; }
.amount span {
  display: block; text-align: center; padding: 10px 8px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface);
}
.amount input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.amount input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.reveal {
  padding: 18px; border-radius: var(--radius); border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); animation: toast-in .4s ease;
}
.reveal .eyebrow { margin-bottom: 8px; }
.reveal-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.05rem; margin: 0 0 12px; }
.reveal-item + .reveal-item { border-top: 1px solid var(--border); padding-top: 12px; }
.reveal-item h3 { margin-bottom: 4px; }
.checkout { padding: 24px; display: grid; gap: 12px; }
.checkout h1 { margin: 0; }

/* ---------- Cash out / admin ---------- */
.breakdown { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 8px 0 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.breakdown dt { margin: 0; color: var(--muted); }
.breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .total { color: var(--text); font-weight: 700; border-top: 1px solid var(--border); padding-top: 6px; }
.form-error { color: var(--danger); margin: 8px 0 0; }
.linklike { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cash-history .list-row { align-items: flex-start; }
.dialog details { margin-top: 8px; }
.dialog summary { cursor: pointer; color: var(--muted); }
.admin-card { padding: 16px; display: grid; gap: 8px; align-content: start; }
.admin-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.admin-card .breakdown { margin: 0; overflow-wrap: anywhere; }

/* ---------- Content upload (fileuploader-2.2, themed) ---------- */
.uploader .fileuploader { margin: 0; padding: 0; background: transparent; box-shadow: none; font-family: inherit; }
.uploader .fileuploader-theme-dragdrop .fileuploader-input { padding: 28px 16px; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius-sm); }
.uploader .fileuploader-theme-dragdrop .fileuploader-input .fileuploader-icon-main { font-size: 40px; margin-bottom: 12px; color: var(--accent); }
.uploader .fileuploader-theme-dragdrop .fileuploader-input h3 { color: var(--text); font-size: 1.05rem; }
.uploader .fileuploader-theme-dragdrop .fileuploader-input p { color: var(--muted); }
.uploader .fileuploader-theme-dragdrop.fileuploader-dragging .fileuploader-input { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.uploader .fileuploader-input-caption, .uploader .fileuploader-input-inner p { color: var(--text); }
.uploader .fileuploader-theme-dragdrop .fileuploader-input-button { background: none; background-image: var(--grad); background-size: 200% auto; color: var(--accent-text); border-radius: 999px; box-shadow: 0 6px 18px rgba(232, 92, 49, .3); }
.uploader .fileuploader-theme-dragdrop .fileuploader-input-button:hover { background-position: right center; }
.uploader .fileuploader-items-list .fileuploader-item { border-bottom-color: var(--border); }
.uploader .fileuploader-item .column-title div { color: var(--text); }
.uploader .fileuploader-item .column-title span { color: var(--muted); }
.uploader-hint { margin: 6px 0 0; }

/* ---------- Revealed files ---------- */
.reveal-files { display: grid; gap: 14px; margin: 12px 0; }
.reveal-file { margin: 0; display: grid; gap: 6px; }
.reveal-file img, .reveal-file video { max-width: 100%; max-height: 70vh; border-radius: var(--radius-sm); background: var(--surface-2); }
.reveal-file audio { width: 100%; }
.reveal-textfile { margin: 0; padding: 12px 14px; max-height: 50vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--radius-sm); background: var(--surface-2); font: inherit; }

/* ---------- Cryptex (puzzle teaser) ---------- */
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.crx-builder { padding: 16px; margin: 16px 0; }
.crx-switch { margin: 0; }
.crx-body { margin-top: 14px; }
.crx-panel { padding: 16px; margin: 16px 0; display: grid; gap: 10px; }
.crx-panel > * { margin: 0; }
.crx-hint { overflow-wrap: anywhere; }
.crx-try { display: flex; gap: 8px; flex-wrap: wrap; }
.crx-try input { flex: 1 1 200px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* ---------- Place & language (header, pickers) ---------- */
.place-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 14rem; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer;
}
.place-btn:hover { background: var(--surface-2); }
.place-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-wrap { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.lang-select {
  font: inherit; font-size: .9rem; color: var(--text); background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 10px; min-height: 40px; max-width: 9rem; cursor: pointer;
}
.loc-picker { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .loc-picker { grid-template-columns: 1fr 1fr; } }
.loc-combo { position: relative; }
.loc-combo input { padding-right: 44px; }
.loc-clear { position: absolute; right: 4px; top: 3px; border: 0; }
.loc-list {
  margin: 4px 0 0; padding: 4px; list-style: none; /* inline (not floating): never clipped by a dialog */
  max-height: 16rem; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.loc-option { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.loc-option:hover, .loc-option[aria-selected="true"] { background: var(--surface-2); }
.place-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px 4px; margin: 16px 0; }
.place-block legend { font-weight: 600; padding: 0 6px; }
.explore-where { margin: 4px 0 0; }
.item-place { margin: 0; }
html.script-devanagari { --font: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif; } /* Hindi: Inter has no Devanagari */
@media (max-width: 640px) {
  .place-btn { max-width: 9rem; padding: 6px 10px; font-size: .85rem; }
  .lang-wrap i { display: none; }
  .lang-select { max-width: 5.5rem; padding: 6px 6px; font-size: .85rem; }
  .brand span { display: none; }
}

/* ---------- Explore filters, tags, paging ---------- */
.chip-select { appearance: auto; width: auto; min-height: 36px; padding: 6px 12px; } /* not the full-width form select */
.tag-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.tag-bar[hidden] { display: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 2px; font: inherit; font-size: .85rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px; padding: 3px 10px; cursor: pointer; text-decoration: none; max-width: 100%; overflow-wrap: anywhere;
}
.tag-chip:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tag-chip.is-active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.tag-chip.small { font-size: .78rem; padding: 2px 8px; }
.explore-more { margin-top: 16px; }
.sort-bar { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; border-radius: 999px; background: var(--surface-2); }
.sort-btn { font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.sort-btn:hover { color: var(--text); }
.sort-btn.is-active { color: var(--text); background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.sort-btn.is-active i { color: var(--accent); }
