/* Social & PvP feature: party frames, invitations, action menu, status bar (PvP flag, criminal,
   mount), guild / players-online / inspect panels, character "Standing", guild chat, nameplate tags. */

/* ------------------------------------------------------------------ party frames (top-left) */

/* Party frames: below the portrait frame (features/settings/layout.js sets `top`). Each other
   member is a small copy of the self frame; your own row is hidden (the self frame shows you). */
#sc-party {
  position: fixed;
  top: 136px;
  left: 10px;
  z-index: 20;
  width: 214px;
  user-select: none;
}

.sc-pf-head {
  display: flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  margin: 0 0 4px 4px;
  padding: 1px 4px 1px 10px;
  background: rgba(10, 10, 12, 0.55);
  border-radius: 999px;
}

.sc-pf-title {
  font-size: 12px;
  font-weight: 700;
  color: #f2d58a;
  text-shadow: 0 1px 2px #000;
}

.sc-pf-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 13px;
  line-height: 16px;
  color: #f3e2bb;
  cursor: pointer;
  background: radial-gradient(circle at 45% 35%, #5b636e, #22272e);
  border: 1px solid #0e1013;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(200, 170, 100, 0.6);
}

.sc-pf-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.sc-pf-btn.leave:hover {
  color: #fff;
  background: #3a1712;
  border-color: var(--error);
}

.sc-pf-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-pf-row {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  cursor: pointer;
}

.sc-pf-row.self {
  display: none;
}

/* 40 px round portrait in a brass / steel ring (like the self frame's, smaller). */
.sc-pf-portrait {
  position: relative;
  z-index: 2;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin-left: 4px;
  border-radius: 50%;
  background: #141a20;
  box-shadow: 0 0 0 2px #1a120a, 0 0 0 3.5px var(--brass), 0 0 0 4.5px #2e3238, 0 0 0 5.5px #0c0d0f, 0 3px 8px rgba(0, 0, 0, 0.5);
}

.sc-pf-face {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.sc-pf-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sc-pf-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  font-size: 15px;
  line-height: 1;
  color: #f2c230;
  text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 6px rgba(242, 194, 48, 0.6);
  transform: translateX(-50%);
}

.sc-pf-plate {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  margin-left: -6px;
}

/* Parchment name ribbon. */
.sc-pf-top {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 17px;
  padding: 0 10px 0 12px;
  background: var(--paper-noise), linear-gradient(180deg, #f8e7c2 0%, #e4c58e 60%, #cfa86a 100%);
  border: 1px solid #3a2410;
  border-left: none;
  border-radius: 0 9px 9px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.sc-pf-name {
  flex: 0 1 auto;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  color: #3a2212;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sc-pf-zone {
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  text-overflow: ellipsis;
  filter: brightness(0.6) saturate(1.3);
}

.sc-pf-bar {
  position: relative;
  margin-left: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #0b0806, #231a13);
  border: 1px solid #06040a;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(160, 166, 174, 0.35);
}

.sc-pf-bar.hp {
  height: 12px;
}

.sc-pf-bar.en {
  height: 10px;
}

.sc-pf-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  transition: width 0.18s linear;
}

.sc-pf-bar.hp .sc-pf-fill {
  background: linear-gradient(180deg, #f06a5a, #c8302a 55%, #8a1a14);
}

.sc-pf-row.low .sc-pf-bar.hp .sc-pf-fill {
  background: linear-gradient(180deg, #ff8a5a, #d84a1a);
}

.sc-pf-bar.en .sc-pf-fill {
  background: linear-gradient(180deg, #6ab4ff, #2f7fd6 55%, #1a4f96);
}

.sc-pf-text {
  position: absolute;
  inset: 0;
  font-size: 9.5px;
  font-weight: bold;
  line-height: 10px;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 1px #000;
}

.sc-pf-bar.hp .sc-pf-text {
  line-height: 11px;
}

.sc-pf-row:hover .sc-pf-portrait {
  box-shadow: 0 0 0 2px #1a120a, 0 0 0 3.5px #fff0b0, 0 0 0 4.5px #2e3238, 0 0 0 5.5px #0c0d0f, 0 3px 8px rgba(0, 0, 0, 0.5);
}

.sc-pf-row.targeted .sc-pf-portrait {
  box-shadow: 0 0 0 2px #1a120a, 0 0 0 3.5px #ffe08a, 0 0 0 5.5px #0c0d0f, 0 0 10px 2px rgba(255, 224, 138, 0.6);
}

.sc-pf-row.offline,
.sc-pf-row.dead {
  opacity: 0.6;
}

.sc-pf-row.offline .sc-pf-face,
.sc-pf-row.dead .sc-pf-face {
  filter: grayscale(1);
}

.sc-pf-row.dead .sc-pf-name {
  color: #8a2a20;
  text-decoration: line-through;
}

.sc-pf-row.away .sc-pf-bar .sc-pf-fill {
  filter: saturate(0.55) brightness(0.85);
}

/* ------------------------------------------------------------------ invitation popups */

#sc-popups {
  position: fixed;
  top: 22%;
  left: 50%;
  z-index: 850;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.sc-popup {
  width: 330px;
  padding: 10px 14px 12px;
  pointer-events: auto;
  background:
    var(--paper-noise),
    radial-gradient(ellipse at 50% 30%, var(--parch-hi), var(--parch) 60%, var(--parch-lo));
  border: 6px solid var(--wood);
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--wood-edge), inset 0 0 16px rgba(120, 72, 22, 0.4), 0 10px 28px rgba(0, 0, 0, 0.7);
  animation: sc-pop-in 0.18s ease-out;
}

.sc-popup.out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s, transform 0.22s;
}

.sc-popup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.sc-popup-title {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  color: #4a2a10;
}

.sc-popup-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.sc-popup-timer {
  height: 5px;
  margin: 8px 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2127, #3c434c);
  border-radius: 3px;
}

.sc-popup-timer > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a07424, #f0c860);
}

.sc-popup-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes sc-pop-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ action menu */

.sc-menu {
  position: fixed;
  z-index: 960;
  /* #ui is pointer-events:none (inherited): the menu and its buttons must opt back in. */
  pointer-events: auto;
  min-width: 170px;
  padding: 4px;
  background:
    var(--paper-noise),
    linear-gradient(180deg, var(--parch-hi), var(--parch) 70%, var(--parch-lo));
  border: 3px solid var(--wood);
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--wood-edge), 0 10px 24px rgba(0, 0, 0, 0.7);
  animation: sc-pop-in 0.1s ease-out;
}

.sc-menu-title {
  display: flex;
  flex-direction: column;
  padding: 3px 8px 5px;
  margin-bottom: 3px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: bold;
  color: #4a2a10;
  border-bottom: 1px solid var(--border-dim);
}

.sc-menu-sub {
  font-size: 10.5px;
  font-weight: normal;
  color: var(--text-faint);
}

.sc-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 5px 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 3px;
}

.sc-menu-item:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(90deg, #8a4f12, rgba(138, 79, 18, 0.55));
}

.sc-menu-item.danger {
  color: #a01e12;
}

.sc-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.sc-menu-hint {
  font-size: 10px;
  color: var(--text-faint);
}

.sc-menu-sep {
  height: 1px;
  margin: 3px 4px;
  background: var(--border-dim);
}

/* ------------------------------------------------------------------ status column (top right, under the menu row; settings/layout.js) */

#sc-status {
  position: fixed;
  top: 96px;
  right: 272px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 132px;
}

.sc-sb-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 6px;
  overflow: hidden;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  background: linear-gradient(180deg, rgba(20, 22, 26, 0.85), rgba(10, 10, 12, 0.8));
  border: 1px solid rgba(200, 170, 100, 0.45);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.sc-sb-btn:hover {
  border-color: var(--gold);
}

.sc-sb-btn > canvas {
  position: relative;
  flex: 0 0 auto;
}

.sc-sb-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(217, 180, 90, 0.08), rgba(217, 180, 90, 0.28));
}

.sc-sb-text {
  position: relative;
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 1px 1px #000;
}

.sc-sb-state,
.sc-sb-key {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.sc-sb-key {
  padding: 0 4px;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
}

.sc-pvp .sc-sb-fill {
  background: linear-gradient(90deg, rgba(224, 69, 58, 0.15), rgba(224, 69, 58, 0.5));
}

.sc-pvp.on {
  border-color: #e0453a;
  box-shadow: 0 0 10px rgba(224, 69, 58, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sc-pvp.on .sc-sb-state {
  color: #ffb0a8;
}

.sc-pvp.busy .sc-sb-state {
  color: var(--gold-bright);
  animation: pulse-text 0.9s infinite;
}

.sc-mount.on {
  border-color: var(--gold);
}

.sc-mount.on .sc-sb-fill {
  background: linear-gradient(90deg, rgba(217, 180, 90, 0.05), rgba(217, 180, 90, 0.18));
}

.sc-mount.broken {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.sc-crim {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(150, 24, 14, 0.92), rgba(80, 10, 6, 0.92));
  border: 1px solid #ff3b2b;
  border-radius: 4px;
  animation: pulse-red 1.4s infinite;
}

.sc-crim-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Mount cast bar: lives in #hud-bottom and reuses the core .hud-cast look. */
.sc-mountcast {
  pointer-events: none;
}

.sc-mountcast .hud-cast-fill {
  background: linear-gradient(180deg, #e8d7a8, #b89a5a 60%, #7d6232);
}

.sc-mountcast.done .hud-cast-fill {
  width: 100% !important;
  background: linear-gradient(180deg, #b6f0a0, #5fb043);
}

.sc-mountcast.cancel .hud-cast-fill {
  background: linear-gradient(180deg, #f08a7a, #a3342a);
}

.sc-mountcast.sc-floating {
  position: fixed;
  bottom: 190px;
  z-index: 25;
}

/* ------------------------------------------------------------------ panels: shared */

.sc-empty {
  padding: 14px 4px;
  text-align: center;
}

.sc-guild-tag {
  font-weight: bold;
  color: var(--gold);
}

.sc-badge {
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 9px;
}

.sc-badge.criminal {
  color: #fff;
  background: rgba(160, 20, 10, 0.75);
  border-color: #ff3b2b;
}

.sc-badge.pvp {
  color: #a01e12;
  border-color: #e0453a;
}

.sc-badge.party {
  color: #2f6a14;
  border-color: #5fb043;
}

/* AI-played resident (server field `ai`): "KI" / "KI-Bewohner", spelled as written. */
.sc-badge.ai {
  color: #3a2410;
  text-transform: none;
  background: linear-gradient(#fbf0d2, #d8b878);
  border-color: #6a4a22;
}

.sc-rep.neg,
.sc-bad {
  color: var(--error);
}

.sc-rep.pos {
  color: var(--good);
}

/* ------------------------------------------------------------------ guild panel */

.sc-guild-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 4px;
  text-align: center;
}

.sc-guild-empty-title {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--gold-bright);
}

.sc-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-field {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.sc-tag-input {
  width: 80px;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sc-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.sc-cost .bad {
  color: var(--error);
}

.sc-form-err {
  min-height: 14px;
  font-size: 11.5px;
  color: var(--error);
}

.sc-guild-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
}

.sc-guild-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: radial-gradient(circle, rgba(217, 180, 90, 0.18), transparent 70%);
  border: 1px solid var(--border-dim);
  border-radius: 50%;
}

.sc-guild-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 11.5px;
}

.sc-guild-name {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--gold-bright);
}

.sc-roster {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 300px;
  overflow-y: auto;
}

.sc-roster-row,
.sc-who-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 6px;
  font-size: 12.5px;
  border-radius: 3px;
}

.sc-roster-row:nth-child(odd),
.sc-who-row:nth-child(odd) {
  background: rgba(255, 248, 228, 0.3);
}

.sc-roster-row:hover,
.sc-who-row:hover {
  background: rgba(255, 240, 200, 0.6);
}

.sc-roster-row.self .sc-roster-name,
.sc-who-row.self .sc-who-name {
  color: var(--gold-bright);
}

.sc-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: #4a4034;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.sc-roster-row.online .sc-dot {
  background: #6fd35f;
  box-shadow: 0 0 5px rgba(111, 211, 95, 0.7);
}

.sc-roster-row:not(.online) .sc-roster-name {
  color: var(--text-faint);
}

.sc-roster-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sc-rank {
  flex: 0 0 58px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sc-rank.leader {
  color: #9a6a08;
}

.sc-rank.officer {
  color: #2a5f9a;
}

.sc-roster-zone {
  flex: 0 0 92px;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-faint);
}

.sc-roster-actions,
.sc-who-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

/* Fixed widths keep the columns aligned when a row has fewer (or no) buttons. */
.sc-roster-actions {
  flex: 0 0 84px;
}

.sc-who-actions {
  flex: 0 0 196px;
}

/* Your own row has no buttons: give the name (and guild tag) the room. */
.sc-who-row.self .sc-who-actions {
  flex-basis: 0;
}

.sc-roster-actions .btn.small {
  min-width: 24px;
  min-height: 22px;
  padding: 0 5px;
}

.sc-invite-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.sc-invite-row .input {
  flex: 1;
}

.sc-guild-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  font-size: 11.5px;
  border-top: 1px solid var(--border-dim);
}

/* ------------------------------------------------------------------ players online */

.sc-who-top {
  display: flex;
  gap: 6px;
}

.sc-who-top .input {
  flex: 1;
}

.sc-who-count {
  margin: 6px 2px;
  font-size: 11.5px;
}

.sc-who-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 360px;
  overflow-y: auto;
}

.sc-who-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sc-who-zone {
  flex: 0 0 96px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* A raised PvP flag (c5-08): the badge sits between the name and the zone column. */
.sc-who-pvp {
  flex: 0 0 auto;
}

/* An AI-played resident's "KI" badge sits right after the name. */
.sc-who-ai {
  flex: 0 0 auto;
}

/* Zone-type colours are made for dark ground: a thin dark halo on paper. */
#ui .panel-body .sc-who-zone {
  text-shadow: 0 0 1px #1a0f06, 0 0 2px rgba(26, 15, 6, 0.9), 0 1px 1px #1a0f06;
}

/* ------------------------------------------------------------------ inspect */

.sc-insp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
}

.sc-insp-name {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--gold-bright);
}

.sc-insp-ip {
  padding: 3px 10px;
  text-align: right;
  background: linear-gradient(270deg, rgba(217, 180, 90, 0.14), transparent);
  border-right: 3px solid var(--gold);
}

.sc-insp-ip b {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--gold-bright);
}

.sc-insp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  font-size: 12px;
}

.sc-insp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px 4px;
}

.sc-insp-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sc-insp-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
}

.sc-insp-slot.empty {
  opacity: 0.55;
  cursor: default;
}

.sc-insp-label {
  font-size: 10px;
  color: var(--text-faint);
}

.sc-insp-buttons {
  margin-top: 12px;
}

/* ------------------------------------------------------------------ character panel: standing */

.sc-standing {
  display: grid;
  gap: 1px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-dim);
}

.sc-standing-title {
  margin-bottom: 2px;
  font-family: var(--font-title);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ------------------------------------------------------------------ guild chat & nameplates */

.ch-guild {
  color: #bfe8b0;
}

.ch-guild .chat-tag,
.ch-guild .chat-from {
  color: #7fd36b;
}

.rn-plate .sc-gtag {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: #e8c872;
}

/* ------------------------------------------------------------------ trade window (social/trade.js) */

.sc-tr-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  --slot: 44px;
}

.sc-tr-cols {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.sc-tr-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: var(--well);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.sc-tr-col.them {
  background: var(--wood-grain), linear-gradient(180deg, #3e2b1b, #22170e);
}

.sc-tr-col.them.changed {
  animation: sc-tr-flash 1.2s ease-out;
}

@keyframes sc-tr-flash {
  0% { box-shadow: 0 0 0 2px var(--warn), inset 0 0 18px rgba(232, 145, 45, 0.45); }
  100% { box-shadow: 0 0 0 0 transparent, inset 0 0 0 transparent; }
}

.sc-tr-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-weight: bold;
  color: var(--gold-bright);
}

.sc-tr-state {
  font-size: 11px;
  font-weight: normal;
  color: var(--text-faint);
}

.sc-tr-state.ready { color: var(--gold); }
.sc-tr-state.ok { color: var(--good); }

.sc-tr-grid {
  display: grid;
  grid-template-columns: repeat(4, var(--slot));
  gap: 4px;
  justify-content: center;
}

.sc-tr-col.you .sc-tr-slot.empty {
  border-style: dashed;
}

.sc-tr-slot.drop-hover {
  border-color: var(--good);
  box-shadow: 0 0 8px rgba(127, 196, 90, 0.5);
}

.sc-tr-silver {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.sc-tr-silver-in {
  width: 100%;
  min-width: 0;
}

.sc-tr-col.you .sc-tr-silver-val {
  color: var(--ink);
}

.sc-tr-silver-val {
  font-weight: bold;
  color: #e6e9ed;
}

.sc-tr-arrows {
  align-self: center;
  font-size: 18px;
  color: var(--gold-dim);
}

.sc-tr-stage {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  background: var(--well);
  border-radius: var(--radius);
}

.sc-tr-stage.confirm {
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}

.sc-tr-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.sc-tr-ready.on {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.sc-tr-tip {
  color: var(--text-faint);
}

/* Inventory slots offered in the open trade. */
.inv-slot.sc-tr-locked {
  opacity: 0.45;
  border-color: var(--gold-dim);
}

.inv-slot.sc-tr-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(217, 180, 90, 0.18) 5px 7px);
  pointer-events: none;
}

/* ------------------------------------------------------------------ character creator (social/look.js) */

#sc-creator {
  position: fixed;
  inset: 0;
  z-index: 890;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: rgba(5, 3, 2, 0.6);
  animation: fade-in 0.2s ease-out;
}

#sc-creator.new {
  background: radial-gradient(ellipse at center, rgba(30, 22, 14, 0.75), rgba(5, 3, 2, 0.92));
}

.sc-lk-card {
  --text: var(--ink);
  --text-dim: var(--ink-dim);
  --text-faint: var(--ink-faint);
  --gold: #8c4f12;
  --gold-bright: #6e3a0a;
  --border-dim: rgba(110, 72, 34, 0.3);
  --well: rgba(118, 76, 32, 0.12);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(640px, 94vw);
  max-height: 94vh;
  overflow: auto;
  padding: 16px 18px;
  background:
    var(--paper-noise),
    radial-gradient(ellipse at 50% 30%, var(--parch-hi), var(--parch) 60%, var(--parch-lo));
  border: 9px solid var(--wood);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--wood-edge), inset 0 0 22px rgba(120, 72, 22, 0.45), 0 16px 40px rgba(0, 0, 0, 0.8);
}

.sc-lk-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  color: #4a2a10;
}

.sc-lk-sub,
.sc-lk-note {
  font-size: 12px;
  color: var(--text-dim);
}

.sc-lk-note:empty {
  display: none;
}

.sc-lk-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sc-lk-preview {
  flex: 0 0 auto;
  background: radial-gradient(circle at 50% 60%, #3a2c1c, #120d09 75%);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.sc-lk-canvas {
  display: block;
  width: 240px;
  height: 300px;
  cursor: grab;
  touch-action: none;
}

.sc-lk-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.sc-lk-label {
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.sc-lk-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sc-lk-opt {
  padding: 3px 9px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  background: var(--well);
  border: 1px solid var(--border-dim);
  border-radius: 3px;
}

.sc-lk-opt:hover {
  border-color: var(--gold-dim);
}

.sc-lk-opt.active {
  color: #fff;
  background: linear-gradient(180deg, var(--red-hi), var(--red-lo));
  border-color: #2a0604;
  box-shadow: 0 0 6px rgba(196, 43, 32, 0.45);
}

.sc-lk-opt.swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.6);
}

.sc-lk-opt.swatch.active {
  border-color: var(--gold-bright);
  transform: scale(1.12);
}

.sc-lk-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sc-lk-gap {
  flex: 1;
}

.sc-lk-btn {
  display: block;
  width: 100%;
  margin: 0;
}

@media (max-width: 560px) {
  .sc-lk-main {
    flex-direction: column;
    align-items: center;
  }
}

/* ------------------------------------------------------------------ emotes & speech bubbles (social/emote.js) */

.sc-em-menu {
  position: fixed;
  z-index: 960;
  pointer-events: auto;
  min-width: 160px;
  padding: 4px;
  background:
    var(--paper-noise),
    radial-gradient(ellipse at 50% 30%, var(--parch-hi), var(--parch) 60%, var(--parch-lo));
  border: 3px solid var(--wood);
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--wood-edge), 0 10px 24px rgba(0, 0, 0, 0.7);
  animation: sc-pop-in 0.1s ease-out;
}

.sc-em-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 3px;
}

.sc-em-item > span:nth-child(2) {
  flex: 1;
}

.sc-em-item:hover {
  color: var(--gold-bright);
  background: var(--bg-hover);
}

#sc-bubbles {
  position: fixed;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  pointer-events: none !important;
}

.sc-bubble {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 220px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #2a1f14;
  overflow-wrap: anywhere;
  background: rgba(244, 236, 220, 0.94);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  transition: opacity 0.4s;
}

.sc-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: rgba(244, 236, 220, 0.94);
}

.sc-bubble.party {
  background: rgba(214, 235, 255, 0.94);
}

.sc-bubble.party::after {
  border-top-color: rgba(214, 235, 255, 0.94);
}

.sc-bubble.emote {
  font-style: italic;
  color: var(--gold-bright);
  background: rgba(20, 15, 10, 0.8);
  border: 1px solid var(--gold-dim);
}

.sc-bubble.emote::after {
  border-top-color: rgba(20, 15, 10, 0.8);
}

.sc-bubble.fading {
  opacity: 0;
}
