/* ------------------------------------------------------------------
   PDX Drug Wars panels (dealui.js, wave 12): the trade panel, the Lace area
   on the character card, the news ticker, the hint and the person's toast.
   DG//OS look (docs/STYLE-GUIDE.md): near-black, chamfers, volt for the chosen
   thing and the action, cyan for information and focus, hot for refusals.
   Tokens from ../core.css.
   ------------------------------------------------------------------ */
.pdx-deal {
  position: fixed; inset: 0; z-index: 30; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 12px 12px 24px; background: rgba(3, 4, 7, .8);
  font-family: var(--font-mono); color: var(--text);
  -webkit-user-select: none; user-select: none;
}
.pdx-deal[hidden] { display: none; }
.pdx-deal-box {
  --c: 14px;
  width: min(780px, 100%); margin: auto; padding: 14px clamp(10px, 2.4vw, 22px) 16px;
  background: var(--panel); border: 1px solid var(--volt);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
.pdx-deal-eyebrow { margin: 0 0 8px; font: 500 10px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.pdx-deal-who { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 20px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.pdx-deal-name { margin: 0; font: 700 clamp(18px, 3.4vw, 24px)/1.1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--volt); }
.pdx-deal-mood { margin: 5px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 500 11px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdx-deal-mood span { color: var(--dim); }
/* A mood tag: volt when the class is buying, hot when it is scared off, cyan for the rest. */
.pdx-mood { font: 700 11px/1 var(--font-mono); font-style: normal; letter-spacing: .16em; color: var(--cyan); }
.pdx-mood.is-hard, .pdx-mood.is-flush, .pdx-mood.is-restless { color: var(--volt); }
.pdx-mood.is-spooked { color: var(--hot); }
.pdx-deal-greet { margin: 5px 0 0; font: 500 12px/1.4 var(--font-mono); color: var(--muted); }
.pdx-deal-cash { margin: 0; display: inline-flex; align-items: baseline; gap: 10px; }
.pdx-deal-cash i { font: 500 11px/1 var(--font-mono); font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.pdx-deal-cash b { font: 700 clamp(22px, 4vw, 30px)/1 var(--font-display); letter-spacing: .04em; color: var(--volt); font-variant-numeric: tabular-nums; }

.pdx-deal-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding-top: 12px; }
.pdx-deal-colhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.pdx-deal-colhead span { font: 500 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.pdx-deal-h { margin: 0; font: 600 12px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.pdx-deal-list { display: grid; gap: 4px; }
.pdx-deal-empty { margin: 0; padding: 10px 2px; font: 500 12px/1.3 var(--font-mono); color: var(--dim); }
.pdx-deal-empty[hidden] { display: none; }

.pdx-deal-row {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "sw name price" "sw left left";
  align-items: center; gap: 2px 10px; width: 100%; min-height: 48px; padding: 7px 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-family: var(--font-mono);
}
.pdx-deal-row > i { grid-area: sw; align-self: stretch; }
.pdx-deal-item { grid-area: name; font: 600 13px/1.2 var(--font-mono); min-width: 0; overflow-wrap: anywhere; }
.pdx-deal-price { grid-area: price; font: 700 15px/1 var(--font-display); color: var(--volt); font-variant-numeric: tabular-nums; }
.pdx-deal-left { grid-area: left; font: 500 11px/1.2 var(--font-mono); color: var(--muted); }
.pdx-deal-row:hover { border-color: var(--muted); }
.pdx-deal-row.is-sel { border-color: var(--volt); background: #151a10; box-shadow: inset 3px 0 0 var(--volt); }
.pdx-deal-row.is-dim { opacity: .45; }
.pdx-deal-row.is-dim.is-sel { opacity: .75; }

.pdx-deal-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.pdx-deal-what { margin: 0; font: 600 13px/1.3 var(--font-mono); color: var(--text); }
.pdx-deal-qty { display: inline-flex; align-items: stretch; gap: 4px; }
.pdx-deal-n { min-width: 3ch; display: inline-grid; place-items: center; padding: 0 6px; border: 1px solid var(--line-2); background: var(--screen); font: 700 16px/1 var(--font-display); color: var(--cyan); font-variant-numeric: tabular-nums; }
.pdx-deal-step, .pdx-deal-btn {
  min-width: 40px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); cursor: pointer;
  font: 600 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
}
.pdx-deal-step { font-size: 16px; }
.pdx-deal-step:hover, .pdx-deal-btn:hover { color: var(--volt); border-color: var(--volt); }
.pdx-deal-btn.is-go { background: var(--volt); border-color: var(--volt); color: #000; }
.pdx-deal-btn.is-go:hover { background: #fff; border-color: #fff; color: #000; }
.pdx-deal-btn.is-go.is-off { background: var(--bg-2); border-color: var(--line-2); color: var(--dim); }
.pdx-deal-acts { display: inline-flex; gap: 6px; }
.pdx-deal-msg { margin: 10px 0 0; min-height: 1.4em; font: 500 12px/1.4 var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.pdx-deal-msg.is-bad { color: var(--hot); }
.pdx-deal-msg.is-ok { color: var(--volt); }
.pdx-deal-keys { margin: 8px 0 0; font: 500 10px/1.5 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.pdx-deal :focus, .pdx-lace :focus { outline: none; }
.pdx-deal :focus-visible, .pdx-lace :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; position: relative; z-index: 1; }

@media (max-width: 640px) {
  .pdx-deal { align-items: flex-start; padding: 8px 8px 24px; }
  .pdx-deal-cols { grid-template-columns: minmax(0, 1fr); }
  .pdx-deal-bar { grid-template-columns: minmax(0, 1fr); }
  .pdx-deal-qty, .pdx-deal-acts { width: 100%; }
  .pdx-deal-qty .pdx-deal-n { flex: 1; }
  .pdx-deal-acts > * { flex: 1; }
  .pdx-deal-keys { display: none; }
}

/* Lace, inside the character card's right column. */
.pdx-lace { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 9px; }
.pdx-lace[hidden] { display: none; }
.pdx-lace-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pdx-lace-sub { font: 500 10px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.pdx-lace-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdx-lace-row .pdx-card-lab { margin: 0; }
.pdx-lace-info { margin: 0; min-height: 2.8em; font: 500 12px/1.4 var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.pdx-lace-info.is-bad { color: var(--hot); }
.pdx-lace-info.is-ok { color: var(--volt); }

/* The person's answer when the bubbles are not there, and the first-time hint, above and
   below the F prompt (interact.js puts the prompt at these offsets). */
.pdx-deal-say, .pdx-deal-hint {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 6; margin: 0;
  max-width: calc(100vw - 32px); padding: 9px 14px; text-align: center;
  background: rgba(6, 7, 11, .9); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 12px/1.3 var(--font-mono); letter-spacing: .06em; color: var(--text);
}
.pdx-deal-say[hidden], .pdx-deal-hint[hidden] { display: none; }
.pdx-deal-say b { color: var(--cyan); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.pdx-deal-say { bottom: calc(var(--keys-h, 40px) + 162px); }
.pdx-deal-hint { bottom: calc(var(--keys-h, 40px) + 78px); color: var(--muted); font-size: 11px; }
@media (pointer: coarse) { .pdx-deal-say { bottom: 202px; } .pdx-deal-hint { bottom: 112px; } }
@media (max-width: 700px) and (pointer: fine) { .pdx-deal-say { bottom: calc(var(--keys-h, 40px) + 194px); } .pdx-deal-hint { bottom: calc(var(--keys-h, 40px) + 110px); } }

/* The news, a slip under the clock. The clock sits in the top bar above 1100px and drops
   under it below (pdx.css, wave 12 A); the stop banner is higher still, so the ticker
   waits while it shows. */
.pdx-news {
  --c: 8px;
  position: fixed; left: 50%; top: 52px; z-index: 5; transform: translateX(-50%); margin: 0;
  width: max-content; max-width: calc(100vw - 32px); padding: 8px 14px; pointer-events: none;
  background: rgba(6, 7, 11, .88); box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
  font: 500 12px/1.35 var(--font-mono); letter-spacing: .04em; color: var(--text);
}
.pdx-news[hidden] { display: none; }
.pdx-news b { margin-right: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hot); }
.pdx-news.is-crash b { color: var(--cyan); }
.pdx-news.is-mood b { color: var(--volt); }
.pdx-news.is-mood.is-spooked b { color: var(--hot); }
.pdx-news.is-mood.is-holding b, .pdx-news.is-mood.is-dry b { color: var(--cyan); }
@media (max-width: 1100px) { .pdx-news { top: calc(var(--hud-h) + 38px); } }
@media (max-width: 460px) { .pdx-news { top: calc(var(--hud-h) + 32px); font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .pdx-deal *, .pdx-news, .pdx-lace * { transition: none !important; animation: none !important; } }
