/* client/views/talk.css */
.talk-overlay {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  bottom: 0;
  width: var(--chat-w, 520px);
  max-width: 100vw;
  height: 380px;
  max-height: 70vh;
  z-index: 34;
  background: var(--stone-700, #4a3927);
  border: 2px solid;
  border-color: var(--stone-300, #9c7f5a) var(--stone-900, #2b2117) var(--stone-900, #2b2117) var(--stone-300, #9c7f5a);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease;
  color: var(--stone-ink, #f4e4c1);
  font: 16px/1.25 var(--font-body, "Pixel Operator", monospace);
}
.talk-overlay.hidden {
  transform: translateY(110%);
  visibility: hidden;
}
.talk-overlay-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-bottom: 2px solid var(--stone-500, #6e5539);
  background: var(--stone-900, #2b2117);
  flex-shrink: 0;
}
.talk-overlay-name {
  font: 20px/1.2 var(--font-head, "Alagard", serif);
  color: var(--rs-yellow, #ffff00);
  text-shadow: 1px 1px 0 #000;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.talk-overlay-close {
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--stone-dim, #c9b58f);
  padding: 2px 8px;
  min-width: 32px;
  text-align: center;
}
.talk-overlay-close:hover {
  color: var(--rs-yellow, #ffff00);
}
.talk-overlay-log {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--stone-500, #6e5539) var(--stone-900, #2b2117);
}
.talk-overlay-line {
  padding: 3px 8px;
  margin: 3px 0;
  max-width: 92%;
  white-space: pre-wrap;
  word-break: break-word;
  animation: talk-slide-in 0.15s ease;
}
.talk-overlay-line.me {
  margin-left: auto;
  color: var(--rs-cyan, #00ffff);
  border-right: 3px solid var(--rs-cyan, #00ffff);
  text-align: right;
}
.talk-overlay-line.them {
  color: var(--stone-ink, #f4e4c1);
  border-left: 3px solid var(--orb-gold, #e2b93b);
  background: var(--stone-900, #2b2117);
}
.talk-overlay-line.sys {
  max-width: 100%;
  text-align: center;
  font-size: 14px;
  color: var(--stone-dim, #c9b58f);
  background: none;
  border: none;
}
.talk-overlay-verbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px;
  border-top: 1px solid var(--stone-500, #6e5539);
  flex-shrink: 0;
}
.talk-overlay-verbs.hide {
  display: none;
}
.talk-overlay-verb {
  font-size: 14px;
  padding: 2px 8px;
  color: var(--stone-dim, #c9b58f);
}
.talk-overlay-verb:hover {
  color: var(--rs-yellow, #ffff00);
}
.talk-overlay-meta {
  font-size: 14px;
  color: var(--stone-dim, #c9b58f);
  padding: 2px 10px;
  flex-shrink: 0;
}
.talk-overlay-input {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-top: 2px solid var(--stone-500, #6e5539);
  background: var(--stone-900, #2b2117);
  flex-shrink: 0;
}
.talk-overlay-text {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
}
.talk-overlay-text:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.talk-overlay-send {
  padding: 4px 14px;
  color: var(--rs-yellow, #ffff00);
  text-shadow: 1px 1px 0 #000;
  font-family: var(--font-head, "Alagard", serif);
}
.talk-overlay-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.talk-influence {
  background: var(--stone-900, #2b2117);
  border-bottom: 1px solid var(--stone-500, #6e5539);
  padding: 4px 10px;
  font-size: 14px;
  color: var(--stone-dim, #c9b58f);
  flex-shrink: 0;
}
.talk-influence-title {
  font: 14px var(--font-head, "Alagard", serif);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orb-gold, #e2b93b);
  margin-bottom: 2px;
}
.talk-influence-npcs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}
.talk-influence-npc {
  border: 1px solid var(--stone-500, #6e5539);
  padding: 0 6px;
  color: var(--stone-ink, #f4e4c1);
}
.talk-influence-empty {
  color: var(--stone-dim, #c9b58f);
  font-style: italic;
}
.talk-influence-ap {
  margin-bottom: 2px;
}
.talk-influence-last {
  color: var(--stone-dim, #c9b58f);
}
@keyframes talk-slide-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .talk-overlay {
    transition: none;
  }
  .talk-overlay-line {
    animation: none;
  }
}
@media (max-width: 899px) {
  .talk-overlay {
    width: 100vw;
    bottom: calc(var(--tabbar-h, 56px) + env(safe-area-inset-bottom));
    height: 60vh;
  }
  .talk-overlay-line {
    font-size: 14px;
  }
}

/* client/views/petition.css */
.petition-overlay {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  bottom: 0;
  width: var(--chat-w, 520px);
  max-width: 100vw;
  height: 380px;
  max-height: 70vh;
  z-index: 35;
  background: var(--stone-700, #4a3927);
  border: 2px solid;
  border-color: var(--stone-300, #9c7f5a) var(--stone-900, #2b2117) var(--stone-900, #2b2117) var(--stone-300, #9c7f5a);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease;
  color: var(--stone-ink, #f4e4c1);
  font: 16px/1.25 var(--font-body, "Pixel Operator", monospace);
}
.petition-overlay.hidden {
  transform: translateY(110%);
  visibility: hidden;
}
.petition-overlay-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-bottom: 2px solid var(--stone-500, #6e5539);
  background: var(--stone-900, #2b2117);
  flex-shrink: 0;
}
.petition-overlay-title {
  font: 14px var(--font-head, "Alagard", serif);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orb-gold, #e2b93b);
}
.petition-overlay-name {
  font: 20px/1.2 var(--font-head, "Alagard", serif);
  color: var(--rs-yellow, #ffff00);
  text-shadow: 1px 1px 0 #000;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.petition-overlay-close {
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--stone-dim, #c9b58f);
  padding: 2px 8px;
  min-width: 32px;
  text-align: center;
}
.petition-overlay-close:hover {
  color: var(--rs-yellow, #ffff00);
}
.petition-overlay-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 8px;
  overflow-y: auto;
}
.petition-overlay-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.petition-overlay-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-dim, #c9b58f);
}
.petition-overlay-scope,
.petition-overlay-body {
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
}
.petition-overlay-scope:disabled,
.petition-overlay-body:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.petition-overlay-body {
  resize: vertical;
  min-height: 90px;
  line-height: 1.3;
}
.petition-overlay-count {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 12px;
  color: var(--stone-dim, #c9b58f);
  pointer-events: none;
}
.petition-overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px;
  border-top: 2px solid var(--stone-500, #6e5539);
  background: var(--stone-900, #2b2117);
  flex-shrink: 0;
}
.petition-overlay-cancel,
.petition-overlay-submit {
  padding: 4px 14px;
}
.petition-overlay-submit {
  color: var(--rs-yellow, #ffff00);
  text-shadow: 1px 1px 0 #000;
  font-family: var(--font-head, "Alagard", serif);
}
.petition-overlay-cancel:disabled,
.petition-overlay-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.petition-overlay-meta {
  font-size: 14px;
  color: var(--stone-dim, #c9b58f);
  padding: 2px 10px;
  flex-shrink: 0;
}
@keyframes petition-slide-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .petition-overlay {
    transition: none;
  }
}
@media (max-width: 899px) {
  .petition-overlay {
    width: 100vw;
    bottom: calc(var(--tabbar-h, 56px) + env(safe-area-inset-bottom));
    height: 60vh;
  }
}

/* src/client/styles/hud.css */
.hud-panel {
  background: var(--stone-900);
  border: 1px solid var(--stone-500);
  padding: 6px 8px;
  margin-bottom: 8px;
  color: var(--stone-ink);
  font: 14px/1.4 var(--font-body);
  user-select: none;
}
.hud-panel-title {
  font: 16px var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
  margin-bottom: 3px;
}
.hud-res-empty {
  color: var(--stone-dim);
  font-style: italic;
}
.hud-era {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-era-name {
  color: var(--rs-yellow);
}
.hud-era-meta {
  color: var(--stone-ink);
}
.hud-snapshot {
  max-width: none;
}
.hud-snapshot .snap-label {
  display: inline-block;
  width: 58px;
  color: var(--stone-dim);
  font-size: 14px;
}
.hud-snapshot .snap-val {
  color: var(--stone-ink);
}
.hud-snapshot .snap-nation-name {
  color: var(--rs-cyan);
}
.hud-snapshot .snap-market-item .mk-name {
  color: var(--stone-ink);
}
.hud-snapshot .snap-market-item .mk-arrow.up {
  color: var(--rs-green);
}
.hud-snapshot .snap-market-item .mk-arrow.dn {
  color: var(--rs-red);
}
.hud-snapshot .snap-market-item .mk-arrow.flat {
  color: var(--stone-dim);
}
.hud-snapshot .snap-pulse {
  color: var(--orb-gold);
}
.hud-snapshot .snap-drama-score.drama-calm {
  color: var(--stone-dim);
}
.hud-snapshot .snap-drama-score.drama-tense {
  color: var(--orb-gold);
}
.hud-snapshot .snap-drama-score.drama-storm {
  color: var(--rs-red);
}
.hud-snapshot .snap-drama-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--stone-dim);
}
.hud-snapshot-flash {
  animation: snap-flash 0.8s ease-out;
}
@keyframes snap-flash {
  0% {
    border-color: var(--rs-red);
    box-shadow: 0 0 10px rgba(255, 48, 48, .5);
  }
  100% {
    border-color: var(--stone-500);
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hud-snapshot-flash {
    animation: none;
    border-color: var(--rs-red);
  }
}

/* src/client/styles/chronicle.css */
.toast {
  position: static;
  transform: translateY(8px);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--parchment);
  color: var(--parchment-ink);
  border: 2px solid;
  border-color: #f6ecd2 #8a7048 #8a7048 #f6ecd2;
  padding: 5px 12px;
  font: 16px/1.25 var(--font-body);
  max-width: min(92vw, 440px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.toast-visible {
  transform: translateY(0);
  opacity: 1;
}
.toast-hidden {
  opacity: 0;
  transform: translateY(-8px);
}
.toast-info {
  border-left: 4px solid var(--stone-300);
}
.toast-notable {
  border-left: 4px solid var(--orb-ap);
}
.toast-dramatic {
  border-left: 4px solid var(--rs-red);
}
.toast-era {
  border-left: 4px solid var(--orb-gold);
}
.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.toast-text {
  color: var(--parchment-ink);
  word-break: break-word;
}
.toast .q-btn {
  color: #1a5c1a;
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: none;
  }
}
.chron.toast-info {
  border-left: 3px solid var(--stone-300);
}
.chron.toast-notable {
  border-left: 3px solid var(--orb-ap);
}
.chron.toast-dramatic {
  border-left: 3px solid var(--rs-red);
}
.chron.toast-era {
  border-left: 3px solid var(--orb-gold);
}
@keyframes chronSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chron-new {
  animation: chronSlideIn .35s ease;
}
@media (prefers-reduced-motion: reduce) {
  .chron-new {
    animation: none;
  }
}

/* src/client/styles/polish.css */
#loading-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 14, 8, 0.9);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
#loading-screen.visible {
  opacity: 1;
}
#loading-screen.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.loading-card {
  text-align: center;
  padding: 22px 32px;
  background: var(--parchment);
  color: var(--parchment-ink);
  border: 3px solid;
  border-color: #f6ecd2 #8a7048 #8a7048 #f6ecd2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
}
.loading-title {
  font: 24px/1.2 var(--font-head);
  letter-spacing: 0.2em;
  color: #7a2a12;
  margin-bottom: 8px;
}
.loading-era {
  font: 16px var(--font-head);
  color: var(--parchment-ink);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #8a7048;
  border-top-color: var(--rs-red);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }
}
.loading-text {
  font-size: 14px;
}
.ew-bubble {
  pointer-events: none;
  z-index: 30;
}
.npc-panel {
  position: fixed;
  z-index: 45;
  width: 200px;
  background: var(--stone-700);
  border: 2px solid;
  border-color: var(--stone-300) var(--stone-900) var(--stone-900) var(--stone-300);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .55);
  padding: 8px 10px;
  color: var(--stone-ink);
  font: 16px/1.25 var(--font-body);
  animation: npc-panel-in 0.12s ease-out;
}
.npc-panel.hide {
  display: none !important;
}
@keyframes npc-panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.npc-panel-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.npc-panel-name {
  font: 20px/1.1 var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
}
.npc-panel-role {
  font-size: 14px;
  color: var(--stone-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.npc-panel-nation {
  font-size: 14px;
  color: var(--orb-gold);
  margin-bottom: 6px;
}
.npc-panel-doing {
  font-size: 14px;
  color: var(--stone-ink);
  font-style: italic;
  margin-bottom: 6px;
}
.npc-panel-quick {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.npc-panel-quick button {
  flex: 1 1 0;
  padding: 4px 2px;
  font-size: 14px;
}
.npc-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}
.npc-panel-actions button {
  width: 100%;
  text-align: left;
  padding: 5px 10px;
}
.npc-panel-more {
  width: 100%;
  padding: 4px;
  font-size: 14px;
  color: var(--stone-dim);
  background: var(--stone-900);
  border-style: dashed;
  border-color: var(--stone-500);
}
.npc-panel-more:hover {
  color: var(--rs-yellow);
}
.npc-panel-flash {
  animation: npc-panel-flash 0.35s ease-out;
}
@keyframes npc-panel-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 0, 0.7);
  }
  100% {
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .55);
  }
}
@media (prefers-reduced-motion: reduce) {
  .npc-panel,
  .npc-panel-flash {
    animation: none;
  }
}

/* src/client/styles/spectator.css */
.npc-panel.npc-sheet {
  width: 320px;
  max-width: calc(100vw - 12px);
  padding: 10px 12px 10px;
}
.npc-panel-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 2px;
  border: 1px solid #000;
}
.npc-panel-crown {
  color: var(--orb-gold);
  font-size: 14px;
}
.npc-panel-mood {
  font-size: 14px;
  color: var(--stone-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.npc-panel-said {
  color: var(--stone-ink);
  margin: 4px 0 6px;
  padding: 4px 8px;
  border-left: 3px solid var(--rs-cyan);
  background: var(--stone-900);
}
.npc-panel-said em {
  color: var(--stone-dim);
  font-style: normal;
  font-size: 14px;
}
.npc-panel-standing {
  font-size: 14px;
  color: var(--orb-gold);
  margin-bottom: 6px;
}
.npc-panel-needs {
  display: flex;
  gap: 6px;
  margin: 2px 0 8px;
}
.npc-need {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--stone-dim);
}
.npc-need i {
  font-style: normal;
  text-transform: uppercase;
}
.npc-need-track {
  flex: 1 1 0;
  height: 5px;
  overflow: hidden;
  background: var(--stone-900);
  border: 1px solid var(--stone-500);
}
.npc-need-track b {
  display: block;
  height: 5px;
  background: var(--rs-green);
}
.npc-panel-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.npc-panel-primary button {
  flex: 1 1 30%;
  min-height: 44px;
  min-width: 60px;
  font: 16px var(--font-head);
  color: var(--stone-ink);
  text-shadow: var(--shadow-ink);
}
.npc-panel-primary button:hover,
.npc-panel-primary button.on {
  color: var(--rs-yellow);
  background: var(--stone-500);
}
.npc-panel-whisper {
  display: flex;
  gap: 4px;
  margin: 6px 0;
}
.npc-panel-whisper-text {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  font-size: 14px;
}
.npc-panel-whisper-send {
  font-size: 14px;
  padding: 4px 10px;
}
.npc-panel-attack {
  color: var(--rs-red);
}
@media (max-width: 640px) {
  .npc-panel.npc-sheet {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    padding-bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
    max-height: 70vh;
    overflow-y: auto;
  }
}
.storylines {
  display: block;
  pointer-events: none;
}
.storylines.hide {
  display: none !important;
}
.sl-card {
  pointer-events: auto;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  color: var(--stone-ink);
  text-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.sl-card:hover .sl-name,
.sl-card.on .sl-name {
  color: var(--rs-yellow);
}
.sl-name {
  color: var(--rs-cyan);
}
.sl-role {
  color: var(--stone-dim);
  font-size: 12px;
}
.sl-line {
  color: var(--stone-ink);
}
.storyline-feed {
  position: fixed;
  left: 8px;
  bottom: calc(var(--chat-h) + 8px);
  width: min(320px, 92vw);
  max-height: 46vh;
  overflow-y: auto;
  z-index: 32;
  background: var(--stone-700);
  border: 2px solid;
  border-color: var(--stone-300) var(--stone-900) var(--stone-900) var(--stone-300);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}
.storyline-feed.hide {
  display: none !important;
}
.sl-feed-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-bottom: 2px solid var(--stone-500);
  background: var(--stone-900);
  position: sticky;
  top: 0;
}
.sl-feed-head b {
  flex: 1 1 auto;
  font: 16px var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
  font-weight: 400;
}
.sl-feed-head button {
  font-size: 14px;
  padding: 2px 8px;
}
.sl-feed-body {
  padding: 6px 10px 10px;
}
.sl-row {
  font-size: 14px;
  color: var(--stone-ink);
  padding: 4px 0;
  border-bottom: 1px solid var(--stone-500);
}
.sl-row i {
  font-style: normal;
  color: var(--stone-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sl-said i,
.sl-heard i {
  color: var(--rs-cyan);
}
.sl-empty {
  font-size: 14px;
  color: var(--stone-dim);
  font-style: italic;
}
@media (max-width: 899px) {
  .storyline-feed {
    left: 0;
    width: 100vw;
    bottom: calc(var(--tabbar-h) + 58px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .npc-panel.npc-sheet {
    animation: none;
  }
}

/* src/client/styles/chrome.css */
#orbs {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  pointer-events: none;
}
#orbs > * {
  pointer-events: auto;
}
.orb-row {
  display: flex;
  gap: 6px;
}
.orb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 60px;
}
.orb-ring {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--stone-900);
  border: 3px solid var(--stone-500);
  box-shadow:
    inset 0 0 0 2px var(--stone-900),
    inset 0 0 0 3px var(--stone-300),
    0 2px 5px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb-ring::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--p, 0) * 1%);
  background: var(--orb-c, var(--stone-500));
  opacity: .85;
  transition: height .3s;
}
.orb-hp .orb-ring {
  --orb-c: var(--orb-hp);
}
.orb-ap .orb-ring {
  --orb-c: var(--orb-ap);
}
.orb-gold .orb-ring {
  --orb-c: var(--orb-gold);
  --p: 100;
}
.orb-ap .orb-ring::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: conic-gradient(var(--rs-yellow) calc(var(--pr, 0) * 1%), transparent 0);
  -webkit-mask:
    radial-gradient(
      circle,
      transparent 66%,
      #000 68%);
  mask:
    radial-gradient(
      circle,
      transparent 66%,
      #000 68%);
}
.orb-num {
  position: relative;
  z-index: 1;
  font: 20px/1 var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
}
.orb-label {
  font-size: 12px;
  line-height: 12px;
  color: var(--stone-ink);
  text-shadow: var(--shadow-ink);
  white-space: nowrap;
}
.orb-plate {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 1px 8px;
  font-size: 14px;
}
.plate-lv b {
  font: 16px var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
}
#conn.live {
  color: var(--rs-green);
}
#conn.sync {
  color: var(--rs-yellow);
}
#conn.offline {
  color: var(--rs-red);
}
.quest-chip {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 10px;
  font-size: 14px;
  text-align: left;
  background: var(--parchment);
  color: var(--parchment-ink);
  border-color: #f6ecd2 #8a7048 #8a7048 #f6ecd2;
}
.quest-chip:hover {
  color: #7a2a12;
}
#tooltip {
  position: fixed;
  top: 10px;
  left: 200px;
  z-index: 22;
  max-width: 200px;
  padding: 2px 7px;
  font-size: 16px;
  color: #fff;
  text-shadow: var(--shadow-ink);
  background: rgba(0, 0, 0, .55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
#tooltip .tt-tgt {
  color: var(--rs-yellow);
}
#tooltip .tt-role {
  color: var(--stone-dim);
}
#minimap-wrap {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--side-w);
  height: var(--mm-h);
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stone-700);
  border-left: 2px solid var(--stone-300);
  box-shadow: inset 0 -2px 0 var(--stone-900);
}
.mm-frame {
  position: relative;
  width: 152px;
  height: 152px;
  border-radius: 50%;
}
#minimap-host {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: #1b4a7f;
  box-shadow: inset 0 0 0 2px var(--stone-900);
}
#minimap-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.compass {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  background: var(--stone-900);
  border: 2px solid var(--stone-300);
  color: var(--stone-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.compass svg {
  width: 26px;
  height: 26px;
}
.compass span {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font: 12px/12px var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
}
#era-plate {
  position: fixed;
  top: var(--mm-h);
  right: 0;
  width: var(--side-w);
  height: var(--era-h);
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 4px;
  border-radius: 0;
  font: 15px/1 var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
  white-space: nowrap;
  overflow: hidden;
}
#era-plate .macro {
  display: none;
}
#panel {
  position: fixed;
  top: calc(var(--mm-h) + var(--era-h));
  right: 0;
  bottom: 0;
  width: var(--side-w);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--stone-700);
  border-left: 2px solid var(--stone-300);
  box-shadow: inset 0 2px 0 var(--stone-900);
}
#panel-head {
  display: flex;
  flex-wrap: nowrap;
  background: var(--stone-900);
  border-bottom: 2px solid var(--stone-500);
  flex: 0 0 auto;
}
#panel-head .tab {
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  padding: 0;
  border-radius: 0;
  border: 2px solid;
  border-color: var(--stone-500) var(--stone-900) var(--stone-900) var(--stone-500);
  background: var(--stone-700);
  color: var(--stone-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
#panel-head .tab:hover {
  color: var(--rs-yellow);
}
#panel-head .tab.on {
  background: var(--stone-500);
  color: var(--rs-yellow);
  box-shadow: inset 0 3px 0 var(--orb-hp);
}
.ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.subtabs {
  display: flex;
  gap: 2px;
  padding: 4px 6px 0;
  flex: 0 0 auto;
}
.subtabs .tab {
  padding: 0 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--stone-dim);
  background: var(--stone-900);
  border-width: 1px;
}
.subtabs .tab.on {
  color: var(--rs-yellow);
}
.sheet-bar {
  display: none;
}
#panel .pane {
  min-height: 0;
}
.inv-vitals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.inv-summary {
  font-size: 14px;
  color: var(--stone-dim);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.inv-slot {
  position: relative;
  min-height: 46px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--stone-900);
  border: 2px solid;
  border-color: var(--stone-900) var(--stone-500) var(--stone-500) var(--stone-900);
}
.inv-slot.has {
  cursor: pointer;
}
.inv-slot.has:hover {
  background: #3a2b1b;
}
.inv-slot .qty {
  position: absolute;
  top: 0;
  left: 3px;
  font-size: 14px;
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
}
.inv-slot .icon {
  font-size: 22px;
  line-height: 1;
}
.inv-slot .name {
  font-size: 12px;
  line-height: 12px;
  color: var(--stone-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-row {
  border-bottom: 1px solid var(--stone-500);
  padding: 8px 0;
}
.set-label {
  display: block;
  font: 16px var(--font-head);
  color: var(--rs-yellow);
  text-shadow: var(--shadow-ink);
  margin-bottom: 4px;
}
.set-opts {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.set-opts button.on {
  color: var(--rs-yellow);
  background: var(--stone-500);
}
.credits {
  line-height: 1.3;
}
#leave-world {
  color: var(--rs-red);
}
#chatbox {
  position: fixed;
  left: 0;
  bottom: 0;
  width: var(--chat-w);
  max-width: 100vw;
  height: var(--chat-h);
  z-index: 25;
  display: flex;
  flex-direction: column;
}
.chat-tabs {
  display: flex;
  gap: 2px;
  padding: 2px 4px 0;
  background: var(--stone-900);
  border-bottom: 1px solid var(--stone-500);
  flex: 0 0 auto;
}
.chat-tab {
  padding: 0 8px;
  font-size: 14px;
  line-height: 18px;
  color: var(--stone-dim);
  border-width: 1px;
}
.chat-tab.on {
  color: var(--rs-yellow);
  background: var(--stone-500);
}
.chat-expand {
  display: none;
  margin-left: auto;
}
.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--stone-500) var(--stone-900);
}
.chat-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--stone-ink);
}
.chat-name {
  color: var(--rs-cyan);
  cursor: pointer;
}
.chat-name:hover {
  color: var(--rs-yellow);
}
.chat-talk {
  color: var(--stone-ink);
}
.chat-trade {
  color: var(--orb-gold);
}
.chat-sys {
  color: var(--rs-yellow);
}
.chat-err {
  color: var(--rs-red);
}
.chat-input {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 6px;
  border-top: 1px solid var(--stone-500);
  background: var(--stone-900);
  flex: 0 0 auto;
}
.chat-me {
  color: var(--rs-cyan);
}
#chat-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 2px 0;
}
#chat-input::placeholder {
  color: var(--stone-dim);
}
#chatbox[data-filter=talk] #ticker .chat-line:not(.chat-talk) {
  display: none;
}
#chatbox[data-filter=events] #ticker .chat-line:not(.chat-event):not(.chat-err):not(.chat-sys) {
  display: none;
}
#chatbox[data-filter=events] #storylines,
#chatbox[data-filter=trade] #storylines {
  display: none;
}
#chatbox[data-filter=trade] #ticker .chat-line:not(.chat-trade) {
  display: none;
}
#hint-bar {
  left: calc(var(--chat-w) / 2);
  transform: translateX(-50%);
  bottom: calc(var(--chat-h) + 10px);
  max-width: calc(var(--chat-w) - 16px);
}
#ghost {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}
#toasts {
  left: 0;
  right: var(--side-w);
  bottom: calc(var(--chat-h) + 56px);
  width: min(92vw, 440px);
}
#menu {
  position: fixed;
  z-index: 40;
  min-width: 170px;
  max-width: 280px;
  background: var(--stone-900);
  border: 1px solid var(--stone-300);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .6);
  padding: 0 0 2px;
}
#menu .mtitle {
  padding: 2px 8px;
  font: 16px/20px var(--font-head);
  color: var(--rs-cyan);
  background: #3d2f1f;
  border-bottom: 1px solid var(--stone-500);
}
#menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 1px 8px;
  line-height: 20px;
  color: #fff;
  text-shadow: var(--shadow-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#menu button:hover,
#menu button:focus {
  color: var(--rs-yellow);
  background: rgba(255, 255, 255, .06);
  outline: none;
}
#menu button .tgt {
  color: var(--rs-yellow);
}
#menu button .tgt.obj {
  color: var(--rs-cyan);
}
#menu button .cost {
  float: right;
  color: var(--orb-gold);
  font-size: 14px;
}
#menu button.danger {
  color: var(--rs-red);
}
#menu button.cancel {
  color: var(--stone-dim);
}
#menu button:disabled {
  color: var(--stone-dim);
}
#tabbar {
  display: none;
}
@media (min-width: 900px) {
  #panel.hide {
    display: flex !important;
  }
}
@media (max-width: 899px) {
  #orbs {
    top: 6px;
    left: 6px;
    gap: 3px;
  }
  .orb-row {
    flex-direction: column;
    gap: 3px;
  }
  .orb {
    width: 48px;
  }
  .orb-ring {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }
  .orb-num {
    font-size: 16px;
  }
  .orb-label {
    font-size: 12px;
  }
  .orb-plate {
    padding: 1px 6px;
    font-size: 12px;
    gap: 6px;
  }
  .plate-lv b {
    font-size: 14px;
  }
  .quest-chip {
    max-width: calc(100vw - 170px);
    font-size: 12px;
  }
  #tooltip {
    display: none !important;
  }
  #minimap-wrap {
    top: 6px;
    right: 6px;
    width: 100px;
    height: 100px;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .mm-frame {
    width: 100px;
    height: 100px;
  }
  #minimap-host {
    top: 5px;
    left: 5px;
    width: 84px;
    height: 84px;
  }
  .compass {
    width: 26px;
    height: 26px;
    top: -3px;
    left: -3px;
  }
  .compass svg {
    width: 20px;
    height: 20px;
  }
  .compass span {
    font-size: 10px;
    line-height: 10px;
  }
  #era-plate {
    top: 110px;
    right: 6px;
    width: 150px;
    height: auto;
    min-height: 24px;
    font-size: 12px;
    line-height: 14px;
    white-space: normal;
    text-align: center;
    padding: 2px 6px;
  }
  #era-plate .macro {
    display: none;
  }
  #tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 31;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--stone-700);
    border-top: 2px solid var(--stone-300);
  }
  #tabbar button {
    flex: 1 1 0;
    min-width: 44px;
    min-height: 44px;
    height: var(--tabbar-h);
    padding: 0;
    border-radius: 0;
    border-width: 0 1px 0 0;
    border-color: var(--stone-900);
    background: var(--stone-700);
    color: var(--stone-dim);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #tabbar button.on {
    color: var(--rs-yellow);
    box-shadow: inset 0 3px 0 var(--orb-hp);
  }
  #tabbar .ico {
    width: 24px;
    height: 24px;
  }
  #panel {
    top: env(safe-area-inset-top);
    left: 0;
    right: 0;
    width: auto;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 2px solid var(--stone-300);
    animation: sheet-in .12s ease-out;
  }
  .sheet-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--stone-900);
    border-bottom: 2px solid var(--stone-500);
    flex: 0 0 auto;
  }
  .sheet-title {
    flex: 1;
    font: 20px var(--font-head);
    color: var(--rs-yellow);
    text-shadow: var(--shadow-ink);
  }
  #panel-close {
    width: 44px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
    padding: 0;
  }
  #panel-head {
    display: none;
  }
  #chatbox {
    left: 0;
    right: 0;
    width: auto;
    height: 58px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    transition: height .12s ease-out;
  }
  #chatbox.expanded {
    height: 45vh;
  }
  .chat-tabs {
    padding: 0 4px;
  }
  .chat-tab {
    font-size: 12px;
    line-height: 16px;
    padding: 0 6px;
  }
  .chat-expand {
    display: inline-block;
    font-size: 10px;
    line-height: 16px;
    padding: 0 10px;
    border-width: 1px;
  }
  #chatbox.expanded .chat-expand {
    transform: rotate(180deg);
  }
  .chat-log {
    font-size: 14px;
    line-height: 17px;
  }
  .chat-input {
    display: none;
  }
  #chatbox.expanded .chat-input {
    display: flex;
  }
  #hint-bar {
    left: 50%;
    transform: translateX(-50%);
    max-width: 92vw;
    font-size: 14px;
    bottom: calc(var(--tabbar-h) + 68px + env(safe-area-inset-bottom));
  }
  #ghost {
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    bottom: calc(var(--tabbar-h) + 108px + env(safe-area-inset-bottom));
  }
  #toasts {
    left: 0;
    right: 0;
    width: min(92vw, 440px);
    bottom: calc(var(--tabbar-h) + 176px + env(safe-area-inset-bottom));
  }
  #talk-overlay-mount,
  #petition-overlay-mount {
    width: 100vw;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }
  #menu {
    min-width: 200px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  #menu button {
    line-height: 32px;
  }
  #panel:not(.hide) ~ #hint-bar,
  #panel:not(.hide) ~ #ghost {
    display: none;
  }
}
#menu:not(.hide) ~ #hint-bar {
  display: none;
}
@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: .6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  #panel {
    animation: none;
  }
  #chatbox {
    transition: none;
  }
  .orb-ring::before {
    transition: none;
  }
}
