/* Things you do WITH another player: the F wheel, the trade table, the look.
   Written against theme.css tokens, like everything else the 3D client adds
   on top of the ported 2D kit. */

/* ---------------------------------------------------------------- the wheel */
/* The same ring as the emote wheel, and deliberately so — one shape means one
   thing, and learning where the spokes are should carry between them. What is
   different is that this one is a MENU: it stays up, it takes the pointer, and
   a spoke can be shut. */

.pwheel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(calc(var(--vh) * 46), 420px);
  height: min(calc(var(--vh) * 46), 420px);
  transform: translate(-50%, -50%) scale(0.86);
  z-index: 61;
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease-out, transform 120ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
  user-select: none;
}

.pwheel.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  /* Unlike the emote ring, this one is clicked. */
  pointer-events: auto;
}

.pwheel-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 22px #000a);
}

.pwheel-ring {
  fill: none;
  stroke: #0a0713d9;
}

.pwheel-spoke {
  fill: #1b1021c7;
  stroke: var(--line, #332a50);
  stroke-width: 2;
  transition: fill 70ms linear;
  cursor: pointer;
}

.pwheel-spoke.is-on {
  fill: var(--acc, #b98cff);
  stroke: var(--acc2, #dcc4ff);
}

/* A shut spoke is dark, dead to the pointer, and stays dark when pointed at:
   the wheel refuses in the hub rather than by doing nothing. */
.pwheel-spoke.is-shut,
.pwheel-spoke.is-shut.is-on {
  fill: #090610ee;
  stroke: var(--edge, #28203e);
  cursor: default;
}

.pwheel-ico {
  pointer-events: none;
  image-rendering: pixelated;
  transition: opacity 70ms linear, transform 90ms ease-out;
}

.pwheel-ico.is-shut {
  opacity: 0.2;
  filter: grayscale(1);
}

.pwheel-num {
  fill: var(--faint, #776b9a);
  font: 600 15px/1 var(--ui, system-ui, sans-serif);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

/* The hub names the spoke, and says why a shut one is shut. */
.pwheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  height: 46%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-radius: 50%;
  text-align: center;
  padding: 0 6%;
  pointer-events: none;
}

.pwheel-who {
  font: 700 clamp(13px, calc(var(--vh) * 1.7), 17px) / 1.2 var(--ui, system-ui, sans-serif);
  letter-spacing: 0.04em;
  color: var(--ink, #ede9f7);
  text-shadow: 0 2px 8px #000c;
  min-height: 1.2em;
}

.pwheel-note {
  font: 600 clamp(10px, calc(var(--vh) * 1.2), 12px) / 1.35 var(--ui, system-ui, sans-serif);
  color: var(--warn, #ffd23f);
  text-shadow: 0 2px 8px #000c;
  min-height: 1.35em;
}

/* ---------------------------------------------------------------- trade */

#tradeWin .box {
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: 320px;
}

.tradebody {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
}

.tdhalf {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tdname {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold2, #ffd38a);
}

/* The lock pips. Big enough to catch the eye of somebody about to accept:
   this pair of words IS the contract. */
.tdlock {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint, #776b9a);
  border: 1px solid var(--edge, #28203e);
  border-radius: 999px;
  padding: 1px 8px;
}

.tdlock.is-on {
  color: #12200f;
  background: var(--good, #5bd06a);
  border-color: #2f7a37;
}

.tdgrid {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  grid-auto-rows: 44px;
  gap: 3px;
  justify-content: center;
}

.tdcell {
  border: 1px solid var(--line, #332a50);
  border-radius: 6px;
  background: #0f0b1e;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.tdcell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5%;
  image-rendering: pixelated;
}

/* The same hand the bag wears: taking a stack back off the table is the same
   gesture as picking one up, so it should not be a different pointer. */
.tdcell.takeable {
  cursor: var(--cur-reach, pointer);
}

.tdcell.takeable:active {
  cursor: var(--cur-grab, grabbing);
}

.tdcell.takeable:hover {
  border-color: var(--gold, #e0a44c);
  background: #1b142e;
}

.tdcoin {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold2, #ffd38a);
}

.tdcoin img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

.tdsilver {
  width: 120px;
  background: #0f0b1e;
  border: 1px solid var(--line, #332a50);
  border-radius: 6px;
  color: var(--ink, #ede9f7);
  font: 700 12.5px var(--ui, system-ui, sans-serif);
  padding: 3px 7px;
}

.tdsilver:disabled,
.tdcoin button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tdrule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2, #473a6e), transparent);
  margin: 2px 0;
}

.tdhint {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--faint, #776b9a);
}

.tdrow {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* The offer to trade. Deliberately the party invitation's box: one kind of
   interruption, however many things can cause it. */
#tradeask {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--panel, #1b1021ee);
  border: 1px solid var(--gold3, #8a6a2e);
  border-radius: 8px;
  padding: 12px 16px 11px;
  box-shadow: 0 10px 30px #000a;
  text-align: center;
}

#tradeask p {
  margin: 0 0 9px;
  font-size: 12.5px;
  color: #e8e4d8;
}

#tradeask b {
  color: var(--gold2, #ffd38a);
}

#tradeask .pirow {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ---------------------------------------------------------------- the look */

/* Wide enough for the longest name the gear tables can produce
   ("Journeyman's Claymore") — a look that ellipsises the thing you looked for
   is not a look. */
#inspectWin .box {
  position: fixed;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  width: 356px;
}

#inspectWin .winbody {
  padding: 9px 12px 12px;
}

.inspectsub {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint, #776b9a);
}

.inspectgrid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.inspectrow {
  display: grid;
  grid-template-columns: 28px 70px 1fr;
  align-items: center;
  gap: 8px;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.inspectrow:hover {
  border-color: var(--edge, #28203e);
  background: #140e24;
}

.inspectart img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.inspectslot {
  font-size: 10.5px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint, #776b9a);
}

.inspectitem {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #ede9f7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspectitem.empty {
  color: var(--faint, #776b9a);
  font-weight: 400;
  font-style: italic;
}

/* ---------------------------------------------------------------- friends */
/* The list: a dot, a name, what they are, where they are. Verbs are on the
   row's click, never drawn — the panels that draw them get ignored. */

.frbody {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fradd {
  display: flex;
  gap: 6px;
  margin: 0;
}

.fradd input {
  flex: 1;
  min-width: 0;
  background: var(--ember3, #0a0713b3);
  border: 1px solid var(--ember-line, #473a6e);
  border-radius: 6px;
  color: #e8e4d8;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.fradd input:focus {
  outline: none;
  border-color: var(--gold2, #ffd38a);
}

.frsum {
  font-size: 11px;
  color: var(--faint, #776b9a);
  min-height: 1em;
}

.frlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(var(--vh) * 44);
  overflow-y: auto;
}

.frrow {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  background: #ffffff08;
  user-select: none;
}

.frrow:hover {
  background: #ffffff14;
}

.frdot {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a4560;
  box-shadow: 0 0 0 1px #0008;
}

.frrow.on .frdot {
  background: var(--good, #5fd36a);
  box-shadow: 0 0 6px var(--good, #5fd36a);
}

.frname {
  grid-column: 2;
  grid-row: 1;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--gold2, #ffd38a);
}

.frrow.off .frname {
  color: #a9a4b8;
}

.frmeta {
  grid-column: 3;
  grid-row: 1;
  font-size: 11px;
  color: #c9c3d8;
  text-align: right;
}

.frwhere {
  grid-column: 2 / 4;
  grid-row: 2;
  font-size: 10.5px;
  color: var(--faint, #776b9a);
}

.frrow.off .frwhere {
  font-style: italic;
}

.frempty {
  padding: 14px 6px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--faint, #776b9a);
}
