:root {
  color-scheme: dark;
  --ink: #f3ead8;
  --soft: #bdbcae;
  --muted: #a3a699;
  --dark: #121814;
  --panel: #1a211c;
  --line: #59605670;
  --amber: #e9b76d;
  --green: #8fc6a4;
  --red: #ef9b7c;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --game-width: min(100vw, 480px);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--dark);
  color: var(--ink);
}

* { box-sizing: border-box; }
.travel-dialog { padding: 0; border: 0; margin: auto; width: var(--game-width); max-width: 100vw; height: 100dvh; max-height: 100dvh; background: var(--dark); color: var(--ink); overflow: hidden; }
.travel-dialog::backdrop { background: #080e0cf5; }
.training-dialog iframe { width: 100%; height: 100%; border: 0; display: block; }
.travel-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 20px; background: radial-gradient(ellipse at center, #243129, #101713 70%); text-align: center; }
.travel-loading h2 { font-size: clamp(1rem, 4.5vw, 1.4rem); line-height: 1.5; word-break: keep-all; }
.travel-spinner { width: 34px; height: 34px; border: 2px solid #657160; border-top-color: var(--amber); border-radius: 50%; animation: travel-spin .8s linear infinite; }
@keyframes travel-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .travel-spinner { animation: none; } }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; justify-content: center; overflow: hidden; background: #080e0c; }
.game-shell { position: relative; isolation: isolate; width: var(--game-width); height: 100%; overflow: hidden; background: var(--dark); box-shadow: 0 0 80px #0008; }
.startup-status { position: fixed; z-index: 20; inset: 0; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: auto; padding: 20px 16px 28px; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(clamp(28px, 7vh, 74px), env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: #101110; text-align: center; overflow-wrap: anywhere; }
.startup-status:not([hidden]) ~ .game-shell,
.startup-status:not([hidden]) ~ dialog { visibility: hidden; }
.startup-art, .startup-status::after { position: absolute; inset: 0; pointer-events: none; }
.startup-art { z-index: -2; background-position: center 42%; background-size: cover; background-repeat: no-repeat; }
.startup-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.startup-status::after { z-index: -1; content: ""; background: linear-gradient(180deg, transparent 48%, #10111035 63%, #101110ee 86%, #101110); }
.startup-content { display: grid; justify-items: center; gap: 12px; max-width: 100%; }
.startup-content h1 { color: var(--ink); font-family: "Arial Black", Impact, system-ui, sans-serif; font-size: clamp(2rem, 8.5vw, 5.2rem); font-weight: 900; line-height: 1; letter-spacing: .035em; text-shadow: 0 2px 16px #000; }
.startup-message { display: grid; gap: 5px; max-width: 36rem; color: var(--ink); }
.startup-message .micro { color: var(--soft); }
#startup-detail:empty { display: none; }
@media (max-height: 460px) {
  .startup-status { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .startup-art { background-position: center 12%; }
  .startup-art img { object-position: center 12%; }
  .startup-content { gap: 8px; }
  .startup-content h1 { font-size: clamp(1.75rem, 9vh, 3rem); }
}
button { color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 4px; }
button, input, label { -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.base {
  position: relative;
  height: 100%;
  font-family: system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  overflow: auto;
  overscroll-behavior: contain;
  padding: calc(10px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
    calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  display: grid;
  grid-template-rows: max-content 1fr;
}

.base-shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0e1412f7 0%, #0e1412d9 21%, #0d141270 53%, #10161382 100%),
    linear-gradient(0deg, #0b110edb 0%, transparent 49%, #11171453 100%);
}

.masthead {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.wordmark, .location-label, .micro, .briefing-tag {
  font: 600 11px var(--mono);
  letter-spacing: 0.14em;
}

.wordmark, .location-label, .briefing-tag { display: flex; align-items: center; gap: 10px; }
.masthead-right { display: flex; align-items: center; gap: clamp(6px, 2vw, 18px); }
.wordmark { color: var(--ink); }
.location-label { color: var(--soft); font-size: 10px; }
.location-label span { display: inline-block; width: 13px; border-top: 1px solid #737a6d; }
.brand-mark { width: 17px; height: 16px; display: inline-block; background: var(--amber); clip-path: polygon(45% 0, 65% 0, 100% 100%, 78% 100%, 55% 31%, 28% 100%, 0 100%); }

.base-layout {
  position: relative;
  width: 100%;
  max-width: 1260px;
  margin: auto;
  padding: clamp(26px, 8vh, 96px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(305px, 390px);
  align-items: center;
  gap: clamp(20px, 5vw, 80px);
}

.briefing { align-self: center; padding-bottom: 18px; container-type: inline-size; }
.briefing-tag { color: var(--amber); padding: 0 0 12px 3px; }
.briefing-tag span { width: 21px; border-top: 1px solid var(--amber); }
.briefing h1 { margin-left: -0.05em; font-size: clamp(24px, 15cqi, 145px); line-height: 1.02; font-weight: 900; letter-spacing: -0.075em; }
.briefing h1 span { color: var(--amber); margin-left: 0.09em; }
.premise { margin-top: clamp(17px, 3vh, 34px); font-size: clamp(17px, 2.4vw, 26px); font-weight: 650; line-height: 1.53; letter-spacing: -0.045em; }
.install-help > p, .install-help ul { font-size: 13px; line-height: 1.6; }
.install-help input { display: block; width: 100%; margin-block: 8px; padding: 9px; border: 1px solid #777765; color: var(--ink); background: #121814; font: inherit; }
.install-help ul { margin: 12px 0 0; padding-inline-start: 18px; }
.install-help > [role="status"] { margin-top: 6px; }
.room-panel { width: min(100%, 340px); margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.room-clock { color: var(--green); font-size: 14px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; }
.room-roster, .room-sessions { margin-top: 6px; border: 1px solid var(--line); background: #151e18e8; }
.room-roster header, .room-sessions header { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; border-bottom: 1px solid var(--line); }
.room-roster h2, .room-roster header span, .room-sessions h2, .room-sessions header span { font-size: 13px; }
.room-roster header span, .room-sessions header span, .room-roster-message { color: var(--soft); }
.room-roster-message { padding: 5px 9px; font-size: 12px; line-height: 1.5; word-break: keep-all; }
.room-roster-columns, .room-participants li { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, min(54px, 21%)); align-items: center; gap: 4px; }
.room-roster-columns { padding: 6px 9px; background: var(--panel); color: var(--soft); font-size: 11px; word-break: keep-all; border-bottom: 1px solid var(--line); }
.room-roster-columns > :not(:first-child), .room-participants li > :not(:first-child) { text-align: center; }
.room-participants {
  --roster-row-height: 32px;
  list-style: none; margin: 0; padding: 0 9px;
  max-block-size: calc(var(--roster-visible-rows) * var(--roster-row-height));
  overflow-y: auto; scrollbar-width: none; overflow-anchor: none;
}
.room-participants::-webkit-scrollbar { display: none; }
.room-participants.is-scrollable { cursor: grab; }
.room-participants.is-scrollable.is-dragging { cursor: grabbing; }
.room-participants:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.room-participants li { block-size: var(--roster-row-height); font-size: 13px; }
.room-participants li + li { border-top: 1px solid var(--line); }
.room-player-name { display: flex; align-items: center; gap: 3px; min-width: 0; }
.room-player-rank { flex: none; width: auto; height: 1em; }
.room-player-nickname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-player-escaped { color: var(--green); font-variant-numeric: tabular-nums; }
.room-player-lost { color: var(--red); font-variant-numeric: tabular-nums; }
.room-player-status { color: var(--green); font-size: 12px; word-break: keep-all; }
.room-player-status.playing-raid { color: var(--amber); }
.room-session-list { list-style: none; margin: 0; padding: 0 9px; max-height: 192px; overflow: auto; }
.room-session-list li { padding: 8px 0; }
.room-session-list li + li { border-top: 1px solid var(--line); }
.room-session-list li > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.room-session-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-session-difficulty { flex: none; color: var(--amber); font-size: 12px; }
.room-session-list p { margin-top: 4px; color: var(--soft); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.death-log { list-style: none; margin: 5px 0 0; padding: 0; color: var(--red); font-size: 11px; line-height: 1.6; }
.room-panel .death-log { max-height: 4.8em; overflow: auto; }
.zone-label .death-log { padding-top: 4px; border-top: 1px solid var(--line); }

.loadout-preview {
  display: grid;
  grid-template-columns: minmax(80px, 38%) minmax(0, 1fr);
  align-items: center;
  width: min(100%, 340px);
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #151e18e8;
}
.loadout-preview canvas { display: block; width: 100%; height: auto; background: radial-gradient(ellipse, #474d3c, #1b251d 68%, #151e18); }
.loadout-preview-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 7px 10px; }
.loadout-preview h2 { color: var(--ink); font-size: 14px; word-break: keep-all; }
.loadout-preview dl { grid-column: 1 / -1; display: grid; gap: 3px; margin: 0; font-size: 11px; line-height: 1.4; }
.loadout-preview dl div { display: grid; grid-template-columns: 4.7em minmax(0, 1fr); gap: 4px; }
.loadout-preview dt { color: var(--soft); white-space: nowrap; }
.loadout-preview dd { margin: 0; color: var(--ink); word-break: keep-all; }
.loadout-preview-actions { grid-area: 1 / 2; display: flex; gap: 4px; }
.loadout-preview-actions button { min-width: 44px; padding-inline: 6px; }
#preview-attack-help { grid-column: 1 / -1; color: var(--soft); font-size: 10px; }
.preview-attack.workbench-open { border-color: var(--amber); background: #413320; color: #ffe0ab; touch-action: none; user-select: none; }
.preview-attack.workbench-open:hover:not(:disabled), .preview-attack.workbench-open:active { background: #594225; }
.preview-attack:disabled { opacity: 0.5; }

.loadout {
  padding: clamp(16px, 2.4vw, 29px);
  background: linear-gradient(145deg, #20271fed, #151b17f5);
  border: 1px solid #6470638c;
  border-top-color: #b69a6f;
  box-shadow: 0 16px 55px #0005;
}

.loadout-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 13px; }
.loadout-save-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.loadout-save-row label { display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: 11px; }
.loadout-save-row select { min-height: 44px; border: 1px solid var(--line); background: #121a14; color: var(--ink); padding: 4px 7px; }
.loadout-save-help { margin: 7px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.bag-supplies { margin-top: 9px; padding: 0 9px; border: 1px solid var(--line); background: #121a14; }
.bag-supplies summary { min-height: 42px; padding-block: 12px; color: var(--ink); cursor: pointer; font-size: 12px; }
.bag-supplies summary span { margin-left: 6px; color: var(--green); font-family: var(--mono); }
.bag-supplies fieldset { display: grid; max-height: 200px; overflow: auto; min-inline-size: 0; margin: 0; padding: 0 0 6px; border: 0; }
.bag-supplies label { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; color: var(--soft); font-size: 11px; }
.bag-supplies .supply-remaining { display: block; margin-top: 2px; color: var(--green); font-size: 11px; }
.bag-supplies select { min-height: 44px; border: 1px solid var(--line); background: #121a14; color: var(--ink); padding: 4px 7px; }
.bag-supplies fieldset p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.loadout-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.account-form { display: grid; gap: 10px; margin-top: 12px; }
.account-form label { display: grid; gap: 4px; color: var(--ink); font-size: 13px; }
.account-form input { width: 100%; min-height: 44px; border: 1px solid #777765; padding: 0 9px; font: inherit; color: var(--ink); background: #121814; }
.account-form .workbench-help { margin: 0; }
.account-form .primary { justify-content: center; }
.account-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.account-nav button[aria-pressed="true"] { color: var(--ink); border-color: var(--amber); background: #393521; }
.recovery-code { display: block; padding: 8px; color: var(--amber); background: #121814; font-family: var(--mono); overflow-wrap: anywhere; user-select: all; }
.abandon-raid { width: 100%; margin-top: 9px; }
.resume-raid { width: 100%; margin-top: 10px; border-color: var(--green); color: var(--green); }
.loadout h2, .dialog h2 { font-size: 22px; letter-spacing: -0.05em; }
.supply-receipts { display: grid; gap: 8px; margin-bottom: 16px; }
.supply-receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 10px;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--green);
  background: var(--dark);
}
.supply-receipt h2 { color: var(--green); font-size: 15px; word-break: keep-all; }
.supply-receipt .workbench-open { min-width: 44px; min-height: 44px; }
.supply-receipt ul { grid-column: 1 / -1; display: grid; gap: 3px; margin: 0; padding: 0; font-size: 12px; }
.supply-receipt li { display: flex; justify-content: space-between; gap: 8px; color: var(--soft); }
.supply-receipt li span:last-child { color: var(--ink); white-space: nowrap; }
.micro { color: var(--muted); }
.equipment { min-width: 0; margin: 0; padding: 0; border: 0; }
.equipment + .equipment { margin-top: 11px; }
.equipment legend { margin-bottom: 5px; padding: 0; color: var(--soft); font-size: 11px; font-weight: 700; }
.equipment-list { display: grid; gap: 4px; }
.equipment input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.equipment label { display: grid; grid-template-columns: 26px 1fr auto; gap: 7px; align-items: center; min-height: 44px; padding: 5px 9px; border: 1px solid #5b64575e; background: #0d15116b; cursor: pointer; }
.equipment input:checked + label { background: #bf92501e; border-color: #b49159; }
.equipment label:hover { border-color: #aaa18a; }
.item-name { display: block; font-size: 13px; font-weight: 800; }
.item-detail { display: block; color: var(--soft); margin-top: 2px; font-size: 10px; line-height: 1.2; }
.grade-badge { display: block; width: fit-content; margin-top: 3px; padding: 1px 5px; border: 1px solid currentColor; border-radius: 3px; font-size: 10px; line-height: 1.4; color: var(--soft); }
.loot-item-name[data-grade="basic"] { color: #d9d8cf; }
.loot-item-name[data-grade="lesser"] { color: var(--soft); }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="normal"] { color: #a7c8b0; }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="greater"] { color: #9fbdd4; }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="extreme"] { color: #9cddd9; }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="unique"] { color: #ffc879; }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="boss"] { color: #dfb779; }
:is(.grade-badge, .loot-item-name, .recipe-grade-heading)[data-grade="special"] { color: #c7a4e5; }
.item-count { color: var(--amber); font: 11px var(--mono); }
.item-glyph { display: inline-grid; place-items: center; width: 23px; height: 23px; color: var(--amber); }
.item-glyph::before { content: ""; width: 19px; height: 19px; background: currentColor; }
.item-glyph.vest::before { clip-path: polygon(5% 17%, 33% 7%, 45% 26%, 55% 26%, 67% 7%, 95% 17%, 90% 48%, 80% 53%, 86% 91%, 14% 91%, 20% 53%, 10% 48%); }
.item-glyph.boots::before { clip-path: polygon(18% 5%, 61% 5%, 61% 56%, 92% 67%, 98% 89%, 9% 89%, 9% 64%, 18% 54%); }
.item-glyph.none::before { width: 13px; height: 1px; background: var(--muted); }
.item-glyph.scrap { color: #c5ae88; }
.item-glyph.scrap::before { clip-path: polygon(19% 6%, 72% 13%, 62% 42%, 96% 48%, 80% 87%, 45% 94%, 27% 69%, 7% 60%); }
.item-glyph.fiber { color: #b7c49c; }
.item-glyph.fiber::before { clip-path: polygon(4% 34%, 55% 8%, 94% 17%, 95% 57%, 43% 87%, 7% 78%, 6% 67%, 41% 77%, 85% 51%, 85% 32%, 41% 55%, 6% 49%); }
.item-glyph.alloy { color: #b8c8d2; }
.item-glyph.alloy::before { clip-path: polygon(13% 32%, 75% 6%, 94% 28%, 94% 62%, 28% 93%, 8% 69%, 8% 43%, 28% 61%, 84% 35%, 77% 22%, 27% 45%); }
.item-glyph.steel-ingot::before { clip-path: polygon(36% 18%, 85% 18%, 98% 58%, 73% 81%, 9% 81%, 3% 53%, 70% 53%, 85% 27%, 71% 46%, 14% 46%); }
.item-glyph.fabric::before { clip-path: polygon(7% 33%, 66% 13%, 93% 27%, 93% 73%, 35% 93%, 7% 79%, 7% 69%, 35% 83%, 85% 64%, 85% 52%, 35% 71%, 7% 57%, 7% 48%, 35% 61%, 85% 42%, 85% 32%, 35% 50%); }
.item-glyph.extract::before { width: 9px; border-radius: 2px 2px 4px 4px; box-shadow: inset 0 4px #567066, inset 0 -5px #527f71; }
.item-glyph.potion::before { clip-path: polygon(34% 4%, 66% 4%, 66% 23%, 81% 36%, 83% 87%, 72% 97%, 28% 97%, 17% 87%, 19% 36%, 34% 23%); }
.item-glyph.noise-bomb::before { clip-path: polygon(39% 0, 64% 0, 64% 19%, 80% 28%, 94% 56%, 84% 87%, 55% 100%, 20% 87%, 7% 56%, 23% 28%, 39% 22%); }
.item-glyph.speed-potion::before { clip-path: polygon(48% 0, 82% 0, 64% 36%, 92% 36%, 31% 100%, 43% 55%, 12% 55%); }
.item-glyph.buckle::before { width: 15px; height: 11px; background: transparent; border: 2px solid currentColor; transform: rotate(-23deg); }
.item-glyph.plate::before { clip-path: polygon(17% 10%, 50% 2%, 83% 10%, 90% 39%, 77% 73%, 50% 97%, 23% 73%, 10% 39%); }
.item-glyph.claw::before { clip-path: polygon(82% 4%, 91% 40%, 74% 78%, 50% 94%, 18% 90%, 12% 68%, 42% 62%, 68% 41%); }
.item-glyph.core::before { clip-path: polygon(35% 3%, 67% 9%, 91% 40%, 78% 78%, 49% 98%, 14% 81%, 5% 44%); }
.item-glyph.backpack::before { clip-path: polygon(35% 2%, 65% 2%, 65% 19%, 82% 25%, 92% 50%, 92% 93%, 8% 93%, 8% 50%, 18% 25%, 35% 19%, 35% 2%, 42% 9%, 42% 19%, 58% 19%, 58% 9%, 42% 9%); }
.item-glyph.pouch::before { clip-path: polygon(5% 20%, 95% 20%, 95% 37%, 83% 45%, 83% 88%, 17% 88%, 17% 45%, 5% 37%, 29% 32%, 29% 44%, 71% 44%, 71% 32%, 29% 32%); }

.primary { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 45px; background: var(--amber); border: 1px solid #f5c786; color: #23190d; padding: 0 13px; font-size: 14px; font-weight: 900; }
.primary:hover:not(:disabled) { background: #f6c784; }
.primary:active:not(:disabled) { background: #d4a060; }
.primary:disabled { opacity: 0.45; }
.primary span { font: 21px var(--mono); }
.loadout-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.base-notice { margin-top: 12px; color: #f1c39f; font-size: 12px; line-height: 1.5; word-break: keep-all; }

.playing { overscroll-behavior: none; }
.raid { position: absolute; inset: 0; overscroll-behavior: none; user-select: none; touch-action: pan-y; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.raid-top, .raid-bottom {
  position: absolute;
  left: calc(clamp(12px, 2.5vw, 30px) + env(safe-area-inset-left));
  right: calc(clamp(12px, 2.5vw, 30px) + env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
}
.raid-top { top: calc(12px + env(safe-area-inset-top)); align-items: start; }
.raid-bottom { bottom: calc(12px + env(safe-area-inset-bottom)); align-items: end; }
.vitals { justify-self: start; min-width: 102px; width: clamp(105px, 17vw, 170px); padding: 7px 9px; border: 1px solid #77746280; background: #101814e3; }
.vitals-text { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11px; color: var(--soft); }
.vitals-text strong { font: 700 14px var(--mono); color: var(--ink); }
.tutorial-goals { grid-column: 1 / -1; justify-self: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; width: min(100%, 288px); margin: 0; padding: 6px 8px; border: 1px solid #77746280; background: #101814e3; list-style: none; font-size: 11px; word-break: keep-all; }
.tutorial-goals li { display: flex; gap: 4px; align-items: baseline; }
.tutorial-goals li[data-tutorial-hint] { grid-column: 1 / -1; }
.tutorial-goals li[data-done="true"] { color: #a8f0ca; }
.tutorial-dialog { width: min(420px, calc(100vw - 24px)); padding: 20px; }
.tutorial-dialog p { line-height: 1.55; }
.tutorial-dialog .primary { min-height: 44px; min-width: 88px; }
progress { appearance: none; display: block; width: 100%; height: 4px; margin: 5px 0 0; border: 0; background: #373d33; color: var(--amber); }
progress::-webkit-progress-bar { background: #373d33; }
progress::-webkit-progress-value { background: var(--amber); }
progress::-moz-progress-bar { background: var(--amber); }
.vitals.danger progress::-webkit-progress-value { background: var(--red); }
.vitals.danger progress::-moz-progress-bar { background: var(--red); }
.active-weapon { color: var(--soft); margin-top: 6px; font-size: 10px; }
.zone-label { padding: 6px 11px 7px; background: #101814d9; border-top: 1px solid #a58d6394; text-align: center; white-space: nowrap; }
.zone-label > span { display: block; color: var(--ink); font-size: 12px; font-weight: 800; }
.zone-label small { display: block; color: var(--soft); font-size: 10px; margin-top: 3px; }
.zone-label #pvp-protection { color: var(--green); }
.zone-label #session-clock { color: var(--amber); font-variant-numeric: tabular-nums; }
.zone-label #session-status { color: #bad698; }
.raid-notices { position: absolute; z-index: 5; top: calc(145px + env(safe-area-inset-top)); left: 12px; right: 12px; display: grid; gap: 8px; pointer-events: none; }
.raid:has(.tutorial-goals:not([hidden])) .raid-notices { top: auto; bottom: calc(clamp(88px, 18dvh, 136px) + 16px + env(safe-area-inset-bottom)); }
.session-notice, .join-notice { margin: 0; padding: 9px 12px; border: 1px solid #93ab6d; background: #142015f2; color: #e2edce; font-size: 12px; line-height: 1.5; text-align: center; pointer-events: none; overflow-wrap: anywhere; }
.join-notice { border-color: #b18d5a; background: #241d13f2; color: #f4d9ad; }
.extraction-notice { border-color: #72b3af; background: #122623f2; color: #c6e9e5; }
@media (max-height: 740px) {
  .raid-notices { gap: 4px; }
  .raid-notices > p { padding: 5px 8px; font-size: 11px; line-height: 1.35; }
}
@media (max-width: 360px), (max-height: 630px) {
  .tutorial-goals:has([data-tutorial-hint="exit"]:not([hidden])) { width: min(100%, 220px); }
  .tutorial-goals:has([data-tutorial-hint="exit"]:not([hidden])) li:not([data-tutorial-hint="exit"]) { display: none; }
}
.bag-button, .icon-button { pointer-events: auto; border: 1px solid #8d927a9c; background: #151d17ef; color: var(--ink); min-height: 44px; }
.hud-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; justify-self: end; gap: 5px; }
.quick-use { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; align-items: center; align-content: center; gap: 1px 3px; width: var(--action-size); height: var(--action-size); min-height: 0; padding: 4px; border-radius: 50%; border: 1px solid #90b29a; background: #1a3026ee; color: #d7e7d2; font-size: 10px; line-height: 1.15; pointer-events: auto; touch-action: manipulation; }
.quick-use span { grid-area: 1 / 1 / 2 / 3; min-width: 0; max-width: 100%; text-align: center; word-break: keep-all; }
.quick-use b, .quick-use kbd { flex-shrink: 0; white-space: nowrap; }
.quick-use b { justify-self: start; font: 700 10px var(--mono); }
.quick-use:disabled { opacity: 0.55; }
.quick-use:active:not(:disabled) { transform: scale(0.94); }
.quick-use kbd { justify-self: end; color: var(--ink); font-size: 10px; line-height: 1; }
.quick-use:disabled:has(b:empty) kbd { grid-column: 1 / -1; justify-self: center; }
.quick-use b:empty { display: none; }
.sound-button { pointer-events: auto; min-height: 44px; padding: 0 7px; border: 1px solid #77746280; background: #101814e3; color: var(--green); white-space: nowrap; font-size: 11px; }
.sound-button[aria-pressed="false"] { color: var(--soft); }
.sound-button:hover { border-color: var(--soft); }
.bag-button { justify-self: end; display: flex; align-items: center; gap: 5px; padding: 0 9px; font-size: 12px; }
.bag-button b { color: var(--amber); font: 700 12px var(--mono); }
.bag-glyph { display: inline-block; width: 13px; height: 12px; border: 1px solid var(--soft); position: relative; margin-right: 2px; }
.bag-glyph::before { content: ""; position: absolute; width: 5px; height: 4px; left: 3px; top: -5px; border: 1px solid var(--soft); border-bottom: 0; }
.raid-bag-controls { display: grid; justify-items: center; gap: 3px; }
.map-player-count { display: flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid #8d927a9c; background: #151d17ef; color: var(--ink); font: 700 11px/12px var(--mono); }
.person-glyph { display: grid; justify-items: center; gap: 1px; color: var(--soft); }
.person-glyph::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.person-glyph::after { content: ""; width: 10px; height: 5px; border-radius: 5px 5px 1px 1px; background: currentColor; }
.movement { justify-self: start; display: grid; justify-items: center; gap: 4px; }
.look-control { justify-self: end; display: grid; justify-items: center; gap: 4px; }
.look-stick { padding: 0; display: block; }
.look-stick.active { border-color: var(--green); background: #294a3bbd; }
.look-label { background: #101814b8; padding: 2px 6px; color: var(--soft); font-size: 10px; }
.stick-zone { display: none; }
.stick { position: relative; width: clamp(87px, 16vh, 118px); height: clamp(87px, 16vh, 118px); border-radius: 50%; border: 1px solid #a9a18685; background: #1d2722a8; touch-action: none; pointer-events: auto; }
.stick::before { content: ""; position: absolute; inset: 20%; border: 1px dashed #a9a1865e; border-radius: 50%; pointer-events: none; }
.stick > span { position: absolute; width: 38%; height: 38%; left: 31%; top: 31%; border-radius: 50%; border: 1px solid #d1c29a; background: #6c6b5194; pointer-events: none; }
.keyboard-hint { background: #101814b8; padding: 2px 6px; color: var(--soft); font-size: 10px; }
.interaction {
  --action-size: 56px;
  --action-gap: 8px;
  --interaction-base: 52dvh;
  --interaction-clearance: 170px;
  --interaction-center: min(calc(var(--interaction-base) + clamp(8px, 2.5dvh, 20px)), calc(100dvh - var(--interaction-clearance) - env(safe-area-inset-bottom)));
  position: absolute; top: var(--interaction-center); right: calc(10px + env(safe-area-inset-right));
  width: min(128px, 40%); height: var(--action-size); transform: translateY(-50%);
}
.raid-quick-actions { position: absolute; right: 0; bottom: calc(100% + var(--action-gap)); display: grid; grid-template-columns: repeat(2, var(--action-size)); grid-template-rows: auto var(--action-size); justify-items: center; gap: var(--action-gap); }
.raid-quick-actions > .quick-use { grid-row: 2; }
.raid-quick-tools { grid-area: 1 / 1 / 2 / -1; justify-self: end; display: flex; align-items: center; gap: 6px; }
.raid-quick-tools .sprint-skill { background: #3b3020ee; border-color: #b89661; }
.sprint-skill kbd { grid-column: 1 / -1; justify-self: center; }
.action-buttons { display: flex; justify-content: flex-end; gap: 6px; height: 100%; }
.action-hint { position: absolute; top: calc(100% + 8px); right: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.action { flex: none; border-radius: 50%; width: var(--action-size); height: var(--action-size); display: grid; gap: 1px; place-content: center; pointer-events: auto; border: 1px solid #d0a973; background: #362e1eea; color: #ffe0a5; font-size: 13px; font-weight: 800; }
.action:disabled { opacity: 0.55; background: #1c251fe8; color: var(--soft); border-color: #798171; }
.action.extract { color: #e2f7e7; border-color: var(--green); background: #244133ed; }
.action.unlock-exit { color: #ffbbb0; border-color: #c8756d; background: #4b2528ed; }
.action.unlock-case { color: #deff9b; border-color: #c4ff52; background: #29381eed; }
.action.skin-note { color: #fff2c8; border-color: #ffdc7c; background: #4b3821f2; }
#gate-status { color: #a2d6ae; }
#gate-status.locked { color: #ffaaa0; }
.item-glyph.key::before { width: 11px; height: 16px; border: 1px solid #a0af8a; border-radius: 3px; background: #434d3b; }
.item-glyph.key::after { width: 5px; height: 2px; top: 7px; left: 10px; background: #c4ff52; box-shadow: 0 5px #a0af8a; }
.action:active:not(:disabled) { transform: scale(0.94); }
kbd { color: var(--soft); font: 10px var(--mono); }
.action-hint, .toast, .extract-progress { padding: 5px 8px; color: var(--ink); border: 1px solid #81816c7e; background: #121b16eb; font-size: 11px; line-height: 1.4; }
.action-hint { white-space: nowrap; }
.action-hint.unlock-case { color: #deff9b; border-color: #8ab451; }
.action-hint.skin-note { color: #fff2c8; border-color: #d8ac58; background: #32271bf2; }
.raid-info { display: grid; gap: 5px; justify-items: center; text-align: center; max-width: min(56vw, 320px); }
.toast { color: var(--amber); }
.extract-progress { width: min(34vw, 176px); color: var(--green); }
.extract-progress progress::-webkit-progress-value { background: var(--green); }
.extract-progress progress::-moz-progress-bar { background: var(--green); }
.extract-progress.opening-crate { color: var(--amber); }
.extract-progress.opening-crate progress::-webkit-progress-value { background: var(--amber); }
.extract-progress.opening-crate progress::-moz-progress-bar { background: var(--amber); }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; overscroll-behavior: contain; background: #101612cf; padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.dialog { width: min(100%, 460px); background: var(--panel); border: 1px solid #777765; border-top-color: var(--amber); padding: clamp(13px, 3vh, 24px); box-shadow: 0 16px 60px #0008; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dialog h2 { margin-top: 4px; }
.workbench-open { min-height: 44px; padding: 0 10px; border: 1px solid #ab915e; color: var(--amber); background: #24271b; font-size: 12px; font-weight: 800; white-space: nowrap; }
.workbench-open:hover { background: #393521; }
.workbench, .appearance, .personal-stash, .death-audio, .guidebook {
  width: min(580px, calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
}
.workbench::backdrop, .appearance::backdrop, .personal-stash::backdrop, .death-audio::backdrop,
.guidebook::backdrop { background: #101612d9; }
.guidebook { width: min(640px, calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right))); overflow: hidden; }
.guidebook[open] { display: flex; flex-direction: column; }
.guidebook .micro { color: var(--amber); }
.guidebook-references { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 6px 0 12px; }
.guidebook-references button { padding: 4px; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.guidebook-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 2px 8px 4px 2px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}
.guidebook-content { overflow-wrap: anywhere; }
.guidebook-content:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.guidebook-content section + section { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.guidebook-content h3 { margin: 0 0 6px; color: var(--amber); font-size: 15px; }
.guidebook-content h4 { margin: 0; color: var(--ink); font-size: 14px; }
.guidebook-content p + p { margin-top: 7px; }
.guidebook-content strong { color: var(--ink); }
.guide-steps, .guide-goals { margin: 8px 0; padding-left: 21px; }
.guide-steps li + li, .guide-goals li + li { margin-top: 9px; }
.guide-goals span { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.guide-help-list { margin: 8px 0 0; }
.guide-help-list div + div { margin-top: 12px; }
.guide-help-list dt { color: var(--ink); font-weight: 700; }
.guide-help-list dd { margin: 3px 0 0; }
.manual-download { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; padding: 10px 12px; text-decoration: none; }
.manual-download-label { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.manual-download > [aria-hidden] { flex-shrink: 0; }
.reviews .micro { color: var(--amber); }
.reviews-intro, .review-author, .review-empty, .review-status { font-size: 12px; line-height: 1.6; color: var(--soft); overflow-wrap: anywhere; }
.review-form { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid var(--line); background: #141d17; }
.review-form label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; }
.review-form :is(input, textarea) { width: 100%; min-width: 0; border: 1px solid #777765; border-radius: 0; padding: 10px; background: #0f1712; color: var(--ink); font: inherit; font-size: 16px; }
.review-form textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
.review-form :is(input, textarea):focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.review-form :is(input, textarea):disabled, .reviews button:disabled { opacity: 0.5; }
.review-form-footer, .review-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review-form-footer > span { color: var(--soft); font: 11px var(--mono); }
.review-status { margin-top: 8px; }
.review-status.error { color: var(--red); }
.review-comments { margin-top: 18px; }
.review-list-heading h3 { margin: 0; font-size: 14px; }
.review-list-heading h3 span { color: var(--amber); }
.review-empty { padding-block: 20px; text-align: center; }
.review-list { margin: 10px 0 0; padding: 0; list-style: none; }
.review-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.review-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 10px; }
.review-meta strong { color: var(--green); font-size: 13px; overflow-wrap: anywhere; }
.review-meta time { color: var(--muted); font-size: 10px; }
.review-list li > p { margin-top: 7px; color: var(--ink); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-more { width: 100%; margin-top: 10px; }
.guide-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.guide-summary > div { padding: 9px 4px; border: 1px solid var(--line); background: #1c261b; text-align: center; }
.guide-summary dt { font-size: 11px; }
.guide-summary dd { margin: 2px 0 0; color: var(--amber); font-size: 23px; font-weight: 800; }
.guidebook-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.guidebook-nav a { display: grid; place-items: center; min-height: 44px; padding: 6px 4px; border: 1px solid var(--line); color: var(--ink); font-size: 12px; text-align: center; text-decoration: none; background: #172019; }
.guidebook-nav a:hover { border-color: var(--amber); color: var(--amber); }
.guidebook-content h3 { scroll-margin-top: 4px; }
.guide-item-list { margin: 9px 0; padding: 0; list-style: none; }
.guide-item-list li { display: grid; gap: 2px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.guide-item-list li span { font-size: 12px; }
.guide-timeline th:first-child { width: 34%; }
.guidebook-controls { width: 100%; border-collapse: collapse; }
.guidebook-controls :is(th, td) { border-bottom: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.guidebook-controls th { color: var(--ink); white-space: nowrap; }
.guidebook-controls kbd { color: var(--ink); font-size: 12px; }
.guidebook-families { display: grid; gap: 7px; margin: 9px 0; }
.guidebook-families > div { border: 1px solid var(--line); border-inline-start: 2px solid var(--green); background: #141b16; padding: 8px 10px; }
.guidebook-families ul { list-style: none; margin: 4px 0 0; padding: 0; }
.guidebook-families li { display: flex; flex-wrap: wrap; column-gap: 12px; justify-content: space-between; }
.guidebook-families li span { font-size: 12px; }
.death-audio { max-width: 410px; }
.death-audio label { display: block; margin-bottom: 6px; color: var(--soft); font-size: 13px; }
.death-audio select {
  width: 100%; min-height: 44px; padding: 0 8px; border: 1px solid var(--line);
  background: #121a14; color: var(--ink); font: inherit; font-size: 16px;
}
.death-audio-status { min-height: 1.4em; margin: 8px 0; color: var(--soft); font-size: 12px; }
.death-audio-actions { display: flex; gap: 8px; }
.death-audio-actions .primary { flex: 1; justify-content: center; }
.death-audio-actions button:disabled { opacity: 0.5; }
.stash-open { background: #3e311e; }
.stash-open span { margin-left: 2px; color: #ddcb9f; font-family: var(--mono); }
.stash-groups { display: grid; gap: 10px; }
.stash-group { min-width: 0; }
.stash-group h3 { margin: 0 0 5px; color: var(--soft); font-size: 12px; }
.stash-group ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.stash-group li {
  display: grid; grid-template-columns: 23px minmax(0, 1fr) auto auto; align-items: center; gap: 6px;
  min-height: 42px; padding: 4px 7px; border: 1px solid var(--line); background: #121a14;
}
.stash-group .item-count { min-width: 23px; text-align: right; }
.stash-equip {
  min-height: 44px; padding: 0 7px; border: 1px solid #836c42; background: #332b1e;
  color: var(--amber); font-size: 11px; white-space: nowrap;
}
.stash-equip:hover:not(:disabled) { background: #493822; }
.stash-equip:disabled { color: var(--muted); background: transparent; border-color: transparent; }
.stash-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.shop-balance { color: var(--amber); font-size: 12px; margin: 6px 0; }
.point-shop .shop-balance { color: var(--amber); font-weight: 700; }
.point-shop p, .point-shop small { color: var(--soft); font-size: 12px; }
.point-shop p:empty { display: none; }
.point-shop ul { list-style: none; margin: 0 0 8px; padding: 0; }
.point-shop li { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; border-top: 1px solid var(--line); padding-block: 7px; }
.point-shop li strong { font-size: 13px; }
.point-shop li small { grid-column: 1; }
.point-shop li button { grid-column: 2; grid-row: 1 / 3; min-height: 44px; }
.loadout-controls { display: grid; gap: 8px; }
.loadout-controls .loadout-save-help { margin: 0; }
.scroll-loadout { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; color: var(--soft); font-size: 13px; font-weight: 700; }
.scroll-loadout select { width: 100%; min-height: 44px; padding-inline: 8px; background: #121a14; color: var(--ink); border: 1px solid var(--line); font: inherit; }
.base-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 44px; gap: 8px; }
.base-secondary-actions .workbench-open:disabled { opacity: 0.55; }
.tutorial-start.workbench-open { background: #403320; color: #ffe0ab; border-color: var(--amber); }
.tutorial-start.workbench-open:hover:not(:disabled) { background: #584326; }
.shop-sale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding: 8px; border: 1px solid var(--line); }
.shop-sale label { flex-basis: 100%; font-size: 12px; }
.shop-sale input, .dye-controls input { min-height: 44px; border: 1px solid var(--line); background: #121a14; color: var(--ink); padding: 4px 7px; }
.shop-sale input { width: 66px; }
.dye-controls { display: flex; flex-wrap: wrap; gap: 5px; }
.dye-controls input[type="color"] { width: 44px; }
.dye-controls input[type="text"] { width: 88px; font: 12px var(--mono); }
.appearance { width: min(715px, calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
.appearance-layout { display: grid; grid-template-columns: minmax(125px, 0.85fr) minmax(0, 2fr); gap: 14px; }
.appearance-stage {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse, #42493a, #19221c 70%, #131b16);
}
.appearance-stage canvas { display: block; width: min(100%, 176px); height: auto; }
.appearance-group legend { color: var(--ink); font-size: 13px; }
.appearance-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.appearance-options.body-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.body-options canvas { display: block; width: min(100%, 70px); height: auto; }
.appearance-style-heading {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
}
/* Anchor each hidden radio to its visible card. Otherwise focusing a label can
   scroll the outer dialog to an absolute input outside the inner scroller. */
.appearance-option { position: relative; display: grid; min-width: 0; }
.appearance-option > input[type="radio"] { top: 0; left: 0; margin: 0; }
.appearance-options label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 3px 0;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}
.appearance-options input:checked + label { color: var(--ink); }
.appearance-options small { color: var(--amber); font-size: 10px; white-space: nowrap; }
.appearance-options input:focus-visible + label { outline-offset: -3px; }
.follower-options { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.skin-swatch { width: 21px; height: 14px; border: 1px solid #ffffff42; }
.hair-options canvas { display: block; width: min(100%, 43px); height: auto; }
.hair-options label { min-width: 0; overflow-wrap: anywhere; }
.appearance-purchase { margin-top: 6px; }
.appearance-purchase:disabled { opacity: 0.62; }
.appearance-summary { position: sticky; bottom: 0; padding: 4px 0; border-top: 1px solid var(--line); background: var(--panel); }
.appearance-summary .base-notice { margin: 0 0 4px; }
.workbench-help { margin-bottom: 11px; color: var(--soft); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.workbench-toolbar { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.materials, .recipes, .recipe-cost { margin: 0; padding: 0; list-style: none; }
.materials { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 4px; }
.materials li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; min-height: 37px; padding: 4px 5px; border: 1px solid var(--line); background: #121a14; font-size: 11px; }
.materials strong { color: var(--amber); font: 700 13px var(--mono); }
.recipe-heading { margin: 16px 0 6px; color: var(--soft); font-size: 13px; }
.recipe-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 4px; margin-bottom: 6px; }
.recipe-filters button { padding-inline: 4px; border-color: var(--line); background: #121a14; color: var(--soft); }
.recipe-filters button:hover { background: #24271b; }
.recipe-filters button[aria-pressed="true"] { border-color: var(--amber); background: #393521; color: var(--amber); }
.recipe-groups { display: grid; gap: 14px; }
.recipe-grade-heading { margin: 0 0 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #121a14; color: var(--soft); font-size: 13px; }
.recipes { display: grid; gap: 6px; }
.recipes > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; background: #111913; border: 1px solid var(--line); }
.recipe-title { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin: 0; font-size: 14px; }
.recipe-title .grade-badge { margin-top: 0; font-size: 11px; white-space: nowrap; }
.recipe-summary { margin-top: 4px; color: var(--soft); font-size: 11px; }
.recipe-cost { display: flex; gap: 4px 10px; flex-wrap: wrap; margin-top: 6px; color: var(--green); font-size: 11px; }
.recipe-cost .grade-badge { display: inline-block; margin: 0 0 0 2px; padding: 0 4px; white-space: nowrap; }
.recipe-cost .missing { color: #e4ad91; }
.recipe-comparison { color: var(--soft); font-size: 11px; margin-top: 6px; word-break: keep-all; }
.recipe-source { color: var(--muted); font-size: 10px; margin-top: 4px; }
.craft-button { width: auto; min-width: 55px; justify-content: center; }
.craft-notice { color: var(--amber); font-size: 12px; line-height: 1.45; }
.craft-notice:not(:empty) { margin-bottom: 8px; padding-bottom: 5px; }
.craft-notice:empty { position: absolute; }
.dialog h2 small { color: var(--amber); font: 600 14px var(--mono); }
.icon-button { font-size: 26px; width: 44px; padding: 0; }
.bag-dialog { max-height: 100%; overflow: auto; }
.bag-toast-slot { min-width: 0; margin-left: auto; }
.bag-toast-slot:not(:has(> .toast:not([hidden]))) { display: none; }
.bag-toast-slot .toast { word-break: keep-all; overflow-wrap: anywhere; }
.bag-equipped { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 4px; }
.bag-equipped > div { min-width: 0; padding: 4px 5px; border: 1px solid var(--line); background: #121a14; }
.bag-equipped dt { color: var(--soft); font-size: 11px; }
.bag-equipped dd { margin: 2px 0 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.bag-equipped .bag-actions { flex-wrap: wrap; margin-top: 4px; }
.bag-equipped .bag-actions button { flex-basis: auto; padding-inline: 4px; }
#bag-layer { position: fixed; }
.overlay .bag-dialog { display: flex; flex-direction: column; width: min(100%, 640px); gap: 5px; }
.overlay .bag-dialog.with-loot { height: min(100%, 700px); }
.bag-dialog .dialog-heading { flex: none; margin-bottom: 0; }
.bag-dialog #bag-notice { flex: none; margin: 0; }
.bag-contents { display: grid; gap: 5px; }
.with-loot .bag-contents { flex: 1 0 0; min-height: 408px; grid-template-rows: minmax(205px, 1fr) minmax(198px, 1fr); }
.bag-dialog h3 { margin: 0 0 6px; color: var(--soft); font-size: 12px; }
.raid-inventory-panel { min-width: 0; min-height: 0; border: 1px solid #526655; background: #131d17; }
.raid-inventory-panel.loot-panel { border-color: #81704c; background: #201c15; }
.raid-inventory-heading { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.raid-inventory-heading h3 { margin: 0 0 3px; color: var(--ink); font-size: 14px; }
.loot-panel .raid-inventory-heading h3 { color: var(--amber); }
.raid-inventory-heading p { margin: 0; color: var(--soft); font-size: 11px; }
.raid-inventory-heading small { margin-left: 4px; color: var(--amber); }
.raid-inventory-details { flex: none; border: 1px solid var(--line); background: #17221b; }
.raid-inventory-details summary { padding: 6px 8px; color: var(--soft); font-size: 12px; cursor: pointer; }
.raid-inventory-details > section + section { margin-top: 4px; }
.with-loot .raid-inventory-heading { padding: 4px 8px; }
.bag-items.raid-quest-items { padding: 4px; grid-auto-rows: minmax(34px, auto); }
.raid-quest-items .bag-quest-slot:not(.empty) { grid-template-rows: 25px 44px; }
#bag-capacity { margin-left: 4px; color: var(--amber); white-space: nowrap; }
.raid-inventory-scroll { min-height: 0; padding: 4px; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }
.bag-contents > .raid-inventory-panel:not([hidden]) { display: flex; flex-direction: column; }
.raid-inventory-heading { flex: none; }
.with-loot .raid-inventory-scroll { flex: 1; }
.bag-dialog:not(.with-loot) .raid-inventory-scroll { max-height: clamp(162px, 52dvh, 420px); }
@media (orientation: landscape) and (max-height: 500px) {
  #bag-layer { padding-block: calc(6px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-bottom)); }
  #bag-layer .bag-dialog { padding: 6px 8px; }
  .with-loot .bag-contents { min-height: 205px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(205px, 1fr); }
}
.loot-items { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.loot-items li { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 45px; padding-left: 6px; border: 1px solid var(--line); background: #121a14; }
.loot-items .loot-source-heading { justify-content: space-between; min-height: 23px; padding: 2px 6px; color: var(--amber); background: #352a19; font-size: 11px; }
.loot-source-heading button { min-height: 44px; font-size: 11px; }
.loot-actions { display: flex; flex: none; margin-left: auto; }
.loot-actions button { min-width: 44px; min-height: 44px; padding: 0 7px; border: 0; font-size: 11px; white-space: nowrap; }
.loot-actions button + button { border-left: 1px solid var(--line); }
.take-loot { background: #473820; color: var(--amber); }
.take-loot:hover:not(:disabled) { background: #654923; }
.take-loot:disabled { opacity: 0.5; }
#loot-status { margin-top: 6px; color: var(--soft); font-size: 11px; }
#loot-status:empty { display: none; }
.bag-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(74px, auto); gap: 4px; margin: 0; padding: 0; list-style: none; }
.bag-items li { display: grid; grid-template-rows: 28px 44px; min-width: 0; border: 1px solid var(--line); background: #121a14; }
.bag-items .bag-multiple-slots { grid-template-rows: 28px auto; }
.bag-multiple-slots .bag-actions { flex-wrap: wrap; }
.bag-multiple-slots .bag-actions button { flex-basis: auto; min-width: 44px; padding-inline: 4px; }
.bag-items li.empty { grid-template-rows: none; place-items: center; color: var(--muted); font-size: 12px; border-style: dashed; }
.bag-items .bag-quest-slot { border-color: #7896a3; background: #233740; }
.bag-items .bag-quest-slot.empty { display: flex; justify-content: center; gap: 4px; color: #c0dce4; }
.pocket-panel { margin-top: 10px; padding: 7px; border: 1px solid #718c72; background: #17261e; }
.pocket-panel h3 span + span { margin-left: 4px; color: var(--green); }
.pocket-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.pocket-items li { display: grid; min-width: 0; min-height: 48px; border: 1px solid #527058; background: #111c15; }
.pocket-items li.empty { place-items: center; color: var(--soft); font-size: 11px; border-style: dashed; }
.pocket-items button { min-height: 44px; border: 0; font-size: 11px; }
.bag-item-label { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0 6px; }
.inspect-item { padding: 0; border: 0; background: transparent; text-align: left; cursor: help; }
.inspect-item.bag-item-label { padding-inline: 6px; }
.loot-items .bag-item-label { flex: 1; min-height: 36px; padding-left: 0; }
.inspect-item:is(:hover, :focus-visible, [aria-describedby]) .item-name,
.inspect-item:is(:hover, :focus-visible, [aria-describedby]):not(.bag-item-label) { text-decoration: underline; text-underline-offset: 3px; }
#bag-inspection { position: fixed; z-index: 5; overflow: auto; overscroll-behavior: contain; padding: 8px 10px; background: #18231d; border: 1px solid #8b9d85; border-radius: 4px; box-shadow: 0 5px 20px #0009; }
#bag-inspection table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
#bag-inspection th, #bag-inspection td { padding: 3px 5px; text-align: left; vertical-align: top; }
#bag-inspection th { color: var(--soft); font-weight: 500; }
#bag-inspection th:first-child { width: 24%; }
#bag-inspection thead th { font-size: 11px; }
#bag-inspection strong { display: block; color: var(--ink); font-size: 13px; }
#bag-inspection thead th:nth-child(2) strong { color: var(--amber); }
#bag-inspection tbody tr { border-top: 1px solid var(--line); }
.bag-item-label .item-glyph, .loot-items .item-glyph { flex: none; }
.bag-item-label .item-name, .loot-items .item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-quantity { flex: none; margin-left: auto; color: var(--amber); font: 11px var(--mono); }
.heal-timer { color: var(--green); font: 11px/1.5 var(--mono); }
.bag-actions { display: flex; min-width: 0; }
.bag-items .bag-actions { border-top: 1px solid var(--line); }
.bag-actions button { flex: 1; min-width: 0; min-height: 44px; border: 0; padding: 0 2px; white-space: nowrap; font-size: 11px; }
.bag-actions button + button { border-left: 1px solid var(--line); }
.inventory-extra-actions { display: contents; }
.inventory-actions .inventory-more { display: none; }
.inventory-actions-many .inventory-extra-actions { display: none; }
.inventory-actions-many .inventory-more { display: inline-grid; place-items: center; }
.bag-actions.inventory-actions-many { flex-wrap: nowrap; }
@container (max-width: 575px) {
  .inventory-actions .inventory-extra-actions { display: none; }
  .inventory-actions .inventory-more { display: inline-grid; place-items: center; }
  .bag-actions.inventory-actions { flex-wrap: nowrap; }
  .bag-actions.inventory-actions button { flex: 1; }
  .loot-actions button { padding-inline: 4px; }
}
.inventory-more-actions { display: grid; gap: 4px; margin-block: 10px; }
.inventory-more-actions button, .inventory-subdialog button { min-height: 44px; }
dialog.inventory-subdialog { width: min(360px, calc(100vw - 24px)); }
.inventory-subdialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.inventory-subdialog-actions > button { flex: 1; width: auto; white-space: nowrap; }
.pocket-swap-choices { display: grid; gap: 4px; min-width: 0; margin-top: 8px; padding: 6px; }
.pocket-swap-choices label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px; border: 1px solid var(--line); cursor: pointer; }
.pocket-swap-choices label:has(:checked) { border-color: var(--amber); background: #3b3020; }
.pocket-swap-choices label:has(:disabled) { color: var(--soft); cursor: default; }
.pocket-swap-choices small { display: block; color: var(--soft); }
.equipment-action { background: #3e624b66; color: var(--green); }
.equipment-action:hover:not(:disabled) { background: #3e624baa; }
.equipment-action:disabled { color: var(--soft); background: transparent; }
.discard { background: #5e443e3d; color: #eab6a2; }
.discard:hover { background: #76514a80; }
.dialog-note, .result-detail { color: var(--soft); margin-top: 10px; font-size: 12px; line-height: 1.5; }
.result h2 { font-size: clamp(30px, 8vh, 48px); color: var(--amber); }
.result h2.success { color: var(--green); }
.result .primary { margin-top: 16px; }

@media (pointer: coarse) {
  .keyboard-hint, .action kbd { display: none; }
}

@media (any-pointer: coarse) {
  .stick-zone {
    position: absolute;
    left: env(safe-area-inset-left);
    bottom: env(safe-area-inset-bottom);
    display: block;
    width: 44%;
    height: 180px;
    pointer-events: auto;
    touch-action: none;
  }
}

/* Every surface shares the same portrait frame, including native modal dialogs. */
@media (orientation: landscape) {
  :root { --game-width: min(480px, 56.25vh); --game-width: min(480px, 56.25dvh); }
}

.base-shade { background: linear-gradient(0deg, #101812fc 3%, #0d1412d9 50%, #0d141299 100%); }
.masthead { min-width: 0; min-height: 44px; padding-bottom: 8px; gap: 6px; flex-wrap: wrap; }
.wordmark { font-family: inherit; font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; }
.masthead-right { min-width: 0; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.account-bar { min-width: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--green); font-size: 12px; }
.masthead-right > .workbench-open { min-width: 44px; padding-inline: 7px; }
.base-layout { max-width: none; margin: 0; padding: 14px 0 0; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; align-items: stretch; }
.briefing { padding: 0; display: flex; flex-direction: column; min-width: 0; }
.briefing-tag { padding: 0 0 5px; font-size: 10px; }
.briefing h1 { margin: 0; font-size: clamp(28px, 8dvh, 42px); }
.premise { margin-top: 7px; font-size: 13px; line-height: 1.5; }
.premise br { display: none; }
.release-contract { margin-top: 8px; border-left: 2px solid #a2895c; padding: 5px 9px; background: #e9b76d0d; color: var(--soft); font-size: 12px; line-height: 1.55; word-break: keep-all; }
.release-contract-heading { display: flex; flex-wrap: wrap; align-items: center; min-height: 26px; column-gap: 8px; }
.release-contract-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-inline-start: auto; }
.release-contract-actions button { min-height: 32px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.release-contract-actions button:hover:not(:disabled) { color: var(--ink); }
.release-contract-actions button:disabled { opacity: 0.5; }
.release-speaker { color: var(--amber); font-size: 10px; font-weight: 750; }
.release-status { display: grid; gap: 5px; margin-top: 8px; color: var(--green); font-size: 12px; font-weight: 750; }
.release-status progress { width: 100%; height: 6px; accent-color: var(--green); }
.room-panel { width: 100%; margin-top: 10px; padding: 0; border: 1px solid var(--line); background: #151e18e8; }
.room-panel summary { min-height: 44px; padding: 13px 10px; color: var(--soft); cursor: pointer; font-size: 13px; }
.lobby-space, .room-panel { --soft: #cfcec0; }
.room-panel > :not(summary) { margin-inline: 9px; }
.room-panel > :last-child { margin-bottom: 8px; }
.loadout-preview { grid-template-columns: minmax(0, 54%) minmax(0, 1fr); width: 100%; margin: 0 0 14px; }
.loadout-preview canvas { width: 100%; max-height: 220px; object-fit: contain; }
.loadout-preview-details { display: flex; flex-direction: column; align-items: stretch; padding: 8px; gap: 7px; }
.loadout-preview h2 { font-size: 13px; }
.loadout-preview dl { font-size: 10px; gap: 4px; }
.loadout-preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.loadout-preview-actions button { min-width: 0; font-size: 11px; }
.loadout { min-width: 0; padding: 12px; }
.loadout-heading { margin-bottom: 9px; }
.loadout h2 { font-size: 17px; }
.loadout-heading .micro { font-size: 10px; letter-spacing: 0; }
.equipment-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.equipment-slot { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: 5px; align-items: center; min-width: 0; min-height: 76px; padding: 8px; text-align: left; background: #111b16e8; border: 1px solid #82714e; }
.equipment-slot:hover:not(:disabled) { background: #36321e; border-color: var(--amber); }
.equipment-slot:disabled { opacity: 0.6; }
.slot-category { color: var(--soft); font-size: 10px; word-break: keep-all; }
.equipment-slot strong { grid-column: 1 / -1; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 350px) {
  .equipment-slot { grid-template-columns: 18px minmax(0, 1fr); padding-inline: 6px; }
  .equipment-slot .item-glyph { width: 18px; height: 18px; }
}
.base-dock { position: sticky; bottom: calc(-12px - env(safe-area-inset-bottom)); padding: 12px 0 0; margin-top: 2px; background: #182019; z-index: 1; }
.loadout-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.loadout-actions button { min-width: 0; padding-inline: 3px; font-size: 11px; }
.deploy-actions { container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; }
.deploy-actions > button { min-width: 0; min-height: 48px; }
.deploy-actions > .workbench-open { padding-inline: 2px; }
.deploy { position: relative; justify-content: center; padding-inline: 22px; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.deploy-actions .deploy { font-size: 15px; }
.deploy > span { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); font-size: 16px; }
@container (max-width: 160px) {
  .deploy { padding-inline: 6px; }
  .deploy > span { display: none; }
}
.lobby-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.lobby-actions > button { min-width: 0; min-height: 44px; padding-inline: 8px; font-size: 13px; }
.lobby-actions > #open-achievements { color: var(--amber); }
.achievements { width: min(580px, calc(100vw - 24px)); }
.achievement-summary { margin: 14px 0 8px; color: var(--amber); font-weight: 700; }
.achievement-equipped { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.achievement-equipped p { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.achievement-equipped button { flex-shrink: 0; min-height: 44px; }
.achievement-filters { display: flex; gap: 6px; margin: 12px 0; }
.achievement-filters button { flex: 1; min-height: 44px; }
.achievement-filters [aria-pressed="true"] { color: var(--amber); border-color: var(--amber); background: #3a3525; }
.achievement-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.achievement-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px; border: 1px solid var(--line); background: #101c16; }
.achievement-card.complete { border-color: #8b7950; }
.achievement-card h3 { margin: 0; font-size: 15px; }
.achievement-state { font-size: 11px; color: var(--soft); align-self: center; }
.complete .achievement-state { color: var(--amber); }
.achievement-card p { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.achievement-card progress { width: 100%; height: 10px; align-self: center; accent-color: #d7b77c; }
.achievement-numbers { color: var(--soft); font: 11px var(--mono); }
.achievement-card .achievement-reward { color: #d9bf84; }
.achievement-card button { grid-column: 1 / -1; justify-self: end; min-height: 44px; }
.achievement-notice { margin: 10px 0; padding: 10px; border: 1px solid #8b7950; color: #e5c786; background: #302d20; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.equipment-toggle { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; }
.equipment-toggle[aria-expanded="true"] { color: var(--amber); border-color: var(--amber); }
.equipment-toggle span { position: absolute; inset-inline-end: 8px; font-size: 20px; }
.lobby-space { margin-top: 8px; min-width: 0; border: 1px solid var(--line); background: #151e18e8; }
.lobby-space header { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; }
.lobby-space h2 { font-size: 13px; }
#lobby-count { color: var(--amber); font-size: 12px; font-variant-numeric: tabular-nums; }
.lobby-space canvas { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; touch-action: none; cursor: crosshair; }
.lobby-space canvas:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.lobby-space p { margin: 7px 9px; font-size: 12px; line-height: 1.5; color: var(--soft); word-break: keep-all; }
#lobby-status { color: var(--amber); }
#lobby-status:empty { margin: 0; }
.lobby-header-actions { display: flex; align-items: center; gap: 10px; }
.lobby-map { position: relative; }
.lobby-map::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  border: 2px solid var(--amber); pointer-events: none;
}
.lobby-map > canvas:focus-visible { outline-color: var(--ink); outline-offset: -5px; }
.lobby-map-actions { position: absolute; inset: auto 8px 8px auto; z-index: 2; display: flex; gap: 6px; }
.lobby-composer-toggle, #lobby-emotes .emote-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #8b7950; border-radius: 50%; color: var(--amber); background: #14201c99;
}
.lobby-composer-toggle:is(:hover:not(:disabled), [aria-expanded="true"]),
#lobby-emotes .emote-toggle:is(:hover:not(:disabled), [aria-expanded="true"]) { border-color: var(--amber); background: #334131cc; }
.lobby-composer-toggle:disabled, #lobby-emotes .emote-toggle:disabled { opacity: 0.5; }
.lobby-chat-glyph { position: relative; width: 20px; height: 15px; border: 2px solid currentColor; border-radius: 6px; }
.lobby-chat-glyph::after {
  content: ''; position: absolute; left: 3px; bottom: -5px; width: 5px; height: 5px;
  border-left: 2px solid currentColor; transform: skewY(-35deg);
}
.emote-glyph {
  background: radial-gradient(circle, currentColor 1px, transparent 1.2px) 4px 2px / 2px 2px no-repeat,
    radial-gradient(circle, currentColor 1px, transparent 1.2px) 10px 2px / 2px 2px no-repeat;
}
.emote-glyph::before {
  content: ''; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 3px;
  border-bottom: 1px solid currentColor; border-radius: 0 0 50% 50%;
}
.lobby-message-form {
  position: absolute; right: 0; bottom: calc(100% + 6px); width: min(318px, calc(100vw - 56px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 8px; border: 1px solid var(--amber); border-radius: 4px; background: #14201c; box-shadow: 0 8px 22px #0009;
}
.lobby-message-form label { color: var(--ink); font-size: 12px; }
.lobby-message-count { color: var(--soft); font: 11px var(--mono); justify-self: end; }
.lobby-message-form input {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px;
  border: 1px solid #64705d; border-radius: 3px; color: var(--ink); background: #101a14; font-size: 16px;
}
.lobby-message-form input[aria-invalid="true"] { border-color: var(--red); }
.lobby-message-form button { min-height: 44px; padding: 0 12px; white-space: nowrap; }
.lobby-message-form button:disabled { opacity: 0.55; }
.lobby-message-form p { grid-column: 1 / -1; margin: 0; color: #f0a18c; }
.lobby-message-form p:empty { display: none; }
.lobby-inspection header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lobby-inspection h2 { font-size: 16px; overflow-wrap: anywhere; }
.lobby-inspection .icon-button { flex: none; min-width: 44px; min-height: 44px; }
.lobby-inspection-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.lobby-inspection-record > div { min-width: 0; padding: 6px 7px; border: 1px solid var(--line); background: #19241d; }
.lobby-inspection-record dd { display: flex; align-items: center; gap: 3px; margin: 2px 0 0; font-size: 12px; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.lobby-inspection-record canvas { flex: none; width: auto; height: 1em; }
.lobby-inspection-layout { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 10px; align-items: start; }
.lobby-inspection-layout > canvas {
  display: block; width: 100%; height: auto; border: 1px solid var(--line);
  background: radial-gradient(ellipse, #474d3c, #1b251d 68%, #151e18);
}
.lobby-inspection-gear h3 { margin: 0 0 2px; font-size: 12px; }
.lobby-inspection-gear dl { display: grid; gap: 3px; margin: 0; font-size: 12px; }
.lobby-inspection-gear dl div { padding: 3px 0; border-bottom: 1px solid var(--line); }
.lobby-inspection dt { color: var(--soft); font-size: 10px; }
.lobby-inspection-gear dd { display: flex; align-items: center; gap: 4px; min-height: 24px; margin: 0; overflow-wrap: anywhere; }
.lobby-inspection-gear dd canvas { flex: none; width: 24px; height: 24px; }
.quick-chat { position: relative; }
.quick-chat-toggle { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px; font-size: 12px; }
.quick-chat-toggle > span { display: inline-block; width: 16px; height: 12px; border: 1px solid currentColor; border-radius: 5px; position: relative; font-size: 0 !important; }
.quick-chat-toggle > span::after { content: ''; position: absolute; left: 3px; bottom: -4px; width: 4px; height: 4px; border-left: 1px solid currentColor; transform: skewY(-35deg); background: var(--panel, #182019); }
.quick-chat-panel { position: absolute; right: 0; top: calc(100% + 5px); z-index: 5; width: min(340px, calc(100vw - 56px)); padding: 10px; border: 1px solid var(--amber); background: #14201c; box-shadow: 0 10px 28px #0009; }
.quick-chat-panel[hidden] { display: none; }
.quick-chat-panel p { margin: 0 0 8px; font-size: 10px; }
.quick-chat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.quick-chat-list button { min-height: 44px; min-width: 0; padding: 6px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.quick-chat-edit { width: 100%; min-height: 44px; margin-top: 8px; color: var(--amber); font-size: 12px; }
.quick-chat-editor { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px; }
.quick-chat-editor header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quick-chat-editor h2 { font-size: 16px; }
.quick-chat-editor p { font-size: 11px; line-height: 1.5; color: var(--soft); }
.quick-chat-fields { display: grid; gap: 10px; margin: 14px 0; }
.quick-chat-field { display: grid; grid-template-columns: 1fr auto; gap: 4px; min-width: 0; }
.quick-chat-field label, .quick-chat-field > span { font-size: 11px; color: var(--soft); }
.quick-chat-field input { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.quick-chat-field input[aria-invalid="true"] { border-color: #f0a18c; }
.quick-chat-field .quick-chat-error { grid-column: 1 / -1; color: #f0a18c; margin: 0; }
.quick-chat-error:empty { display: none; }
.quick-chat-editor footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.quick-chat-editor footer button { min-width: 0; white-space: nowrap; }
.quick-chat-editor button { min-height: 44px; }
.quick-chat-reset { width: 100%; font-size: 11px; }
.quick-chat button, .quick-chat-editor button { border: 1px solid #64705d; border-radius: 3px; background: #233128; color: var(--ink); }
.quick-chat button:hover:not(:disabled), .quick-chat-editor button:hover:not(:disabled) { border-color: var(--amber); background: #334131; }
.quick-chat button:disabled { opacity: 0.45; }
.quick-chat .quick-chat-toggle, .quick-chat .quick-chat-edit { color: var(--amber); }
.quick-chat-editor .quick-chat-fields { max-height: max(150px, calc(100dvh - 310px)); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.quick-chat-editor .quick-chat-field input { border: 1px solid #64705d; border-radius: 3px; padding: 8px 10px; color: var(--ink); background: #101a14; }
.quick-chat-editor .quick-chat-field input[aria-invalid="true"] { border-color: var(--red); }
.quick-chat-editor .quick-chat-save { border-color: var(--amber); background: var(--amber); color: #211b11; }
.quick-chat-editor button:disabled { opacity: 0.45; }
.settings-group { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); }
.settings-group + .settings-group { margin-top: 12px; }
.settings-group legend { padding: 0 6px; color: var(--amber); font-size: 13px; }
.settings-group .micro { font: 400 12px/1.5 system-ui, sans-serif; letter-spacing: normal; word-break: keep-all; }
.settings-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.settings-actions #install-app { grid-column: 1 / -1; }
.settings-group :is(.workbench-open, .sound-button) { padding: 6px 8px; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.settings-group > .sound-button { width: 100%; }
.settings-group .sound-button:disabled { opacity: 0.6; }
.audio-settings .settings-actions, #haptics-status { margin-top: 8px; }
#music-volume-help { margin: 4px 0 8px; }
#account-logout { border-color: #8f6056; color: #efb9ac; }
#account-logout:hover:not(:disabled) { background: #382621; }
#logout-status:empty { margin: 0; }
.audio-settings label { color: var(--ink); font-size: 13px; }
.audio-volume-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audio-volume-label output { color: var(--amber); font: 12px var(--mono); }
.audio-volume-control { display: flex; align-items: center; gap: 8px; }
.audio-volume-control input { min-width: 0; flex: 1; }
.audio-toggle { display: grid; place-items: center; flex: none; color: var(--green); }
.audio-toggle[aria-pressed="false"] { color: var(--soft); }
.audio-toggle[aria-pressed="false"] .audio-toggle-waves,
.audio-toggle[aria-pressed="true"] .audio-toggle-cross { display: none; }
.audio-settings input[type="range"] { display: block; width: 100%; min-height: 36px; margin: 3px 0; accent-color: var(--amber); touch-action: pan-y; }
.audio-settings select { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 6px; border: 1px solid var(--line); color: var(--ink); background: #101814; font: inherit; font-size: 13px; }
.lobby-music-now { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.lobby-music-now p { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.lobby-music-now button { flex-shrink: 0; }
.bestiary { font-size: 0.75rem; line-height: 1.55; }
.bestiary .dialog-heading h2 { font-size: 1.0625rem; }
.bestiary-help { color: var(--soft); margin-bottom: 12px; word-break: keep-all; }
.bestiary-entries { display: grid; gap: 10px; }
.bestiary-grade { display: grid; gap: 10px; min-width: 0; }
.bestiary-grade h3 { margin: 8px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--amber); font-size: 0.8125rem; }
.bestiary-entry { border: 1px solid var(--line); background: #121c16; }
.bestiary-entry summary { display: grid; grid-template-columns: minmax(48px, 30%) minmax(0, 1fr) 14px; align-items: center; gap: 8px; padding: 8px; cursor: pointer; list-style: none; }
.bestiary-entry summary::-webkit-details-marker { display: none; }
.bestiary-entry summary::after { content: '+'; color: var(--amber); font: 18px var(--mono); }
.bestiary-entry[open] summary::after { content: '−'; }
.bestiary-entry summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.bestiary-entry img { display: block; width: 100%; height: auto; object-fit: contain; border: 1px solid var(--line); }
.bestiary-name { display: grid; gap: 5px; min-width: 0; }
.bestiary-entry summary strong { overflow-wrap: anywhere; }
.bestiary-name > span { color: var(--amber); font-size: 11px; }
.bestiary-entry dl { margin: 0; padding: 0 12px 12px; word-break: keep-all; }
.bestiary-entry dl > div + div { margin-top: 8px; }
.bestiary-entry dt { color: var(--amber); font-weight: 700; }
.bestiary-entry dd { margin: 2px 0 0; color: var(--soft); overflow-wrap: anywhere; }
.catalog-entry summary { grid-template-columns: 40px minmax(0, 1fr) 14px; }
.catalog-entry summary canvas { display: block; width: 40px; height: 40px; }
.catalog-search { display: grid; gap: 4px; margin: 0 0 12px; color: var(--soft); }
.catalog-search input { min-height: 44px; width: 100%; padding: 6px 10px; border: 1px solid var(--line); background: #101814; color: var(--ink); font: inherit; }
.catalog-ingredients { display: block; margin-top: 3px; color: var(--soft); font-size: inherit; overflow-wrap: anywhere; }
dialog.dialog.material-search-dialog { width: min(290px, 92vw); }
.material-search-dialog > .primary { width: 100%; margin-top: 12px; }
#loot-items [aria-haspopup="dialog"] { -webkit-touch-callout: none; user-select: none; }
:is(.catalog-weapon-grade, .catalog-armor-grade) h4 { margin: 4px 0 0; color: var(--soft); font-size: 12px; }
.difficulty-picker { min-width: 0; margin: 12px 0 0; padding: 8px; border: 1px solid #82714e; }
.difficulty-picker legend { padding: 0 5px; color: var(--soft); font-size: 11px; }
.difficulty-options { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.difficulty-options label { position: relative; cursor: pointer; }
.difficulty-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.difficulty-options span { display: block; padding: 10px 4px; text-align: center; font-size: 12px; border: 1px solid #82714e; background: #111b16; }
.difficulty-options input:checked + span { color: var(--amber); border-color: var(--amber); background: #36321e; }
.difficulty-options input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.difficulty-options:disabled { opacity: 0.6; }
.difficulty-help-open { padding: 0; font: 700 18px var(--mono); }
.difficulty-help h3 { margin: 12px 0 0; font-size: 14px; }
.difficulty-help-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.difficulty-help-list li { padding: 8px 10px; border: 1px solid var(--line); background: #172019; color: var(--soft); font-size: 12px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.difficulty-help-list strong { display: block; color: var(--amber); font-size: 14px; }

dialog.dialog { width: calc(var(--game-width) - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: none; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; overflow: auto; overscroll-behavior: contain; color: var(--ink); padding: 14px; }
dialog.lobby-inspection { max-width: 425px; }
dialog::backdrop { background: #080e0ce8; }
.dialog-heading { position: sticky; top: -14px; z-index: 1; padding-block: 6px; background: var(--panel); }
.dialog-heading h2 { font-size: 20px; }
.housing.dialog {
  width: min(588px, calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  background: #182422;
  border-color: #4f6962;
  border-top-color: #a6b6a3;
}
.housing .dialog-heading { background: #182422; }
.housing-toolbar, .housing-floor-nav, .housing-room-actions, .housing-action-buttons { display: flex; align-items: center; gap: 8px; }
.housing-toolbar { justify-content: space-between; margin-bottom: 9px; }
.housing-floor-nav button { min-width: 44px; font-size: 16px; }
.housing-floor-nav strong { min-width: 3ch; text-align: center; }
.housing-room-actions { min-width: 0; justify-content: flex-end; }
.housing-mode { color: #c3eddb; border-color: #6d9687; background: #29433a; }
.housing-mode:hover { background: #37554a; }
.housing-points { color: var(--soft); font-size: 12px; overflow-wrap: anywhere; }
.housing-points strong, .housing-price, .result-housing strong { color: var(--amber); }
.housing-room { position: relative; overflow: hidden; background: #121d1e; border-radius: 9px; }
.housing-room canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.housing-room canvas:focus-visible { outline: 2px solid #99c6b4; outline-offset: -4px; border-radius: 9px; }
.housing-grid { position: absolute; inset: 0; pointer-events: none; }
.housing-cell {
  position: absolute; width: var(--slot-width); height: var(--slot-height); transform: translate(-50%, -50%);
  padding: 0; border: 1px solid #adcbb46b; border-radius: 5px; background: #22322f18; pointer-events: auto;
}
.housing-cell:hover:not(:disabled), .housing-cell.is-source { border-color: #f2c789; background: #c3974933; }
.housing-cell.is-preview { border: 1px dashed #f2c789; background: #c3974926; }
.housing-cell:focus-visible, .housing-catalog button:focus-visible, .housing-tabs button:focus-visible { outline-offset: -3px; }
.housing-editor { margin-top: 10px; }
.housing-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; background: #101a1a; border-radius: 7px; }
.housing-tabs button {
  min-height: 40px; border: 1px solid transparent; border-radius: 5px; background: transparent;
  color: #bacbc1; font-size: 12px; font-weight: 750;
}
.housing-tabs button[aria-selected="true"] { color: #d7f5e7; background: #2a423b; border-color: #65867a; }
.housing-catalog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.housing-catalog button {
  min-width: 0; min-height: 75px; padding: 3px 2px 5px; display: grid; justify-items: center; align-content: center;
  border: 1px solid #4b645a; border-radius: 6px; background: linear-gradient(155deg, #314846, #263a36);
  color: #edf1e9; font-size: 11px; line-height: 1.35; word-break: keep-all;
}
.housing-catalog canvas { display: block; width: min(100%, 57px); height: auto; }
.housing-catalog button[aria-pressed="true"] { border-color: var(--amber); background: linear-gradient(155deg, #506058, #383e2d); }
.housing-actions { margin-bottom: 8px; border-left: 2px solid #8d9d84; padding: 6px 0 4px 7px; }
.housing-actions p, .housing-status, .housing-help { font-size: 12px; color: var(--soft); line-height: 1.45; }
.housing-help { margin-top: 9px; }
.housing-actions p { margin-bottom: 6px; }
.housing-action-buttons { gap: 4px; }
.housing-action-buttons .primary { flex: 1; width: auto; min-height: 44px; padding: 0 4px; font-size: 12px; }
.housing-expand { width: 100%; margin-top: 10px; }
.housing-status:not(:empty) { margin-bottom: 8px; }
.housing button:disabled { opacity: .62; }
.result-housing span { display: block; color: var(--muted); }
.result .result-release { color: var(--green); font-weight: 750; }
.result #result-ending:not([hidden]) + #return { margin-top: 6px; border-color: #ab915e; color: var(--amber); background: #24271b; }
.result #result-ending:not([hidden]) + #return:hover { background: #393521; }
dialog.player-intro {
  width: min(810px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)), max(290px, calc(150dvh - 132px)));
  padding: clamp(8px, 2vw, 14px);
  background: #111411;
}
.player-intro::backdrop { background: #030504ed; }
.player-intro-header, .player-intro-actions { display: flex; align-items: center; gap: 8px; }
.player-intro-header { justify-content: space-between; margin-bottom: 8px; }
.player-intro-header h2 { margin: 0; font-size: clamp(15px, 3.5vw, 20px); white-space: nowrap; }
.player-intro-actions .primary, .player-intro-actions .workbench-open {
  margin: 0; min-height: 40px; width: auto; padding: 7px 10px; white-space: nowrap;
}
.player-intro-frame { position: relative; background: #000; }
.player-intro-frame :is(canvas, video) { display: block; width: 100%; height: auto; }
#player-intro-description:not(.player-intro-caption) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.player-intro-caption {
  position: absolute; inset: auto 0 0; margin: 0; padding: 12px 8px;
  background: #000c; color: #f8f5eb; font-size: clamp(12px, 2.6vw, 15px);
  text-align: center; word-break: keep-all;
}
dialog.release-ending { width: min(740px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
.release-ending .dialog-heading { padding-block: 0 6px; }
.release-playback { display: flex; gap: 8px; align-items: center; }
.release-wordless .dialog-heading { justify-content: flex-end; }
.release-wordless .dialog-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.release-scene { margin: 0; }
.release-frame { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 2; background: #101411; }
.release-frame :is(img, video) { width: 100%; height: auto; display: block; }
.release-frame > p { padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.release-caption { display: grid; gap: 5px; margin-top: 12px; font-size: 14px; line-height: 1.55; word-break: keep-all; }
.release-caption-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.release-caption-heading h3 { margin: 0; font-size: 17px; }
.release-caption-heading span { color: var(--muted); font: 12px var(--mono); }
#release-narration { color: var(--soft); }
#release-dialogue { color: var(--amber); font-weight: 700; }
.release-navigation, .release-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.release-choices .workbench-open { min-height: 48px; white-space: normal; font-size: 13px; }
.release-navigation .workbench-open:disabled { opacity: 0.45; }
@media (max-width: 350px) {
  .housing.dialog { width: calc(100vw - 8px - env(safe-area-inset-left) - env(safe-area-inset-right)); padding-inline: 6px; }
  .housing-toolbar, .housing-room-actions, .housing-floor-nav { gap: 5px; }
  .housing-floor-nav button { min-width: 40px; }
}
.guidebook-content { min-width: 0; }
.guidebook-controls { table-layout: fixed; overflow-wrap: anywhere; }
.guidebook-controls :is(th, td) { padding-inline: 4px; white-space: normal; }
.equipment-picker .equipment { margin-top: 0; }
.equipment-picker .equipment legend { display: none; }
.equipment-picker .equipment-list { gap: 7px; }
.equipment-picker label { min-height: 58px; }
.appearance-layout { grid-template-columns: minmax(0, 1fr); gap: 9px; }
.appearance-stage { grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 10px; }
.appearance-stage canvas { width: 105px; }
.appearance-stage-actions { display: grid; gap: 6px; }
.weapon-skin-preview-name { grid-column: 1 / -1; margin: 0; color: var(--amber); font-size: 12px; text-align: center; }
.appearance-stage:has(.weapon-skin-preview-name:not([hidden])) canvas { width: min(41vw, 138px); }
.appearance[open] { display: flex; flex-direction: column; overflow: hidden; }
.appearance > .dialog-heading { position: static; flex-shrink: 0; }
.appearance .appearance-layout { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.appearance .appearance-stage { position: sticky; top: 0; z-index: 1; align-self: start; }
.appearance .appearance-summary { flex-shrink: 0; }
.appearance-help { margin: 4px 0 12px; color: var(--soft); font-size: 11px; line-height: 1.6; }
.cosmetic-options canvas { display: block; width: min(100%, 52px); height: auto; }
.weapon-skin-list { display: grid; gap: 6px; }
.weapon-skin-entry { min-width: 0; border: 1px solid #526454; border-radius: 6px; background: #182720; }
.weapon-skin-entry summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; list-style: none; }
.weapon-skin-entry summary::-webkit-details-marker { display: none; }
.weapon-skin-entry summary canvas { width: 40px; height: 40px; }
.weapon-skin-entry summary small, .weapon-skin-entry summary strong { display: block; overflow-wrap: anywhere; }
.weapon-skin-entry summary small { color: #b3c4b5; font-size: 11px; }
.weapon-skin-progress { color: #ead397; font-size: 12px; white-space: nowrap; }
.weapon-skin-progress::after { content: ' ▾'; }
.weapon-skin-entry[open] .weapon-skin-progress::after { content: ' ▴'; }
.weapon-skin-entry ol { display: grid; gap: 6px; margin: 6px 12px 9px; padding: 8px 8px 3px 22px; border-top: 1px solid #526454; font-size: 12px; line-height: 1.55; }
.weapon-skin-entry .unread { color: #a2aca3; }
.weapon-skin-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 0; }
.weapon-skin-actions button { flex: 1 1 auto; min-height: 40px; padding-inline: 8px; white-space: normal; }
.weapon-skin-actions button[aria-pressed='true'] { background: #3c4931; border-color: #bca766; color: #f8e4a9; }
.weapon-skin-actions button:disabled { opacity: .48; cursor: default; }
#weapon-skin-status { margin: 3px 0; color: var(--amber); font-size: 12px; }
#weapon-skin-status:empty { display: none; }
.raid-skin-note { position: absolute; z-index: 3; inset: clamp(77px, 14%, 150px) auto auto 50%; transform: translateX(-50%); width: min(23rem, calc(100% - 3.5rem)); box-sizing: border-box; min-height: 88px; padding: 10px 37px 11px 13px; border: 1px solid #a29561; border-radius: 4px; background: #e5d6a8; color: #292e22; box-shadow: 0 4px 16px #060c09b8; pointer-events: none; }
.raid-skin-note canvas { position: absolute; width: 115px; height: auto; inset: 50% 41px auto auto; transform: translateY(-50%); opacity: .2; }
.raid-skin-note-copy { position: relative; }
.raid-skin-note h2 { margin: 0; font-size: 13px; }
.raid-skin-note p { font-size: 14px; margin: 5px 0; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.raid-skin-note small { color: #464631; font-size: 11px; }
.raid-skin-note > button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; min-width: 0; min-height: 0; pointer-events: auto; }
.cosmetic-options label { min-width: 0; min-height: 80px; overflow-wrap: anywhere; word-break: normal; }
.follower-options label { word-break: keep-all; }
.stash-groups { grid-template-columns: minmax(0, 1fr); }
.stash-group li { grid-template-columns: 23px minmax(0, 1fr) auto; }
.stash-actions { grid-column: 2 / -1; }
.bag-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bag-dialog { max-height: 100%; }
.overlay { align-items: center; padding-inline: calc(12px + env(safe-area-inset-left)) calc(12px + env(safe-area-inset-right)); }
.overlay .dialog { min-width: 0; padding: 14px; max-height: 100%; overflow: auto; }
.materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.materials li { grid-template-columns: auto minmax(0, 1fr); }
.materials strong { grid-column: 2; }
.recipe-cost { overflow-wrap: anywhere; }
.recipes > li { grid-template-columns: auto minmax(0, 1fr); }
.recipes .craft-button { grid-column: 2; width: 100%; }
.account-nav { display: grid; grid-template-columns: 1fr 1fr; }
.account-nav button:last-child { grid-column: 1 / -1; }

.raid-top, .raid-bottom { left: calc(10px + env(safe-area-inset-left)); right: calc(10px + env(safe-area-inset-right)); }
.raid-top { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; top: calc(10px + env(safe-area-inset-top)); }
.vitals { min-width: 0; width: 100%; max-width: 180px; }
.hud-actions { grid-area: 1 / 2; flex-wrap: nowrap; align-items: start; }
.hud-actions .sound-button { padding-inline: 5px; font-size: 10px; }
.zone-label { grid-column: 1 / -1; justify-self: center; max-width: 100%; white-space: normal; }
.zone-label .death-log { max-height: 4.8em; overflow: hidden; }
.raid-bottom { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); }
.movement { align-self: end; }
.stick { width: 96px; height: 96px; }
.interaction { min-width: 0; max-width: 170px; }
.action-buttons { gap: 6px; }
.action { width: var(--action-size); height: var(--action-size); font-size: 13px; }
.quick-use { max-width: var(--action-size); }
.quick-use span { white-space: pre-line; }
.action-hint { max-width: 150px; }
.raid-info { position: absolute; bottom: 184px; left: 0; right: 0; max-width: none; pointer-events: none; }
.toast { max-width: 100%; }
.extract-progress { width: min(100%, 210px); }

@media (max-height: 500px) {
  .wordmark { font-size: 9px; }
  .brand-mark { display: none; }
  .account-bar { max-width: 92px; }
  .equipment-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loadout-heading .micro { display: none; }
  .loadout-actions { grid-template-columns: 1fr; }
  .loadout-preview { grid-template-columns: minmax(0, 1fr); }
  .loadout-preview canvas { max-height: 150px; }
  .loadout-preview dl { display: none; }
  .stick { width: 72px; height: 72px; }
  .interaction { --action-size: 48px; --action-gap: 4px; --interaction-base: max(52dvh, calc(198px + env(safe-area-inset-top))); --interaction-clearance: 138px; right: calc(6px + env(safe-area-inset-right)); }
  .action { font-size: 11px; }
  .raid-top, .raid-bottom { left: calc(6px + env(safe-area-inset-left)); right: calc(6px + env(safe-area-inset-right)); }
  .vitals { padding-inline: 6px; }
  .vitals-text { flex-wrap: wrap; gap: 1px 4px; font-size: 10px; }
  .vitals-text strong { font-size: 12px; }
  .hud-actions { gap: 3px; }
  .hud-actions .sound-button { display: none; }
  .zone-label { justify-self: start; max-width: calc(100% - 108px); padding: 4px 6px; }
  .raid-bottom { gap: 4px; }
  .quick-use, .action-hint { max-width: 105px; }
  .raid-info { bottom: 166px; }
  .appearance-stage { grid-template-columns: 1fr; }
}

.performance-toggle { min-width: 40px; }
.performance-toggle[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }
.performance-panel { position: absolute; right: calc(10px + env(safe-area-inset-right)); bottom: calc(118px + env(safe-area-inset-bottom)); width: min(260px, calc(100% - 20px)); padding: 8px; border: 1px solid #789783; background: #0c1714ed; color: var(--ink); font: 10px/1.4 var(--mono); user-select: text; touch-action: manipulation; }
.performance-panel header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.performance-panel header strong { font: 10px system-ui, sans-serif; }
.performance-panel button { min-height: 32px; padding: 3px 7px; border: 1px solid var(--line); background: #23362b; font-size: 10px; }
.performance-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 5px 0; }
.performance-panel dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 4px; min-width: 0; }
.performance-panel dt { color: var(--soft); font-size: 9px; }
.performance-panel dd { margin: 0; font-variant-numeric: tabular-nums; color: #e1eecb; }
.performance-panel .performance-wide { grid-column: 1 / -1; }
.performance-panel p { margin: 4px 0 0; color: var(--amber); font: 10px/1.4 system-ui, sans-serif; overflow-wrap: anywhere; }
.performance-help { margin-top: 12px; color: var(--soft); font-size: 12px; line-height: 1.6; }
.performance-help summary { cursor: pointer; color: var(--amber); }
.performance-help p { margin-top: 8px; }
.connection-check input { display: block; width: 100%; margin: 5px 0 8px; padding: 8px; color: var(--ink); background: #101b15; border: 1px solid var(--line); }
.connection-check button { margin: 4px 4px 0 0; }
.route-result { white-space: pre-line; overflow-wrap: anywhere; color: var(--amber); }
.report-copy { width: min(640px, calc(100vw - 24px)); max-height: 85vh; overflow: auto; }
.report-copy p { margin: 12px 0; }
.report-copy textarea { width: 100%; height: 45vh; padding: 10px; color: var(--ink); background: #101b15; border: 1px solid var(--line); font: 12px/1.5 var(--mono); }
@media (max-height: 500px) {
  .performance-panel { bottom: calc(65px + env(safe-area-inset-bottom)); max-height: calc(100% - 135px); overflow: auto; }
  .hud-actions .performance-toggle { display: inline-block; }
}

.room-list { margin: 0 0 10px; padding: 0; list-style: none; color: #b7c4bf; font-size: 12px; }
.room-clock:empty, .room-list:empty { display: none; }
.room-list li { padding: 7px 0; border-bottom: 1px solid #33423d; line-height: 1.6; overflow-wrap: anywhere; }

.emote-picker { position: relative; pointer-events: auto; }
.emote-toggle { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 5px 8px; color: var(--ink); background: #17271fed; border: 1px solid #80947b; touch-action: manipulation; }
.emote-picker svg { display: block; width: 24px; height: 24px; flex: none; }
.emote-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 8; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 196px; padding: 8px; border: 1px solid #b9a477; background: #12201bf5; box-shadow: 0 8px 24px #0008; }
.emote-panel[hidden] { display: none; }
#lobby-emotes { position: static; }
#lobby-emotes .emote-panel { top: auto; bottom: calc(100% + 6px); }
.emote-panel button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 52px; padding: 4px 2px; font-size: 11px; color: var(--ink); border: 1px solid #566b58; background: #1d3027; touch-action: manipulation; }
.emote-panel button span { font: 11px system-ui, sans-serif !important; color: var(--ink) !important; white-space: nowrap; }
.emote-panel button:hover:not(:disabled), .emote-panel button:focus-visible { background: #314337; border-color: #dfc18b; }
.raid-emotes .emote-toggle { width: 44px; height: 44px; padding: 8px; border-radius: 50%; }
.raid-pin { position: relative; width: 44px; height: 44px; border-radius: 50%; pointer-events: auto; }
.raid-pin[aria-pressed="true"] { color: #ffbd72; border-color: currentColor; background: #3b3020ee; }
.raid-pin-shortcut { position: absolute; right: 3px; bottom: 2px; padding: 0 2px; line-height: 1.2; pointer-events: none; }
.raid-pin-icon { position: relative; width: 19px; height: 20px; border-left: 2px solid currentColor; }
.raid-pin-icon::before { content: ""; position: absolute; inset: 0 0 8px; background: currentColor; clip-path: polygon(0 0, 100% 0, 75% 50%, 100% 100%, 0 100%); }
.raid-emotes .emote-panel {
  top: auto; bottom: calc(100% + 6px);
  width: min(196px, calc(var(--game-width) - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(var(--interaction-center) - 1.5 * var(--action-size) - 2 * var(--action-gap) - 58px - env(safe-area-inset-top));
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
}
.interaction:has(.raid-emotes .emote-panel:not([hidden])) { z-index: 6; }
.lobby-header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.lobby-space header { gap: 5px; }
@media (max-width: 360px) {
  .lobby-header-actions { gap: 4px; }
  .quick-chat-toggle { padding-inline: 6px; }
}
@media (max-height: 660px) {
  .raid-emotes .emote-panel {
    top: calc(100% + 6px); bottom: auto;
    max-height: calc(100dvh - var(--interaction-center) + 1.5 * var(--action-size) + 2 * var(--action-gap) - 14px - env(safe-area-inset-bottom));
  }
}
@media (max-height: 340px) {
  .raid-bottom { bottom: calc(3px + env(safe-area-inset-bottom)); }
  .look-control { gap: 2px; }
  .interaction { --interaction-clearance: 122px; }
}
@media (max-height: 500px) {
  .quick-use { font-size: 9px; }
}

/* Keep sortie controls outside of the independently scrolling base content. */
.base { grid-template-rows: max-content minmax(0, 1fr) max-content; overflow: hidden; }
.base > .base-layout { position: relative; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 10px; }
.base > .base-dock { position: relative; bottom: auto; z-index: 1; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); background: var(--dark); }
.deploy-actions { grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); }
.deploy-actions .difficulty-toggle { color: var(--amber); border-color: #82714e; white-space: nowrap; font-size: 14px; }
.difficulty-popup { position: fixed; inset: auto 0 var(--difficulty-bottom, 64px); margin: 0 auto; width: calc(var(--game-width) - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: 100%; max-height: calc(100dvh - var(--difficulty-bottom, 64px) - 12px); padding: 10px; overflow: auto; overscroll-behavior: contain; border: 1px solid #82714e; background: var(--panel); color: var(--ink); }
.difficulty-popup::backdrop { background: #080e0c55; }
.difficulty-popup .difficulty-options { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.difficulty-popup .difficulty-options span { display: grid; place-items: center; min-height: 44px; word-break: keep-all; }
/* Transparent accessible target for the avatar drawn in the main lobby canvas. */
.lobby-merchant-npc {
  position: absolute;
  z-index: 2;
  top: var(--merchant-y, 85.4167%);
  left: var(--merchant-x, 16.5%);
  transform: translate(-50%, -88%);
  width: max(48px, 9%);
  height: max(48px, 25%);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}
.lobby-merchant-npc:is(:hover, :focus-visible) {
  outline: 1px solid #f3ca83;
  outline-offset: 2px;
  background: #f3ca830d;
}
.scroll-vendor-npc:is(:hover, :focus-visible) { outline-color: #d6b7ff; }
.merchant-door-sign { color: #d9b57d; }
.merchant-views { display: flex; gap: 6px; margin-block: 8px; }
.merchant-views button { flex: 1; white-space: nowrap; min-height: 44px; padding-inline: 4px; }
.merchant-dialog .stash-equip[data-supply] { min-height: 44px; }
.merchant-supply-price { display: block; margin-top: 3px; color: #e1bd84; font-size: .8rem; }
.merchant-views button[aria-pressed="true"] { color: #ffdc9c; border-color: #a87c45; }
.merchant-dialog .shop-sale { margin-bottom: 10px; }
.merchant-dialog input { font-size: 16px; }
#merchant-quest-view { padding: 8px; border: 1px solid var(--line); }

.raid-settings { position: absolute; z-index: 6; top: 49px; right: 0; display: grid; gap: 4px; width: 146px; padding: 5px; border: 1px solid var(--line); background: #121a14; box-shadow: 0 5px 15px #0009; pointer-events: auto; }
.raid-settings button { min-height: 44px; padding: 5px 9px; font-size: 12px; text-align: left; }
.hud-actions { position: relative; }
#raid-settings .sound-button { display: inline-block; }

.diary-glyph { border-radius: 2px 4px 4px 2px; border-left-width: 3px; }
.diary-glyph::before { content: ""; position: absolute; inset: 4px 3px auto; height: 3px; border-block: 1px solid currentColor; }
.diary-glyph::after { content: ""; position: absolute; bottom: 0; right: 2px; width: 3px; height: 5px; background: var(--amber); }
.result-attacker { display: grid; grid-template-columns: minmax(68px, 100px) minmax(0, 1fr); align-items: center; gap: 6px 10px; margin-block: 10px; padding: 9px; border: 1px solid var(--line); background: #121a14; text-align: left; }
.result-attacker h3 { grid-column: 1 / -1; margin: 0; color: var(--soft); font-size: 12px; }
.result-attacker-portrait :is(canvas, img) { display: block; width: 100%; height: auto; }
.result-attacker-info { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.result-attacker-info strong { color: var(--amber); }
.result-attacker-info dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 7px; margin: 5px 0 0; }
.result-attacker-info dt { color: var(--soft); }
.result-attacker-info dd { margin: 0; }
.diary-glyph { display:inline-block; position:relative; flex:none; width:17px; height:18px; border:1.5px solid currentColor; border-radius:2px 4px 4px 2px; border-left-width:3px; }

.lobby-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.lobby-space header > h2 { flex: none; margin-inline-end: 8px; }
.lobby-chat-log-toggle { display: flex; align-items: center; min-height: 44px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--amber); cursor: pointer; white-space: nowrap; font-size: 12px; list-style: none; }
.lobby-chat-log-toggle[aria-expanded="true"], .lobby-chat-log-toggle:hover { border-color: var(--amber); background: #334131cc; }
.lobby-chat-log-panel { margin: 0 8px 8px; max-height: min(165px, 32dvh); overflow: auto; overscroll-behavior: contain; padding: 8px; background: #14201c; border: 1px solid var(--amber); box-shadow: 0 8px 22px #0009; }
.lobby-chat-log-panel p { margin: 0 0 7px; }
.lobby-chat-log-panel ol { list-style: none; padding: 0; margin: 0; }
.lobby-chat-log-panel li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; padding: 5px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.lobby-chat-log-panel time { font-variant-numeric: tabular-nums; color: var(--soft); }
.lobby-header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
