/* ==========================================================
   Hum N Play — Pinned Games styling
   Loaded after style.css, so anything here wins on a tie.

   Built from the tokens already in style.css — no new colours,
   no new fonts, and no accent this page wasn't already using.
   The pin marker is a bare icon in --ink-soft. Chosen state uses
   the done button uses the --pink-soft treatment already on the
   feedback link. Shapes follow the house style: flat, 2–2.5px
   --ink outlines, no shadows.
   ========================================================== */


/* ----------------------------------------------------------
   1. The "arrange your games" link
   Sits under the tag pills, inside .filter-controls (which is
   a centred flex column, so this centres itself).

   Visibility mirrors style.css's own .only-in pattern rather
   than borrowing the class — .only-in forces `display: block`,
   which would flatten the flex layout here. The pre-auth rule
   is the same anti-flash trick used for the nav and banners.
   ---------------------------------------------------------- */
.organize-row { display: none; }
body.auth-in .organize-row,
html.pre-auth-in body.auth-out .organize-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.organize-link {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-bottom: 1.5px solid var(--pill-border);
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.organize-link i { font-size: 13px; color: var(--ink-soft); }
.organize-link:hover { color: var(--ink); border-color: var(--ink-soft); }

/* While organize mode is open the link is the way back out. */
body.organizing .organize-link { color: var(--ink); border-color: var(--ink); }

/* First-time hint. Same soft-pink sticker language as .new-pill,
   so it reads as "this is new" in a vocabulary the site already
   uses. Removed from the page for good after the first open. */
#organize-new {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  padding: 2px 8px;
  border-radius: 20px;
  border: 2px solid var(--ink);
  background: var(--newpill-fill);
  color: var(--newpill-text);
}


/* ----------------------------------------------------------
   2. The organize bar (counter + done)
   Card-shaped: white, 2.5px outline, 13px radius — same
   silhouette as a tile and the start bar, so it belongs.
   ---------------------------------------------------------- */
.organize-bar {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  padding: 12px 16px;
  margin-top: 2px;
  outline: none;
}
body.organizing .organize-bar { display: flex; }

.organize-hint {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
.organize-count {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--ink-soft);
  margin-top: 3px;
}

.organize-done {
  flex: 0 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--pink-soft);
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  padding: 7px 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.organize-done:hover { transform: translate(-2px, -2px); }


/* ----------------------------------------------------------
   3. The pin badge (normal view)
   A label, not a button — unpinning happens in organize mode.

   Top-right, matching .new-pill's 9px inset. Top-LEFT is not
   available: that's where the 44px .chip sits. On the rare tile
   that is both pinned AND new, the "new" sticker slides left to
   make room (see the .is-pinned .new-pill rule below).
   ---------------------------------------------------------- */
.pin-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  height: 18px;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}
.pin-badge i {
  font-size: 13px;
  color: var(--ink-soft);
}

/* When a tile is both pinned and new, the "new" sticker steps inboard
   so the two sit side by side. 19px = the pin icon plus a small gap.
   Shifting the sticker rather than the pin keeps the spacing right
   whether it reads "new" or the wider "update". */
.card.is-pinned .new-pill { right: 28px; }

/* The badge does NOT hide in organize mode. Same icon, same spot, the
   whole time — and it's the ONLY pin on the page. An unpinned tile
   shows nothing: a pin here means "this one is pinned", never "this
   one could be". The organize bar's instruction is what tells someone
   the tiles are tappable. */


/* ----------------------------------------------------------
   4. Organize mode on the tiles
   The whole tile is the tap target; the circle is the affordance
   that says so (clicks are handled on the tile, in pins.js).
   ---------------------------------------------------------- */
body.organizing .card { cursor: pointer; }

/* All 3 slots used. Unpinned tiles stop responding and dim to the
   same 0.3 the tag filter already uses, so it reads as a familiar
   "not right now" rather than a new state. Nothing auto-replaces:
   the counter in the bar says to unpin one to swap. */
body.organizing .card.pin-full {
  opacity: 0.3;
  cursor: default;
}
body.organizing .card.pin-full:hover { transform: none; }


/* ----------------------------------------------------------
   5. Housekeeping
   ---------------------------------------------------------- */
.organize-link:focus-visible,
.organize-done:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .organize-link,
  .organize-done { transition: none; }
  .organize-done:hover { transform: none; }
}

/* Mobile: the bar stacks rather than squeezing.
   Matches style.css's 720px breakpoint. */
@media (max-width: 720px) {
  .organize-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .organize-done { align-self: stretch; }
}