.game.game-shell {
  --dock-height: clamp(160px, 25dvh, 246px);
  --stage-gutter: clamp(12px, 1.65vw, 26px);
  --top-tools: 88px;
  --chalk: #f1ede0;
  --sheet-edge: #6a8883;
  --sheet-accent: #d78165;
  --sheet-void: #142224;
  --sheet-dark: #23383a;
  --sheet-light: #456568;
  --dock-ink: #e9ece2;
  --dock-muted: #b2c7c2;
  --plate-cut: polygon(0 13%, 4% 3%, 91% 0%, 98% 9%, 100% 72%, 96% 97%, 9% 100%, 1% 90%);
  --fasteners: radial-gradient(circle at 6px 6px, #a0aaa0 0 1px, #142629 1.4px 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), #a0aaa0 0 1px, #142629 1.4px 2px, transparent 2.5px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--dock-height);
  width: 100%;
  height: 100dvh;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--sheet-void);
}

.game-shell .stage {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #263d3d;
}

.game-shell .stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.game-shell .stage > #yard-backdrop { pointer-events: none; }

.game-shell .stage-toolbar {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  min-height: var(--top-tools);
  margin: 0;
  padding: 9px var(--stage-gutter) 12px;
  background: linear-gradient(180deg, #122629c9, #12262953 64%, transparent);
  pointer-events: none;
}

.stage-toolbar .brand { gap: 10px; min-width: 0; padding: 4px 0; text-shadow: 1px 2px #142324; }
.stage-toolbar .brand h1 { color: var(--chalk); font-size: clamp(1.2rem, 2.65vw, 2rem); letter-spacing: -.055em; white-space: nowrap; }
.stage-toolbar .brand p { margin-top: 3px; color: #d3ded4; }
.stage-toolbar .lantern { background: #89554c; border-color: #bf8674; box-shadow: 2px 3px #142324; }
.stage-toolbar .lantern::before, .stage-toolbar .lantern::after { border-color: var(--chalk); }
.stage-toolbar .yard-title-image { display: none; width: clamp(150px, 18vw, 254px); height: 59px; flex: none; object-fit: contain; object-position: left center; filter: drop-shadow(1px 3px 0 #0e1d20ae); }
.stage-toolbar .brand-has-title .yard-title-image { display: block; }
.stage-toolbar .brand-has-title h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.stage-toolbar .brand-has-title :is(.lantern, p) { display: none; }
.stage-toolbar .topbar-actions { align-self: flex-start; gap: 7px; pointer-events: auto; }

.game-shell .hud-button,
.game-shell .interact,
.game-shell .action {
  --plate: var(--sheet-dark);
  --plate-sheen: var(--sheet-light);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--chalk);
  box-shadow: none;
  filter: drop-shadow(1px 3px 0 #122225cc);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px #17282b;
}

.game-shell :is(.hud-button, .interact, .action)::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: var(--plate-cut);
  background: var(--fasteners), radial-gradient(ellipse at 8% 96%, #bd735ac7, transparent 26%),
    repeating-linear-gradient(169deg, transparent 0 12px, #ced9c312 13px, transparent 15px 20px),
    linear-gradient(164deg, var(--plate-sheen), var(--plate) 57%);
  box-shadow: inset 0 0 0 1px var(--sheet-edge), inset 1px 2px #aec6bd59, inset -2px -3px #111b1f70;
  content: '';
  pointer-events: none;
}

.game-shell .hud-button { min-height: 42px; padding: 5px 13px; font-size: .79rem; }
.game-shell .hud-button-label { color: inherit; font-size: inherit; white-space: nowrap; }
.game-shell .hud-icon { width: 26px; height: 26px; flex: none; display: block; object-fit: contain; filter: drop-shadow(0 2px 0 #18282aab); }
.stage-toolbar .hud-button kbd { margin-left: 1px; }
.stage-toolbar .hud-tool { min-width: 40px; padding-inline: 6px; }
.game-shell :is(.hud-button, .interact, .action):hover:not(:disabled) { filter: drop-shadow(1px 3px 0 #122225cc) brightness(1.18); }
.game-shell :is(.hud-button, .interact, .action):active:not(:disabled) { transform: translateY(1px); filter: drop-shadow(0 1px #111d20) brightness(.94); }
.game-shell :is(.hud-button, .interact, .action):focus-visible { outline-color: #d2e6cf; filter: none; }
.game-shell .interact:active:not(:disabled) { transform: translate(-50%, 1px); }
.game-shell .action.attack { --plate: #713d36; --plate-sheen: #a36051; --sheet-edge: #ba8b79; background: transparent; color: var(--chalk); }
.game-shell .action.attack small { color: #f1ded0; }
.game-shell .action.chosen:disabled { opacity: 1; background: transparent; box-shadow: none; }
.game-shell .action.chosen::before { box-shadow: inset 0 0 0 2px var(--chalk); }
.game-shell kbd { border-color: #748b85; border-radius: 2px; background: #192e31; color: var(--chalk); }
.game-shell .interact kbd, .game-shell .action.attack kbd { border-color: #d5b6a4; background: #e3decb; color: #372d2d; }

.game-shell .scene-label {
  z-index: 2;
  top: calc(var(--top-tools) + 5px);
  left: var(--stage-gutter);
  max-width: min(425px, calc(100% - 2 * var(--stage-gutter)));
}

.game-shell .scene-label, .game-shell .health-card {
  border: 1px solid #79908a;
  border-left: 3px solid var(--sheet-accent);
  border-radius: 1px 6px 2px 4px;
  background: var(--fasteners), repeating-linear-gradient(173deg, transparent 0 18px, #d1ddc014 19px, transparent 21px 31px), #304a4cec;
  color: var(--chalk);
  box-shadow: 2px 3px #11232695;
}

.game-shell .scene-label { padding: 10px 14px; transform: rotate(-.65deg); }
.game-shell .scene-label .eyebrow { color: #d7ddd0; }
.game-shell .scene-label p:last-child { color: #d2e3df; }
.game-shell .health-card.enemy { border-left-color: #dc8a75; background-color: #563b3bee; }
.game-shell .health-label span + span { color: #f2e2b8; }
.game-shell .round-stamp { border: 1px solid #af8b77; border-radius: 0; background: #783e37; color: #fff0d8; box-shadow: 2px 3px #132326ab; transform: rotate(2deg); }
.game-shell #battle-turn-clock:not([hidden]) { display: inline-block; margin-left: .5em; padding-left: .5em; border-left: 1px solid currentColor; white-space: nowrap; font-variant-numeric: tabular-nums; }
.game-shell #battle-turn-clock[data-urgent] { color: #ffe584; }

.game-shell .health-row {
  z-index: 2;
  top: var(--top-tools);
  padding: 4px var(--stage-gutter) 0;
  pointer-events: none;
}

.game-shell .interact { position: absolute; z-index: 3; bottom: 68px; padding: 5px 13px 5px 9px; }
.game-shell .feedback { z-index: 2; bottom: 108px; border-color: #849a90; border-radius: 1px 4px 2px 3px; background: #293d3ef5; color: var(--chalk); box-shadow: 2px 3px #0f2022ae; }
.game-shell .battle-caption {
  min-width: 0;
  width: fit-content;
  max-width: min(100%, 38rem);
  max-height: max(28px, calc(var(--top-tools) - 12px));
  padding: 3px 8px;
  border: 1px solid #77908a;
  border-radius: 2px 5px 1px 3px;
  background: #203537f5;
  box-shadow: 1px 2px #122225ad;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-y;
  pointer-events: auto;
  font: .78rem/1.2 system-ui, sans-serif;
}
.game-shell .battle-caption-copy > strong { display: block; color: #f3dbc9; font-size: inherit; }
.game-shell .battle-caption-copy > :is(strong, span, p):empty,
.game-shell .battle-caption[data-aiming] .battle-caption-copy > strong { display: none; }
.game-shell .battle-caption:has(.battle-caption-copy:focus-visible) { outline: 2px solid #fff3c6; outline-offset: 1px; }

.game-shell :is(.explore-overlay, .battle-overlay) {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  min-height: 0;
  margin: 0;
  padding: 13px var(--stage-gutter) 11px;
  background: linear-gradient(0deg, #17282bec, #263d3ece 34%, transparent);
  pointer-events: none;
}

.game-shell :is(.explore-overlay, .battle-overlay) button { pointer-events: auto; }
.explore-overlay .inventory > .eyebrow,
.explore-overlay .keyboard { color: #e8eade; text-shadow: 0 1px 2px #102327, 0 0 5px #102327; }
.explore-overlay .slot { padding: 0; border-color: #6e8a84; border-radius: 1px 4px 3px 5px; background: #273f42ec; color: var(--chalk); pointer-events: auto; }
.explore-overlay .slot.owned { background: #476665ee; border-color: #9caea0; box-shadow: 2px 2px #132124a1; }
.explore-overlay .slot:not(.owned) { opacity: .66; }
.explore-overlay .carry-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 31px;
  padding: 2px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-weight: 740;
  text-shadow: 0 1px #1c2d31;
}
.explore-overlay .carry-item .hud-icon { width: 21px; height: 21px; }
.explore-overlay .carry-item:hover { background: #c5dac63d; }
.explore-overlay .carry-item:focus-visible { outline-offset: 2px; }
.explore-overlay .slot.equipped { border-color: #dce8c7; box-shadow: inset 0 0 0 1px #dee7c950, 1px 2px #172528; }
.game-shell .battle-overlay { justify-content: center; gap: 16px; }
.battle-overlay .actions { width: auto; max-width: min(630px, 80%); }
.game-shell .action { width: auto; min-height: 45px; padding: 5px 9px; }
.game-shell .action .hud-icon { width: 32px; height: 31px; }
.battle-overlay .grid-control { min-width: 0; color: var(--chalk); text-shadow: 0 1px 3px #142123; }
.battle-overlay .grid-control strong { color: #d9e4c6; }

.game-shell {
  --private-fabric: #4e3457;
  --private-paper: #dec4e8;
  --private-edge: #a984b7;
  --private-ink: #332139;
  --private-text: #f6e9fa;
}

.world-console {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(205px, 1fr);
  gap: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-top: 3px solid #708d87;
  color: var(--dock-ink);
  background: radial-gradient(ellipse at 96% 100%, #824e4546, transparent 30%), repeating-linear-gradient(105deg, #b9cec206 0 1px, transparent 1px 8px 12px), #1d3033;
  box-shadow: inset 0 1px #ccddd18a;
}

.location-chat, .location-players {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.location-chat {
  grid-template-areas: "heading" "messages" "restriction" "compose";
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.location-chat > .console-heading { grid-area: heading; }
.location-chat > .chat-log { grid-area: messages; }
.location-chat > .chat-compose { grid-area: compose; }
.location-chat > .chat-restriction { grid-area: restriction; }
.location-players { grid-template-rows: auto minmax(0, 1fr) auto; border-left: 2px solid #597271; background: linear-gradient(112deg, #acc3b80c, transparent 37%), #263c3e; }
.console-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 4px 16px;
  border-bottom: 1px solid #758780;
  background: var(--fasteners), radial-gradient(ellipse at 98% 110%, #be73558c, transparent 24%),
    repeating-linear-gradient(171deg, transparent 0 31px, #d4ded026 32px, transparent 33px 37px), #3a585a;
}

.console-title { display: flex; align-items: center; min-width: 0; gap: 7px; }
.console-title .hud-icon { width: 24px; height: 24px; }
.console-title h2 { margin: 0; color: var(--chalk); font-size: .84rem; font-weight: 850; line-height: 1.02; letter-spacing: .06em; text-transform: uppercase; }
.console-room { min-width: 0; overflow: hidden; color: #dce5d9; font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.console-status, .player-count {
  display: inline-flex;
  align-items: center;
  flex: none;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid #91a299a6;
  border-radius: 1px 3px 0 2px;
  background: #293c40;
  color: #edf0df;
  font-weight: 750;
  font-size: .69rem;
  white-space: nowrap;
}

.console-status[data-state='online']::before,
.console-status[data-online='true']::before { content: ''; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #bed7a1; box-shadow: 0 0 6px #bed7a178; }
.player-count { min-width: 24px; justify-content: center; font-variant-numeric: tabular-nums; }

.chat-log, .player-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #708c86 #213437;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
}

.chat-log { display: flex; flex-direction: column; gap: 6px; padding-inline: 13px; }
.chat-channels { display: flex; align-items: center; min-width: 0; gap: 4px; }
.chat-channels button, .chat-recipient {
  -webkit-tap-highlight-color: transparent;
}
.chat-channels button {
  padding: 3px 8px;
  border: 1px solid #b3815470;
  border-radius: 3px;
  background: #4b2d1e76;
  color: #eac69a;
  font: inherit;
  font-size: .75rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-channels button[aria-pressed='true'] { border-color: #e2b973; background: #ecd09b; color: #4b2c1c; }
.chat-channels button:disabled { opacity: .55; }
#chat-world-tab, #chat-local-tab { flex-shrink: 0; }
.chat-private-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.chat-private-thread {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 13rem;
  border: 1px solid #ae82a6;
  border-radius: 4px;
  background: #563442ad;
  color: var(--private-text);
}
.chat-private-thread[data-selected='true'] {
  border-color: var(--private-paper);
  background: var(--private-fabric);
}
.chat-channels .chat-private-thread button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  border: 0;
  background: none;
  color: inherit;
  font-size: clamp(.8rem, 1vw, 1rem);
}
.chat-channels .chat-private-thread .chat-private-close {
  flex: none;
  justify-content: center;
  width: 1.65rem;
  padding-inline: 0 4px;
  color: #edd2a7;
  font-size: 1.05rem;
  line-height: .8;
}
.chat-private-tabs .chat-private-tab[data-unread],
.chat-channels .chat-private-close:hover {
  color: #ffe0ad;
}
.chat-private-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-private-tabs button:focus-visible { outline-offset: -2px; }
.chat-private-unread {
  min-width: 1.2rem;
  padding: 1px 3px;
  border-radius: 10px;
  background: var(--private-paper);
  color: var(--private-ink);
  text-align: center;
  font-size: .66rem;
  font-variant-numeric: tabular-nums;
}
.mobile-chat-toggle[data-private-unread] { position: relative; }
.mobile-chat-toggle[data-private-unread]::after {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 1rem;
  padding: 1px 3px;
  border: 1px solid var(--private-edge);
  border-radius: 10px;
  background: var(--private-fabric);
  color: var(--private-text);
  content: attr(data-private-unread);
  font: 750 .64rem/1.2 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-align: center;
  pointer-events: none;
}
.is-private-chat .chat-system {
  color: var(--private-paper);
  border-left-color: var(--private-edge);
}
.chat-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; font-size: .81rem; line-height: 1.4; }
.chat-line.is-private {
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  background: #693c5c62;
}
.cardboard-game .chat-line.is-private :is(.chat-text, .chat-name) { color: var(--private-text); }
.cardboard-game .chat-line.is-private .chat-time { color: #e5c294; }
.chat-identity, .player-name-line { display: flex; align-items: center; min-width: 0; gap: 5px; }
.chat-identity { max-width: 100%; }
.chat-trade-invite { min-height: 1.9em; column-gap: clamp(7px, 1vw, 17px); }
.chat-trade-text { color: #f8dcb1; }
.chat-trade-controls { display: inline-flex; flex-wrap: wrap; gap: 2px clamp(8px, 1.5vw, 24px); align-items: center; }
.chat-trade-action {
  padding: 2px;
  border: 0;
  background: none;
  color: #e0bb9a;
  font: inherit;
  cursor: pointer;
}
.chat-trade-action[data-chat-trade-action='open'] { color: #ffe19b; text-decoration: underline; text-underline-offset: .22em; }
.chat-trade-action:hover, .chat-trade-action:focus-visible { color: #fff4da; }
.chat-trade-action:disabled { opacity: .65; cursor: wait; }
.chat-name { min-width: 0; color: #c4dec9; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-recipient {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.player-name-line .chat-recipient { color: var(--chalk); }
.chat-recipient:hover, .chat-recipient:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.chat-text { flex: 1 1 10ch; min-width: 0; color: var(--chalk); overflow-wrap: anywhere; }
.chat-time { order: 3; flex: none; margin-left: auto; color: var(--dock-muted); font-size: .66rem; font-variant-numeric: tabular-nums; }
.player-faction-label { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: .72em; font-weight: 750; white-space: nowrap; }
.player-faction-label.is-knots { color: #d5d8a5; }
.player-faction-label.is-gates { color: #f3bc88; }
.player-faction-label img { width: 19px; height: 18px; object-fit: contain; }
.player-profile-dot, .player-message-dot {
  position: relative;
  flex: none;
  width: 1.2em;
  height: 1em;
  padding: 0;
  border: 0;
  font: inherit;
  background: none;
  cursor: pointer;
}
.player-profile-dot { border-radius: 50%; }
.player-profile-dot img, .player-message-dot::before {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: .72em;
  height: .72em;
  width: 1cap;
  height: 1cap;
  margin: auto;
  pointer-events: none;
}
.player-profile-dot img {
  border: 1px solid #ba8d59;
  border-radius: 50%;
  background: #3c2418;
  object-fit: cover;
  object-position: center 24%;
}
.player-message-dot::before {
  content: '';
  border: 1px solid #b28cab;
  border-radius: 2px;
  background: #57364b url('assets/public-profile/profile-message.webp') -.2em center / auto .92em no-repeat;
}
.player-profile-dot:hover img, .player-profile-dot:focus-visible img { border-color: #ffdb91; }
.player-message-dot:hover::before, .player-message-dot:focus-visible::before { border-color: #ffdb91; }
.player-profile-dot:focus-visible, .player-message-dot:focus-visible, .chat-channels button:focus-visible, .chat-recipient:focus-visible {
  outline: 2px solid #ffdb91;
  outline-offset: 1px;
}
.is-private-chat :focus-visible {
  outline-color: var(--private-paper);
}
.chat-system { padding: 4px 7px 4px 8px; border-left: 3px solid var(--sheet-accent); color: var(--dock-muted); font-size: .75rem; line-height: 1.35; }

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  padding: 6px 12px 9px;
  border-top: 1px solid #496466;
  background: #294042;
}

.chat-compose input {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 7px 10px;
  border: 1px solid #6b8580;
  border-radius: 0 4px 3px 2px;
  background: #17292d;
  color: var(--chalk);
  box-shadow: inset 0 2px 3px #101b1e84;
  font: inherit;
  font-size: .83rem;
}

.chat-compose input::placeholder { color: #b2c9c4; }
.chat-compose input:focus { outline: 1px solid #d0e4ca; outline-offset: 0; border-color: #d0e4ca; }
.game-shell .chat-send { --plate: #753e39; --plate-sheen: #a66657; --sheet-edge: #be8d7d; min-height: 37px; }
.game-shell .chat-send .hud-icon { width: 24px; height: 23px; }
.game-shell .chat-send:disabled { opacity: .65; }

.player-list { display: grid; align-content: start; gap: 6px; }
.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 7px 4px 4px;
  border: 1px solid #55716c;
  border-radius: 2px 5px 2px 4px;
  background: #354f51;
}

.player-identity { display: grid; gap: 3px; min-width: 0; line-height: 1.13; }
.player-identity .player-name-line { font-size: .82rem; }
.player-identity .player-name-line:has(.chat-recipient) { font-size: clamp(.78rem, 1.13vw, 1.08rem); }
.player-identity strong { overflow: hidden; color: var(--chalk); font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.player-identity small { color: #c0d3c7; font-size: .67rem; }
.player-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.player-actions button { min-height: 30px; padding: 4px 8px; }

.cardboard-game .world-console .social-heading { padding-inline: 5px; }
.social-heading .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.social-tabs {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  width: 100%;
}
.social-tabs button {
  position: relative;
  min-width: 0;
  min-height: 27px;
  padding: 2px 3px;
  border: 1px solid #a7784e;
  border-radius: 3px 3px 1px 1px;
  background: #4b2d1e96;
  color: #f0d0a3;
  font: 800 clamp(.63rem, 6.5cqw, .93rem)/1 'Trebuchet MS', 'Segoe UI', sans-serif;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.social-tabs button[aria-pressed='true'] { border-color: #e2b973; background: #ecd09b; color: #4b2c1c; }
.social-tabs button:has(.social-tab-badge:not([hidden], #player-count)) { border-color: #f6cc75; }
.social-tabs button:focus-visible, .social-action:focus-visible { outline: 2px solid #ffe3a4; outline-offset: 1px; }
.social-tab-badge {
  display: inline-block;
  min-width: .95em;
  margin-left: .12em;
  padding: 1px 3px;
  border-radius: 8px;
  background: #dc974a;
  color: #402318;
  font-size: .76em;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}
.social-tab-badge[hidden] { display: none; }
#player-count.social-tab-badge { background: #785135; color: #fff0cc; }
.mobile-chat-toggle[data-social-unread] { position: relative; }
.mobile-chat-toggle[data-social-unread]::before {
  position: absolute;
  top: 1px;
  left: 1px;
  min-width: 1rem;
  padding: 1px 3px;
  border: 1px solid #fff0b2;
  border-radius: 10px;
  background: #dc974a;
  color: #402318;
  content: attr(data-social-unread);
  font: 800 .63rem/1.2 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-align: center;
  pointer-events: none;
}
.location-players > [hidden] { display: none; }
.social-list {
  min-width: 0;
  min-height: 0;
  padding: 5px 7px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.social-subheading {
  margin: 0;
  padding: 3px 3px 4px;
  border-bottom: 1px solid #ad7a4f71;
  color: #f5d39a;
  font: 800 .75rem/1.1 'Trebuchet MS', 'Segoe UI', sans-serif;
}
.social-people { display: grid; gap: 5px; margin: 0 0 6px; padding: 4px 0 0; list-style: none; }
.social-person { display: grid; min-width: 0; gap: 3px; padding: 3px 4px; border-radius: 3px; background: #eecd9820; }
.social-person .player-name-line { min-width: 0; font-size: .81rem; }
.social-person .player-name-line > :is(strong, .chat-recipient) {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #f4e1c0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-presence { display: block; margin: 2px 0; color: #d0ae89; font-size: .68rem; line-height: 1.3; }
.social-presence[data-online='true'] { color: #d6e0ad; }
.social-presence::before { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: currentColor; content: ''; vertical-align: .12em; }
.social-leader { display: inline-block; margin-inline-start: 4px; padding: 0 3px; border: 1px solid #b9935e; border-radius: 2px; color: #ffd998; }
.social-actions { display: flex; flex-wrap: wrap; gap: 3px; }
.social-action {
  min-height: 23px;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #cca467;
  border-radius: 3px;
  background: #ecd09b;
  color: #4b2c1c;
  font: 750 .72rem/1.05 'Trebuchet MS', 'Segoe UI', sans-serif;
}
.social-action-secondary { border-color: #a57851; background: #4c3124; color: #f4d1a1; }
.social-action:hover:enabled { filter: brightness(1.16); }
.social-action:disabled { opacity: .56; }
.social-empty, .social-status { margin: 0; padding: 4px; color: #e7c59a; font-size: .73rem; line-height: 1.25; }
.social-status { border-top: 1px solid #ad7a4f71; background: #512f25; }
.cardboard-game .player-identity .social-relation { color: #dec58e; }
.cardboard-game .player-identity .social-relation[data-kind='group'] { color: #dbd7aa; }

@container (max-width: 210px) {
  .social-tabs button { padding-inline: 1px; }
  .social-tab-badge { position: absolute; z-index: 1; top: -5px; right: -2px; margin: 0; }
}

@media (max-width: 650px) {
  .social-tabs button { min-height: 32px; padding-inline: 0; font-size: .63rem; }
  .social-list { padding-inline: 4px; }
  .social-action { min-height: 30px; }
  .social-person .player-name-line .player-faction-label { font-size: 0; gap: 0; }
}

.rpg-inventory :is([data-make], [data-gear-action], [data-place])::before {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  vertical-align: middle;
  content: '';
  background: url('assets/hud-new/craft.webp') center / contain no-repeat;
}
.rpg-inventory [data-gear-action]::before { background-image: url('assets/hud-new/hand.webp'); }

@media (max-height: 600px) {
  .game.game-shell { --dock-height: clamp(131px, 27dvh, 170px); --top-tools: 66px; }
  .game-shell .stage-toolbar { padding-block: 6px 8px; }
  .stage-toolbar .yard-title-image { height: 44px; }
  .game-shell :is(.explore-overlay, .battle-overlay) { padding-block: 8px 6px; }
  .console-heading { min-height: 35px; }
  .chat-compose { padding-block: 4px 6px; }
}

@media (max-width: 900px) {
  .game-shell .stage:has(.battle-overlay:not([hidden])) > canvas { height: calc(100% - 52px); }
  .game-shell .stage:has(.battle-overlay:not([hidden])) .battle-overlay {
    min-height: 52px;
    padding-block: 4px;
    background: linear-gradient(0deg, #17282bf5, #2f4648f2);
  }
}

@media (max-width: 780px) {
  .game.game-shell { --stage-gutter: 10px; }
  .world-console { grid-template-columns: minmax(0, 2.45fr) minmax(140px, 1fr); }
  .stage-toolbar .topbar-actions { gap: 5px; }
  .stage-toolbar .hud-button { gap: 4px; padding-inline: 5px; }
  .stage-toolbar .hud-button .hud-icon { width: 24px; height: 24px; }
  .stage-toolbar .hud-button kbd { display: none; }
  .battle-overlay .actions { max-width: none; }
}

@media (max-width: 560px) {
  .game.game-shell { --dock-height: clamp(150px, 26dvh, 210px); --top-tools: 58px; --stage-gutter: 8px; }
  .game-shell .stage-toolbar { padding-top: 5px; padding-bottom: 6px; }
  .stage-toolbar .brand { gap: 6px; }
  .stage-toolbar .brand > div { min-width: 0; }
  .stage-toolbar .brand h1 { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; }
  .stage-toolbar .brand p { display: none; }
  .stage-toolbar .yard-title-image { width: clamp(115px, 38vw, 186px); height: 38px; }
  .stage-toolbar .lantern { width: 28px; height: 29px; }
  .stage-toolbar .lantern::before { inset: 6px 7px 5px; }
  .stage-toolbar .lantern::after { inset: 3px 10px auto; }
  .stage-toolbar .hud-button { min-width: 34px; min-height: 34px; }
  .stage-toolbar .hud-button-label, .chat-send .hud-button-label { display: none; }
  .game-shell .scene-label { top: calc(var(--top-tools) + 2px); }
  .game-shell .health-row > .health-card:first-child { padding-bottom: 24px; }
  .game-shell .health-row > .round-stamp {
    display: block;
    position: absolute;
    bottom: 5px;
    left: calc(var(--stage-gutter) + 6px);
    max-width: calc(44% - 20px);
    padding: 2px 5px;
    transform: none;
    font-size: .58rem;
    letter-spacing: .035em;
  }
  .game-shell .battle-overlay { gap: 4px; }
  .game-shell .battle-overlay .grid-control { display: none; }
  .game-shell .action { padding-inline: 5px; font-size: .73rem; }
  .game-shell .action .hud-icon { width: 23px; height: 23px; }
  .game-shell .action kbd { display: none; }
  .explore-overlay .carry-item { padding-inline: 4px; }
  .game-shell .interact { bottom: 97px; }
  .game-shell .feedback { bottom: 141px; }
  .world-console { grid-template-columns: minmax(0, 2.1fr) minmax(108px, 1fr); }
  .console-heading { gap: 5px; min-height: 34px; padding: 3px 6px; }
  .console-title { gap: 4px; }
  .console-title .hud-icon { width: 19px; height: 19px; }
  .console-title h2 { font-size: .73rem; }
  .console-room { display: none; }
  .chat-log, .player-list { padding: 5px 6px; }
  .chat-line { flex-wrap: wrap; gap: 1px 4px; font-size: .73rem; }
  .chat-text { max-width: 100%; }
  .chat-time { display: none; }
  .chat-system { font-size: .69rem; }
  .chat-compose { gap: 3px; padding: 4px 5px 6px; }
  .chat-compose input { min-height: 34px; padding-inline: 6px; font-size: 16px; }
  .game-shell .chat-send { min-width: 34px; min-height: 34px; padding: 4px; }
  .player-row { gap: 4px; min-height: 33px; padding: 3px; }
  .player-faction-label img { width: 15px; height: 15px; }
  .chat-channels button { padding-inline: 5px; }
  .chat-channels .chat-private-thread button { padding: 5px 8px; font-size: .76rem; }
  .chat-channels .chat-private-thread .chat-private-close { width: 1.35rem; padding-inline: 0 3px; }
  .player-identity .player-name-line { font-size: .66rem; }
  .player-identity small { font-size: .58rem; }
}

@media (orientation: landscape) and (max-width: 650px) {
  .location-chat .console-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #chat-local-tab { max-width: min(37vw, 12rem); }
  .chat-private-thread { max-width: 7.5rem; }
}

@media (orientation: landscape) and (max-width: 510px) {
  #chat-status {
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
  }
  #chat-status::before { width: 6px; height: 6px; border-radius: 50%; background: #937454; content: ''; }
  #chat-status.is-online::before { background: #bed7a1; }
}

.chat-restriction {
  margin: 0;
  padding: 4px 8px;
  background: #522e1e;
  color: #ffe8b8;
  font-size: .83rem;
  overflow-wrap: anywhere;
}
