/* Comic / pixel style: white paper, thick black ink, hard shadows, grumpy pixel Santa mascot. */
:root {
  --paper: #ffffff;
  --paper-2: #f3f1ec;
  --ink: #111111;
  --muted: #5c5c5c;
  --brick: #d97757;   /* Claude terracotta */
  --brick-dark: #b25a3c;
  --brick-light: #e8a088;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --hatch: repeating-linear-gradient(-45deg, var(--ink) 0 6px, transparent 6px 12px);
  --santa: #c8322b;
  --santa-dark: #8f1f1a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background-color: var(--paper);
  /* faint dot grid, like print halftone */
  background-image: radial-gradient(rgba(17, 17, 17, .09) 1px, transparent 1.4px);
  background-size: 14px 14px;
  overflow-x: hidden;
}

/* hatched tape across the top, like the monitor bezel */
.tape {
  position: fixed; top: 0; left: 0; right: 0; height: 12px; z-index: 6; pointer-events: none;
  background: var(--hatch), var(--paper);
  border-bottom: var(--line);
}

main {
  position: relative; z-index: 2;
  max-width: 560px; margin: 0 auto;
  padding: 30px 16px calc(112px + env(safe-area-inset-bottom));
}

.loader { display: grid; place-items: center; padding-top: 26vh; }
.loader .mascot { width: 110px; animation: hop .7s steps(2) infinite; }
@keyframes hop { 50% { transform: translateY(-10px); } }

/* ---------- mascot + speech bubble hero ---------- */
.hero { position: relative; margin: 8px 0 22px; min-height: 152px; }

.bubble {
  position: relative; background: var(--paper); border: var(--line); border-radius: 18px;
  padding: 16px 16px 14px; margin-right: 92px; box-shadow: var(--shadow);
}
.bubble::after, .bubble::before {
  content: ''; position: absolute; right: 34px; bottom: -24px;
  border-style: solid; border-width: 24px 0 0 26px;
  border-color: var(--ink) transparent transparent transparent;
}
.bubble::before {
  right: 37px; bottom: -17px; z-index: 1;
  border-width: 18px 0 0 20px; border-color: var(--paper) transparent transparent transparent;
}

.shout {
  display: inline; font-family: 'Oswald', 'Arial Narrow', sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; line-height: 1.32;
  font-size: clamp(24px, 7.4vw, 34px);
  background: var(--ink); color: var(--paper); padding: 0 8px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere;
}
.hero h1 { margin: 0; font-size: inherit; font-weight: inherit; }
.hero .sub { margin: 10px 0 0; font-weight: 600; color: var(--muted); }

.hero .mascot {
  position: absolute; right: -4px; top: 34px; width: 98px;
  transform: rotate(4deg);
}

.chip.chip--ink { background: var(--ink); color: var(--paper); margin-left: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 4px 10px; border: 2px solid var(--ink); border-radius: 8px;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; text-transform: uppercase;
  background: var(--brick-light);
}

/* ---------- cards ---------- */
.list { display: grid; gap: 16px; }

.card {
  background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}

.wl-card {
  display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer;
  text-align: left; width: 100%; font: inherit; color: inherit;
  transition: transform .08s, box-shadow .08s;
}
.wl-card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.wl-card .icon {
  flex: none; width: 54px; height: 54px; border: var(--line); border-radius: 10px;
  display: grid; place-items: center; background: var(--brick);
}
.wl-card .icon svg { width: 40px; }
.wl-card .t { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; overflow-wrap: anywhere; }
.wl-card .s { color: var(--muted); font-weight: 600; font-size: 14px; margin-top: 2px; }
.wl-card .arrow { margin-left: auto; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 26px; }

.item { display: flex; gap: 14px; padding: 12px; position: relative; overflow: hidden; }
.item.taken { background: var(--paper-2); }
.item.taken .thumb { filter: grayscale(1) contrast(1.1); }
.item.mine { background: #fff4ee; box-shadow: 5px 5px 0 var(--brick); }
.item .thumb {
  flex: none; width: 84px; height: 84px; border: var(--line); border-radius: 10px; overflow: hidden;
  background: var(--paper-2); display: grid; place-items: center; font-size: 34px;
}
.item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.item .t { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; font-weight: 600; }
.item .price {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 16px;
  background: var(--brick-light); border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px;
}
.item .link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.item .note { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.item .actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 2px solid var(--ink);
  border-radius: 6px; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px;
  text-transform: uppercase; background: var(--paper);
}
.badge.mine { background: var(--brick); color: var(--paper); }
.badge.star { align-self: flex-start; background: var(--ink); color: var(--paper); }
.item.wanted { box-shadow: 5px 5px 0 var(--ink), 9px 9px 0 var(--brick); }
.item .given { font-weight: 600; font-size: 14px; }
.item .given b { background: var(--brick-light); padding: 0 4px; border-radius: 4px; }
.notice-actions { margin-top: 10px; }

.check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: var(--line); border-radius: 10px; font-weight: 600;
}
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; flex: none; }

/* "ЗАНЯТО" — black/white hazard tape across the corner */
.ribbon {
  position: absolute; top: 14px; right: -38px; transform: rotate(35deg);
  background: var(--ink); color: var(--paper); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .08em;
  padding: 2px 40px; text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none; cursor: pointer; font: inherit;
  font-family: 'Oswald', 'Arial Narrow', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border: var(--line); border-radius: 10px; padding: 10px 16px; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--paper); background: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { background: var(--paper-2); color: var(--muted); border-color: var(--muted); box-shadow: none; cursor: default; transform: none; }
.btn.sm { padding: 6px 12px; font-size: 15px; border-radius: 8px; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.brick { background: var(--brick); color: var(--ink); }
.btn.danger { background: var(--paper); color: #c62f2f; border-color: #c62f2f; box-shadow: 3px 3px 0 #c62f2f; }
.btn.block { width: 100%; }

.fab {
  position: fixed; z-index: 5; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(528px, calc(100% - 32px)); padding: 14px; font-size: 20px;
  background: var(--brick); color: var(--ink); box-shadow: var(--shadow);
}
.fab:active { transform: translateX(-50%) translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

.toolbar { display: flex; gap: 12px; margin: 0 0 18px; }
.toolbar .btn { flex: 1; }

.empty { text-align: center; padding: 22px 18px; }
.empty .mascot { width: 90px; margin: 4px auto 10px; display: block; }
.empty h2 { margin: 6px 0 8px; }
.empty p { color: var(--muted); font-weight: 600; margin: 0; }

/* notice = small speech bubble */
.notice {
  position: relative; padding: 12px 14px; border: var(--line); border-radius: 14px; margin: 0 0 22px;
  font-weight: 600; font-size: 15px; background: var(--paper); box-shadow: var(--shadow-sm);
}
.notice::before {
  content: ''; position: absolute; left: 22px; top: -14px; width: 18px; height: 14px;
  background: var(--ink); clip-path: polygon(0 100%, 100% 100%, 20% 0);
}
.notice b { background: var(--ink); color: var(--paper); padding: 0 4px; font-weight: 600; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; animation: fade .15s;
  background: rgba(17, 17, 17, .55);
}
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow-y: auto;
  background: var(--paper); border: var(--line); border-bottom: 0; border-radius: 20px 20px 0 0;
  padding: 0 18px calc(22px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; animation: up .2s ease-out;
}
.sheet::before {
  content: ''; display: block; height: 12px; margin: 0 -18px 16px; border-radius: 17px 17px 0 0;
  background: var(--hatch); border-bottom: var(--line);
}
.sheet h3 { margin: 0 0 16px; text-align: center; }
.sheet h3 .shout { font-size: 24px; }
.sheet .stack { display: grid; gap: 12px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.field { display: grid; gap: 6px; }
.field span { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 14px; text-transform: uppercase; padding-left: 2px; }
.field input, .field textarea {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--paper);
  border: var(--line); border-radius: 10px; padding: 11px 12px; outline: none; width: 100%;
}
.field input:focus, .field textarea:focus { box-shadow: var(--shadow-sm); background: #fffaf7; }
.field textarea { min-height: 70px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); font-weight: 600; }

.preview { display: flex; align-items: center; gap: 12px; }
.preview .thumb {
  flex: none; width: 72px; height: 72px; border: var(--line); border-radius: 10px; overflow: hidden;
  background: var(--paper-2); display: grid; place-items: center; font-size: 32px;
}
.preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview .thumb.loading { animation: hop .6s steps(2) infinite; }

.share-link {
  font-weight: 600; font-size: 14px; word-break: break-all; padding: 12px;
  border: 3px dashed var(--ink); border-radius: 10px; background: var(--paper-2);
}

.toast {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px);
  background: var(--ink); color: var(--paper); border: 3px solid var(--paper); outline: 3px solid var(--ink);
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 16px; text-transform: uppercase; letter-spacing: .02em;
  padding: 10px 16px; border-radius: 8px; animation: fade .15s; text-align: center;
}

/* ---------- mascot reactions ---------- */
.btn.locked { background: var(--paper-2); color: var(--muted); border-color: var(--muted); box-shadow: none; }

.react {
  position: fixed; z-index: 45; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 24px)); transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 6px; cursor: pointer;
  animation: react-in .28s cubic-bezier(.3, 1.6, .6, 1);
}
.react[hidden] { display: none; }
.react .bubble { flex: 1; margin: 0 0 30px; padding: 12px 14px; }
.react .bubble::after, .react .bubble::before { right: -2px; bottom: 14px; }
.react .bubble::after { right: -26px; border-width: 12px 0 12px 26px; border-color: transparent transparent transparent var(--ink); }
.react .bubble::before { right: -19px; bottom: 17px; border-width: 9px 0 9px 20px; border-color: transparent transparent transparent var(--paper); }
.react .shout { font-size: 24px; }
.react .sub { margin: 8px 0 0; font-weight: 600; color: var(--ink); }
.react .mascot { width: 96px; flex: none; }
.react--grumpy .mascot { animation: shake .35s 3; }
@keyframes react-in { from { transform: translateX(-50%) scale(.6) translateY(30px); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-4deg); } 75% { transform: translateX(5px) rotate(4deg); } }

.mascot--party { animation: dance .5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes dance { from { transform: rotate(-7deg) translateY(0); } to { transform: rotate(7deg) translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .react, .react--grumpy .mascot, .mascot--party { animation: none; }
}

#confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .loader .mascot, .preview .thumb.loading { animation: none; }
}

/* ---------- home: two big choices ---------- */
.chooser { display: grid; gap: 18px; margin-top: 8px; }
.choice {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  padding: 20px 18px; background: var(--brick-light); border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .06s, box-shadow .06s;
}
.choice:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.choice .emoji { grid-row: span 2; font-size: 44px; line-height: 1; align-self: center; }
.choice .t { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 30px; text-transform: uppercase; line-height: 1.1; }
.choice .s { font-weight: 600; font-size: 14px; color: var(--ink); opacity: .75; margin-top: 4px; }
.choice--red { background: var(--santa); color: var(--paper); }
.choice--red .s { color: var(--paper); opacity: .9; }

/* ---------- our own "tipsy Santa" advisory sticker (a parody, not the real label) ---------- */
.advisory {
  display: inline-grid; justify-items: center; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); padding: 3px 6px 4px; transform: rotate(-4deg);
  font-family: 'Oswald', 'Arial Narrow', sans-serif; text-transform: uppercase; line-height: 1;
}
.advisory b { font-weight: 700; font-size: 11px; letter-spacing: .12em; border-bottom: 2px solid var(--ink); padding-bottom: 2px; width: 100%; text-align: center; }
.advisory span { background: var(--ink); color: var(--paper); font-weight: 700; font-size: 13px; padding: 3px 5px; margin: 3px 0; letter-spacing: .03em; white-space: nowrap; }
.advisory i { font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: .2em; }
.advisory--corner { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); right: 16px; z-index: 3; transform: rotate(-4deg) scale(.85); transform-origin: 100% 100%; }
.advisory--loader { margin-top: 26px; }
main { position: relative; }
.loader { display: grid; justify-items: center; }

/* ---------- 18+ gate ---------- */
.age-gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(17, 17, 17, .82); animation: fade .15s;
}
.age-card { width: min(380px, 100%); padding: 22px 18px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.age-card .mascot { width: 110px; }
.age-card h2 { margin: 0; }
.age-card p { margin: 0; font-size: 18px; font-weight: 600; }

/* ---------- consents ---------- */
.consent-gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(17, 17, 17, .82); overflow-y: auto; animation: fade .15s;
}
.consent-card { width: min(400px, 100%); padding: 22px 18px; display: grid; gap: 12px; justify-items: center; }
.consent-card .mascot { width: 90px; }
.consent-card h2, .consent-card > p { margin: 0; text-align: center; }
.consent-card > p { font-weight: 600; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; font-size: 15px; line-height: 1.4; cursor: pointer; }
.consent-row input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--brick); }
.consent-row a { color: var(--brick-dark); font-weight: 600; }
.consent-opt { color: var(--muted); font-style: normal; font-size: 13px; }
.consent-card .btn:disabled { background: var(--paper-2); color: var(--muted); }

/* ---------- Secret Santa ---------- */
.wl-card .icon.icon--red { background: var(--santa); }
.section { margin: 26px 0 12px; }
.section .shout { font-size: 22px; }
.dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.dates div { border: var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; background: var(--paper); box-shadow: var(--shadow-sm); }
.dates span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.dates b { font-family: 'Oswald', sans-serif; font-size: 17px; }
.stack-row { display: grid; gap: 10px; margin: 0 0 18px; }
.gap { margin: 0 0 18px; }
.santa-card { padding: 14px; display: grid; gap: 8px; }
.santa-card .who { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 24px; text-transform: uppercase; overflow-wrap: anywhere; }
.santa-card .row { display: grid; gap: 2px; }
.santa-card .row > span { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.santa-card p { margin: 0; overflow-wrap: anywhere; }
.santa-card i { color: var(--muted); }
.santa-card .row .btn { justify-self: start; }
.santa-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.santa-card .code { background: var(--ink); color: var(--paper); padding: 0 6px; font-size: 18px; letter-spacing: .08em; }
.players { padding: 6px 12px; }
.player { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px dashed var(--paper-2); flex-wrap: wrap; }
.player:last-child { border-bottom: 0; }
.player .name { font-weight: 700; overflow-wrap: anywhere; }
.player .marks { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.badge.danger { border-color: #c62f2f; color: #c62f2f; }
.pairs { padding: 12px 14px; display: grid; gap: 8px; font-weight: 700; }
.pairs span { color: var(--santa); }
.footer-actions { display: grid; gap: 10px; margin-top: 26px; }
.field select {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--paper);
  border: var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
.player-fields[hidden] { display: none; }
