@charset "UTF-8";

/* Browser shell: quiet forest colours, parchment labels, joined brass frames. */
body.in-game {
  background: #131a11;
  background-image: repeating-linear-gradient(0deg, #0e140b30 0 1px, transparent 1px 5px);
}
.game-screen {
  height: 100dvh;
  min-height: 600px;
  max-width: 1920px;
  margin: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 210px;
  grid-template-rows: 64px minmax(0, 1fr) 132px 18px;
  grid-template-areas: "header header header" "equipment world sidebar" "chat events sidebar" "help help help";
  gap: 7px;
}
.game-screen .panel {
  border: 1px solid #746341;
  border-radius: 0;
  background: linear-gradient(90deg, #00000013, transparent 12%, transparent 88%, #00000013), #253120;
  box-shadow: inset 0 0 0 1px #a2935620, inset 0 0 18px #111a0e80, 0 1px 2px #0009;
}
.game-screen .section-heading {
  gap: 7px;
  border-bottom: 1px solid #776540;
  min-height: 26px;
  padding-bottom: 7px;
}
.game-screen .section-heading h2 {
  color: #e2cea1;
  font: bold 14px/1.25 Georgia, "Times New Roman", serif;
  letter-spacing: .02em;
  text-shadow: 0 1px #10160c;
}
.game-screen .count-pill {
  min-width: 24px;
  padding: 0 5px;
  border: 1px solid #83704a;
  border-radius: 0;
  background: #171f13;
  color: #d1c19b;
  font-size: 10px;
}
.game-header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 8px 14px;
  position: relative;
}
.game-screen .game-header {
  border-color: #97804e;
  background: linear-gradient(180deg, #35422a, #25321f 50%, #1d2819);
  box-shadow: inset 0 1px #b8a16b65, inset 0 -1px #0e150c, 0 2px 3px #0008;
}
.wordmark.compact {
  color: #e1c589;
  gap: 8px;
  font: bold 17px/1 Georgia, "Times New Roman", serif;
  letter-spacing: .09em;
  white-space: nowrap;
  text-shadow: 0 1px 1px #090d06;
}
.compact .brand-mark {
  width: 29px;
  height: 34px;
  font: 25px/1 Georgia, "Times New Roman", serif;
  color: #dec082;
  border: 1px solid #ab8c54;
  background: #182211;
}
.profile-identity {
  display: flex;
  flex-direction: column;
  min-width: 123px;
  padding-left: 14px;
  border-left: 1px solid #8a795144;
  font-size: 12px;
}
.profile-identity strong { color: #f0e6cb; font-size: 13px; font-weight: bold; }
.profile-identity > .muted { font-size: 10px; margin-top: 2px; }
.vital-bars { flex: 1; min-width: 90px; max-width: 680px; }
.bar-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 10px;
  color: #ddd5b9;
}
.meter {
  width: 100%;
  height: 8px;
  border: 1px solid #17170e;
  outline: 1px solid #83714766;
  background: #11160f;
  overflow: hidden;
  border-radius: 0;
  box-shadow: inset 0 1px 2px #000;
}
.meter span { display: block; width: 0; height: 100%; transition: width .18s ease; }
.meter.hp span { background: linear-gradient(180deg, #bd6851, #863d30); box-shadow: inset 0 1px #e3a18466; }
.meter.resource { margin-top: 5px; height: 6px; }
.meter.resource span { background: linear-gradient(180deg, #7799a2, #446677); }
.meter.xp { height: 6px; margin: 5px 0; }
.meter.xp span { background: linear-gradient(180deg, #d8be76, #9c803f); }
.ward-label { display: block; min-height: 0; color: #b5c9b0; font-size: 9px; margin-top: 2px; }
.experience { width: 160px; margin-left: auto; color: #c2b794; font-size: 9px; }
#location-name { display: block; color: #dfc68e; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.header-actions { display: flex; gap: 5px; align-items: center; }
.game-screen .header-actions button {
  border-color: #827044;
  background: linear-gradient(180deg, #425337, #273820);
  box-shadow: inset 0 1px #a99b6260, inset 0 -1px #142010;
  color: #e6d8b5;
}
.game-screen .header-actions button:hover:not(:disabled) { border-color: #d4bc7d; background: #475b39; }
.icon-button { width: 32px; min-height: 32px; padding: 0; font-size: 20px; line-height: 1; }
.header-actions .quiet { font-size: 10px; padding: 6px 10px; min-height: 32px; }
.mobile-equipment-button, .mobile-label { display: none; }

/* The eight cells remain empty until actual equipment exists. */
.equipment-panel { grid-area: equipment; padding: 11px; align-self: start; min-width: 0; }
.equipment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.equipment-slot {
  min-height: 57px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  padding: 4px 2px;
  border: 1px solid #88734a;
  border-radius: 0;
  background: radial-gradient(ellipse at 50% 45%, #34412a, #192313 90%);
  box-shadow: inset 1px 1px 0 #10190c, inset -1px -1px 0 #a5945535;
  font-size: 9px;
  color: #b2ab87;
  text-align: center;
  overflow: hidden;
}
.equipment-slot::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 30px;
  top: 5px;
  left: calc(50% - 13.5px);
  background-color: #8b8d66;
  opacity: .33;
  mask: var(--slot-shape) center / contain no-repeat;
  -webkit-mask: var(--slot-shape) center / contain no-repeat;
}
.equipment-slot[data-slot="head"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 24V13C7 3 25 3 25 13v11l-7 4v-9h5v-4H9v4h5v9z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="neck"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='none' stroke='black' stroke-width='2.5' d='M8 5C2 17 9 23 16 23S30 17 24 5'/%3E%3Cpath d='m16 19 5 6-5 6-5-6z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="weapon"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m26 2-1 10-12 12-4-4L21 8zm-18 16 8 8-3 3-8-8zm-2 7 3 3-4 4-3-3z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="offhand"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m16 3 11 4v11c0 6-6 10-11 13C11 28 5 24 5 18V7zm-7 7v8c0 4 4 8 7 10V7z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="body"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m10 3 3 3h6l3-3 9 5-3 9-6-2v14H10V15l-6 2-3-9z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="hands"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 4h3v10h1V2h3v12h1V4h3v10h1V7h3v13l-5 9H8L3 17l3-2 4 5z'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="ring"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m16 1 6 6-6 6-6-6z'/%3E%3Ccircle cx='16' cy='20' r='9' fill='none' stroke='black' stroke-width='4'/%3E%3C/svg%3E"); }
.equipment-slot[data-slot="feet"] { --slot-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 3h12v16l9 4v7H4v-8l4-4z'/%3E%3C/svg%3E"); }
.equipment-slot > span:first-child { position: relative; z-index: 1; line-height: 1.3; }
.equipment-slot .slot-content { display: none; }
.equipment-slot.filled { color: #e6d8b5; }
.equipment-slot.filled::before { display: none; }
.equipment-slot.filled .slot-content { display: block; font-size: 10px; margin: 3px 0; }
.equipment-panel > .field-help { font-size: 9px; line-height: 1.5; margin-top: 10px; color: #aaa78c; }
.recovery-row { display: flex; gap: 5px; margin-top: 11px; }
.recovery-row button { flex: 1; min-width: 0; padding: 6px 3px; min-height: 29px; font-size: 9px; }

/* The world remains a single unscaled Godot surface. */
.godot-world {
  grid-area: world;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #151d11;
  border: 2px solid #aa8b54;
  border-radius: 0;
  outline: 1px solid #172010;
  box-shadow: 0 0 0 1px #bdab6930, 0 2px 5px #0009;
}
#game-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.world-location {
  position: absolute;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #b8a16a;
  border-radius: 0;
  background: #202a18ed;
  box-shadow: inset 0 0 0 1px #171e13, 0 1px 3px #0009;
  color: #ede0b8;
  font-size: 10px;
  line-height: 1.45;
  pointer-events: none;
}
#world-location-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.safe-badge { color: #bacc9c; border-left: 1px solid #807345; padding-left: 7px; white-space: nowrap; }
.engine-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  text-align: center;
  background: radial-gradient(ellipse at center, #33402a, #111a0d);
}
.loading-rune {
  display: grid;
  place-items: center;
  width: 48px;
  height: 57px;
  border: 1px solid #b09860;
  color: #d5b875;
  background: #1c2615;
  box-shadow: inset 0 0 0 3px #26321d;
  font: 39px/1 Georgia, "Times New Roman", serif;
}
.engine-loading strong { color: #e4d4ad; font: 21px/1.3 Georgia, "Times New Roman", serif; }
.engine-loading .muted { max-width: 340px; font-size: 11px; }
.engine-loading progress { width: 190px; height: 8px; accent-color: #ba9d5a; border: 1px solid #8b764b; }
.engine-loading progress::-webkit-progress-bar { background: #11180d; }
.engine-loading progress::-webkit-progress-value { background: #b99b55; }

.world-sidebar { grid-area: sidebar; display: flex; flex-direction: column; gap: 7px; min-height: 0; min-width: 0; overflow-y: auto; scrollbar-width: thin; }
.minimap-panel { padding: 10px; }
.minimap-panel .section-heading > .muted { font-size: 9px; text-transform: none; letter-spacing: 0; }
.minimap-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 9px;
  border: 1px solid #9a834f;
  border-radius: 0;
  background: #171f13;
  box-shadow: 0 0 0 2px #161e12;
}
.map-legend { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #c1b993; font-size: 9px; }
.map-legend span { display: flex; align-items: center; gap: 4px; }
.legend-player { width: 5px; height: 5px; display: inline-block; background: #b4d0bb; }
.legend-group { width: 5px; height: 5px; display: inline-block; background: #b9694e; }
.legend-exit { background: #dcc07f; }
.group-panel { padding: 10px; }
.group-panel h2 { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.group-members { display: flex; align-items: flex-end; justify-content: space-around; min-height: 67px; margin: 10px 0 8px; gap: 3px; border-bottom: 1px solid #75644066; padding-bottom: 8px; }
.group-member { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 3px; min-width: 0; color: #d6c294; font-size: 9px; }
.group-member .pixel-sprite { max-width: 100%; height: 55px; }
.group-panel .field-help { font-size: 9px; line-height: 1.6; }
.connection-panel { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 8px 10px; color: #b8b69b; font-size: 9px; }
.game-screen .status-dot { width: 5px; height: 5px; border-radius: 0; background: #9fb873; box-shadow: 0 0 0 1px #151e0e, 0 0 0 2px #627248; }

.chat-panel { grid-area: chat; z-index: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; width: calc(100% + 235px); padding: 9px 10px; }
.event-panel { grid-area: events; display: flex; flex-direction: column; min-width: 0; min-height: 0; margin-left: 235px; padding: 9px 10px; }
.chat-panel .section-heading, .event-panel .section-heading { min-height: 21px; padding-bottom: 5px; }
.chat-panel .section-heading > .muted, .event-panel .section-heading > .muted { color: #afa98b; font-size: 9px; }
.message-log { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; color: #d5cfb2; font-size: 10px; line-height: 1.6; scrollbar-width: thin; scrollbar-color: #756640 #1b2515; }
.message-log > p { margin: 3px 0; overflow-wrap: anywhere; }
.message-log .author { color: #d8bd7c; font-weight: bold; }
.chat-panel .message-log { margin: 5px 0; }
.event-panel .message-log { margin-top: 5px; color: #b8b195; }
.chat-form { display: flex; gap: 5px; }
.chat-form input { min-width: 0; min-height: 27px; padding: 4px 7px; background: #131e10; border-color: #7c6b45; color: #e8dfbd; font-size: 10px; box-shadow: inset 0 1px 3px #0008; }
.chat-form input::placeholder { color: #9f9e83; }
.chat-form button { min-height: 27px; min-width: 29px; padding: 3px 7px; font-size: 13px; }
.game-help { grid-area: help; display: flex; align-items: center; justify-content: center; gap: 24px; white-space: nowrap; color: #a79f7f; font-size: 9px; }
.game-help kbd, .battle-help kbd { border-color: #81724b; color: #c6bea0; background: #1c2716; border-radius: 0; font: 9px/1.4 Verdana, Arial, sans-serif; }
.game-help .small-diamond { margin-right: 4px; }
.mobile-controls { display: none; position: absolute; bottom: 11px; left: 11px; grid-template-columns: repeat(3, 37px); grid-template-rows: repeat(2, 37px); gap: 4px; }
.mobile-controls button { min-height: 37px; padding: 0; border: 1px solid #c1a66b; border-radius: 0; background: #27341ded; box-shadow: inset 0 1px #d0ba7740, 0 1px 3px #0009; color: #f0e1bc; font-size: 19px; user-select: none; }
.mobile-controls button:active { background: #526742; }
.mobile-controls [data-move="up"] { grid-column: 2; }
.mobile-controls [data-move="left"] { grid-row: 2; grid-column: 1; }
.mobile-controls [data-move="down"] { grid-row: 2; grid-column: 2; }
.mobile-controls [data-move="right"] { grid-row: 2; grid-column: 3; }

/* Dialog contents are kept in the same classic shell as the world. */
dialog {
  color: var(--text);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 23px;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px #a3935425, 0 10px 55px #000b;
  overflow: auto;
}
dialog.panel { border: 2px solid #aa8d53; background: linear-gradient(90deg, #00000015, transparent 20%, transparent 80%, #00000015), #263323; }
dialog::backdrop { background: #071005c9; }
dialog[open] { animation: dialog-in .12s ease-out; }
dialog > .section-heading { border-bottom: 1px solid #857045; padding-bottom: 12px; }
dialog .section-heading h2 { color: #e2cfa3; font: bold 24px/1.2 Georgia, "Times New Roman", serif; }
dialog .eyebrow { color: #b9a16b; font-size: 9px; letter-spacing: .12em; }
dialog .count-pill { border-radius: 0; }
.settings-dialog { width: 480px; }
.settings-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid #82704466; }
.settings-section > h3 { color: #dac08b; font: bold 15px/1.3 Georgia, "Times New Roman", serif; margin-bottom: 10px; }
.settings-section select { min-height: 37px; font-size: 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: relative; margin: 0; padding: 10px 0; cursor: pointer; font-size: 12px; font-weight: normal; }
.toggle-row small { display: block; margin-top: 3px; font-size: 10px; color: #b3b195; }
.toggle-row input { position: absolute; width: 1px; min-height: 1px; height: 1px; opacity: 0; right: 10px; }
.toggle-row > i { flex: none; width: 20px; height: 20px; position: relative; background: #172111; border: 1px solid #a08851; border-radius: 0; box-shadow: inset 1px 1px #060e03, inset -1px -1px #bca66b30; }
.toggle-row > i::after { content: ""; position: absolute; display: none; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #e0c684; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.toggle-row input:checked + i { background: #3a4d2a; border-color: #d7b96f; }
.toggle-row input:checked + i::after { display: block; }
.toggle-row input:focus-visible + i { outline: 2px solid #d3d0a0; outline-offset: 3px; }
.network-controls, .test-profile-controls { display: flex; gap: 7px; }
.network-controls input, .test-profile-controls select { flex: 1; min-width: 0; }
.network-controls button, .test-profile-controls button { font-size: 11px; }
.test-profile-controls input { width: 80px; min-width: 0; }
.settings-dialog > .quiet { margin-top: 22px; font-size: 11px; }
.duel-dialog { width: 435px; }
.duel-dialog h2 { font: bold 25px/1.2 Georgia, "Times New Roman", serif; color: #e3cf9e; }
.duel-dialog > p:not(.eyebrow) { margin-top: 15px; font-size: 12px; line-height: 1.8; }
.dialog-actions { display: flex; gap: 8px; margin-top: 23px; }
.dialog-actions button { flex: 1; }

.battle-dialog { width: 864px; padding: 8px; }
.battle-dialog > .section-heading { margin-bottom: 14px; }
.battle-dialog > .section-heading h2 { font-size: 20px; }
.battle-dialog .secondary { font-size: 11px; }
.side-caption { margin: 0 0 7px; font: bold 12px/1.3 Georgia, "Times New Roman", serif; letter-spacing: .03em; }
.enemy-caption { color: #d69e86; }
.ally-caption { color: #bdd0a5; }
.combat-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #7b6944 #1a2615; }
.combatant {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 132px;
  max-width: 260px;
  min-height: 170px;
  padding: 9px 8px 8px;
  border: 1px solid #7b6b46;
  border-radius: 0;
  background: radial-gradient(ellipse at 50% 64%, #3d452d60, transparent 65%), #1e2a19;
  box-shadow: inset 0 0 0 1px #af9e5520;
  text-align: center;
  transition: border-color .12s, background .12s;
}
.combatant:disabled { opacity: 1; cursor: default; }
.combatant.current { border-color: #e0bf75; box-shadow: inset 0 0 0 1px #b79a53, 0 0 0 1px #5f532a; }
.combatant.selected { border-color: #ccd6aa; background-color: #3a4c2a; box-shadow: inset 0 0 0 1px #79885a; }
.combatant.local { background-color: #2b3b23; }
.combatant.local.selected { background-color: #3a4c2a; }
.combatant.dead { filter: grayscale(1); opacity: .48; }
.combatant h4 { width: 100%; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e7d9b5; font: bold 11px/1.5 Verdana, Arial, sans-serif; }
.combatant .local-badge { position: absolute; top: 28px; right: 7px; padding: 1px 4px; border: 1px solid #849769; background: #314523; border-radius: 0; color: #d3e2b6; font-size: 7px; line-height: 1.4; }
.combatant .pixel-sprite { width: 100%; height: 99px; flex: none; margin: 3px 0 5px; }
.combatant .meter { height: 6px; margin-top: auto; }
.combatant .combat-hp { margin-top: 4px; font-size: 9px; color: #dbd0ae; }
.combatant .combat-resource { margin-top: 1px; font-size: 9px; color: #adc0b5; }
.combatant .combat-status { min-height: 0; font-size: 9px; color: #d8b979; }
.pixel-sprite { display: block; image-rendering: pixelated; }
.battle-divider { position: relative; margin: 9px 0 10px; height: 14px; color: #b5a273; text-align: center; font: italic 11px/14px Georgia, "Times New Roman", serif; }
.battle-divider::before, .battle-divider::after { position: absolute; content: ""; height: 1px; width: calc(50% - 22px); background: #78663e; top: 7px; }
.battle-divider::before { left: 0; }
.battle-divider::after { right: 0; }
.battle-controls { display: flex; gap: 9px; margin-top: 14px; }
.ability-buttons { display: grid; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ability-button { display: flex; justify-content: space-between; align-items: center; gap: 7px; min-height: 34px; padding: 7px 8px; color: #e3d5af; text-align: left; font-size: 10px; background: linear-gradient(180deg, #35452b, #26371e); border-color: #88754c; }
.ability-button.selected { border-color: #d4c58a; background: #4b5b32; box-shadow: inset 0 0 0 1px #958255; }
.ability-button .ability-cost { font-size: 9px; color: #b7bb98; white-space: nowrap; }
.ability-button:disabled { opacity: .42; }
.battle-controls > .primary { min-width: 98px; font-size: 12px; }
.battle-target { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 8px 0 5px; color: #bcb597; font-size: 10px; }
.battle-messages { min-height: 40px; max-height: 72px; border-top: 1px solid #7a6844; padding-top: 5px; font-size: 10px; }
.battle-help { color: #a8a588; font-size: 9px; text-align: center; margin-top: 9px; }
.battle-help span { margin: 0 7px; }
.equipment-dialog { width: 282px; }
.equipment-dialog > .section-heading { margin-bottom: 14px; }
.equipment-dialog .equipment-panel { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
.equipment-dialog .equipment-grid { gap: 9px; }
.equipment-dialog .equipment-slot { min-height: 68px; font-size: 10px; }
.equipment-dialog .equipment-slot::before { top: 9px; width: 30px; height: 34px; left: calc(50% - 15px); }
.equipment-dialog .section-heading h2 { font-size: 20px; }
.equipment-dialog .equipment-panel .section-heading h2 { font-size: 14px; }
.noscript-warning { position: fixed; inset: 0; display: grid; place-items: center; background: #141d10; color: #e8d8b0; z-index: 2000; font-size: 18px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (min-width: 1600px) {
  .game-screen { grid-template-columns: 185px minmax(0, 1fr) 230px; grid-template-rows: 68px minmax(0, 1fr) 142px 20px; padding: 10px; gap: 8px; }
  .chat-panel { width: calc(100% + 270px); }
  .event-panel { margin-left: 270px; }
  .equipment-slot { min-height: 63px; }
  .equipment-slot::before { top: 8px; }
  .game-help { font-size: 10px; }
}
@media (max-width: 1050px) {
  .game-screen { grid-template-columns: 145px minmax(0, 1fr) 182px; grid-template-rows: 62px minmax(0, 1fr) 123px 18px; padding: 6px; gap: 6px; }
  .game-header { gap: 11px; padding: 7px 10px; }
  .wordmark.compact { font-size: 0; }
  .compact .brand-mark { font-size: 24px; }
  .profile-identity { min-width: 100px; padding-left: 9px; }
  .experience { width: 124px; }
  .equipment-panel { padding: 9px; }
  .game-screen .equipment-panel h2 { font-size: 12px; }
  .equipment-grid { gap: 5px; margin-top: 9px; }
  .equipment-slot { min-height: 52px; font-size: 8px; }
  .equipment-slot::before { height: 25px; top: 4px; }
  .recovery-row { gap: 3px; }
  .recovery-row button { font-size: 8px; padding: 5px 2px; }
  .chat-panel { width: calc(100% + 185px); }
  .event-panel { margin-left: 185px; }
  .game-help { gap: 16px; font-size: 8px; }
  .minimap-panel, .group-panel { padding: 9px; }
  .map-legend { font-size: 8px; gap: 4px; }
}
@media (max-width: 800px) {
  .game-screen { min-height: 560px; grid-template-columns: minmax(0, 1fr) 163px; grid-template-rows: 62px minmax(0, 1fr) 121px 18px; grid-template-areas: "header header" "world sidebar" "chat sidebar" "help help"; }
  .equipment-panel, .event-panel { display: none; }
  .chat-panel { width: 100%; }
  .game-header { gap: 10px; }
  .wordmark.compact { display: none; }
  .profile-identity { padding-left: 0; border-left: 0; }
  .profile-identity strong { font-size: 12px; }
  .experience { width: 120px; }
  .header-actions .quiet { display: none; }
  .mobile-equipment-button { display: block; font-size: 10px; }
  .header-actions #leave-world { display: block; width: 32px; min-height: 32px; padding: 4px; font-size: 17px; }
  .header-actions .desktop-label { display: none; }
  .header-actions .mobile-label { display: inline; }
  .game-help { gap: 11px; font-size: 8px; }
  .world-location { font-size: 9px; }
  .safe-badge { display: none; }
  .group-members { min-height: 56px; }
  .group-member .pixel-sprite { height: 45px; }
  .battle-dialog { padding: 15px; }
  .battle-dialog > .section-heading h2 { font-size: 18px; }
  .combatant { min-width: 116px; min-height: 158px; }
  .combatant .pixel-sprite { height: 99px; }
  .ability-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .battle-help { font-size: 8px; }
}
@media (max-width: 600px) {
  .experience { display: none; }
  .game-header { gap: 8px; }
  .vital-bars { max-width: none; }
  .profile-identity { min-width: 94px; }
  .game-help span:last-child { display: none; }
}
@media (max-width: 480px) {
  .game-screen { grid-template-columns: minmax(0, 1fr) 116px; grid-template-rows: 61px minmax(0, 1fr) 121px 16px; padding: 4px; gap: 4px; }
  .game-header { gap: 6px; padding: 6px; }
  .profile-identity { min-width: 76px; }
  .profile-identity strong { font-size: 10px; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .profile-identity > .muted { font-size: 8px; }
  .bar-labels { display: block; font-size: 8px; line-height: 1.25; margin-bottom: 3px; }
  .bar-labels span { display: block; }
  .meter { height: 6px; }
  .meter.resource { height: 5px; margin-top: 4px; }
  .ward-label { font-size: 7px; margin-top: 1px; }
  .header-actions { gap: 3px; }
  .icon-button, .header-actions #leave-world { width: 27px; min-height: 29px; }
  .icon-button { font-size: 18px; }
  .mobile-equipment-button { font-size: 9px; }
  .minimap-panel, .group-panel { padding: 7px; }
  .minimap-panel .section-heading { flex-wrap: wrap; gap: 2px; padding-bottom: 5px; }
  .game-screen .minimap-panel h2 { font-size: 12px; }
  .minimap-panel .section-heading > .muted { font-size: 8px; }
  .minimap-panel canvas { margin: 8px 0; }
  .map-legend { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 8px; }
  .game-screen .group-panel h2 { font-size: 11px; }
  .group-panel .count-pill { font-size: 8px; min-width: 19px; padding: 0 3px; }
  .group-members { flex-wrap: wrap; justify-content: flex-start; gap: 3px; }
  .group-member { flex: 0 0 calc(50% - 2px); font-size: 8px; }
  .group-member .pixel-sprite { height: 39px; }
  .group-panel .field-help { font-size: 8px; }
  .connection-panel { padding: 7px; gap: 5px; font-size: 8px; }
  .world-location { top: 6px; left: 6px; max-width: calc(100% - 12px); padding: 4px 6px; gap: 5px; font-size: 8px; }
  .chat-panel { padding: 7px 8px; }
  .game-help { justify-content: flex-start; overflow: hidden; gap: 12px; font-size: 7px; }
  .game-help kbd { font-size: 8px; }
  .mobile-controls { bottom: 8px; left: 8px; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(2, 34px); gap: 3px; }
  .mobile-controls button { min-height: 34px; }
  dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 18px; }
  .battle-dialog { padding: 11px; }
  .battle-dialog > .section-heading h2 { font-size: 16px; }
  .battle-dialog .secondary { font-size: 9px; padding: 6px; }
  .combatant { min-width: 108px; padding: 8px 6px 7px; }
  .combatant h4 { font-size: 10px; }
  .battle-controls { gap: 6px; }
  .battle-controls > .primary { min-width: 60px; padding: 7px 6px; font-size: 10px; }
  .ability-button { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px; font-size: 9px; }
  .battle-target { font-size: 9px; }
  .battle-help { line-height: 1.6; }
  .battle-help span { margin: 0 3px; }
  .settings-dialog { padding: 18px; }
  .toggle-row { font-size: 11px; gap: 9px; }
  .toggle-row small { font-size: 9px; }
  .test-profile-controls input { width: 58px; }
  .test-profile-controls button, .network-controls button { padding: 8px; font-size: 10px; }
}
@media (pointer: coarse) { .mobile-controls { display: grid; } }
@media (prefers-reduced-motion: reduce) {
  .game-screen *, dialog, dialog * { animation: none !important; transition: none !important; }
}

/* Desktop chrome follows the fixed 864×480 world instead of filling the monitor. */
.game-screen {
  height:auto; min-height:0; max-width:1272px; margin:8px auto;
  grid-template-columns:156px minmax(0,1fr) 212px;
  grid-template-rows:54px 484px 136px 16px; gap:6px; padding:6px;
}
.godot-world { display:block; min-width:0; overflow:hidden; }
.world-viewport { display:flex; justify-content:center; align-items:center; width:100%; height:100%; overflow:hidden; }
#game-canvas { width:100%; height:auto; max-width:864px; aspect-ratio:9 / 5; flex-shrink:0; touch-action:none; }
.chat-panel { width:calc(100% + 240px); }
.event-panel { margin-left:240px; }
.group-fight-actions { display:flex; flex-wrap:wrap; gap:5px; }
.group-fight-actions button { flex:1; padding:6px 4px; font-size:10px; }
@media(max-width:1271px) {
  .game-screen { grid-template-rows:54px auto 136px 16px; }
  .godot-world { align-self:start; }
  .world-viewport { height:auto; }
  .world-sidebar { max-height:626px; }
}
@media(max-width:1050px) {
  .game-screen { grid-template-columns:138px minmax(0,1fr) 174px; }
  .chat-panel { width:calc(100% + 190px); }.event-panel { margin-left:190px; }
}
@media(max-width:800px) {
  .game-screen { grid-template-columns:minmax(0,1fr) 150px; grid-template-rows:54px auto 136px 16px; }
  .chat-panel { width:100%; }.event-panel { margin-left:0; }
}
@media(max-width:600px) {
  .game-screen {
    margin:0; padding:4px; gap:4px; height:auto; min-height:0;
    grid-template-columns:minmax(0,1fr); grid-template-rows:61px auto auto 121px 16px;
    grid-template-areas:"header" "world" "sidebar" "chat" "help";
  }
  .godot-world { width:100%; height:auto; aspect-ratio:auto; }
  .world-sidebar { display:grid; grid-template-columns:120px minmax(0,1fr); align-items:start; overflow:visible; max-height:none; gap:4px; }
  .minimap-panel { grid-column:1; }.quest-panel { grid-column:2; }
  .group-panel,.connection-panel { grid-column:1 / -1; }.connection-panel { margin-top:0; }
}
/* Combat is a separate HTML overlay; it never resizes the Godot raster. */
.battle-dialog {
  width:864px; height:480px; max-width:calc(100vw - 12px); max-height:calc(100dvh - 12px);
  padding:6px; overflow:hidden;
}
.battle-dialog[open] {
  display:grid; grid-template-rows:34px 24px minmax(160px,1fr) 68px 16px 30px 12px; gap:3px;
}
.battle-dialog.anchored { inset:auto; left:var(--battle-left); top:var(--battle-top); margin:0; width:var(--battle-width); height:var(--battle-height); }
.battle-dialog>.section-heading { min-height:0; margin:0; padding:0 0 3px; }
.battle-dialog>.section-heading h2 { margin:0; font-size:18px; line-height:1; }
.battle-dialog .eyebrow { margin:0; font-size:9px; line-height:1.3; letter-spacing:0; }
.battle-dialog #battle-exit { min-height:26px; padding:3px 8px; font-size:10px; }
.battle-initiative { display:flex; align-items:center; gap:8px; min-width:0; }
.initiative-caption { flex:none; font-size:9px; }
.battle-queue { display:flex; flex:1; min-width:0; gap:4px; margin:0; padding:0; list-style:none; overflow:hidden; }
.battle-queue li { display:flex; align-items:center; min-width:0; flex:1; gap:4px; padding:2px 5px; font:9px/1.5 Verdana,Arial,sans-serif; }
.turn-number { flex:none; font-weight:bold; }.turn-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.battle-field { min-height:0; display:grid; grid-template-rows:1fr 1fr; gap:2px; overflow:hidden; padding:2px 5px; }
.battle-team { display:flex; flex-direction:column; min-height:0; }
.battle-dialog .side-caption { flex:none; margin:0; height:13px; font:11px/13px 'Velmoria Pixel',monospace; }
.battle-dialog .combat-row { flex:1; justify-content:center; align-items:center; min-height:0; gap:10px; padding:0 2px; overflow-x:auto; overflow-y:hidden; }
.battle-dialog .combatant { display:grid; grid-template-rows:12px 80px 4px 12px; flex:0 1 138px; min-width:108px; max-width:154px; min-height:0; height:110px; padding:0 4px; gap:0; border-radius:0; box-shadow:none; }
.battle-dialog .combatant h4 { font:9px/12px Verdana,Arial,sans-serif; margin:0; }
.combat-figure { display:block; position:relative; width:100%; height:80px; }
.battle-dialog .combatant .pixel-sprite { width:100%; height:80px; margin:0; }
.battle-dialog .combatant .local-badge { top:2px; left:0; right:auto; padding:0 2px; font-size:7px; line-height:1.4; }
.battle-dialog .combatant .turn-mark { position:absolute; top:2px; left:0; padding:0 2px; font-size:7px; line-height:1.4; }
.battle-dialog .combatant.local .turn-mark { top:15px; }
.battle-dialog .combatant .meter { height:3px; margin:0; width:100%; }
.combat-vitals { display:flex; justify-content:center; width:100%; gap:6px; overflow:hidden; white-space:nowrap; }
.battle-dialog .combatant .combat-hp,.battle-dialog .combatant .combat-resource { margin:0; font:8px/12px Verdana,Arial,sans-serif; }
.battle-dialog .combatant .combat-status { position:absolute; top:2px; right:0; display:flex; flex-direction:column; align-items:flex-end; gap:2px; font-size:8px; }
.status-badge { display:flex; align-items:center; gap:2px; min-height:15px; padding:0 2px; font:8px/13px Verdana,Arial,sans-serif; }
.status-badge b { font:700 8px/13px Verdana,Arial,sans-serif; }.status-badge small { font-size:8px; }
.battle-dialog .battle-controls { min-width:0; margin:0; gap:6px; }
.battle-dialog .ability-buttons { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; min-width:0; }
.battle-dialog .ability-button { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:14px 11px; min-height:0; padding:2px 5px; gap:0 4px; font-size:9px; }
.ability-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.battle-dialog .ability-button .ability-cost { font:8px/14px Verdana,Arial,sans-serif; }.ability-reason { grid-column:1/-1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:8px/11px Verdana,Arial,sans-serif; }
.battle-dialog .battle-controls>.primary { min-width:80px; min-height:0; padding:4px 8px; font-size:15px; }
.battle-dialog .battle-target { min-height:0; margin:0; font:9px/16px Verdana,Arial,sans-serif; }
.battle-dialog .battle-messages { min-height:0; max-height:none; height:30px; padding:1px 4px; margin:0; font:9px/14px Verdana,Arial,sans-serif; overflow:auto; }
.battle-dialog .battle-messages p { margin:0; }
.battle-dialog .battle-help { margin:0; font:8px/12px Verdana,Arial,sans-serif; white-space:nowrap; overflow:hidden; }
.battle-dialog .battle-help span { margin:0 3px; }
@media(max-width:600px) {
  .battle-dialog { height:min(580px,calc(100dvh - 12px)); padding:6px; }
  .battle-dialog[open] { grid-template-rows:34px 25px minmax(160px,1fr) 108px 16px 42px 12px; gap:4px; }
  .battle-dialog>.section-heading h2 { font-size:17px; }.battle-dialog #battle-exit { max-width:96px; padding:3px 4px; font-size:9px; }
  .battle-initiative { gap:4px; }.initiative-caption { max-width:40px; font-size:8px; line-height:1.2; }
  .battle-queue { gap:2px; overflow-x:auto; scrollbar-width:thin; }.battle-queue li { flex:0 0 84px; padding:2px 3px; font-size:8px; }
  .battle-dialog .combat-row { justify-content:flex-start; gap:5px; }
  .battle-dialog .combatant { min-width:95px; max-width:125px; }
  .battle-dialog .ability-buttons { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .battle-dialog .battle-controls>.primary { min-width:52px; width:52px; padding:3px; font-size:13px; }
  .battle-dialog .battle-messages { height:42px; }
}
@media(max-height:420px) {
  .battle-dialog[open] { grid-template-rows:28px 22px minmax(100px,1fr) 64px 14px 28px; overflow:auto; }
  .battle-dialog .battle-help { display:none; }.battle-dialog .battle-field { min-height:240px; overflow-y:auto; }
}
