/* Common in-game dialog skin, including the result and create dialog's distinct DOM paths.
   Original tile/button outlines; reference-derived SVG weave and alpha are web adaptations. */
#selection-tooltip {
  position: fixed;
  z-index: 30;
  width: max-content;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 3px solid #30388d;
  border-image: url("./dialog72/frame.png") 8 / 3px / 0 stretch;
  background: #030913f5;
  color: #c4d1b4;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-shadow: 1px 1px #000;
  pointer-events: none;
}
#selection-tooltip .selection-tooltip-title {
  color: #dedc61;
  margin-bottom: 4px;
}
#screen .overlay:not(.lobby) {
  background: transparent;
}
/* Keep only the active dialog's text above the scene; preserve parent state/focus restoration. */
#screen:has(:is(#settings-panel, #help-panel, #unit-detail, #event-history, #game-info):not([hidden])) #menu,
#screen:has(.overlay:not(.lobby):not([hidden])) #result,
#screen:has(.overlay:not(.lobby):not([hidden])) .lobby-shell {
  visibility: hidden;
}
#screen .window,
#screen.native-console .window,
#screen .lobby-create {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 0.936768cqw solid transparent;
  border-image: url("./dialog72/frame.png") 8 / 0.936768cqw / 0 repeat;
  border-radius: 0.351288cqw;
  box-shadow: none;
  background: url("./dialog-weave72.svg") 0 0 / 5.620609cqw 3.747073cqw repeat #030613a8;
  background-clip: border-box;
  color: #bfc4df;
  padding: 1.405152cqw;
  font-size: 1.405152cqw;
  line-height: 1.45;
  max-height: 51.522248cqw;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #343985 #080b20;
  text-shadow: 1px 1px #000;
}
#screen :is(.window, .lobby-create) > :is(h2, nav, button, .menu-actions) {
  flex-shrink: 0;
}
#screen .window > button {
  align-self: center;
  min-width: 10.30445cqw;
}
#screen :is(.help-window dl, #history-lines, #unit-detail-text, .game-info-content) {
  min-height: 0;
  overflow: auto;
  scrollbar-color: inherit;
}
#screen :is(.window, .lobby-create) h2,
#screen #menu .menu-window h2 {
  position: static;
  color: #bec3e5;
  font-size: 1.873536cqw;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  margin: 0 0 1.873536cqw;
}
#screen :is(.window, .lobby-create) button {
  position: static;
  height: 3.278689cqw;
  min-height: 3.278689cqw;
  padding: 0 1.405152cqw;
  border: 0;
  border-radius: 0;
  border-image: url("./dialog72/normal.png") 0 8 0 8 fill / 0 0.936768cqw / 0 stretch;
  background: transparent;
  box-shadow: none;
  color: #dedc61;
  font-size: 1.639344cqw;
  font-weight: 400;
  line-height: 1.25;
  filter: none;
  white-space: nowrap;
}
#screen :is(.window, .lobby-create) button:is(:hover, :focus-visible) {
  color: #ffffbb;
  outline: 1px solid #757bd1;
  outline-offset: -0.468384cqw;
  filter: none;
}
#screen :is(.window, .lobby-create) button:is(:active, [aria-pressed="true"]) {
  border-image-source: url("./dialog72/pressed.png");
}
#screen :is(.window, .lobby-create) button:disabled {
  border-image-source: url("./dialog72/disabled.png");
  color: #737586;
  outline: none;
}
#screen #menu .menu-window {
  width: 30.913349cqw;
  display: flex;
  flex-direction: column;
  gap: 0.468384cqw;
}
#screen #menu {
  align-items: flex-start;
  padding-top: 1.873536cqw;
}
#screen .settings-window {
  width: 42.154567cqw;
}
.settings-content {
  display: contents;
}
.settings-content > #fullscreen {
  align-self: center;
  min-width: 10.30445cqw;
}
#screen .detail-window {
  width: 52.459016cqw;
}
#screen .history-window {
  width: 64.637002cqw;
}
#screen #menu .menu-window h2 {
  margin-bottom: 1.405152cqw;
}
#screen #menu .menu-window button {
  flex-shrink: 0;
  width: 100%;
}
#screen #menu #resume {
  margin-top: 0.936768cqw;
}
#screen #result {
  position: absolute;
  left: 31.264637%;
  top: 24%;
  width: 37.470726cqw;
  z-index: 4;
  text-align: center;
}
#screen #result p {
  margin: 0 0 1.873536cqw;
  line-height: 1.6;
}
#screen #result p:empty {
  display: none;
}
#screen #result button {
  display: block;
  width: 26.229508cqw;
  margin: 0.702576cqw auto 0;
}
#screen :is(.window, .lobby-create) :is(.check-row, .setting-row) {
  padding: 0.936768cqw 0;
  border: 0;
}
#screen :is(.window, .lobby-create) input[type="checkbox"] {
  appearance: none;
  flex: 0 0 1.873536cqw;
  width: 1.873536cqw;
  height: 1.873536cqw;
  padding: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: url("./dialog72/check-off.png") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
#screen :is(.window, .lobby-create) input[type="checkbox"]:checked {
  background-image: url("./dialog72/check-on.png");
}
#screen :is(.window, .lobby-create) input[type="checkbox"]:hover {
  background-image: url("./dialog72/check-hover.png");
}
#screen :is(.window, .lobby-create) input[type="checkbox"]:checked:hover {
  background-image: url("./dialog72/check-on-hover.png");
}
#screen .window select {
  background: #080b2055;
  color: #dedc61;
  border: 1px solid #30377b;
  padding: 0.468384cqw;
  font: inherit;
}
#screen .window select option {
  background: #0b1027;
  color: #dedc61;
}
#screen :is(.window, .lobby-create) .menu-actions {
  border: 0;
  margin: 1.405152cqw 0 0;
  padding: 0;
}
#screen #history-lines,
#screen.native-console .game-info-content {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0.468384cqw;
  color: #bfc4df;
}
#screen #game-info nav {
  border-color: #252e5d;
}
#screen.native-console .info-row {
  padding: 0.468384cqw 0;
  border-color: #252e5d;
}
#screen .help-window dl {
  gap: 0.936768cqw;
}
#screen #help-panel .window {
  font-size: 1.405152cqw;
}
#screen .help-window dt {
  color: #dedc61;
}
#screen .help-window dd {
  color: #bfc4df;
  line-height: 1.45;
}
#screen #unit-detail-text {
  line-height: 1.55;
}
