/* Trading cards: the kid PIN pad, the binder's tabs, friends and trades
   (trading-ui.js) and the parent's Trading tab (parent-trading.js).

   Sized for a kid's finger on an iPad: every button is at least 48px tall,
   and the two halves of a trade -- YOU GIVE AWAY and YOU GET -- are told
   apart by a coloured label and a coloured edge, not by colour alone. */

/* ------------------------------------------------------------ PIN pad */

.pinpad-back .sheet { width: 400px; text-align: center; }
.pinpad h2 { margin: 0; }
.pinpad p { margin: 4px 0 14px; }
.pinpad-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
.pinpad-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #C7CED4; }
.pinpad-dots i.on { background: var(--pin-accent, #141414); border-color: var(--pin-accent, #141414); }
.pinpad-err { min-height: 22px; color: #C41E23; font-weight: 700; font-size: 15px; }
.pinpad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pinpad-key {
  height: 72px; border-radius: 18px; background: #EEF1F3; color: #141414;
  font: 800 32px/1 'Saira Condensed', Saira, sans-serif;
}
.pinpad-key:active { background: var(--pin-accent, #141414); color: var(--pin-ink, #fff); }
.pinpad-key.ghost { background: transparent; font: 700 17px Saira, sans-serif; color: #56616A; }
.pinpad-key:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }
.pinpad.shake { animation: pin-shake .4s; }
@keyframes pin-shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ------------------------------------------------- the binder's tabs */

.cards-tabs { display: flex; gap: 8px; padding: 12px 20px 0; flex: none; }
.cards-tab {
  min-height: 48px; padding: 0 20px; border-radius: 999px; background: #fff; color: #1A1D22;
  font: 700 17px Saira, sans-serif; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: inset 0 0 0 2px #D5DBE1;
}
.cards-tab.on { background: #1A1D22; color: #fff; box-shadow: none; }
.cards-tab-n {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: #E0262B; color: #fff;
  font: 700 14px Saira, sans-serif; display: inline-grid; place-items: center;
}
.cards-tab:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }

/* ------------------------------------------------------------ a pane */

.tr-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; color: #1A1D22; }
.tr-label { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: #6A747C; margin-bottom: 6px; }
.tr-hint { color: #5E6670; font-size: 15px; }
.tr-off { background: #fff; border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }
.tr-off b { font: 800 26px 'Saira Condensed', sans-serif; text-transform: uppercase; }
.tr-left { align-self: flex-start; background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; }

.tr-btn {
  min-height: 48px; padding: 0 18px; border-radius: 12px; background: #141414; color: #fff;
  font: 700 16px Saira, sans-serif; white-space: nowrap;
}
.tr-btn.ghost { background: #fff; color: #141414; box-shadow: inset 0 0 0 2px #D5DBE1; }
.tr-btn.link { background: none; color: #5E6670; padding: 0 8px; text-decoration: underline; }
.tr-btn.big { min-height: 60px; padding: 0 30px; font-size: 20px; }
.tr-btn:disabled { opacity: .45; }
.tr-btn:focus-visible, .tr-pick:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }

.tr-me, .tr-add, .tr-group { background: #fff; border-radius: 18px; padding: 16px 18px; }
.tr-me { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tr-username { font: 800 30px/1.1 'Saira Condensed', sans-serif; }
.tr-add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tr-input {
  flex: 1 1 220px; min-height: 52px; border-radius: 12px; border: 2px solid #D5DBE1; padding: 0 14px;
  font: 600 18px Saira, sans-serif; color: #1A1D22; background: #fff;
}
.tr-input:focus { outline: none; border-color: #141414; }
.tr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid #EEF1F3; }
.tr-row:first-of-type { border-top: 0; }
.tr-row b { font-size: 18px; margin-right: auto; }

.tr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-title { margin: 0; font: 800 30px/1.05 'Saira Condensed', sans-serif; text-transform: uppercase; margin-right: auto; }
.tr-head-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.tr-card { position: relative; border-radius: 10px; }
.tr-card .pc { width: 100%; }
.tr-card.busy { opacity: .45; }
.tr-card.picked { outline: 4px solid #2F9E4F; outline-offset: 3px; border-radius: 8px; }
.tr-card-tag {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); white-space: nowrap;
  background: #141414; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.tr-pick { padding: 0; background: none; text-align: left; border-radius: 10px; touch-action: none; }
.tr-pick:disabled { cursor: default; }

/* ---------------------------------------- YOU GIVE AWAY  /  YOU GET */

.tr-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.tr-side, .tr-zone {
  background: #fff; border-radius: 18px; padding: 12px; min-height: 180px; position: relative;
  border: 4px solid transparent;
}
.tr-side.give, .tr-zone[data-zone="mine"] { border-color: #F0A23B; }
.tr-side.get, .tr-zone.theirs { border-color: #2F9E4F; }
.tr-side-label {
  font: 800 20px/1 'Saira Condensed', sans-serif; letter-spacing: .04em; margin-bottom: 10px;
}
.tr-side.give .tr-side-label, .tr-zone[data-zone="mine"] .tr-side-label { color: #B8650A; }
.tr-side.get .tr-side-label, .tr-zone.theirs .tr-side-label { color: #1F7A3A; }
.tr-side-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.tr-empty-side { color: #6A747C; font-size: 15px; padding: 24px 6px; text-align: center; grid-column: 1 / -1; }
.tr-arrow { align-self: center; font-size: 34px; color: #6A747C; }
.tr-zone.over { background: #FFF6E8; }
.tr-zone.locked { box-shadow: inset 0 0 0 3px rgba(0,0,0,.08); }
.tr-lock-tag {
  position: absolute; top: 10px; right: 12px; background: #141414; color: #fff;
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.tr-ghost { position: fixed; width: 100px; z-index: 100; pointer-events: none; transform: rotate(-4deg); box-shadow: 0 12px 30px rgba(0,0,0,.35); }

.tr-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-warn { background: #FFF4D6; border-left: 5px solid #E8A317; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.tr-review { display: flex; flex-direction: column; gap: 12px; }
.tr-wait { font-weight: 700; font-size: 18px; }
.tr-offer { border-top: 1px solid #EEF1F3; padding: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.tr-offer:first-of-type { border-top: 0; }
.tr-offer-who { font: 800 22px 'Saira Condensed', sans-serif; }
.tr-past { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid #EEF1F3; }
.tr-past.new .tr-past-what::before { content: "NEW "; color: #E0262B; font-weight: 800; }
.tr-past-what { font-weight: 700; }

.tr-qr { width: 280px; max-width: 100%; margin: 0 auto 6px; }
.tr-qr svg { display: block; width: 100%; height: auto; }
.tr-video-box { border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 14px; }
.tr-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet.tr-confirm { width: 760px; }
.sheet.tr-confirm .tr-sides { margin-bottom: 14px; }

/* A phone: the two halves stack, YOU GIVE AWAY on top. */
@media (max-width: 760px) {
  .tr-sides { grid-template-columns: 1fr; }
  .tr-arrow { transform: rotate(90deg); justify-self: center; }
  .cards-tabs { padding: 8px 10px 0; overflow-x: auto; }
  .cards-tab { padding: 0 14px; font-size: 15px; }
  .tr-pane { padding: 12px 12px 24px; }
}

/* ------------------------------------------------- parent's tab */

.ptr-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #EEF1F3; flex-wrap: wrap; }
.ptr-switch:first-of-type { border-top: 0; }
.ptr-toggle { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ptr-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ptr-inline input { flex: 1 1 200px; min-width: 0; }
.ptr-kid-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .pinpad.shake { animation: none; }
}

/* ------------------------------------- the kid's card on the picker */

.kid-card { position: relative; }
.kid-card-badge {
  position: absolute; top: 12px; right: 12px; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 999px;
  background: #E0262B; color: #fff; font: 800 20px/34px 'Saira Condensed', sans-serif; text-align: center;
  box-shadow: 0 0 0 3px #141C33;
}
.kid-card-lock { position: absolute; top: 14px; left: 14px; width: 26px; height: 26px; color: rgba(255,255,255,.55); }
.kid-card-lock svg { width: 100%; height: 100%; display: block; }
.locker-binder-packs.trades { background: #2F7DF6; }

/* A brother or sister in the friends list: family, not removable. */
.tr-family { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
             color: #1F7A3A; background: #E6F5EA; border-radius: 999px; padding: 4px 12px; }

/* The same red number on the Locker button and the binder tile. */
.pill { position: relative; }
.pill-badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #E0262B; color: #fff; font: 800 13px/22px Saira, sans-serif; text-align: center;
  box-shadow: 0 0 0 2px var(--dark, #141414);
}
.locker-binder { position: relative; }
.locker-binder-badge {
  position: absolute; top: 12px; right: 12px; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px;
  background: #E0262B; color: #fff; font: 800 18px/32px 'Saira Condensed', sans-serif; text-align: center;
}
/* The pile of packs inside the binder. */
.bd-packs { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bd-packs-hint { color: #5E6670; font-size: 15px; font-weight: 600; }

/* A friend's username beside their first name: smaller and quieter. */
.tr-at { font-weight: 600; font-size: .8em; color: #6A747C; margin-left: 4px; }
