/* packages/client/static/dialogue.css */
.npc-dialogue {
  position: absolute;
  left: 8px;
  right: 312px;
  bottom: 84px;
  z-index: 20;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 20px 14px 16px;
  background:
    linear-gradient(
      135deg,
      rgba(38, 50, 53, .98),
      rgba(19, 29, 32, .98));
  border: 1px solid #84938a;
  border-top: 2px solid #b8a36c;
  box-shadow: 0 8px 24px #0009;
  border-radius: 3px;
  max-height: 48vh;
}
html[data-action-bar=top] .npc-dialogue {
  bottom: 8px;
}
.npc-portrait {
  height: 174px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  background:
    radial-gradient(
      ellipse at 50% 35%,
      #34474b,
      #162125 80%);
  border: 1px solid #65756d;
  box-shadow: inset 0 0 18px #0008;
  overflow: hidden;
}
.npc-portrait canvas {
  position: static;
  display: block;
  width: 120px;
  height: 156px;
  image-rendering: pixelated;
}
.npc-dialogue-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: auto;
  padding-right: 12px;
}
.npc-dialogue-body h2 {
  margin: 0;
  color: #e8c77c;
  font: 600 18px Georgia, serif;
  letter-spacing: .4px;
}
.npc-dialogue-body p {
  margin: 0;
  color: #ece9dd;
  font: 15px/1.4 system-ui;
}
.npc-replies {
  display: grid;
  gap: 5px;
}
.npc-replies button {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  color: #d6e4e0;
  background: #202e32;
  border: 1px solid #435354;
  border-radius: 2px;
  font: 13px system-ui;
  cursor: pointer;
}
.npc-replies button:hover,
.npc-replies button:focus-visible {
  border-color: #d1b67c;
  background: #34464b;
}
.npc-dialogue-close {
  position: absolute;
  right: 9px;
  top: 6px;
  padding: 0;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #bdc8c1;
  font: 22px/1 system-ui;
}

/* packages/client/static/viewport-ui.css */
#hover-readout {
  position: absolute;
  top: 8px;
  left: 8px;
  background: transparent;
  border: 0;
  padding: 4px 7px;
  border-radius: 0;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 13px;
  line-height: normal;
  letter-spacing: 0.15px;
  pointer-events: none;
  color: var(--workspace-cyan, #83d4d1);
  min-width: 120px;
  text-shadow: 0 1px 2px #000;
}
#hover-readout:empty {
  display: none;
}
#ctx-menu {
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-size: 14px;
  line-height: normal;
  position: fixed;
  background: var(--panel-grad, linear-gradient(180deg, #202a2f 0%, #151d21 100%));
  border: 1px solid var(--panel-border, #3d494d);
  border-radius: 6px;
  min-width: 150px;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
#ctx-menu.show {
  display: block;
}
#ctx-menu .ctx-title {
  padding: 5px 10px;
  color: var(--accent, #b59a66);
  border-bottom: 1px solid var(--panel-border, #3d494d);
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.08),
      transparent);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#ctx-menu .ctx-item {
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text, #e5e5dc);
}
#ctx-menu .ctx-item:hover {
  background: #2c2c3a;
}
#ctx-menu .ctx-item.kind-interact:hover {
  background: rgba(63, 214, 224, 0.22);
  color: #9aeef2;
}
#ctx-menu .ctx-item.tone-pickup {
  color: #e9c57a;
}
#ctx-menu .ctx-item.tone-pickup:hover {
  background: rgba(224, 170, 69, 0.2);
  color: #ffe0a1;
}
#ctx-menu .ctx-item.tone-attack {
  color: #ee8b85;
}
#ctx-menu .ctx-item.tone-attack:hover {
  background: rgba(224, 105, 105, 0.2);
  color: #ffaaa2;
}
#ctx-menu .ctx-item.kind-examine {
  color: #9fb7c9;
}
#ctx-menu .ctx-item.kind-examine:hover {
  background: rgba(143, 180, 205, 0.14);
  color: #c4d9e8;
}
#ctx-menu .ctx-item.disabled {
  color: var(--dim, #9aa5a5);
  cursor: default;
}
#ctx-menu .ctx-item.disabled:hover {
  background: transparent;
}
#ctx-menu .ctx-item .ctx-tag {
  font-weight: 600;
  white-space: pre;
}
#ctx-menu .ctx-item .ctx-tag.danger {
  color: var(--bad, #e06969);
}
#ctx-menu .ctx-item .ctx-tag.warn {
  color: var(--accent, #b59a66);
}
#ctx-menu .ctx-item .ctx-tag.safe {
  color: #7ad17a;
}
.rating-plate {
  padding: 7px 10px 8px;
  border-bottom: 1px solid var(--panel-border, #3d494d);
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.10),
      rgba(224, 170, 69, 0.015) 70%,
      transparent);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.rating-plate-main {
  display: flex;
  align-items: baseline;
  gap: 11px;
}
.rating-elo {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f2dda9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}
.rating-ladder {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8fb6c9;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
.rating-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.25;
  color: #a7b1b3;
}
.rating-plate.state-provisional .rating-elo {
  color: #bfae86;
}
.rating-plate.state-provisional .rating-note {
  font-style: italic;
}
.rating-plate.state-loading .rating-elo,
.rating-plate.state-loading .rating-note {
  color: #6d7a7e;
}

/* packages/client/static/style.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}
:root {
  --bg: #0b0b0f;
  --panel: #17171e;
  --panel-2: #1f1f29;
  --panel-3: #262633;
  --panel-border: #2c2c38;
  --panel-border-bright: #3a3a4a;
  --text: #eaeaf0;
  --dim: #9a9aa8;
  --accent: #e0aa45;
  --accent-bright: #f0c064;
  --good: #6cc66c;
  --bad: #e06969;
  --panel-grad:
    linear-gradient(
      180deg,
      #1d1d27,
      #16161d);
  --cell-grad:
    linear-gradient(
      180deg,
      #2b2b37,
      #23232d);
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  font-size: 14px;
  overflow: hidden;
}
#app {
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}
#records-panel {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}
#records-panel[open] {
  display: flex;
  flex-direction: column;
}
.records-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
}
#records-panel iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
}
#app * {
  -webkit-user-drag: none;
}
#app input,
#app textarea,
#app select,
#app [contenteditable=true],
#app [contenteditable=plaintext-only] {
  user-select: text;
  -webkit-user-select: text;
}
button,
input,
select {
  font: inherit;
  color: inherit;
  background: #26262f;
  border: 1px solid var(--panel-border-bright);
  border-radius: 4px;
  padding: 4px 10px;
}
button {
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
input:focus {
  outline: 1px solid var(--accent);
}
#lobby,
#auth {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  overflow: auto;
}
#lobby h1,
#auth h1 {
  font-size: 24px;
  letter-spacing: 6px;
  color: var(--accent);
  text-align: center;
}
#lobby .lobby-card,
#auth .lobby-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  max-width: min(760px, 100%);
}
#lobby .lobby-col,
#auth .lobby-col {
  flex: 1 1 280px;
  min-width: 250px;
  max-width: 390px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#lobby .lobby-col + .lobby-col,
#auth .lobby-col + .lobby-col {
  border-left: 1px solid var(--panel-border);
}
@media (max-width: 640px) {
  #lobby .lobby-col + .lobby-col,
  #auth .lobby-col + .lobby-col {
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }
}
#lobby .lobby-col h3,
#auth .lobby-col h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--dim);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
  margin-bottom: 2px;
}
#lobby .row,
#auth .row {
  display: flex;
  gap: 8px;
  align-items: center;
}
#lobby .field-grid,
#auth .field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#lobby .full,
#auth .full {
  width: 100%;
}
#auth .auth-foot {
  margin-top: -6px;
}
#auth .auth-foot a {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 1px;
}
#auth .auth-foot a:hover {
  color: var(--accent);
}
#lobby .error,
#auth .error {
  color: var(--bad);
  min-height: 1em;
  font-size: 12px;
}
#lobby .party-list {
  list-style: none;
}
#lobby .party-list li {
  padding: 2px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 2px;
  flex: none;
}
#lobby .room-code {
  font-size: 22px;
  letter-spacing: 6px;
  color: var(--accent);
  text-align: center;
}
#lobby .room-floor {
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  margin-top: 2px;
  letter-spacing: 1px;
  min-height: 1em;
}
#lobby .seed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 2px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--panel);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--dim);
  vertical-align: middle;
}
#lobby .copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
#lobby .copy-btn:hover {
  filter: brightness(1.3);
}
#lobby .hint,
#auth .hint {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}
#auth {
  position: relative;
  isolation: isolate;
  display: block;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #101016;
}
#auth .auth-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#auth .auth-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  background: rgba(23, 23, 30, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.38);
}
#auth h1 {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
}
#auth .boards {
  padding: 4px 12px;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  background: #211d16;
  border: 1px solid #6b5730;
  border-radius: 3px;
}
#auth .boards:hover {
  background: #2c2519;
  color: #ffdf9f;
  border-color: var(--accent);
}
#auth .auth-panel {
  position: absolute;
  z-index: 3;
  left: 20px;
  bottom: 24px;
  width: 356px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 96px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(23, 23, 30, 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
#auth.is-create .auth-panel {
  width: min(720px, calc(100% - 40px));
}
#auth .auth-create-cols {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
#auth .auth-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
}
#auth .auth-pane h3 {
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--panel-border);
}
#auth .full {
  width: 100%;
}
#auth .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#auth .field input,
#auth .field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 10px;
  background: #111217;
  border-color: var(--panel-border-bright);
}
#auth .field input:focus,
#auth .field select:focus {
  outline: 1px solid var(--accent);
}
#auth .auth-pane > .full {
  min-height: 34px;
  margin-top: 6px;
  color: #17130c;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--accent);
  border: 1px solid #8f6a25;
  border-radius: 3px;
}
#auth .auth-pane > .full:hover:not(:disabled) {
  background: var(--accent-bright);
}
#auth .toggle {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--accent);
  font-size: 12px;
  text-align: left;
}
#auth .toggle:focus-visible,
#auth .boards:focus-visible,
#auth .cyc:focus-visible,
#auth .colpick:focus-visible,
#auth .pick:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}
#auth .linkish {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  text-decoration: underline;
}
#auth .section-lb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--dim);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
  margin-top: 6px;
}
#auth .look-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#auth .look {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#auth .look-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
#auth .look-lb {
  width: 44px;
  flex: none;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
}
#auth .cycler {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
}
#auth .cyc {
  width: 26px;
  height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 15px;
}
#auth .cyc-name {
  width: 92px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#auth .colpick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  min-width: 128px;
  font-size: 12px;
}
#auth .col-strips {
  display: inline-flex;
  flex: none;
}
#auth .col-strips i {
  width: 5px;
  height: 15px;
  border: 1px solid #000;
}
#auth .col-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#auth .colpick .plus {
  color: var(--dim);
  font-size: 13px;
  flex: none;
}
#auth .look-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #101014;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
}
#auth .pick-lb {
  font-size: 11px;
}
#auth .pick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
#auth .pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px 6px;
  border: 1px solid var(--panel-border-bright);
  background: none;
  cursor: pointer;
}
#auth .pick .sw {
  display: flex;
}
#auth .pick .sw i {
  width: 7px;
  height: 17px;
  border: 1px solid #000;
}
#auth .pick .nm {
  font-size: 9px;
  color: var(--text);
  white-space: nowrap;
}
#auth .pick:hover {
  border-color: var(--accent);
}
#auth .pick.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
#auth .pick-canon .nm {
  color: var(--dim);
}
#auth .preview-note {
  min-height: 1em;
}
#auth .preview-retry {
  display: block;
  margin-top: 8px;
  color: var(--accent-bright);
  background: #252119;
  border-color: #655437;
}
@media (max-width: 760px) {
  #auth .auth-panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
  #auth .auth-create-cols {
    flex-direction: column;
    gap: 14px;
  }
}
@media (max-width: 420px) {
  #auth .auth-bar {
    top: 10px;
    left: 10px;
    gap: 10px;
    padding: 5px 8px;
  }
  #auth h1 {
    font-size: 10px;
    letter-spacing: 2px;
  }
  #auth .look-line {
    gap: 6px;
  }
  #auth .cyc-name {
    width: 74px;
  }
  #auth .colpick {
    min-width: 98px;
    padding: 0 5px;
    gap: 4px;
  }
}
#lobby .divider {
  height: 1px;
  background: var(--panel-border);
}
#game {
  position: relative;
  width: 100%;
  height: 100%;
}
#game > canvas,
#hub > canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: calc(100% - 304px);
  height: calc(100% - 82px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
#hub {
  position: relative;
  width: 100%;
  height: 100%;
}
#hub-top {
  position: absolute;
  top: 8px;
  left: calc((100% - 304px) / 2);
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  background:
    linear-gradient(
      180deg,
      rgba(29, 29, 39, 0.92),
      rgba(13, 13, 18, 0.9));
  border: 1px solid rgba(74, 70, 82, 0.72);
  border-radius: 3px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}
#hub-top .row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  pointer-events: auto;
}
#hub-top h1 {
  order: -2;
  display: block;
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 3px;
  white-space: nowrap;
}
#hub-count {
  order: -1;
  display: inline;
  padding-left: 10px;
  border-left: 1px solid var(--panel-border-bright);
  white-space: nowrap;
}
#hub-account {
  display: none;
}
#hub-party {
  color: var(--accent);
  white-space: nowrap;
}
#hub-top .linkish {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
#hub .hint {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}
#hub #hover-readout {
  top: 8px;
}
#hub #chat-panel {
  bottom: 8px;
}
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}
.invite-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.invite-name {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hub #race-challenge .game-modal {
  width: min(760px, 100%);
}
.race-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--dim);
  font-size: 12px;
}
.race-clock {
  margin-left: auto;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.race-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.05),
      transparent);
}
.race-term {
  display: flex;
  gap: 6px;
  font-size: 12px;
}
.race-term-k {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}
.race-term-v {
  color: var(--text);
}
.race-term-v.rated {
  color: var(--accent-bright);
}
.race-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.race-side {
  border: 1px solid var(--panel-border);
  padding: 8px 10px;
}
.race-side.mine {
  border-left: 2px solid var(--accent);
}
.race-side-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.race-side-agg {
  margin-left: auto;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.race-row {
  display: grid;
  grid-template-columns: 14px minmax(48px, 1fr) 40px 34px 74px 16px;
  gap: 6px;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(92, 106, 106, 0.14);
}
.race-row:last-of-type {
  border-bottom: 0;
}
.race-row.me .race-name {
  color: var(--accent-bright);
}
.race-crown {
  color: var(--accent-bright);
  text-align: center;
  text-shadow: 0 1px 0 #0b0e0f;
}
.race-crown.off {
  color: transparent;
}
.race-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-elo,
.race-rd,
.race-tick {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.race-rd {
  color: var(--dim);
}
.race-row.prov .race-elo {
  color: var(--dim);
}
.race-stake {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.race-win {
  color: var(--good);
}
.race-loss {
  color: var(--bad);
}
.race-tick {
  color: var(--dim);
}
.race-tick.yes {
  color: var(--good);
}
.race-side-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--panel-border);
  color: var(--dim);
  font-size: 11px;
}
.race-side-foot.full {
  color: var(--good);
}
.race-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.race-confirm {
  flex: 1;
  color: var(--bad);
  font-size: 12px;
}
#party-panel .keyrace {
  margin-top: 6px;
  padding: 6px 10px 8px;
  border-top: 1px solid var(--panel-border);
}
#party-panel .keyrace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}
#party-panel .keyrace-label {
  flex: 1;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-weight: 600;
  letter-spacing: 0.15px;
}
#party-panel .keyrace-clock {
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#party-panel .keyrace-clock.low {
  color: var(--bad);
}
#party-panel .keyrace-clock.done {
  color: var(--good);
}
#party-panel .keyrace-side {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
  color: var(--dim);
}
#party-panel .keyrace-dot {
  width: 7px;
  height: 7px;
  border: 1px solid #536064;
  background: #182126;
}
#party-panel .keyrace-dot.in {
  border-color: #6cc66c;
  background: #6cc66c;
}
#party-panel .keyrace-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#party-panel .keyrace-hint {
  color: var(--accent);
  font-size: 10px;
}
#party-panel .keyrace-challenge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--dim);
}
#party-panel .keyrace-challenge .linkish {
  font-size: 11px;
}
#hub .game-modal-backdrop {
  z-index: 60;
}
#hub .game-modal {
  width: min(480px, 100%);
}
.modal-copy {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.modal-hint {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-section-title {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--dim);
  font-size: 12px;
}
.modal-field select {
  width: 100%;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.modal-actions .modal-primary:first-child {
  margin-right: auto;
}
.modal-primary {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.modal-secondary {
  border-color: transparent;
  background: transparent;
  color: var(--dim);
}
.modal-secondary:hover:not(:disabled) {
  border-color: var(--panel-border-bright);
  color: var(--text);
}
.bull-dialogue {
  max-width: 44ch;
}
.bull-editor {
  gap: 14px;
}
#hub #bull-dialog:has(.bull-editor) .game-modal,
#hub #loadout-dialog .game-modal {
  width: min(780px, 100%);
}
.loadout-build {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px;
  gap: 14px;
  align-items: start;
}
.loadout-gear {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.loadout-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid #53605b;
  background:
    linear-gradient(
      145deg,
      #28342d,
      #17201d);
  box-shadow: inset 0 1px #ffffff0c;
}
.loadout-item[data-slot=weapon] {
  grid-column: 1 / -1;
}
.loadout-item[data-slot=weapon] .loadout-item-preview {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.loadout-item[data-slot=weapon] .loadout-item-icon {
  width: 64px;
  height: 64px;
}
.loadout-item .modal-field > span {
  color: #c3b280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.loadout-item select {
  font-size: 12px;
  padding: 5px;
}
.loadout-item-preview {
  padding-top: 8px;
}
.loadout-item-icon {
  display: block;
  margin: 0 auto 6px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
.loadout-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #79877a;
  font: italic 12px Georgia, serif;
}
.loadout-summary {
  position: sticky;
  top: 0;
  padding: 10px;
  border: 1px solid #87774e;
  background: linear-gradient(#2d352b, #1b211b);
  box-shadow: inset 0 0 0 2px #121a1299;
}
.loadout-summary > strong {
  color: #d9c082;
  font: 600 14px Georgia, serif;
}
.bull-editor > .modal-actions {
  position: sticky;
  bottom: -16px;
  padding: 10px 0;
  background: #1b2426;
  border-top: 1px solid #566155;
  z-index: 1;
}
.loadout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
@media (max-width: 900px) {
  #hub #bull-dialog {
    inset: 0 0 82px;
    padding: 12px;
  }
}
@media (max-width: 560px) {
  .loadout-grid {
    grid-template-columns: 1fr;
  }
  .loadout-build {
    grid-template-columns: 1fr;
  }
  .loadout-summary {
    grid-row: 1;
    position: static;
  }
  .loadout-gear {
    grid-template-columns: 1fr;
  }
}
.panel {
  position: absolute;
  background: var(--panel-grad);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 12px;
  max-height: 38%;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 7px;
  border-bottom: 1px solid var(--panel-border);
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.08),
      rgba(224, 170, 69, 0.02));
}
.panel-head h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(224, 170, 69, 0.25);
}
.panel-badge {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 1px 8px;
}
.panel-badge:empty {
  display: none;
}
.panel-body {
  padding: 8px 10px;
  overflow-y: auto;
}
#equipment-panel .panel-body {
  padding: 6px 8px;
}
#equipment-panel .panel-head {
  padding: 6px 10px 5px;
}
.panel-body::-webkit-scrollbar,
#chat-log::-webkit-scrollbar,
#lobby::-webkit-scrollbar {
  width: 8px;
}
.panel-body::-webkit-scrollbar-thumb,
#chat-log::-webkit-scrollbar-thumb,
#lobby::-webkit-scrollbar-thumb {
  background: #33333f;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.panel-body::-webkit-scrollbar-thumb:hover,
#chat-log::-webkit-scrollbar-thumb:hover {
  background: #45454f;
  background-clip: padding-box;
}
.panel-body::-webkit-scrollbar-track,
#chat-log::-webkit-scrollbar-track,
#lobby::-webkit-scrollbar-track {
  background: transparent;
}
#top-right {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 304px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  background:
    linear-gradient(
      90deg,
      #111118,
      #0b0b10);
  border-left: 1px solid #30303a;
  z-index: 8;
}
#top-right .panel {
  position: relative;
  max-height: none;
  width: 100%;
  flex: none;
}
#party-panel {
  min-width: 190px;
}
#party-panel .line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
#party-panel .line .name {
  flex: 1;
  font-weight: 600;
}
#party-panel .line .dot {
  font-size: 11px;
}
#equipment-panel {
  min-width: 190px;
}
.equip-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  grid-template-areas: ". helmet ." "weapon chest shield" "weapon legs shield" ". feet .";
  grid-auto-rows: 40px;
  gap: 4px 12px;
  padding: 4px;
  background:
    linear-gradient(#56605a55, #56605a55) center / 1px calc(100% - 16px) no-repeat,
    linear-gradient(
      90deg,
      transparent,
      #9e89654d,
      transparent) center 67px / 100% 1px no-repeat,
    radial-gradient(
      ellipse at 50% 45%,
      #a995621a,
      transparent 68%);
}
.equip-cell[data-slot=helmet] {
  grid-area: helmet;
}
.equip-cell[data-slot=shield] {
  grid-area: shield;
}
.equip-cell[data-slot=chest] {
  grid-area: chest;
}
.equip-cell[data-slot=weapon] {
  grid-area: weapon;
}
.equip-cell[data-slot=legs] {
  grid-area: legs;
}
.equip-cell[data-slot=feet] {
  grid-area: feet;
}
.equip-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 0;
  padding: 1px 3px;
  border: 1px solid #59635f;
  border-radius: 3px;
  background:
    linear-gradient(
      145deg,
      #2b3638,
      #182126);
  box-shadow:
    inset 0 1px 0 #e7e3c01a,
    inset 0 -3px 8px #0005,
    0 2px 4px #0005;
  user-select: none;
}
.equip-cell.empty {
  border-color: #354344;
  background:
    linear-gradient(
      145deg,
      #182225,
      #11191d);
  box-shadow: inset 0 2px 8px #0005, inset 0 0 0 2px #71817a08;
  cursor: default;
}
.equip-cell.filled {
  cursor: pointer;
  border-color: #8b7953;
}
.equip-cell.filled:hover,
.equip-cell.filled:focus-visible {
  outline: 1px solid var(--workspace-brass-hi);
  outline-offset: 1px;
  background:
    linear-gradient(
      145deg,
      #3c4033,
      #202b2c);
  box-shadow: inset 0 1px 0 #f6edca22, 0 0 12px #b59a6626;
}
.equip-cell .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  flex-shrink: 0;
  color: #61736e;
  image-rendering: pixelated;
}
.equip-cell .icon svg {
  width: 100%;
  height: 100%;
}
.equip-cell .eq-name {
  max-width: 100%;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 10px;
  line-height: 1.1;
  color: #e2dbc2;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.equip-armour .eq-name,
.equip-cell .eq-name:empty {
  display: none;
}
.equip-cell .eq-slot {
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #919e94;
}
.equip-cell.filled .eq-slot {
  color: #b7a77e;
}
.equip-hand {
  gap: 3px;
  padding: 5px 4px;
}
.equip-hand .icon {
  width: 36px;
  height: 36px;
}
.equip-hand.empty .icon {
  color: #718078;
}
#bottom-dock {
  position: absolute;
  left: 8px;
  right: 312px;
  bottom: 7px;
  height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
  z-index: 5;
  pointer-events: none;
}
#bottom-dock > * {
  min-width: 0;
  pointer-events: auto;
}
#combat-summary {
  grid-column: 1;
  grid-row: 1;
}
#floor-timer {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
.bottom-widget {
  align-self: stretch;
  padding: 5px 8px;
  border: 1px solid #4d5c60;
  background:
    linear-gradient(
      180deg,
      #1c262a,
      #10181b);
  box-shadow: inset 0 1px 0 rgba(220, 225, 211, 0.06);
  color: var(--text);
}
#combat-summary {
  width: min(100%, 280px);
}
.combat-heading,
.floor-timer-label {
  display: block;
  color: var(--workspace-brass-hi, var(--accent-bright));
  font:
    600 9px/12px ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.combat-hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
}
.combat-name {
  flex: 0 0 55px;
  overflow: hidden;
  color: #c8d2cf;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.combat-hp-track {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 13px;
  overflow: hidden;
  border: 1px solid #56605b;
  background: #330f14;
}
.combat-hp-fill {
  height: 100%;
  width: 0;
  background:
    linear-gradient(
      180deg,
      #81cc75,
      #3e8442);
  transition: width 0.12s linear;
}
#combat-summary .combat-hp-row.enemy .combat-hp-fill {
  background:
    linear-gradient(
      180deg,
      #db8975,
      #aa433e);
}
.combat-hp-value {
  position: absolute;
  inset: 0;
  color: #fff;
  font:
    9px/11px ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}
.combat-idle {
  display: block;
  color: #7f8b88;
  font-size: 10px;
  line-height: 22px;
}
#floor-timer {
  width: min(100%, 180px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}
.floor-timer-value {
  color: #e8ece5;
  font:
    600 22px/25px ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
#abilities-panel {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 6px;
  height: 68px;
  padding: 5px;
  background:
    linear-gradient(
      180deg,
      #242430,
      #1b1b25);
  border: 1px solid var(--panel-border-bright);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 5;
}
@media (max-width: 1050px) {
  #bottom-dock #abilities-panel .ability {
    width: 44px;
  }
  #bottom-dock #abilities-panel .ability .ability-icon {
    width: 30px;
    height: 30px;
  }
  .combat-name {
    flex-basis: 42px;
  }
  .floor-timer-value {
    font-size: 16px;
  }
}
#abilities-panel .ability-wrap {
  position: relative;
  display: flex;
  flex: none;
  height: 100%;
}
#abilities-panel .ability-wrap:hover,
#abilities-panel .ability-wrap:focus-within {
  z-index: 6;
}
#abilities-panel .ability {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 100%;
  min-width: 0;
  text-align: center;
  padding: 6px;
  background:
    linear-gradient(
      180deg,
      #2a2a38,
      #22222c);
  border: 1px solid #3c3c49;
  border-top: 2px solid var(--accent);
  border-radius: 5px;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    transform 0.12s;
}
#abilities-panel .ability .ability-icon {
  position: relative;
  z-index: 2;
  display: block;
  width: 36px;
  height: 36px;
  color: var(--accent-bright);
  pointer-events: none;
}
#abilities-panel .ability .ability-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
#abilities-panel .ability[data-icon=summon-pgt] .ability-icon {
  color: #b7a0e9;
}
#abilities-panel .ability[data-icon=teleport] .ability-icon,
#abilities-panel .ability[data-icon=teleport-pgt] .ability-icon,
#abilities-panel .ability[data-icon=teleport-ggs] .ability-icon {
  color: #83d4d1;
}
#abilities-panel .ability:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(224, 170, 69, 0.25);
  transform: translateY(-1px);
}
#abilities-panel .ability:disabled {
  border-top-color: #3a3a44;
  opacity: 0.5;
}
#abilities-panel .ability .key {
  position: absolute;
  z-index: 3;
  top: 3px;
  left: 5px;
  color: var(--dim);
  font-size: 9px;
}
#abilities-panel .ability .cooldown {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--cooldown, 0%);
  background: rgba(2, 2, 5, 0.72);
  pointer-events: none;
}
#abilities-panel .ability .cooldown-count {
  position: absolute;
  z-index: 3;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 26px;
  padding: 0 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 17px;
  background: #0b1114;
  border: 1px solid #7f9695;
  border-radius: 3px;
  box-shadow: 0 1px 4px #000;
  pointer-events: none;
}
#abilities-panel .ability .cooldown-count:empty {
  display: none;
}
#abilities-panel .ability.cooling .ability-icon {
  width: 30px;
  height: 30px;
  transform: translateY(-11px);
}
#abilities-panel .ability.active {
  border-color: var(--accent-bright);
  box-shadow: inset 0 0 14px rgba(224, 170, 69, .25);
}
#abilities-panel .ability.armed {
  border-color: #c9a6ff;
  box-shadow: 0 0 13px rgba(139, 70, 255, .45);
}
#abilities-panel .ability-split {
  width: 1px;
  margin: 3px 2px;
  background: var(--panel-border-bright);
}
#abilities-panel .ability-tooltip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  min-width: 155px;
  max-width: min(230px, calc(100vw - 16px));
  padding: 9px 11px;
  color: #e8e6db;
  text-align: left;
  font:
    11px/1.35 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  background: #172126;
  border: 1px solid #718388;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.12s,
    transform 0.12s,
    visibility 0.12s;
}
#abilities-panel .ability-wrap:hover .ability-tooltip,
#abilities-panel .ability-wrap:focus-within .ability-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
#abilities-panel .ability-tooltip-name {
  color: #e7c16d;
  font-size: 12px;
}
#abilities-panel .ability-tooltip-detail {
  color: #c1cbca;
}
#abilities-panel .ability-tooltip-detail:empty {
  display: none;
}
#abilities-panel .ability-tooltip-state {
  color: #83d4d1;
  font-size: 10px;
}
#buff-bar {
  position: absolute;
  top: 8px;
  right: 312px;
  z-index: 6;
  display: flex;
  gap: 5px;
  pointer-events: none;
}
#buff-bar[hidden] {
  display: none;
}
.buff-wrap {
  position: relative;
  display: flex;
  pointer-events: auto;
}
.buff-wrap:hover,
.buff-wrap:focus-within {
  z-index: 7;
}
.buff-tile {
  opacity: 0.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 46px;
  padding: 4px 2px 3px;
  background:
    linear-gradient(
      180deg,
      #242430,
      #1b1b25);
  border: 1px solid #3c3c49;
  border-top: 2px solid var(--accent);
  border-radius: 5px;
}
.buff-wrap:hover .buff-tile {
  opacity: 1;
}
.buff-tile.debuff {
  border-top-color: #a4443e;
}
.buff-icon {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--accent-bright);
}
.buff-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.buff-tile.debuff .buff-icon {
  color: #e08a7f;
}
.buff-mag,
.buff-time {
  color: #e7c16d;
  font:
    600 9px/10px ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000;
}
.buff-time {
  color: #fff;
}
#buff-bar .ability-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  min-width: 170px;
  max-width: min(240px, calc(100vw - 16px));
  padding: 9px 11px;
  color: #e8e6db;
  text-align: left;
  font:
    11px/1.35 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  background: #172126;
  border: 1px solid #718388;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.06s, transform 0.06s;
}
#buff-bar .buff-wrap:hover .ability-tooltip,
#buff-bar .buff-wrap:focus-within .ability-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
#buff-bar .ability-tooltip-name {
  color: #e7c16d;
  font-size: 12px;
}
#buff-bar .ability-tooltip-detail {
  color: #c1cbca;
}
#buff-bar .ability-tooltip-detail:empty {
  display: none;
}
#buff-bar .ability-tooltip-state {
  color: #83d4d1;
  font-size: 10px;
}
#inventory-panel {
  width: 100%;
  min-height: 150px;
  flex: 1 !important;
  max-height: none !important;
}
#inventory-panel .panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.inventory-grid {
  display: grid;
  gap: 5px;
  grid-auto-rows: 96px;
}
#inventory-panel .inventory-grid {
  height: min(100%, 399px);
  grid-auto-rows: minmax(0, 1fr);
}
#inventory-panel .inventory-grid .cell {
  min-height: 0;
  gap: 1px;
  padding: 3px 2px 2px;
}
#inventory-panel .inventory-grid .cell .icon {
  width: auto;
  height: auto;
  min-height: 0;
  max-width: 48px;
  max-height: 48px;
  aspect-ratio: 1;
  flex: 1 1 48px;
}
#inventory-panel .inventory-grid .cell .primary {
  padding: 1px 5px;
}
.inventory-grid .cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 5px 4px 4px;
  background: var(--cell-grad);
  border: 1px solid #383846;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 4px rgba(0, 0, 0, 0.35);
}
.inventory-grid .cell.item:hover {
  border-color: var(--accent);
  background:
    linear-gradient(
      180deg,
      #343040,
      #292837);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 12px rgba(224, 170, 69, 0.25);
}
.inventory-grid .cell.empty {
  background: #101016;
  border: 1px solid #242430;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.inventory-grid .cell.dim {
  opacity: 0.7;
}
.inventory-grid .cell.dragging {
  opacity: 0.3;
}
.inventory-grid .cell.drop-target {
  border-color: var(--accent-bright);
  background: #2f291c;
  box-shadow: inset 0 0 0 2px rgba(224, 170, 69, 0.55), 0 0 14px rgba(224, 170, 69, 0.35);
}
.inventory-grid .cell .icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: var(--dim);
  background: #12121a;
  border: 1px solid #2e2e3a;
  border-radius: 5px;
  image-rendering: pixelated;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}
.inventory-grid .cell .cap {
  width: 100%;
  max-width: 58px;
  font-size: 9.5px;
  line-height: 1.12;
  color: var(--text);
  text-align: center;
  white-space: normal;
  overflow: visible;
}
.inventory-grid .cell .primary {
  font-size: 9px;
  line-height: 1;
  color: var(--accent-bright);
  background: rgba(224, 170, 69, 0.12);
  border: 1px solid rgba(224, 170, 69, 0.35);
  border-radius: 7px;
  padding: 2px 7px;
  opacity: 0;
  transition: opacity 0.12s;
}
.inventory-grid .cell:hover .primary {
  opacity: 1;
}
.inventory-grid .cell .sub {
  color: var(--dim);
  font-size: 11px;
}
.cell-ghost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  opacity: 0.92;
  transform: scale(1.04);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 5px 4px 4px;
  box-shadow: 0 0 18px rgba(224, 170, 69, 0.25);
}
.cell-ghost .icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12121a;
  border: 1px solid #2e2e3a;
  border-radius: 5px;
  image-rendering: pixelated;
}
.cell-ghost .cap {
  width: 52px;
  font-size: 9.5px;
  line-height: 1.12;
  color: var(--text);
  text-align: center;
  white-space: normal;
  overflow: visible;
}
.cell-ghost .primary {
  font-size: 9px;
  line-height: 1;
  color: var(--accent-bright);
  background: rgba(224, 170, 69, 0.12);
  border: 1px solid rgba(224, 170, 69, 0.35);
  border-radius: 7px;
  padding: 2px 7px;
}
#drop-hint {
  position: fixed;
  z-index: 61;
  pointer-events: none;
  display: none;
  padding: 6px 12px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
#drop-hint.no-drop {
  border-color: var(--bad);
}
#chat-panel {
  left: 8px;
  bottom: 90px;
  width: min(560px, 44%);
  display: flex;
  flex-direction: column;
  max-height: 30%;
  padding: 8px 10px;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  min-height: 20px;
}
.chat-title {
  flex: 1;
  color: var(--accent-bright);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.chat-unread {
  min-width: 16px;
  color: var(--workspace-cyan, var(--accent-bright));
  font-size: 10px;
  text-align: right;
}
.chat-unread:empty {
  display: none;
}
.chat-toggle {
  width: 24px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--panel-border-bright);
  border-radius: 1px;
  color: var(--accent-bright);
  font-size: 15px;
  line-height: 16px;
  cursor: pointer;
}
#chat-panel.collapsed {
  width: 142px;
  max-height: none;
  padding: 6px 8px;
}
#chat-panel.collapsed .chat-head {
  margin-bottom: 0;
}
#chat-panel.collapsed #chat-log,
#chat-panel.collapsed #chat-form {
  display: none;
}
#chat-log {
  overflow-y: auto;
  flex: 1;
  max-height: 180px;
}
#chat-log .line {
  padding: 2px 0;
  word-wrap: break-word;
}
#chat-log .system {
  color: var(--dim);
  font-style: italic;
}
#chat-log .invalid {
  color: var(--bad);
}
#chat-log .line.feedback {
  transition: opacity 0.4s;
}
#chat-log .line.feedback.fading {
  opacity: 0;
}
#chat-form {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
#chat-form input {
  flex: 1;
  background: #14141c;
  border: 1px solid #34343f;
  border-radius: 5px;
  padding: 6px 10px;
}
#chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(224, 170, 69, 0.2);
}
#banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(
      180deg,
      #241c10,
      #171309);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 22px 40px;
  text-align: center;
  font-size: 24px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(224, 170, 69, 0.4);
  box-shadow: 0 0 48px rgba(224, 170, 69, 0.3);
  display: none;
  z-index: 20;
}
#banner.show {
  display: block;
}
#exit-countdown {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  background:
    linear-gradient(
      180deg,
      #1d1608,
      #141005);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 22px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--accent-bright);
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(224, 170, 69, 0.25);
  z-index: 19;
}
#results {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 40;
}
#results h1 {
  font-size: 42px;
  letter-spacing: 10px;
  text-transform: uppercase;
}
#results h1.cleared {
  color: var(--accent-bright);
  text-shadow: 0 0 30px rgba(240, 192, 100, 0.5);
}
#results h1.retreated {
  color: #8fa8bc;
  text-shadow: 0 0 24px rgba(120, 168, 196, 0.4);
}
#results .results-sub {
  color: var(--dim);
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
#results #results-rank {
  color: var(--accent-bright);
  width: min(500px, calc(100% - 24px));
  text-align: center;
  text-shadow: 0 0 18px rgba(240, 192, 100, 0.35);
}
#results .results-rank-title {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 1px;
}
#results .results-detail-link {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  margin-top: 8px;
  letter-spacing: 0;
  text-shadow: none;
}
#results #results-rank.dq {
  color: #e6a290;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-shadow: none;
}
#results .results-nearby {
  margin: 10px auto 0;
  padding: 4px;
  border: 1px solid var(--panel-border-bright);
  background: var(--panel-grad);
}
#results .results-nearby-row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  text-align: left;
  gap: 20px;
  padding: 4px 9px;
  color: var(--dim);
  font:
    12px/1.4 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0;
  text-shadow: none;
}
#results .results-nearby-row.own {
  color: var(--accent-bright);
  background: rgba(224, 170, 69, 0.14);
  font-weight: 700;
}
#results .results-nearby-row span:last-child {
  font-variant-numeric: tabular-nums;
}
#results .results-table {
  border-collapse: collapse;
  background: var(--panel-grad);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  overflow: hidden;
  min-width: min(620px, 84%);
}
#results .results-table th {
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.12),
      transparent);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--panel-border);
}
#results .results-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
}
#results .results-table tbody tr:last-child td {
  border-bottom: none;
}
#results .results-table tr.me td {
  background: rgba(224, 170, 69, 0.06);
}
#results .results-table td.ended-cleared {
  color: var(--good);
}
#results .results-table td.ended-retreated {
  color: #8fa8bc;
}
#results .results-table td.ended-left {
  color: var(--dim);
  font-style: italic;
}
.game-modal-backdrop {
  position: absolute;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 45;
}
.game-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  max-height: 100%;
  background: var(--panel-grad);
  border: 1px solid var(--panel-border-bright);
  border-radius: 3px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.game-modal-head {
  position: relative;
  flex: none;
  padding: 14px 48px 12px 18px;
  border-bottom: 1px solid var(--panel-border);
  background:
    linear-gradient(
      180deg,
      rgba(224, 170, 69, 0.1),
      transparent);
}
.game-modal-title {
  color: var(--accent-bright);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.game-modal-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  font-size: 24px;
  line-height: 1;
}
.game-modal-close:hover {
  color: var(--accent-bright);
  border-color: var(--panel-border-bright);
}
.game-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}
#leave-confirm {
  background: rgba(8, 8, 12, 0.7);
}
.leave-body {
  padding: 0 0 14px;
  color: var(--text);
  line-height: 1.5;
}
.leave-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.leave-stay {
  border-color: var(--panel-border-bright);
}
.leave-go {
  border-color: #8fa8bc;
  color: #cfe3ef;
}
.leave-go:hover {
  border-color: #bcd8e8;
}
.sack-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 420px);
  margin: 0 auto;
}
.sack-grid .cell {
  cursor: pointer;
}
.sack-empty {
  color: var(--dim);
  text-align: center;
  padding: 10px 0 16px;
}
#map-overlay {
  position: absolute;
  inset: 0;
  background: #10191c;
  display: none;
  z-index: 30;
}
#map-overlay.show {
  display: block;
}
#game #map-overlay canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
  box-shadow: none;
}
#map-overlay .map-close {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 20px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #6c7878;
  border-radius: 0;
  background: #2a3437;
  color: #d9ddcf;
  font-size: 26px;
  line-height: 30px;
}
#map-overlay .map-close:hover,
#map-overlay .map-close:focus-visible {
  color: #fff3cf;
  border-color: #e1c88e;
  outline: none;
}
#game,
#hub {
  --workspace-ink: #0c1114;
  --workspace-void: #11171b;
  --workspace-iron: #1a2227;
  --workspace-iron-hi: #303b40;
  --workspace-stone: #293237;
  --workspace-stone-hi: #4b585b;
  --workspace-brass: #b59a66;
  --workspace-brass-hi: #e1c88e;
  --workspace-cyan: #83d4d1;
  --workspace-rust: #68473b;
  --accent: var(--workspace-brass);
  --accent-bright: var(--workspace-brass-hi);
  --panel: var(--workspace-iron);
  --panel-2: #222c31;
  --panel-3: #2a353a;
  --panel-border: #3d494d;
  --panel-border-bright: #5b686b;
  --text: #e5e5dc;
  --dim: #9aa5a5;
  --panel-grad:
    linear-gradient(
      180deg,
      #202a2f 0%,
      #151d21 100%);
  --cell-grad:
    linear-gradient(
      180deg,
      #2a353a 0%,
      #1b2428 100%);
  color: var(--text);
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    sans-serif;
  background: var(--workspace-ink);
}
#game button,
#game input,
#game select,
#hub button,
#hub input,
#hub select {
  font-family: inherit;
  border-radius: 1px;
  background: var(--workspace-iron);
  border-color: var(--workspace-stone-hi);
}
#game > canvas,
#hub > canvas {
  outline: 1px solid rgba(96, 112, 114, 0.58);
  outline-offset: -1px;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.18);
}
#top-right {
  position: absolute;
  background:
    linear-gradient(
      90deg,
      rgba(103, 119, 120, 0.1),
      transparent 22%),
    linear-gradient(
      180deg,
      #172025,
      #0f1518 74%,
      #101619);
  border-left: 1px solid #526064;
  box-shadow: inset 9px 0 22px rgba(0, 0, 0, 0.32), -12px 0 22px rgba(0, 0, 0, 0.12);
  padding: 9px 8px 8px;
  gap: 6px;
}
#top-right::before {
  content: "";
  position: absolute;
  inset: 7px 5px;
  border: 1px solid rgba(123, 139, 140, 0.16);
  pointer-events: none;
}
#top-right .panel {
  z-index: 1;
}
#game .panel,
#hub .panel {
  border: 1px solid var(--workspace-stone-hi);
  border-radius: 2px;
  background:
    linear-gradient(
      90deg,
      rgba(138, 154, 151, 0.06),
      transparent 8%,
      transparent 92%,
      rgba(138, 154, 151, 0.04)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012) 0 1px,
      transparent 1px 4px),
    var(--panel-grad);
  box-shadow:
    inset 0 0 0 1px rgba(7, 11, 13, 0.74),
    inset 0 10px 20px rgba(127, 143, 140, 0.035),
    0 8px 18px rgba(0, 0, 0, 0.38);
}
#game .panel-head,
#hub .panel-head {
  padding: 7px 10px 6px;
  border-bottom: 1px solid #566366;
  background:
    linear-gradient(
      90deg,
      rgba(181, 154, 102, 0.11),
      transparent 38%),
    linear-gradient(
      180deg,
      #303b40,
      #202a2e);
  box-shadow: inset 0 1px 0 rgba(221, 224, 205, 0.08);
}
#game .panel-head h3,
#hub .panel-head h3 {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.1px;
  color: var(--workspace-brass-hi);
  text-shadow: 0 1px 0 #0a0d0e;
}
#game .panel-badge,
#hub .panel-badge {
  border-color: #536064;
  border-radius: 1px;
  background: #182126;
  color: #bac2bd;
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
}
#party-panel .line {
  padding: 4px 0;
  border-bottom: 1px solid rgba(92, 106, 106, 0.2);
}
#party-panel .line:last-child {
  border-bottom: 0;
}
#party-panel .party-line {
  flex-wrap: wrap;
  row-gap: 2px;
}
#party-panel .party-line .name {
  flex: none;
}
#party-panel .party-line .dot {
  margin-left: auto;
}
#party-panel .party-key {
  min-width: 14px;
  padding: 0 3px;
  border: 1px solid #536064;
  border-radius: 1px;
  background: #182126;
  color: var(--workspace-brass-hi);
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  font-size: 10px;
  line-height: 13px;
  text-align: center;
}
#party-panel .line .name {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-weight: 600;
  letter-spacing: 0.15px;
}
#party-panel .line .swatch {
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(236, 236, 220, 0.24);
}
#party-panel .party-crown {
  color: var(--workspace-brass-hi);
  text-shadow: 0 1px 0 #0b0e0f;
}
#party-panel .party-action-row {
  cursor: context-menu;
}
#party-panel .party-action-row:hover {
  background: rgba(180, 151, 86, 0.12);
}
#party-panel .party-leave {
  display: block;
  margin: 5px 0 0 auto;
  font-size: 11px;
}
#party-panel .party-none {
  color: var(--dim);
  font-style: italic;
}
#party-panel .party-create {
  display: block;
  margin: 5px 0 0 auto;
  font-size: 11px;
}
#equipment-panel .panel-body,
#inventory-panel .panel-body {
  padding: 7px;
}
.inventory-grid .cell {
  border-radius: 1px;
  border-color: #4d5a5d;
  background:
    linear-gradient(
      135deg,
      rgba(165, 175, 165, 0.05),
      transparent 35%),
    var(--cell-grad);
  box-shadow: inset 0 1px 0 rgba(239, 236, 213, 0.07), inset 0 -4px 9px rgba(0, 0, 0, 0.22);
}
.inventory-grid .cell.empty {
  border-color: #313c40;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(123, 139, 137, 0.025) 0 1px,
      transparent 1px 5px),
    #131a1e;
  box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.56), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.inventory-grid .cell.item:hover {
  border-color: var(--workspace-brass-hi);
  background:
    linear-gradient(
      135deg,
      rgba(190, 165, 108, 0.17),
      transparent 52%),
    #273238;
  box-shadow: inset 0 1px 0 rgba(246, 237, 202, 0.13), 0 0 12px rgba(181, 154, 102, 0.16);
}
.inventory-grid .cell .icon,
.cell-ghost .icon {
  border-radius: 1px;
  border-color: #526064;
  background: #11181b;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.58), 0 1px 0 rgba(218, 219, 200, 0.05);
}
.inventory-grid .cell .cap,
.inventory-grid .cell .primary {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
}
.inventory-grid .cell .primary {
  color: var(--workspace-brass-hi);
  background: rgba(181, 154, 102, 0.11);
  border-color: rgba(181, 154, 102, 0.46);
  border-radius: 1px;
}
#abilities-panel {
  gap: 5px;
  padding: 4px;
  border: 1px solid #5c696b;
  border-radius: 2px;
  background:
    linear-gradient(
      90deg,
      rgba(134, 151, 148, 0.08),
      transparent 17%,
      transparent 83%,
      rgba(134, 151, 148, 0.05)),
    linear-gradient(
      180deg,
      #303b40,
      #1b2428);
  box-shadow:
    inset 0 1px 0 rgba(237, 233, 210, 0.1),
    inset 0 -5px 12px rgba(0, 0, 0, 0.26),
    0 8px 20px rgba(0, 0, 0, 0.42);
}
#abilities-panel .ability {
  width: 56px;
  padding: 6px;
  border: 1px solid #536064;
  border-top: 2px solid #8f774b;
  border-radius: 1px;
  background:
    linear-gradient(
      135deg,
      rgba(167, 180, 169, 0.065),
      transparent 40%),
    linear-gradient(
      180deg,
      #2a353a,
      #1b2428);
  box-shadow: inset 0 1px 0 rgba(230, 231, 210, 0.08), inset 0 -5px 10px rgba(0, 0, 0, 0.22);
}
#abilities-panel .ability .ability-icon {
  color: var(--workspace-brass-hi);
}
#abilities-panel .ability.map-ability .ability-icon {
  color: #dfc98f;
}
#abilities-panel .ability.map-ability {
  border-top-color: #a9915e;
}
#abilities-panel .ability[data-icon=summon-pgt] .ability-icon {
  color: #b7a0e9;
}
#abilities-panel .ability[data-icon=teleport] .ability-icon,
#abilities-panel .ability[data-icon=teleport-pgt] .ability-icon,
#abilities-panel .ability[data-icon=teleport-ggs] .ability-icon {
  color: var(--workspace-cyan);
}
#abilities-panel .ability .key {
  top: 3px;
  left: 5px;
  color: var(--workspace-brass-hi);
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
}
#abilities-panel .ability:hover:not(:disabled) {
  border-color: var(--workspace-brass-hi);
  box-shadow: inset 0 1px 0 rgba(246, 237, 202, 0.14), 0 0 13px rgba(181, 154, 102, 0.2);
  transform: translateY(-1px);
}
#abilities-panel .ability:disabled {
  border-top-color: #465256;
  opacity: 0.62;
  pointer-events: none;
}
#abilities-panel .ability.cooling:disabled {
  opacity: 1;
}
#abilities-panel .ability.cooling .ability-icon {
  opacity: 0.45;
}
#abilities-panel .ability.active {
  border-color: var(--workspace-brass-hi);
  box-shadow: inset 0 0 14px rgba(181, 154, 102, 0.2);
}
#abilities-panel .ability.armed {
  border-color: var(--workspace-cyan);
  border-top-color: var(--workspace-cyan);
  box-shadow: inset 0 0 14px rgba(131, 212, 209, 0.16), 0 0 11px rgba(131, 212, 209, 0.18);
}
#abilities-panel .ability[data-icon=phoenix-teleport] .ability-icon {
  color: #e6a56c;
}
#abilities-panel .ability[data-icon=phoenix-teleport].active {
  border-color: #db9959;
  background:
    radial-gradient(
      ellipse at 50% 65%,
      rgba(224, 114, 39, 0.2),
      transparent 75%),
    linear-gradient(
      180deg,
      #34332e,
      #282321);
  box-shadow: inset 0 0 12px rgba(230, 130, 55, 0.15), 0 0 10px rgba(230, 130, 55, 0.18);
}
#abilities-panel .ability[data-icon=phoenix-teleport].active .ability-icon {
  color: #ffce91;
  filter: drop-shadow(0 0 3px rgba(255, 145, 55, 0.4));
}
#abilities-panel .ability-split {
  background: #76827f;
  opacity: 0.65;
}
.inventory-grid .cell {
  position: relative;
}
.equip-cell::before,
.inventory-grid .cell::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-top: 1px solid rgba(174, 187, 177, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
.equip-cell.empty::before,
.inventory-grid .cell.empty::before {
  inset: 5px;
  border-color: rgba(125, 143, 140, 0.08);
}
#chat-panel {
  border-radius: 2px;
  padding: 8px 10px;
  background:
    linear-gradient(
      90deg,
      rgba(126, 143, 140, 0.06),
      transparent 20%),
    linear-gradient(
      180deg,
      #202a2e,
      #141c20);
  border-color: #4f5c60;
  box-shadow: inset 0 1px 0 rgba(229, 230, 210, 0.07), 0 8px 18px rgba(0, 0, 0, 0.4);
}
#chat-log .system {
  color: #879390;
}
#chat-form input {
  border-radius: 1px;
  background: #11181b;
  border-color: #4c595d;
}
#chat-form input:focus {
  border-color: var(--workspace-cyan);
  box-shadow: 0 0 8px rgba(131, 212, 209, 0.14);
}
#chat-form button {
  border-color: #68746e;
  color: var(--workspace-brass-hi);
}
#hub-top,
#hub-bottom {
  background: transparent;
  border: 0;
  border-radius: 0;
  text-shadow: 0 1px 2px #000;
}
#hub-top {
  padding: 4px 0;
}
#hub-top .linkish {
  color: var(--workspace-brass-hi);
  text-decoration: none;
  border-bottom: 1px solid rgba(225, 200, 142, 0.48);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
}
#hub-bottom .hint {
  color: #a0aaa6;
}
#game .game-modal,
#hub .game-modal {
  border-radius: 2px;
  border-color: #5b686b;
  background:
    linear-gradient(
      90deg,
      rgba(181, 154, 102, 0.09),
      transparent 28%),
    linear-gradient(
      180deg,
      #283237,
      #151d21);
  box-shadow: inset 0 1px 0 rgba(232, 231, 208, 0.08), 0 12px 28px rgba(0, 0, 0, 0.5);
}
#game .game-modal-title,
#hub .game-modal-title {
  color: var(--workspace-brass-hi);
}
#game .modal-secondary,
#hub .modal-secondary {
  color: #aab4ae;
}
#game #banner,
#game #exit-countdown,
#game #results,
#hub #banner {
  border-radius: 2px;
  border-color: var(--workspace-brass-hi);
  background:
    linear-gradient(
      180deg,
      #332a1c,
      #171811);
  box-shadow: 0 0 38px rgba(181, 154, 102, 0.18);
}
.art-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e9dfc9;
  background: #101017;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-align: center;
}
.art-loading h1 {
  margin: 0;
  font-size: 24px;
}
.art-loading p {
  margin: 0;
  max-width: 36rem;
}
.art-loading button {
  padding: 8px 20px;
  cursor: pointer;
}
#bull-dialog a.linkish {
  color: var(--accent-bright);
  font-size: 13px;
  text-decoration: underline;
}
#bull-dialog a.linkish:hover {
  color: var(--text);
}
.connection-notice {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 10px 18px;
  border: 1px solid #b99755;
  border-radius: 6px;
  background: #191b23;
  color: #f4dfb1;
  pointer-events: none;
}
#hub #player-card .game-modal {
  width: min(430px, 100%);
}
#player-card .pc-top {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 2px 14px;
  align-items: center;
}
#player-card .pc-figure {
  grid-row: span 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 96px;
}
#player-card .pc-hero {
  width: 116px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55));
}
#player-card .pc-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
#player-card .pc-class {
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--dim);
}
#player-card .rating-plate {
  grid-column: 1 / -1;
  margin-top: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  padding: 8px 11px 9px;
}
#player-card .pc-section {
  margin-top: 14px;
}
#player-card .pc-section-head {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
#player-card .pc-ladder,
#player-card .pc-slot,
#player-card .pc-best {
  display: grid;
  align-items: baseline;
  gap: 12px;
  padding: 4px 1px;
  font-size: 13px;
  border-bottom: 1px solid rgba(44, 44, 56, 0.5);
}
#player-card .pc-ladder:last-child,
#player-card .pc-slot:last-child,
#player-card .pc-best:last-child {
  border-bottom: 0;
}
#player-card .pc-ladder {
  grid-template-columns: 1fr auto auto;
}
#player-card .pc-ladder-name {
  color: var(--dim);
  letter-spacing: 0.4px;
}
#player-card .pc-ladder.shown .pc-ladder-name {
  color: var(--text);
  font-weight: 600;
}
#player-card .pc-ladder.shown .pc-ladder-elo {
  color: var(--accent-bright);
}
#player-card .pc-ladder-elo {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#player-card .pc-ladder-detail {
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#player-card .pc-ladder.empty {
  opacity: 0.5;
}
#player-card .pc-slot {
  grid-template-columns: 72px 1fr;
}
#player-card .pc-slot-label {
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#player-card .pc-slot-value {
  color: var(--text);
}
#player-card .pc-best {
  grid-template-columns: 1fr auto auto;
}
#player-card .pc-best-floor {
  color: var(--text);
}
#player-card .pc-best-bucket {
  color: var(--dim);
  font-size: 11px;
}
#player-card .pc-best-time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
#player-card .pc-quiet,
#player-card .pc-quiet-row {
  color: var(--dim);
  font-size: 12px;
  font-style: italic;
  padding: 4px 1px;
}
.inventory-grid .cell .icon {
  position: relative;
}
.icon .key-mark {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 24px;
  pointer-events: none;
}
.icon .key-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
#party-panel .party-key {
  border: 0;
  padding: 0;
  background: none;
}
#party-panel .party-key svg {
  display: block;
  width: 14px;
  height: 17px;
}
#game > canvas,
#hub > canvas {
  height: 100%;
}
#hub-top {
  display: none;
}
html[data-action-bar=top] #abilities-panel {
  position: fixed;
  top: 8px;
  left: calc((100vw - 304px) / 2);
  transform: translateX(-50%);
  height: 68px;
}
html[data-action-bar=top] #abilities-panel .ability-tooltip {
  bottom: auto;
  top: calc(100% + 9px);
}
#settings-dialog .game-modal {
  width: min(360px, 100%);
}
.settings-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.settings-actions > a,
.settings-actions > button {
  box-sizing: border-box;
  width: 100%;
  display: block;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #566366;
  background: #253236;
  color: #e8dfc6;
  font: 14px system-ui;
  text-decoration: none;
}
.settings-actions > a:visited {
  color: #e8dfc6;
}
.settings-actions > a:hover,
.settings-actions > button:hover:not(:disabled) {
  background: #344247;
  border-color: #84938a;
  color: #fff3cf;
}
.settings-actions > a:focus-visible,
.settings-actions > button:focus-visible {
  outline: 2px solid #e1c88e;
  outline-offset: 2px;
}
.game-modal-close:focus {
  outline: none;
}
.game-modal-close:focus-visible {
  outline: 2px solid #e1c88e;
  outline-offset: 2px;
}
.settings-actions > button:disabled {
  opacity: .45;
  cursor: default;
}
#settings-dialog label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.appearance-editor {
  position: relative;
  height: 540px;
}
.appearance-editor #auth {
  position: relative;
  height: 100%;
  min-height: 0;
}
.appearance-editor .auth-panel {
  left: 12px;
  right: auto;
  top: 12px;
  bottom: auto;
  width: min(400px, 75%);
}
.appearance-editor .auth-create-cols {
  display: block;
}
.appearance-editor .auth-pane[hidden],
.appearance-editor button[hidden] {
  display: none;
}
#appearance-dialog .game-modal {
  width: min(850px, 100%);
}
@media (max-width: 850px) {
  .npc-dialogue {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .npc-portrait {
    height: 135px;
  }
  .npc-portrait canvas {
    width: 90px;
    height: 117px;
  }
}
html[data-action-bar=top] #buff-bar {
  top: 84px;
}
.appearance-editor #auth.is-create .auth-panel {
  left: 12px;
  right: auto;
  top: 12px;
  bottom: auto;
  width: 380px;
  max-width: calc(100% - 260px);
}
.appearance-editor #auth .auth-create-cols {
  display: block;
}
.appearance-editor #auth .auth-scene {
  left: 400px;
  right: 0;
  top: 0;
  width: calc(100% - 400px);
  height: 100%;
}
@media (max-width: 900px) {
  .appearance-editor {
    height: 620px;
  }
  .appearance-editor #auth.is-create .auth-panel {
    width: calc(100% - 24px);
    max-width: none;
  }
  .appearance-editor #auth .auth-scene {
    left: 0;
    top: 330px;
    width: 100%;
    height: 280px;
  }
}
#settings-dialog .settings-rating {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
#settings-dialog .settings-rating select {
  width: 100%;
  min-width: 0;
}
#settings-dialog .settings-note {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0 12px;
}
#results .results-race {
  letter-spacing: 0;
  text-shadow: none;
}
#results .results-race h2 {
  font-size: 28px;
  margin: 0 0 8px;
}
#results .results-race p {
  font-size: 14px;
  line-height: 1.45;
  margin: 8px 0;
}
#results .results-race .results-detail-link {
  margin: 8px 10px;
}
#results {
  box-sizing: border-box;
  overflow-y: auto;
  padding: 24px 12px;
}
@media (max-width: 600px), (max-height: 650px) {
  #results {
    justify-content: flex-start;
    gap: 14px;
  }
  #results h1 {
    font-size: 25px;
    letter-spacing: 3px;
    text-align: center;
    margin: 12px 0 0;
  }
  #results .results-sub {
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
  }
  #results .results-table {
    width: 100%;
    max-width: 500px;
    font-size: 12px;
  }
  #results .results-table th,
  #results .results-table td {
    padding: 8px 6px;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  #results .results-rank-title {
    font-size: 14px;
    letter-spacing: 0;
  }
  #results .results-nearby {
    width: 100%;
  }
  #settings-dialog label {
    flex-wrap: wrap;
  }
  #settings-dialog select {
    max-width: 100%;
  }
  .records-panel-toolbar {
    padding: 8px 10px;
  }
  #hub #player-card .pc-top {
    gap: 10px;
  }
  #hub #player-card .pc-best {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #hub #player-card .pc-best-bucket {
    grid-column: 1;
  }
}
@media (pointer: coarse) {
  #settings-dialog button,
  #settings-dialog a,
  #settings-dialog select,
  #results button,
  #results a,
  .records-panel-toolbar button {
    min-height: 44px;
  }
  #settings-dialog select {
    font-size: 16px;
  }
}
@media (max-width: 600px) {
  #race-challenge.game-modal-backdrop,
  #settings-dialog.game-modal-backdrop,
  #player-card.game-modal-backdrop {
    padding: 12px;
  }
  #race-challenge .race-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  #race-challenge .race-side {
    min-width: 0;
    padding: 8px;
  }
  #race-challenge .race-row {
    grid-template-columns: 10px minmax(42px, 1fr) 34px 28px 60px 12px;
    gap: 4px;
  }
  #race-challenge .race-stake {
    gap: 4px;
  }
  #race-challenge .race-actions {
    flex-wrap: wrap;
  }
  #race-challenge .race-actions button {
    min-height: 44px;
  }
  #race-challenge .game-modal-title {
    overflow-wrap: anywhere;
    font-size: 16px;
  }
  #settings-dialog .settings-rating {
    width: 100%;
  }
}
