/* ShoppingPlay. Cool paper, navy ink; the one loud thing is the yellow shelf ticket. */
:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #5b6478;
  --line: #dde1e8;
  --tag: #ffd23f;
  --tag-ink: #14213d;
  --mark: #d7263d;
  --good: #1f7a4d;
  --focus: #2f6bff;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1322;
    --surface: #151d31;
    --ink: #e8ecf4;
    --muted: #98a2b8;
    --line: #26304a;
    --mark: #ff5a6e;
    --good: #4cc38a;
    --focus: #7ea2ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body); }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }

/* Header */
.top { background: var(--ink); color: var(--paper); }
@media (prefers-color-scheme: dark) { .top { background: #070b15; color: var(--ink); } }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo { font: 800 28px/1 var(--display); letter-spacing: .01em; text-decoration: none; display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.logo-tag { width: 22px; height: 28px; background: var(--tag); border-radius: 3px 3px 3px 3px;
  -webkit-mask: radial-gradient(circle at 50% 6px, transparent 3px, #000 3.5px); mask: radial-gradient(circle at 50% 6px, transparent 3px, #000 3.5px); transform: rotate(-8deg); }
.search { flex: 1 1 260px; }
.search input { width: 100%; border: 0; border-radius: 999px; padding: 9px 16px; background: rgba(255,255,255,.12); color: inherit; }
.search input::placeholder { color: currentColor; opacity: .65; }
.search input:focus { background: var(--surface); color: var(--ink); outline-offset: 0; }
.account { display: flex; gap: 8px; align-items: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-post { background: var(--tag); color: var(--tag-ink); }
.btn-post:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .9; }
.btn-go { background: var(--ink); color: var(--paper); padding: 12px 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: progress; }

/* Layout */
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.layout > *, .detail-grid > * { min-width: 0; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .side { order: -1; } }

.feed-head h1 { font: 800 40px/1 var(--display); text-transform: uppercase; margin: 0 0 6px; letter-spacing: .01em; }
.intro { color: var(--muted); margin: 0 0 12px; }
.sorts { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 16px; border-bottom: 1px solid var(--line); }
.sorts a { text-decoration: none; padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.sorts a[aria-current] { color: var(--ink); border-color: var(--tag); }
.sorts a:hover { color: var(--ink); }

/* Deal rows */
.deals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.deal { display: grid; grid-template-columns: 44px 72px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.deal.is-expired { opacity: .6; }
.thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--paper); display: grid; place-items: center; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-initial { font: 800 30px var(--display); color: var(--muted); text-transform: uppercase; }
.deal-meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.merchant { font-weight: 700; color: var(--ink); text-decoration: none; }
.merchant:hover, .deal-title a:hover { text-decoration: underline; }
.deal-title { font-size: 17px; line-height: 1.3; margin: 3px 0 6px; font-weight: 600; }
.deal-title a { text-decoration: none; }
.deal-foot { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.deal-foot a { text-decoration: none; }
.deal-foot a:hover { color: var(--ink); }
.when.urgent { color: var(--mark); font-weight: 600; }
.when.expired { color: var(--mark); }
.postmark { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 4px 7px; border: 1px dashed currentColor; border-radius: 4px; }
.by { font-size: 13px; }

.code { font: 500 12px/1 var(--mono); letter-spacing: .06em; border: 1.5px dashed var(--ink); background: transparent; color: var(--ink); padding: 5px 8px; border-radius: 5px; cursor: copy; }
.code:hover { background: var(--paper); }
.code-lg { font-size: 18px; padding: 10px 14px; display: inline-flex; gap: 12px; align-items: center; }
.code-lg span { font: 600 12px var(--body); letter-spacing: 0; color: var(--muted); }

/* Votes */
.votes { display: grid; justify-items: center; gap: 2px; }
.vote { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.vote:hover { background: var(--paper); color: var(--ink); }
.vote[aria-pressed="true"].up { color: var(--good); }
.vote[aria-pressed="true"].down { color: var(--mark); }
.score { font: 800 20px/1 var(--display); }
.score.pos { color: var(--good); }
.score.neg { color: var(--mark); }

/* The shelf ticket */
.ticket { --hole: 5px; position: relative; background: var(--tag); color: var(--tag-ink); border-radius: 6px;
  padding: 14px 14px 8px; min-width: 96px; text-align: center; display: grid; justify-items: center; gap: 1px;
  transform: rotate(-2deg); transition: transform .18s ease;
  -webkit-mask: radial-gradient(circle at 50% 7px, transparent var(--hole), #000 calc(var(--hole) + .5px));
  mask: radial-gradient(circle at 50% 7px, transparent var(--hole), #000 calc(var(--hole) + .5px));
  box-shadow: inset 0 -3px 0 rgba(20, 33, 61, .12); }
.deal:hover .ticket { transform: rotate(0); }
.ticket-price { font: 800 30px/0.95 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ticket-price small { font-size: .55em; margin-left: 2px; text-transform: uppercase; }
.ticket-text { font: 800 19px/1 var(--display); text-transform: uppercase; max-width: 120px; overflow-wrap: anywhere; }
.ticket-was { font: 600 12px/1.2 var(--body); }
.ticket-off { position: absolute; top: -2px; right: -4px; background: var(--mark); color: #fff; font: 800 13px/1 var(--display);
  padding: 4px 6px; border-radius: 4px; transform: rotate(6deg); }
.ticket-lg { min-width: 150px; padding: 20px 22px 12px; --hole: 7px; }
.ticket-lg .ticket-price { font-size: 52px; }
.ticket-lg .ticket-text { font-size: 30px; max-width: 200px; }
.ticket-lg .ticket-was { font-size: 15px; }
.ticket-lg .ticket-off { font-size: 18px; padding: 5px 8px; }
@media (prefers-reduced-motion: reduce) { .ticket { transition: none; } }

@media (max-width: 640px) {
  .deal { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 12px 10px; }
  .thumb { display: none; }
  .ticket { min-width: 76px; padding: 13px 8px 6px; }
  .ticket-price { font-size: 24px; }
  .ticket-text { font-size: 16px; max-width: 84px; }
  .deal-title { font-size: 15px; }
  .feed-head h1 { font-size: 32px; }
}

/* Sidebar */
.side h2 { font: 800 18px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 24px 0 10px; }
.inbox-card { background: var(--surface); border: 1px dashed var(--muted); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.inbox-card p { margin: 0; color: var(--muted); font-size: 13px; }
.inbox-card .inbox-n { font: 800 44px/1 var(--display); color: var(--ink); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-block; text-decoration: none; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.chips a span { color: var(--muted); }
.chips a:hover, .chips a[aria-current] { border-color: var(--ink); }
.stores { list-style: none; margin: 0; padding: 0; }
.stores li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stores a { text-decoration: none; font-weight: 600; }
.stores span { color: var(--muted); }
@media (max-width: 900px) { .side .stores, .side h2:last-of-type { display: none; } .side h2 { margin-top: 16px; } .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .chips a { white-space: nowrap; } }

.pager { display: flex; justify-content: space-between; margin: 20px 0 0; }
.pager a { font-weight: 600; }
.expired-toggle { font-size: 13px; color: var(--muted); }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h1 { font: 800 36px var(--display); text-transform: uppercase; }

/* Deal page */
.detail { max-width: 980px; margin: 0 auto; }
.banner { background: var(--surface); border-left: 4px solid var(--mark); padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.detail-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin: 8px 0 24px; }
.detail-title h1 { font: 600 30px/1.2 var(--body); margin: 6px 0 0; letter-spacing: -.01em; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.detail-img { display: block; max-height: 380px; border-radius: var(--radius); margin: 0 0 18px; background: var(--surface); }
.get { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; }
.desc p { margin: 0 0 12px; max-width: 68ch; }
.conditions { color: var(--muted); font-size: 14px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tags a { color: var(--muted); }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; font-size: 14px; }
@media (max-width: 760px) {
  .detail-head { grid-template-columns: 36px minmax(0, 1fr); }
  .detail-head .ticket { grid-column: 1 / -1; justify-self: start; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-title h1 { font-size: 23px; }
}

.comments-box { margin-top: 36px; max-width: 720px; }
.comments-box h2 { font: 800 24px var(--display); text-transform: uppercase; }
.comment-list { list-style: none; padding: 0; margin: 0 0 20px; }
.comment-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-list li.is-hidden { opacity: .45; }
.comment-meta { margin: 0 0 4px; font-size: 13px; }
.comment-meta span { color: var(--muted); }
.comment-body p { margin: 0 0 6px; overflow-wrap: anywhere; }
.comment-form, .form { display: grid; gap: 10px; }
.comment-form label, .form label { font-weight: 600; font-size: 14px; display: grid; gap: 4px; }
input:not([type=search]), select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 11px; }
.comment-form .btn, .form .btn { justify-self: start; }
.hide-comment { font-size: 12px; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Submit */
.submit { max-width: 720px; margin: 0 auto; }
.submit h1 { font: 800 40px var(--display); text-transform: uppercase; margin: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

/* Sign-in */
.auth { border: 0; border-radius: 14px; padding: 24px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.auth::backdrop { background: rgba(10, 16, 30, .55); }
.auth h2 { font: 800 28px var(--display); text-transform: uppercase; margin: 0 0 4px; }
.auth p { color: var(--muted); margin: 0 0 12px; }
.auth-step { display: grid; gap: 6px; }
.auth-step label { font-weight: 600; font-size: 14px; }
.auth-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.auth-error { color: var(--mark) !important; min-height: 1em; margin: 4px 0 0 !important; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 16px;
  border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
