/* Play-by-post table. Everything is scoped under .rp so the forum is untouched.
   The site's custom.css loads after this file and restyles every <a> and <h3>
   (Lovelt font, 0.75rem), so anything inside .rp resets those explicitly. */

body:has(.rp-table) .main { margin: 1rem 0; }
body:has(.rp-table) .pw-container { max-width: 1720px; }

.rp {
  --rp-pink: #ff9fff;          /* same pink as the site's links */
  --rp-pink-dim: #b46ab4;
  --rp-pink-faint: rgba(255, 159, 255, 0.12);
  --rp-white: #f5f5f5;
  --rp-yellow: #ffd23f;
  --rp-red: #ff3b3b;
  --rp-red-dim: #b84a4a;
  --rp-green: #66ff9c;
  --rp-left: 258px;            /* JS sets this to the inventory grid's width */
  --rp-gap: 8px;
  color: var(--rp-pink);
  font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}
.rp a, .rp h1, .rp h3, .rp h4 { font-family: inherit; font-size: inherit; font-weight: inherit; }
.rp a { color: var(--rp-pink); text-decoration: underline; text-underline-offset: 2px; }
.rp-dim { color: var(--rp-pink-dim); }

.rp-box {
  border: 1px solid var(--rp-pink);
  padding: 6px 8px;
}

/* --- layout --- */

.rp-table {
  display: grid;
  grid-template-columns: var(--rp-left) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.rp-table--gm { grid-template-columns: var(--rp-left) minmax(0, 1fr) 340px; }

@media (max-width: 1100px) {
  .rp-table--gm { grid-template-columns: var(--rp-left) minmax(0, 1fr); }
  .rp-col--gm {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px 20px; align-items: start;
  }
  .rp-col--gm .rp-gm-block + .rp-gm-block { margin-top: 0; padding-top: 0; border-top: none; }
}
@media (max-width: 760px) {
  .rp-table, .rp-table--gm { grid-template-columns: minmax(0, 1fr); }
  .rp-col--center { order: -1; }
  .rp-col--left { width: var(--rp-left); max-width: 100%; }
  .rp-log { height: auto; min-height: 200px; max-height: 65vh; }
}

.rp [hidden] { display: none !important; }
.rp-col { min-width: 0; }
.rp-col--left > * + *, #rp-sheet > * + * { margin-top: var(--rp-gap); }

/* --- left column --- */

.rp-charpick { display: flex; gap: 8px; align-items: center; }
.rp-charpick select {
  flex: 1; min-width: 0;
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-pink);
  padding: 3px 5px; font: inherit;
}

.rp-sheet-top { display: flex; gap: var(--rp-gap); align-items: stretch; }
.rp-sheet-stats { display: flex; flex-direction: column; gap: var(--rp-gap); width: 120px; flex: none; }

.rp-stat { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 6px; }
.rp-stat b { margin-left: auto; text-align: right; }
.rp-stat b { color: var(--rp-white); font-weight: 600; }
.rp-name { color: var(--rp-white); font-weight: 600; overflow-wrap: anywhere; }
.rp-player { color: var(--rp-pink-dim); font-size: 12px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rp-stat .rp-status--hurt, .rp-stat .rp-status--winded { color: var(--rp-yellow); }
.rp-stat .rp-status--reeling, .rp-stat .rp-status--tired,
.rp-stat .rp-status--collapsing, .rp-stat .rp-status--dying,
.rp-stat .rp-status--dead, .rp-stat .rp-status--unconscious { color: var(--rp-red); }

.rp-ooc-toggle { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.rp-ooc-toggle input { accent-color: var(--rp-pink); margin: 0; }

.rp-body { flex: 1; min-width: 0; padding: 0; display: flex; }
.rp-body__canvas {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 14px; padding: 10px 0;
}
.rp-body__fig { flex: none; overflow: visible; }
/* 3 across, 3px apart; the head slot sits alone over the middle column */
.rp-wear { display: grid; grid-template-columns: repeat(3, 32px); gap: 3px; }
.rp-wear__slot[data-slot="head"] { grid-column: 2; }
.rp-wear__slot[data-slot="head"] + .rp-wear__slot { grid-column: 1; }
.rp-wear__slot {
  width: 32px; height: 32px;
  position: relative; background: url("slots/wearslot.png") no-repeat;
  image-rendering: pixelated;
}
.rp-wear__slot[data-slot="head"] { --icon: url("slots/head.png"); }
.rp-wear__slot[data-slot="glasses"] { --icon: url("slots/glasses.png"); }
.rp-wear__slot[data-slot="mask"] { --icon: url("slots/mask.png"); }
.rp-wear__slot[data-slot="headset"] { --icon: url("slots/headset.png"); }
.rp-wear__slot[data-slot="uniform"] { --icon: url("slots/uniform.png"); }
.rp-wear__slot[data-slot="suit"] { --icon: url("slots/suit.png"); }
.rp-wear__slot[data-slot="gloves"] { --icon: url("slots/gloves.png"); }
.rp-wear__slot[data-slot="back"] { --icon: url("slots/back.png"); }
.rp-wear__slot[data-slot="shoes"] { --icon: url("slots/shoes.png"); }
.rp-wear__slot[data-slot="suit_storage"] { --icon: url("slots/suit_storage.png"); }
.rp-wear__slot[data-slot="belt"] { --icon: url("slots/belt.png"); }
.rp-wear__slot[data-slot="hand_l"] { --icon: url("slots/hand_l.png"); }
.rp-wear__slot[data-slot="hand_r"] { --icon: url("slots/hand_r.png"); }
/* hands: things are shown at their real size, so a slot grows to fit */
.rp-hands { display: flex; justify-content: center; align-items: center; gap: 3px; padding: 6px; }
.rp-wear__slot.rp-hand { width: auto; height: auto; min-width: 32px; min-height: 32px; background-position: center; }
.rp-wear__slot.rp-hand.rp-wear__slot--full { background: none; }
.rp-wear__slot.rp-hand::before { background-position: center; opacity: 1; }  /* hand icons show at full strength */
.rp-hand > .rp-icon { position: relative; display: block; cursor: grab; }
.rp-wear__slot.rp-hand--merged { display: none; }
/* the "what goes here" icon is faint so an empty slot doesn't look equipped */
.rp-wear__slot::before { content: ""; position: absolute; inset: 0; background: var(--icon) no-repeat; opacity: 0.33; }
.rp-wear__slot--full::before { display: none; }
.rp-wear__slot.rp-droptarget { outline: 1px solid var(--rp-pink); }
.rp-icon.rp-wear__item {
  position: absolute; inset: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; border: 0; background: transparent; color: #f5f5f5; cursor: grab;
}
.rp-icon.rp-wear__item.rp-icon--reserved { box-shadow: inset 0 0 0 1px #f5f5f5; }
.rp-wear__item img { max-width: 32px; max-height: 32px; image-rendering: pixelated; object-fit: contain; }
/* character cards: what they've got on */
.rp-tooltip .rp-wear { flex: none; }
.rp-tooltip .rp-wear__slot[data-slot="belt"] { grid-column: 1; }
/* a character card is a stack of separate panels */
.rp-tooltip[hidden] { display: none !important; }
.rp-tooltip.rp-tooltip--card { border: 0; background: none; box-shadow: none; padding: 0; max-width: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rp-cardpanel { background: #000; border: 1px solid #ff9fff; padding: 6px; box-shadow: 0 4px 18px rgba(255, 159, 255, 0.25); }
.rp-cardpanel--main { max-width: 280px; }
.rp-cardrow { display: flex; gap: 6px; align-items: flex-start; }
.rp-cardpanel--list { min-width: 150px; max-width: 300px; }
.rp-charcard__worn div { line-height: 1.35; }
.rp-charcard__worn .rp-dim { font-size: 12px; }
.rp-hit rect { fill: transparent; }
.rp-table--gm .rp-hit [data-loc] { cursor: pointer; }
/* the puppet is grey; hovering a part colours it in from the pointer outwards */
.rp-fig { image-rendering: pixelated; }
.rp-fig--mono { filter: grayscale(1); }
.rp-fig--colour { pointer-events: none; }
.rp-loc-labels text { fill: var(--rp-white); font-size: 10px; text-anchor: middle; font-family: inherit; pointer-events: none;
  paint-order: stroke; stroke: #000; stroke-width: 2.5px; stroke-linejoin: round; }
.rp-loc-labels text.rp-hurt { fill: var(--rp-yellow); }
.rp-loc-labels text.rp-crippled { fill: var(--rp-red); font-weight: 700; }

.rp-inv__head {
  display: flex; justify-content: space-between; gap: 8px;
  border: 1px solid var(--rp-pink); border-bottom: none;
  padding: 3px 8px;
}
.rp-inv__head #rp-weight { color: var(--rp-white); white-space: nowrap; }
.rp-inv__head #rp-weight.rp-enc--1 { color: var(--rp-yellow); }
.rp-inv__head #rp-weight.rp-enc--2, .rp-inv__head #rp-weight.rp-enc--3,
.rp-inv__head #rp-weight.rp-enc--4, .rp-inv__head #rp-weight.rp-enc--5 { color: var(--rp-red); }

.rp-grid {
  position: relative;
  border: 1px solid var(--rp-pink);
  box-sizing: content-box;
  background-color: #0a000a;
  background-image:
    radial-gradient(circle, rgba(255, 159, 255, 0.5) 1px, transparent 1.4px),
    linear-gradient(to right, rgba(255, 159, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 159, 255, 0.1) 1px, transparent 1px);
  background-size: 8px 8px, 32px 32px, 32px 32px;
  background-position: 4px 4px, 0 0, 0 0;
}

/* item tiles: solid black so the art pops off the dotted grid */
.rp-icon {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  border: 1px solid var(--rp-pink);
  background: #000;
  color: var(--rp-white);
  font-size: 20px; line-height: 1;
  overflow: hidden;
  user-select: none;
  vertical-align: middle;
}
.rp-icon__art {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.rp-icon--rot .rp-icon__art { transform: translate(-50%, -50%) rotate(90deg); }
.rp-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.rp-grid__item { position: absolute; cursor: grab; }
.rp-grid__item:hover, .rp-stash .rp-icon:hover { border-color: var(--rp-white); box-shadow: inset 0 0 0 1px var(--rp-white); }
.rp-dragging { opacity: 0.35; }
.rp-carry, .rp-dragimage {
  position: fixed; z-index: 1001; pointer-events: none; opacity: 0.9;
  border-color: var(--rp-yellow);
}
.rp-dragimage { left: -1000px; top: -1000px; }
body.rp-carrying .rp-grid { cursor: copy; }

.rp-ghost {
  position: absolute; pointer-events: none; z-index: 1;
  outline: 1px dashed var(--rp-green); outline-offset: -1px;
  background: rgba(102, 255, 156, 0.15);
}
.rp-ghost--bad { outline-color: var(--rp-red); background: rgba(255, 59, 59, 0.18); }

.rp-traits { padding: 0; }
.rp-traits summary {
  cursor: pointer; padding: 5px 8px; list-style: none;
  display: flex; align-items: center; gap: 6px; user-select: none;
}
.rp-traits summary::-webkit-details-marker { display: none; }
.rp-traits summary::before {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s;
}
.rp-traits[open] summary::before { transform: rotate(90deg); }
.rp-traits[open] summary { border-bottom: 1px solid var(--rp-pink); }
#rp-traits { padding: 2px 8px 8px; max-height: 320px; overflow-y: auto; }
.rp-traits h4 { font-size: 12px; font-weight: 600; margin: 8px 0 2px; color: var(--rp-white); }
.rp-traits pre { white-space: pre-wrap; font: inherit; margin: 0; color: var(--rp-pink); }
#rp-traits > .rp-dim { display: block; padding-top: 6px; }

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

/* --- center column --- */

.rp-scenes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; min-height: 24px; }
.rp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rp .rp-tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box;
  border: 1px solid var(--rp-pink); color: var(--rp-pink); text-decoration: none;
  font-size: 13px; line-height: 1;
}
.rp .rp-tab:hover { background: var(--rp-pink-faint); }
.rp .rp-tab--active { border-color: var(--rp-white); color: var(--rp-white); }
.rp-scene-name { color: var(--rp-pink); flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }

.rp-log {
  height: calc(100vh - 200px);
  min-height: 360px;
  overflow-y: auto;
  padding: 2px 4px 8px;
  border: 1px dashed transparent;
  overflow-wrap: anywhere;
}
.rp-log.rp-droptarget { border-color: var(--rp-yellow); }

.rp-msg { position: relative; line-height: 1.3; padding: 1px 18px 1px 0; }
.rp-msg--narration { color: var(--rp-pink); }
.rp-msg--say { color: var(--rp-white); }
/* old /me lines now read like any other line */
.rp-msg--emote { color: var(--rp-white); }
.rp-msg--ooc, .rp-msg--system, .rp-msg--roll, .rp-msg--drop { color: var(--rp-yellow); }
.rp-msg--show { color: var(--rp-pink); }
.rp-log--hide-ooc .rp-msg--ooc { display: none; }
.rp-msg--image { margin: 4px 0; }

.rp-scene-image {
  /* the frame hugs the picture; big ones scale down to fit */
  display: inline-block; vertical-align: top;
  max-width: min(100%, 520px);
  border: 1px solid var(--rp-pink);
  background: #050005;
  line-height: 0;
}
.rp-scene-image img { display: block; max-width: 100%; height: auto; }
.rp-scene-image__caption { font-size: 12px; color: var(--rp-pink-dim); margin-top: 2px; }

.rp-ref {
  text-decoration: underline dotted; text-underline-offset: 3px;
  cursor: help; font-weight: 600;
}
.rp-secret {
  display: inline-block; border: 1px solid currentColor; padding: 0 4px;
  font-size: 10px; line-height: 14px; letter-spacing: 0.04em; vertical-align: 1px;
}

.rp-grab--open { cursor: grab; animation: rp-pulse 1.4s ease-in-out infinite; }
/* taken (or deprecated by the GM): just greyed out, like a sense */
.rp-grab.rp-grab--taken { color: #a3a3a3; cursor: default; }
@keyframes rp-pulse { 50% { text-shadow: 0 0 8px rgba(255, 210, 63, 0.8); } }
@media (prefers-reduced-motion: reduce) { .rp-grab--open { animation: none; } }

/* × and edit, stacked at the right edge, shown on hover */
.rp-msg__tools {
  position: absolute; top: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  background: #000;
  /* hidden ones must not catch clicks meant for the message above */
  visibility: hidden;
}
.rp-msg:hover, .rp-msg:focus-within { z-index: 2; }
.rp-msg:hover .rp-msg__tools, .rp-msg__tools:focus-within { visibility: visible; }
.rp-msg__tools button {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 15px;
  background: none; border: none; cursor: pointer; padding: 0;
  font: inherit; font-size: 14px; line-height: 1;
}
.rp-msg__del { color: var(--rp-red); }
.rp-msg__edit { color: var(--rp-pink-dim); }
.rp-msg__edit:hover { color: var(--rp-pink); }
.rp-msg--editing { padding-right: 0; }
.rp-msg--editing .rp-msg__tools { display: none; }
.rp-msg__editbox {
  display: block; width: 100%; box-sizing: border-box; resize: vertical;
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-white);
  padding: 4px 6px; font: inherit;
}
.rp-msg__editbar { display: flex; gap: 6px; margin: 4px 0 2px; }
.rp-msg__editbar button, .rp-chip {
  background: none; color: var(--rp-pink); border: 1px solid var(--rp-pink);
  padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; line-height: 1.4;
}
.rp-msg__editbar button:hover, .rp-chip:hover { background: var(--rp-pink-faint); }

/* narration: anything outside "quotes" fades back a bit */
.rp-unq { color: #a58ca5; }
.rp-msg--emote .rp-unq { color: #a58ca5; }
.rp-msg--say .rp-unq { color: #a58ca5; }

/* line breaks */
.rp-msg--divider { padding: 6px 18px 6px 0; }
.rp-break { border: none; border-top: 1px solid var(--rp-pink); margin: 0; }
.rp-table--gm .rp-msg--divider { cursor: grab; }
/* unread marker: a red line break with the count in the middle */
.rp-unread { cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 6px 18px 6px 0; color: #ff3b3b; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; }
.rp-unread::before, .rp-unread::after { content: ""; flex: 1; border-top: 1px solid #ff3b3b; }
.rp-drop-line { height: 0; border-top: 2px dashed var(--rp-green); margin: 3px 0; pointer-events: none; }
.rp-chip--break { cursor: grab; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.rp-chip--break::before { content: ""; width: 14px; border-top: 1px solid currentColor; }

/* music */
.rp-say__bar { flex-wrap: wrap; align-items: center; }
.rp-music { position: relative; }
.rp-music__pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 50;
  width: 260px; background: #000; border: 1px solid var(--rp-pink); padding: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}
.rp-music__head { color: var(--rp-white); font-weight: 600; margin-bottom: 6px; }
.rp-music__list { list-style: none; margin: 0 0 8px; padding: 0; max-height: 220px; overflow-y: auto; }
.rp-music__list li { padding: 3px 0; border-bottom: 1px solid rgba(255, 159, 255, 0.15); }
.rp-music__list li:last-child { border-bottom: none; }
.rp-music__row { display: flex; align-items: center; gap: 6px; }
.rp-music__mix { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 11px; color: var(--rp-pink-dim); white-space: nowrap; }
.rp-music__mix input { flex: 1; min-width: 0; height: 14px; margin: 0; accent-color: var(--rp-pink); cursor: pointer; }
.rp-music__pct { width: 32px; text-align: right; color: var(--rp-white); }
.rp-music__play {
  flex: 1; min-width: 0; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--rp-pink); font: inherit; padding: 3px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-music__play:hover { background: var(--rp-pink-faint); }
.rp-music__on .rp-music__play { color: var(--rp-white); font-weight: 600; }
.rp-music__on .rp-music__play::before { content: "▸ "; color: var(--rp-green); }
.rp-music__del { background: none; border: none; color: var(--rp-red); cursor: pointer; font-size: 14px; padding: 0 4px; }
.rp-music__stop, .rp-music__upload {
  display: block; width: 100%; box-sizing: border-box; text-align: center; margin-top: 6px;
  background: none; border: 1px solid var(--rp-pink); color: var(--rp-pink);
  padding: 4px; font: inherit; font-size: 13px; cursor: pointer;
}
.rp-music__upload input { display: none; }
.rp-music__stop:hover, .rp-music__upload:hover { background: var(--rp-pink-faint); }
.rp-nowplaying { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--rp-pink-dim); min-width: 0; }
.rp-nowplaying__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.rp-nowplaying__name::before { content: "Now Playing: "; color: #6e5873; }
.rp-nowplaying__btn {
  background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink-dim);
  padding: 0 6px; font: inherit; font-size: 11px; line-height: 16px; cursor: pointer;
}

/* game list */
.rp-games__row { display: flex; align-items: baseline; gap: 12px; }
.rp .rp-games__settings { margin-left: auto; font-size: 13px; color: var(--rp-pink); }


.rp-say { margin-top: 8px; }
.rp-say textarea {
  display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 48px;
  background: #000; color: var(--rp-white);
  border: 1px solid var(--rp-pink); padding: 8px; font: inherit;
}
.rp-say textarea::placeholder { color: #5a3f62; opacity: 1; }
.rp-say textarea:focus { outline: none; border-color: var(--rp-white); }
.rp-say textarea.rp-droptarget { border-style: dashed; border-color: var(--rp-green); }
.rp-error { color: var(--rp-red); min-height: 18px; font-size: 13px; padding-top: 2px; }

/* --- gm column --- */

.rp-col--gm {
  border: 1px solid var(--rp-red);
  color: var(--rp-red);
  padding: 10px;
  font-size: 13px;
}
.rp-col--gm a, .rp-col--gm .rp-linkbtn { color: var(--rp-red); }
.rp-col--gm .rp-dim { color: var(--rp-red-dim); font-size: 12px; }
.rp-gm-block + .rp-gm-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 59, 59, 0.35); }
.rp-gm-block h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--rp-red); line-height: 1.2; }
.rp-gm-block > * + * { margin-top: 6px; }
.rp-gm-block > h3 + * { margin-top: 0; }

.rp-col--gm input, .rp-col--gm textarea, .rp-col--gm select {
  display: block; width: 100%; min-width: 0; box-sizing: border-box;
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-red);
  padding: 4px 6px; font: inherit; line-height: 1.3;
}
.rp-col--gm textarea { resize: vertical; }
.rp-col--gm input::placeholder, .rp-col--gm textarea::placeholder { color: var(--rp-red-dim); opacity: 1; }
.rp-col--gm input[type="number"] { -moz-appearance: textfield; }
.rp-col--gm input[type="number"]::-webkit-inner-spin-button { opacity: 0.5; }
.rp-col--gm input[type="file"] { border: none; padding: 0; color: var(--rp-red-dim); }
.rp-col--gm input[type="file"]::file-selector-button {
  background: #000; color: var(--rp-red); border: 1px solid var(--rp-red);
  padding: 3px 8px; margin-right: 8px; font: inherit; cursor: pointer;
}
.rp-col--gm input[type="checkbox"] { display: inline-block; width: auto; margin: 0; accent-color: var(--rp-red); }
.rp-col--gm button, .rp-btnlink {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; color: var(--rp-red); border: 1px solid var(--rp-red);
  padding: 4px 8px; font: inherit; line-height: 1.2; cursor: pointer; box-sizing: border-box;
}
.rp .rp-btnlink { text-decoration: none; color: var(--rp-red); }
.rp-col--gm form:not(.rp-row) > button, .rp-col--gm .rp-wide, .rp-col--gm .rp-btnlink { width: 100%; }
.rp-col--gm button:hover, .rp .rp-btnlink:hover { background: rgba(255, 59, 59, 0.15); }
.rp-col--gm form { display: flex; flex-direction: column; gap: 6px; }
.rp-col--gm form.rp-row { flex-direction: row; }
.rp-row { display: flex; gap: 6px; align-items: center; }
.rp-row > input { flex: 1; }
.rp-row > button { flex: none; }

/* labelled fields: small caption on top, control underneath */
.rp-field-sm { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--rp-red-dim); min-width: 0; }
.rp-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: end; }
.rp-fields--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rp-span2 { grid-column: span 2; }
.rp-check { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.rp-check--bottom { height: 27px; }

.rp-btnrow, .rp-quickroll { display: grid; gap: 6px; }
.rp-btnrow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-quickroll { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rp-btnrow button, .rp-quickroll button { padding: 4px 0; }

.rp-linkbtn { background: none !important; border: none !important; padding: 0 !important; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; color: inherit; }
.rp-gm-chars { list-style: none; padding: 0; margin: 0; }
.rp-gm-chars li { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; }
.rp-col--gm .rp-gm-chars li .rp-gm-chars__name {
  display: block; flex: 0 1 auto; min-width: 0; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-gm-chars li .rp-dim { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-gm-chars li a { flex: none; }

.rp-stash {
  min-height: 44px; border: 1px dashed rgba(255, 59, 59, 0.5); padding: 6px;
  display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto;
}
.rp-stash.rp-droptarget { border-color: var(--rp-yellow); background: rgba(255, 210, 63, 0.08); }
.rp-stash__item { display: flex; align-items: center; gap: 8px; color: var(--rp-pink); }
.rp-stash__item .rp-icon { cursor: grab; flex: none; max-width: 96px; max-height: 64px; }
.rp-stash__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-stash__del { font-size: 12px; flex: none; }

/* --- tooltip (lives outside .rp, so no variables) --- */

.rp-tooltip {
  position: fixed; z-index: 1000; pointer-events: none;
  max-width: 280px;
  background: #000; color: #f5f5f5;
  border: 1px solid #ff9fff; padding: 6px 8px;
  font: 13px/1.4 "Segoe UI", Tahoma, system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(255, 159, 255, 0.25);
}
.rp-tooltip__name { font-weight: 600; }
.rp-tooltip__pic {
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
  border: 1px solid #ff9fff; background: #000; font-size: 22px; line-height: 1;
}
.rp-tooltip__pic img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.rp-tooltip__meta { color: #ffd23f; font-size: 12px; }
.rp-tooltip__desc { margin-top: 4px; white-space: pre-wrap; color: #ff9fff; }
.rp-tooltip .rp-dim { color: #b46ab4; font-weight: 400; }

/* --- simple pages (game list / forms) --- */

.rp-page { max-width: 760px; }
.rp .rp-page-title { color: var(--rp-pink); font-size: 1.6rem; margin: 0 0 1rem; font-weight: 600; }
.rp .rp-section-title { color: var(--rp-white); font-size: 1rem; margin: 1rem 0 0; font-weight: 600; }
.rp-back { display: inline-block; margin-bottom: 0.75rem; }
.rp-games { list-style: none; padding: 0; margin: 0 0 1rem; }
.rp-games li { border: 1px solid var(--rp-pink); padding: 10px 12px; margin-bottom: 10px; }
.rp .rp-games li a { font-size: 1.1rem; color: var(--rp-white); }
.rp-games li div { margin-top: 4px; }
.rp-form { display: grid; gap: 12px; }
.rp-form .rp-field { display: grid; gap: 4px; min-width: 0; }
.rp-form .rp-field label { color: var(--rp-white); }
.rp-form .errorlist { color: var(--rp-red); margin: 0; padding-left: 1rem; }
.rp-form input, .rp-form select, .rp-form textarea {
  width: 100%; min-width: 0; box-sizing: border-box;
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-pink);
  padding: 5px 7px; font: inherit;
}
.rp-form select[multiple] { padding: 2px; }
.rp-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.rp-form-actions { display: flex; gap: 8px; margin-top: 4px; }
.rp .rp-btn {
  display: inline-flex; align-items: center;
  background: none; border: 1px solid var(--rp-pink); color: var(--rp-pink);
  padding: 5px 14px; cursor: pointer; font: inherit; text-decoration: none;
}
.rp .rp-btn:hover { background: var(--rp-pink-faint); }
.rp .rp-btn--danger { border-color: var(--rp-red); color: var(--rp-red); }
.rp-summary { border: 1px solid var(--rp-pink); padding: 8px 10px; color: var(--rp-white); margin-bottom: 16px; }

/* roll lines */
.rp-msg--roll .rp-num { color: var(--rp-white); }
.rp-msg--roll .rp-success { color: var(--rp-green); }
.rp-msg--roll .rp-failure { color: var(--rp-red); }
.rp-form input[type="file"] { padding: 4px; color: var(--rp-pink-dim); }
.rp-form input[type="file"]::file-selector-button {
  background: #000; color: var(--rp-pink); border: 1px solid var(--rp-pink);
  padding: 3px 10px; margin-right: 10px; font: inherit; cursor: pointer;
}
.rp-form select[multiple] option { padding: 2px 6px; }
.rp-form select[multiple] option:checked { background: var(--rp-pink-faint); color: var(--rp-white); }

/* hoverable character names + their card */
.rp-charref { text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.rp-tooltip__char { display: flex; gap: 8px; align-items: flex-start; }
.rp-tooltip__face { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }  /* portrait stays put however long the word under it */
.rp-tooltip__health { font-size: 12px; line-height: 1.2; color: #f5f5f5; }
.rp-health--hurt, .rp-health--winded { color: #ffd23f; }
.rp-health--reeling, .rp-health--tired, .rp-health--collapsing, .rp-health--dying,
.rp-health--dead, .rp-health--unconscious { color: #ff3b3b; }
.rp-tooltip__portrait {
  flex: none; width: 48px; height: 64px; object-fit: cover;
  border: 1px solid #ff9fff; background: #000; image-rendering: pixelated;
}
.rp-tooltip__portrait--none {
  display: flex; align-items: center; justify-content: center;
  color: #ff9fff; font-size: 22px;
}

/* speak as */
.rp-say__bar { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; }
.rp-say__bar .rp-error { flex: 1; padding-top: 4px; }
.rp-speakas { display: flex; align-items: center; gap: 8px; flex: none; color: var(--rp-pink-dim); font-size: 13px; }
.rp-speakas select {
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-pink);
  padding: 3px 6px; font: inherit; max-width: 220px;
}

/* stasis */
.rp-stasis-tag {
  display: inline-block; margin: 2px 0 4px; padding: 0 5px;
  border: 1px solid #8fd3ff; color: #8fd3ff; font-size: 11px; line-height: 16px;
}
.rp-sheet--stasis .rp-grid, .rp-sheet--stasis .rp-body { opacity: 0.55; filter: saturate(0.4); }
.rp-tooltip__stasis { color: #8fd3ff; font-size: 12px; }
.rp-gm-chars li.rp-in-stasis .rp-gm-chars__name { opacity: 0.6; }
.rp-gm-chars li.rp-in-stasis .rp-stasis-btn { color: #8fd3ff; }
.rp-col--gm .rp-gm-chars li .rp-stasis-btn { margin-left: auto; flex: none; }

/* folders */
.rp-folder { margin-top: 4px; }
.rp-gm-chars li[draggable="true"] { cursor: grab; }
.rp-folder.rp-droptarget > summary { outline: 1px dashed currentColor; }
.rp-folder > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  padding: 2px 0; color: var(--rp-red); font-weight: 600; user-select: none;
}
.rp-folder > summary::-webkit-details-marker { display: none; }
.rp-folder > summary::before {
  content: ""; border-left: 5px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform 0.15s;
}
.rp-folder[open] > summary::before { transform: rotate(90deg); }
.rp-folder > .rp-gm-chars { padding-left: 12px; border-left: 1px solid rgba(255, 59, 59, 0.3); margin-left: 2px; }
.rp-form input[type="checkbox"] { width: auto; justify-self: start; accent-color: var(--rp-pink); }

/* volume: button that opens a slider next to it */
.rp-volume { display: inline-flex; align-items: center; gap: 6px; }
.rp-volume input[type="range"] { width: 110px; height: 16px; margin: 0; accent-color: var(--rp-pink); cursor: pointer; }
.rp-nowplaying__btn[aria-expanded="true"] { color: var(--rp-pink); border-color: var(--rp-pink); }

/* GM holding Shift: lines can be picked up and reordered */
.rp-log--reorder .rp-msg { cursor: grab; }
.rp-log--reorder .rp-msg:hover { outline: 1px dashed var(--rp-pink-dim); outline-offset: 1px; }

/* scene locks */
.rp .rp-tab--locked { border-style: dashed; }
.rp .rp-tab--obscured { background: #5b375b; border-style: dashed; }
.rp .rp-tab--obscured.rp-tab--active { border-style: solid; }
.rp-say textarea:disabled { cursor: not-allowed; opacity: 0.6; }
.rp-say textarea:disabled::placeholder { color: var(--rp-pink-dim); }
.rp-say select:disabled { opacity: 0.5; }

/* stacks */
.rp-icon__qty {
  position: absolute; right: 1px; bottom: 0;
  padding: 0 2px; font-size: 10px; line-height: 12px; font-weight: 700;
  color: var(--rp-white); background: rgba(0, 0, 0, 0.75);
  pointer-events: none;
}
.rp-ghost--merge { outline: 1px solid var(--rp-yellow); background: rgba(255, 210, 63, 0.2); }

/* right-click menus (live on <body>, so no .rp variables) */
.rp-menu {
  position: fixed; z-index: 1100; min-width: 170px; max-width: 260px;
  background: #000; border: 1px solid #ff9fff; padding: 4px 0;
  font: 13px/1.3 "Segoe UI", Tahoma, system-ui, sans-serif; color: #ff9fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}
.rp-menu__title {
  padding: 4px 10px 6px; color: #f5f5f5; font-weight: 600;
  border-bottom: 1px solid rgba(255, 159, 255, 0.25); margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-menu__item {
  display: block; width: 100%; text-align: left; box-sizing: border-box;
  background: none; border: none; color: #ff9fff; font: inherit;
  padding: 5px 10px 5px 24px; cursor: pointer; position: relative;
}
.rp-menu__item:hover, .rp-menu__item:focus { background: rgba(255, 159, 255, 0.15); outline: none; }
.rp-menu__item:disabled { color: #6e5873; cursor: not-allowed; background: none; }
.rp-menu__item--on::before { content: "✓"; position: absolute; left: 8px; color: #66ff9c; }
.rp-menu__amount { padding: 6px 10px 8px; display: grid; gap: 6px; }
.rp-menu__amount input {
  width: 100%; box-sizing: border-box; background: #000; color: #f5f5f5;
  border: 1px solid #ff9fff; padding: 4px 6px; font: inherit;
}
.rp-menu__quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rp-menu__quick button, .rp-menu__ok {
  background: none; border: 1px solid #ff9fff; color: #ff9fff; font: inherit;
  padding: 3px 0; cursor: pointer;
}
.rp-menu__ok { background: rgba(255, 159, 255, 0.15); color: #f5f5f5; }
.rp-menu__quick button:hover, .rp-menu__ok:hover { background: rgba(255, 159, 255, 0.25); }
.rp-menu__note { color: #8a7a8a; font-weight: 400; }
.rp-menu__amount:first-child { padding-top: 8px; }

/* stash: library with folders + search */
.rp-stash__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rp-stash__head h3 { margin: 0 !important; }
.rp-col--gm .rp-stash__newfolder { padding: 2px 8px; font-size: 12px; }
.rp-col--gm #rp-stash-search { margin-bottom: 6px; }
.rp-stash__folder > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  padding: 2px 0; color: var(--rp-red); font-weight: 600; user-select: none;
}
.rp-stash__folder > summary::-webkit-details-marker { display: none; }
.rp-stash__folder > summary::before {
  content: ""; border-left: 5px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform 0.15s;
}
.rp-stash__folder[open] > summary::before { transform: rotate(90deg); }
.rp-stash__folder > .rp-stash__item, .rp-stash__folder > .rp-stash__empty {
  margin-left: 4px; padding-left: 10px; border-left: 1px solid rgba(255, 59, 59, 0.3);
}
.rp-stash__folder > .rp-stash__item + .rp-stash__item { margin-top: 4px; }
.rp-stash__folder.rp-droptarget { background: rgba(255, 210, 63, 0.12); outline: 1px dashed var(--rp-yellow); }
.rp-stash__empty { font-size: 12px; padding: 2px 0; }

/* [+] next to the text box */
.rp-say__row { display: flex; gap: 6px; align-items: stretch; }
.rp-say__row textarea { flex: 1; min-width: 0; }
.rp-plus {
  flex: none; width: 34px; background: #000; color: var(--rp-pink);
  border: 1px solid var(--rp-pink); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.rp-plus:hover, .rp-plus:focus-visible { background: var(--rp-pink-faint); outline: none; }

/* new poll form */
.rp-pollform {
  margin-top: 8px; padding: 10px; border: 1px solid var(--rp-pink); background: #000;
  display: grid; gap: 6px; max-width: 460px;
}
.rp-pollform__head { color: var(--rp-white); font-weight: 600; }
.rp-pollform input, .rp-pollform select {
  background: #000; color: var(--rp-white); border: 1px solid var(--rp-pink-dim);
  padding: 4px 6px; font: inherit; box-sizing: border-box; width: 100%; min-width: 0;
}
.rp-pollform input:focus, .rp-pollform select:focus { outline: none; border-color: var(--rp-white); }
.rp-pollform__opts { display: grid; gap: 4px; }
.rp-pollform__opt { display: flex; gap: 4px; }
.rp-pollform__opt button {
  flex: none; width: 26px; background: none; border: 1px solid var(--rp-pink-dim);
  color: var(--rp-pink-dim); cursor: pointer; font: inherit;
}
.rp-pollform__timer { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; color: var(--rp-pink-dim); font-size: 13px; }
.rp-pollform__timer input { width: 90px; }
.rp-pollform__add, .rp-pollform__actions button {
  background: none; border: 1px solid var(--rp-pink); color: var(--rp-pink);
  padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; justify-self: start;
}
.rp-pollform__add:disabled { opacity: 0.4; cursor: default; }
.rp-pollform__actions { display: flex; gap: 6px; justify-content: flex-end; }
.rp-pollform__actions .rp-pollform__post { background: var(--rp-pink-faint); color: var(--rp-white); }

/* poll cards in the log */
.rp-poll {
  margin: 4px 0; padding: 8px 10px; max-width: 460px;
  border: 1px solid var(--rp-pink); background: rgba(0, 0, 0, 0.6);
}
.rp-poll__q { color: var(--rp-white); font-weight: 600; margin-bottom: 6px; }
.rp-poll__by { color: var(--rp-pink-dim); font-weight: 400; }
.rp-poll__opts { display: grid; gap: 4px; }
.rp-poll__opt {
  position: relative; display: flex; justify-content: space-between; gap: 8px;
  padding: 4px 8px; text-align: left; overflow: hidden;
  background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink);
  font: inherit; cursor: pointer;
}
.rp-poll__opt:not(:disabled):hover { border-color: var(--rp-pink); }
.rp-poll__opt:disabled { cursor: default; }
.rp-poll__bar { position: absolute; inset: 0 auto 0 0; background: var(--rp-pink-faint); pointer-events: none; transition: width 0.3s; }
.rp-poll__label, .rp-poll__count { position: relative; }
.rp-poll__count { color: var(--rp-white); }
.rp-poll__opt--mine { border-color: var(--rp-white); }
.rp-poll__opt--mine .rp-poll__label::after { content: "  ✓"; color: var(--rp-green); }
.rp-poll__opt--won { border-color: var(--rp-green); }
.rp-poll__opt--won .rp-poll__bar { background: rgba(102, 255, 156, 0.18); }
.rp-poll__foot { margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--rp-pink-dim); font-size: 12px; }
.rp-poll--closed .rp-poll__foot { color: var(--rp-green); }
.rp-poll__end {
  background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink-dim);
  font: inherit; font-size: 11px; padding: 1px 8px; cursor: pointer;
}
.rp-poll__end:hover { color: var(--rp-pink); border-color: var(--rp-pink); }
@media (prefers-reduced-motion: reduce) { .rp-poll__bar { transition: none; } }

/* hover: a faint line from the message across to its × */
.rp-msg { display: flex; align-items: flex-start; }
.rp-msg__body { flex: 0 1 auto; min-width: 0; }
.rp-msg::after {
  content: ""; flex: 1 0 12px; height: 0; margin: 0.65em 2px 0 8px;
  border-top: 1px solid transparent; pointer-events: none;
}
.rp-msg:has(.rp-msg__tools):hover::after { border-top-color: rgba(255, 159, 255, 0.35); }
.rp-msg--divider, .rp-msg--editing { display: block; }
.rp-msg--divider::after, .rp-msg--editing::after { display: none; }

/* {{scene:N}} links */
.rp .rp-sceneref { color: var(--rp-pink); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.rp .rp-sceneref:hover { color: var(--rp-white); }

/* scene images: always nearest-neighbour; scaled ones may leave the 520px cap */
.rp-scene-image img { image-rendering: pixelated; }
.rp-scene-image--scaled { max-width: 100%; }
.rp-scene-image--scaled img { max-width: 100%; height: auto; }
.rp-table--gm .rp-scene-image { cursor: context-menu; }

/* click-to-100% images */
.rp-scene-image--canzoom, .rp-table--gm .rp-scene-image--canzoom { cursor: zoom-in; }
.rp-scene-image--canzoom.rp-scene-image--zoomed { cursor: zoom-out; }
.rp-scene-image--zoomed, .rp-scene-image--zoomed img { max-width: none !important; }
.rp-menu__title .rp-menu__check { margin: 0 0 0 8px; vertical-align: -2px; accent-color: #ff9fff; cursor: pointer; }
.rp-scene-image--mono img { filter: grayscale(1); }
.rp-menu__toggle {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 24px;
  border-top: 1px solid rgba(255, 159, 255, 0.25); margin-top: 2px; cursor: pointer; color: #ff9fff;
}
.rp-menu__toggle:hover { background: rgba(255, 159, 255, 0.15); }
.rp-menu__toggle input { margin: 0; accent-color: #ff9fff; cursor: pointer; }

/* paragraph break: an empty gap (GMs see a faint outline on hover to grab it) */
.rp-para { height: 14px; }
.rp-table--gm .rp-msg--paragraph:hover .rp-para { outline: 1px dashed rgba(255, 159, 255, 0.35); }
.rp-chip--para { cursor: grab; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.rp-chip--para::before { content: ""; width: 10px; height: 8px; border-top: 1px dotted currentColor; border-bottom: 1px dotted currentColor; }

/* game clock + the | before Now Playing */
.rp-clock { position: relative; display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--rp-pink-dim); white-space: nowrap; }
.rp-clock__time { color: var(--rp-white); font-variant-numeric: tabular-nums; }
.rp-clock__btn {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 18px;
  background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink); cursor: pointer; padding: 0;
}
.rp-clock__btn:hover, .rp-clock__btn[aria-expanded="true"] { border-color: var(--rp-pink); background: var(--rp-pink-faint); }
.rp-clock__pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 300px;
  background: #000; border: 1px solid var(--rp-pink); padding: 8px; display: grid; gap: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7); white-space: normal;
}
.rp-clock__row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 4px; }
.rp-clock__row--set { grid-template-columns: 1fr auto; }
.rp-clock__pop button, .rp-clock__pop input {
  background: #000; color: var(--rp-pink); border: 1px solid var(--rp-pink-dim);
  font: inherit; font-size: 12px; padding: 3px 4px; min-width: 0; box-sizing: border-box;
}
.rp-clock__pop button { cursor: pointer; }
.rp-clock__pop button:hover { border-color: var(--rp-pink); background: var(--rp-pink-faint); }
.rp-clock__pop input { color: var(--rp-white); color-scheme: dark; }
.rp-clock__custom { display: flex; gap: 2px; min-width: 0; }
.rp-clock__custom input { flex: 1; width: 0; }
.rp-clock__hunger { display: flex; gap: 6px; align-items: center; color: var(--rp-pink-dim); }
.rp-clock__hunger input { accent-color: var(--rp-pink); margin: 0; }
.rp-nowplaying { margin-left: 0; }
.rp-clock[hidden] + .rp-nowplaying { margin-left: auto; }
.rp-clock[hidden] + .rp-nowplaying .rp-nowplaying__sep { display: none; }
.rp-nowplaying__sep { color: var(--rp-pink-dim); }

/* GM column tabs */
.rp-gm-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.rp-col--gm .rp-gm-tabs button { padding: 4px 0; }
.rp-col--gm .rp-gm-tabs button[aria-selected="true"] { background: rgba(255, 59, 59, 0.2); color: var(--rp-white); }
.rp-gm-pane { display: contents; }
.rp-gm-pane[hidden] { display: none !important; }
@media (max-width: 1100px) { .rp-gm-tabs { grid-column: 1 / -1; } }
.rp-btnrow--2 { grid-template-columns: 1fr 1fr; }
.rp-everyone { display: grid; gap: 6px; }

/* items: consumables */
.rp-fields--2 { grid-template-columns: 1fr 1fr; }
.rp-item-clothes { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 1px solid var(--rp-pink-faint); }
.rp-item-clothes[hidden] { display: none; }
.rp-tooltip__use { color: #66ff9c; font-size: 12px; }
.rp-tooltip__hurt { color: #ff3b3b; }  /* tooltip sits outside .rp, so no var */
#rp-item-cancel { margin-top: -2px; }
.rp-col--gm input[type="radio"] { width: auto; display: inline-block; margin: 0; accent-color: var(--rp-red); }

/* reserved items: white outline */
.rp-icon--reserved { border-color: var(--rp-white, #f5f5f5); }
.rp-clock__checks { display: flex; gap: 16px; }

/* activity logs (food, hunger, rest, clock): GM Log tab + each sheet */
.rp-gm-tabs { grid-template-columns: repeat(3, 1fr); }
.rp-actlog { list-style: none; margin: 0; padding: 0; color: #a3a3a3; font-size: 12px; line-height: 1.35; }
.rp-actlog li { display: flex; gap: 8px; padding: 1px 0; }
.rp-actlog__when { flex: none; color: #a3a3a3; font-variant-numeric: tabular-nums; }
.rp-actlog__text { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #a3a3a3; }
.rp-actlog__real { flex: none; color: #a3a3a3; opacity: 0.7; font-size: 11px; }
.rp-actlog__empty { color: #a3a3a3; }
.rp-charlog { padding: 4px 8px; max-height: 150px; overflow-y: auto; border-color: #a3a3a3; }
.rp-actlog--gm { max-height: 520px; overflow-y: auto; }
/* GM log: times on one line, "who: what" underneath */
.rp-actlog--gm li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 8px;
  padding: 3px 0; border-bottom: 1px solid rgba(163, 163, 163, 0.15);
}
.rp-actlog--gm .rp-actlog__text { grid-column: 1 / -1; grid-row: 2; }

/* senses */
.rp-msg--sense, .rp-msg--pickup { color: #a3a3a3; }
.rp-msg--pickup .rp-ref, .rp-msg--pickup .rp-charref { color: #a3a3a3 !important; }
/* drop lines are grey too; only something still up for grabs stays yellow */
.rp-msg--drop { color: #a3a3a3; }
.rp-msg--drop .rp-charref { color: #a3a3a3 !important; }
.rp-msg--drop .rp-grab--open { color: var(--rp-yellow); }
.rp-msg--sense .rp-charref { color: #a3a3a3 !important; }  /* beats name colours */
.rp-log--hide-senses .rp-msg--sense { display: none; }
/* GM holding Shift: actions that would post a sense go red (they'll be silent) */
body.rp-silent .rp-menu__item--sense,
body.rp-silent .rp-clock__pop [data-hours],
body.rp-silent .rp-clock__pop [data-minutes],
body.rp-silent .rp-clock__pop [data-custom],
body.rp-silent #rp-clock-setbtn { color: #ff3b3b !important; border-color: #ff3b3b !important; }

/* game settings: currency checklist */
.rp-form .rp-field ul { list-style: none; margin: 0; padding: 6px 8px; border: 1px solid var(--rp-pink); max-height: 220px; overflow-y: auto; display: grid; gap: 4px; }
.rp-form .rp-field ul label { display: flex; align-items: center; gap: 8px; color: var(--rp-white); }
.rp-form .rp-field ul input { width: auto; margin: 0; accent-color: var(--rp-pink); }

/* new shop form */
.rp-shopform { max-width: 560px; }
.rp-shopform__cols, .rp-shopform__line { display: grid; grid-template-columns: minmax(0, 2.2fr) 70px minmax(0, 1.2fr) 64px 26px; gap: 4px; align-items: center; }
.rp-shopform__cols { color: var(--rp-pink-dim); font-size: 11px; }
.rp-shopform__lines { display: grid; gap: 4px; }
.rp-shopform__line button, .rp-docform__line button {
  height: 100%; background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink-dim); cursor: pointer; font: inherit;
}

/* shop cards in the log */
.rp-shop { margin: 4px 0; padding: 8px 10px; max-width: 520px; border: 1px solid var(--rp-pink); background: rgba(0, 0, 0, 0.6); }
.rp-shop__title { color: var(--rp-white); font-weight: 600; margin-bottom: 6px; }
.rp-shop__row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto 52px; gap: 10px; align-items: center;
  padding: 3px 0; border-top: 1px solid rgba(255, 159, 255, 0.12);
}
.rp-shop__icon {
  width: 32px; height: 32px; box-sizing: border-box; border: 1px solid var(--rp-pink); background: #000;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; overflow: hidden;
}
.rp-shop__icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.rp-shop__name { color: var(--rp-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help; }
.rp-shop__left { color: var(--rp-pink-dim); font-size: 12px; white-space: nowrap; }
.rp-shop__price { color: var(--rp-yellow); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-shop__buy {
  background: none; border: 1px solid var(--rp-pink); color: var(--rp-pink); font: inherit; font-size: 12px;
  padding: 3px 0; cursor: pointer;
}
.rp-shop__buy:not(:disabled):hover { background: var(--rp-pink-faint); color: var(--rp-white); }
.rp-shop__buy:disabled { opacity: 0.35; cursor: default; }
/* sold out: grey, struck through, monochrome icon */
.rp-shop__row--out .rp-shop__name { color: #777; text-decoration: line-through; }
.rp-shop__row--out .rp-shop__icon { filter: grayscale(1); opacity: 0.6; border-color: #555; }
.rp-shop__row--out .rp-shop__price { color: #777; }
#id_currencies {
  border: 1px solid var(--rp-pink); padding: 6px 8px; max-height: 220px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px;
}
#id_currencies label { display: flex; align-items: center; gap: 8px; color: var(--rp-white); }
#id_currencies input { width: auto; margin: 0; accent-color: var(--rp-pink); }

/* currency symbols */
.rp-shop__icon--small { width: 16px; height: 16px; font-size: 11px; border: none; background: none; display: inline-flex; vertical-align: -3px; }
.rp-curdisplay { border: 1px solid var(--rp-pink); padding: 6px 8px; display: grid; gap: 6px; }
.rp-curdisplay__row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; }
.rp-curdisplay__name { color: var(--rp-white); }
.rp-curdisplay__icon { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.rp-form .rp-curdisplay__icon input { width: auto; margin: 0; accent-color: var(--rp-pink); }
.rp-msg em { font-style: italic; }

/* GM picking lines to group (only the GM ever sees this) */
.rp-msg--picked { background: rgba(255, 159, 255, 0.14); outline: 1px dashed rgba(255, 159, 255, 0.5); }
/* the group panel fits whatever's in it: the picture at its own size (up to
   most of the window), text as wide as it needs before wrapping */
.rp-tooltip.rp-tooltip--group { max-width: min(640px, calc(100vw - 16px)); width: max-content; padding: 1px; }
.rp-tooltip__groupimg { display: block; max-width: min(640px, calc(100vw - 34px)); max-height: 70vh; image-rendering: pixelated; }
.rp-tooltip__groupimg + .rp-tooltip__grouptext { margin-top: 6px; }
.rp-tooltip__grouptext { white-space: pre-wrap; max-width: 420px; padding: 2px; }  /* + the panel's 1px = 3px round text */
.rp-tooltip__groupimg + .rp-tooltip__grouptext { max-width: none; width: min-content; min-width: 100%; }
/* composer mode chip (Quiet / Private to …) */
.rp-mode { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #ff3b3b; color: #ff9f9f; padding: 0 2px 0 6px; font-size: 12px; }
.rp-mode button { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0 4px; }
.rp-tag { margin-right: 2px; }
.rp-groupform .rp-groupform__pic { color: var(--rp-pink-dim); font-size: 13px; }  /* not the GM-panel red */
/* internal thoughts (/me): the thought icon at its own size, in the line; italic words */
.rp-thought-icon { width: 10px; height: 10px; image-rendering: pixelated; vertical-align: middle; }
.rp-thought, .rp-thought .rp-unq, .rp-thought .rp-ref { font-style: italic; color: #4c414c; }
/* the thinker's name, half as bright */
.rp-speaker--thinking { filter: brightness(0.5); }
/* camouflaged lines: fully invisible, with nothing that hints there's anything
   there, until someone drag-selects across them */
.rp-msg--camo, .rp-msg--camo * {
  color: transparent !important; text-decoration: none !important;
  filter: none !important; animation: none !important; cursor: inherit !important; border-color: transparent !important;
}
.rp-msg--camo img { opacity: 0; }
.rp-msg--camo::selection, .rp-msg--camo *::selection { color: #f5f5f5 !important; background: Highlight; }  /* selected: plain white text, normal highlight */
.rp-msg--camo::after { display: none; }

/* the GM can still find them */
.rp-table--gm .rp-msg--camo, .rp-table--gm .rp-msg--camo * { color: rgba(255, 171, 255, 0.3) !important; }
.rp-table--gm .rp-msg--camo img { opacity: 0.3; }
.rp-menu__ok--silent { color: #ff3b3b !important; border-color: #ff3b3b !important; }  /* a silent give */

/* forms: a legal document in the log */
.rp-doc { margin: 6px 0; padding: 14px 16px; max-width: 560px; background: #000; border: 1px solid var(--rp-pink); color: var(--rp-white); }
.rp-doc__title { font-weight: 700; text-align: center; letter-spacing: 0.04em; margin-bottom: 10px; }
.rp-doc__body { white-space: normal; line-height: 1.45; }
.rp-doc__lines { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 18px; }
.rp-doc__line { flex: 1 1 180px; min-width: 160px; max-width: 260px; }
.rp-doc__mark { height: 48px; display: flex; align-items: flex-end; }
.rp-doc__sig { max-height: 48px; max-width: 100%; }
.rp-doc__rule { border-top: 1px solid var(--rp-pink); }
.rp-doc__caption { font-size: 12px; color: var(--rp-pink-dim); margin-top: 3px; min-height: 1em; }
.rp-doc__sign {
  background: none; border: 1px solid var(--rp-pink-dim); color: var(--rp-pink); font: inherit; font-size: 12px;
  padding: 1px 10px; margin-bottom: 4px; cursor: pointer;
}
.rp-doc__sign:hover { color: var(--rp-white); border-color: var(--rp-pink); }
.rp-docform textarea { width: 100%; box-sizing: border-box; background: #000; color: var(--rp-white); border: 1px solid var(--rp-pink); font: inherit; padding: 6px; resize: vertical; }
.rp-docform__lines { display: grid; gap: 4px; }
.rp-docform__line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 26px; gap: 4px; }
/* the signing pad */
.rp-sigpad { font: 13px/1.4 "Segoe UI", Tahoma, system-ui, sans-serif; position: fixed; z-index: 1100; background: #000; border: 1px solid #ff9fff; padding: 8px; box-shadow: 0 4px 18px rgba(255, 159, 255, 0.25); }
.rp-sigpad canvas { display: block; border: 1px dashed rgba(255, 159, 255, 0.5); background: #050305; cursor: crosshair; touch-action: none; }
.rp-sigpad__row { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.rp-sigpad__row button { background: none; border: 1px solid #ff9fff; color: #ff9fff; font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; }
.rp-sigpad__row .rp-sigpad__go { color: #f5f5f5; }
.rp-sigpad__saved { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #b46ab4; font-size: 12px; }
.rp-sigpad__saved img { max-height: 32px; border: 1px solid rgba(255, 159, 255, 0.3); }

