/* ─────────────────────────────────────────────────────────────────────────────
   PokéStock Live — Auction view styles
   The live auction page: video player, bid pane, chat, winner banner, toasts.
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── Auction grid (video on the left, bid pane on the right) ────────────── */
.grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}

/* ─── Video player ───────────────────────────────────────────────────────── */
.video { overflow: hidden; }
.videohead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.chanbox       { flex: 1; display: flex; gap: 8px; }
.chanbox input { flex: 1; }
.playerwrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.playerwrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--mut);
  text-align: center;
  padding: 24px;
}
.placeholder .big { font-size: 40px; }

/* Live pill in the corner of the video */
.livepill {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: var(--live);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .5px;
  padding: 5px 10px;
  border-radius: 8px;
}
.livepill.on { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .5; } }

/* ─── Bid pane ───────────────────────────────────────────────────────────── */
.bidpane   { display: flex; flex-direction: column; }
.lot       { padding: 16px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; }
.lottitle  { font-weight: 800; font-size: 17px; margin: 0 0 4px; }

.pricerow {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px;
}
.k       { font-size: 10px; letter-spacing: 1.4px; color: var(--mut); text-transform: uppercase; }
.price   { font-family: "Anton"; font-size: 46px; line-height: .9; color: var(--gold); margin-top: 4px; }
.holder  { font-size: 12px; color: var(--mut); margin-top: 4px; }
.timer        { text-align: right; }
.timer .clock { font-family: "Anton"; font-size: 42px; line-height: .9; margin-top: 4px; }
.timer.urgent .clock { color: var(--live); animation: blink 1s infinite; }

.controls   { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.quick      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick .btn { padding: 13px 4px; }
.row2       { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* Seller setup form (start a lot) */
.setup        { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.setup .row2  { grid-template-columns: 1fr 1fr; }

/* Bid feed */
.feed {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  max-height: 190px;
  overflow: auto;
}
.bidrow {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

/* ─── Chat ───────────────────────────────────────────────────────────────── */
.chat        { border-top: 1px solid var(--line); padding: 12px 16px; }
.chatlog {
  max-height: 130px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 10px;
}
.chatlog p   { margin: 0; line-height: 1.4; }
.chatlog b   { color: var(--cool); }
.chat-name   { cursor: pointer; user-select: none; }
.chat-name:hover { text-decoration: underline; }

/* Role badges next to chat names */
.role-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
}
.rb-admin  { background: #ff3b46; color: #fff; }
.rb-seller { background: #f0a500; color: #1a1a1a; }
.rb-mod    { background: #38bdf8; color: #0a1420; }

/* ─── Auction result / payment banner ────────────────────────────────────── */
.result    { padding: 22px 16px; text-align: center; }
.result h3 { font-family: "Anton"; font-size: 26px; margin: 0 0 4px; letter-spacing: .5px; }

.paybanner {
  margin: 0 16px 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  background: var(--surf2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.paybanner .grow { flex: 1; color: var(--mut); }

/* ─── Winner hero banner ─────────────────────────────────────────────────── */
#winnerBanner {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 13, .82);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
#winnerBanner.show { opacity: 1; pointer-events: auto; }
#winnerBanner .wb-card {
  background: linear-gradient(145deg, var(--surf) 0%, var(--surf2) 100%);
  border: 2px solid var(--gold);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 60px rgba(255, 203, 69, .25);
}

/* ─── Seller toast stack ─────────────────────────────────────────────────── */
#toastStack {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.seller-toast {
  background: var(--surf);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
  pointer-events: auto;
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), opacity .3s;
  opacity: 0;
}
.seller-toast.in  { transform: translateX(0);    opacity: 1; }
.seller-toast.out { transform: translateX(110%); opacity: 0; }

/* ─── Mobile (≤ 640px) ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Video: wrap channel input below the platform select */
  .videohead         { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .videohead select  { flex: none; }
  .chanbox           { width: 100%; }
  #loadchan          { flex: 1; }

  /* Don't let overflow:hidden clip the chat below */
  .video { overflow: visible; }

  /* Chat: tighten padding, cap visible messages at 6 (6 × 1.4em + 5 × 6px gaps) */
  .chat    { padding: 10px 12px; }
  .chatlog { max-height: calc(6 * 1.4em + 5 * 6px); }

  /* Bid pane: shrink hero numbers, tighten gutters */
  .pricerow  { padding: 12px; }
  .price     { font-size: 38px; }
  .clock     { font-size: 36px; }
  .feed      { padding: 10px 12px; }
  .controls  { padding: 0 12px 12px; }
  .paybanner { flex-wrap: wrap; margin: 0 12px 10px; }

  /* Seller setup form */
  .setup { padding: 12px; }

  /* Lot Queue header: wrap the button group to a second line */
  #queueBar > div:first-child                  { flex-wrap: wrap; gap: 6px; }
  #queueBar > div:first-child > div:last-child { flex-wrap: wrap; gap: 4px; }

  /* Item title + Notes: stack note input under the title input */
  #titleNotesRow         { grid-template-columns: 1fr !important; }
  #titleNotesRow > div   { width: 100%; }
  #s_note                { width: 100% !important; }

  /* Toast notifications: full-width at the top */
  #toastStack    { right: 10px; left: 10px; }
  .seller-toast  { min-width: 0; max-width: 100%; width: 100%; }

  /* Winner banner */
  #winnerBanner .wb-card { padding: 28px 16px; }

  /* Live Room / Store header social icons — shrink on mobile so all 5–6 icons
     (Instagram, X, Facebook, TikTok, YouTube, Twitch) stay on a single row
     instead of the last one(s) wrapping below. The left column is squeezed
     by the +Follow / Store (or Live Room) buttons on the right, so we make
     the icons slightly more compact at narrow widths.
     Uses !important because the per-icon width/height are set inline by JS. */
  #liveRoomSocials,
  #storeSocials {
    gap: 6px !important;
  }
  #liveRoomSocials a,
  #storeSocials a {
    width: 28px !important;
    height: 28px !important;
  }
  #liveRoomSocials a svg,
  #storeSocials a svg {
    width: 15px !important;
    height: 15px !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Hover utility classes (bug #11/#12 CSP).
   These replace inline `onmouseover/out` style mutations on three auction-
   page elements: openStoreBtn, the batch-calendar prev/next buttons, and
   the dynamically-generated review-link span. Pure CSS, no JS — works
   under a strict CSP without `'unsafe-inline'`.
   ────────────────────────────────────────────────────────────────────── */
.hover-bg-gold-soft:hover  { background: rgba(255, 203, 69, 0.1); }
.hover-bg-line:hover       { background: var(--line); }
.hover-underline-mut:hover { text-decoration-color: var(--mut); }
