/* J33 (Roger 2026-11-16T23:52Z): a paid interaction is visible at every step — confirm card, status bar, stage badge,
   failure note — and the gift panel is a popover that covers neither the buy button nor the message field.
   The pieces are drawn by js/room-interaction-j33.js from a state the platform owns. Weights 400 / 500 / 600. */

/* ---- status bar: on the video's lower edge, above the message field ---- */
.watch .j33-bar {
  position: absolute; z-index: 62; left: 16px; right: 16px; bottom: 138px;
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; box-sizing: border-box;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(22, 15, 40, .86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: #fff; font: 500 14px/1.3 "Inter Variable", "Noto Sans SC", sans-serif;
}
.watch .j33-bar[hidden], .watch .j33-badge[hidden], .watch .j33-layer[hidden], .watch .j33-demo-strip[hidden] { display: none !important; }
.watch .j33-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #b48cff; animation: j33-pulse 1.4s ease-in-out infinite; }
.watch .j33-bar[data-phase="playing"] .j33-dot { background: #ff5c8a; }
.watch .j33-bar[data-phase="failed"] { border-color: rgba(255, 170, 150, .5); background: rgba(58, 22, 22, .92); }
.watch .j33-bar[data-phase="failed"] .j33-dot { background: #ff9a85; animation: none; }
.watch .j33-text { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.watch .j33-stages { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; flex: none; }
.watch .j33-stages li { padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .62); font-size: 12px; white-space: nowrap; }
.watch .j33-stages li.is-done { background: rgba(120, 220, 160, .18); color: #a9efc6; }
.watch .j33-stages li.is-current { background: #7c4dff; color: #fff; font-weight: 600; }
.watch .j33-time { flex: none; color: rgba(255, 255, 255, .78); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.watch .j33-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 400 20px/1 sans-serif; cursor: pointer; }
.watch :is(.j33-demo-tag, .j33-demo) { flex: none; padding: 2px 7px; border-radius: 6px; background: #ffe08a; color: #3a2a00; font: 600 11px/1.4 "Inter Variable", "Noto Sans SC", sans-serif; }
@keyframes j33-pulse { 50% { opacity: .35; } }
/* the bar takes the captions' and the player controls' place: they move up, nothing is covered */
.watch .stage-wrap:has(> .j33-bar:not([hidden])) .pop-captions { bottom: 192px !important; }
.watch .stage-wrap:has(> .j33-bar:not([hidden])) > .player-controls { transform: translateY(-54px); }

/* ---- stage badge: whose dance this is ---- */
.watch .j33-badge {
  position: absolute; z-index: 61; left: 16px; top: 104px; max-width: calc(100% - 32px); padding: 6px 12px; box-sizing: border-box;
  border-radius: 999px; background: linear-gradient(135deg, #7c4dff, #ff5c8a); color: #fff;
  font: 600 14px/1.3 "Inter Variable", "Noto Sans SC", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

/* ---- confirm card ---- */
.watch .j33-layer { position: absolute; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.watch .j33-scrim { position: absolute; inset: 0; background: rgba(10, 6, 20, .6); border-radius: inherit; }
.watch .j33-card {
  position: relative; width: min(360px, 100%); padding: 20px; box-sizing: border-box; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16); background: #1d1530; color: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  font: 400 15px/1.5 "Inter Variable", "Noto Sans SC", sans-serif;
}
.watch .j33-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; line-height: 1.3; color: #fff; }
.watch .j33-card .j33-demo { display: inline-block; margin: 0 0 10px; }
.watch .j33-facts { display: grid; gap: 0; margin: 0 0 12px; }
.watch .j33-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.watch .j33-row:first-child { border-top: 0; }
.watch .j33-row dt { color: rgba(255, 255, 255, .7); }
.watch .j33-row dd { margin: 0; font-weight: 600; text-align: right; }
.watch .j33-row.is-short dd { color: #ffb4a6; }
.watch .j33-note { margin: 0 0 14px; color: rgba(255, 255, 255, .7); font-size: 13px; }
.watch .j33-short { margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 140, 120, .16); color: #ffcfc6; font-weight: 600; }
.watch .j33-actions { display: flex; gap: 10px; }
.watch :is(.j33-primary, .j33-secondary) { flex: 1 1 0; min-height: 44px; padding: 0 16px; border-radius: 999px; font: 600 15px/1 "Inter Variable", "Noto Sans SC", sans-serif; cursor: pointer; }
.watch .j33-primary { border: 0; background: var(--roan-grad-primary, linear-gradient(90deg, #5b3fd6, #7a55f5)); color: #fff; }
.watch .j33-secondary { border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; }
.watch :is(.j33-primary, .j33-secondary, .j33-close):focus-visible { outline: 2px solid #c994ff; outline-offset: 2px; }

/* ---- the demo's start strip and chat lines ---- */
.watch .j33-demo-strip { position: absolute; z-index: 64; left: 16px; right: 16px; top: 150px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 14px; border: 1px dashed #ffe08a; background: rgba(22, 15, 40, .9); color: #fff; font: 400 13px/1.4 "Inter Variable", "Noto Sans SC", sans-serif; }
.watch .j33-demo-strip strong { font-weight: 600; color: #ffe08a; }
.watch .j33-demo-strip .j33-primary { flex: none; min-height: 36px; margin-left: auto; }
.watch #feed .j33-demo-line { display: flex; gap: 6px; align-items: baseline; }

/* ---- gift panel (real room): a paid item the balance cannot cover ---- */
.watch .room-gifts-160 .room-gift-160.j33-short-item { opacity: .55; filter: grayscale(.7); cursor: not-allowed; }
.watch .room-gifts-160 .room-gift-160.j33-short-item .room-gift-cost { opacity: 1; color: #ffb4a6; font-weight: 600; }
.watch .room-gifts-160 .room-interaction-notice.j33-need-points { color: #ffcfc6; font-weight: 600; }

@media (min-width: 1024px) {
  /* The gift panel opens upward from the gift button, inside the video, and stops short of the "today's pick" card's
     buy button above it and the message field below it. Clicking outside closes it (js/room-desktop-h4.js). */
  body.watch #shell[data-reference].h4-gifts-open .stage-wrap > .room-gifts-160 {
    left: auto !important; right: 16px !important; top: auto !important; bottom: 136px !important;
    width: min(360px, calc(100% - 32px)) !important; max-height: 244px; overflow: auto; z-index: 66 !important;
  }
  body.watch #shell[data-reference] .room-gifts-160 .room-gift-grid-188 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  /* the status bar never sits under an open panel */
  body.watch #shell[data-reference].h4-gifts-open .stage-wrap > .j33-bar { right: calc(16px + min(360px, 100% - 32px) + 12px); }
}

@media (max-width: 768px) {
  /* phone: the action column is on the right, the caption bar above the message field */
  .watch .j33-bar { left: 12px; right: 72px; bottom: 136px; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; font-size: 13px; }
  .watch .j33-text { flex: 1 1 0; }
  .watch .j33-stages { flex-basis: 100%; order: 3; }
  .watch .j33-time { order: 4; }
  .watch .j33-close { order: 2; }
  .watch .j33-stages li { padding: 2px 7px; font-size: 11px; }
  .watch .stage-wrap:has(> .j33-bar:not([hidden])) .h11-caption { transform: translateY(-78px); }
  /* the top of a phone room is full (host row, disclosure): the badge rides just above the status bar */
  .watch .j33-badge { left: 12px; top: auto; bottom: 188px; max-width: calc(100% - 96px); font-size: 13px; }
  .watch .stage-wrap:has(> .j33-badge:not([hidden])) .h11-caption { transform: translateY(-112px); }
  .watch .j33-layer { place-items: end center; padding: 0; }
  .watch .j33-card { width: 100%; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .watch .j33-demo-strip { left: 12px; right: 12px; top: 120px; }
}
@media (prefers-reduced-motion: reduce) { .watch .j33-dot { animation: none; } }
