/* Shared native combat/workshop materials. Text, portraits, progress and actions
   stay live DOM; this layer has no baked screenshot or fixed-size screen. */
:root {
  --game-steel: #90a6b9;
  --game-ink: #091421;
  --game-cyan: #67dced;
  --game-gold: #ffcb58;
  --game-cut: polygon(
    12px 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0 calc(100% - 12px),
    0 12px
  );
}
.game-icon {
  width: 26px;
  height: 26px;
  display: block;
  flex: none;
  color: inherit;
}
body :is(dialog, #lobby) {
  color: #eef4fa;
  background: linear-gradient(140deg, #263a50, #0d1c2d 58%, #091522);
  border: 2px solid #8a9eaf;
  border-top-color: #b1cadb;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 4px #0a1625,
    inset 0 6px #c1d8e714,
    0 8px #050e17,
    0 24px 75px #000a;
  padding: clamp(18px, 3vw, 30px);
  scrollbar-color: #617f95 #102132;
}
body dialog::backdrop {
  background: #020911c9;
  backdrop-filter: blur(3px);
}
body :is(dialog, #lobby) :is(h2, h3) {
  color: #f1f6fa;
  letter-spacing: -0.5px;
}
body :is(dialog, #lobby) > h2 {
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid #4d687f;
}
body :is(dialog, #lobby) > h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1em;
  background: var(--game-gold);
  margin-right: 12px;
  vertical-align: -2px;
  box-shadow: 0 0 12px #ffca5840;
}
body :is(dialog, #lobby) button {
  min-height: 48px;
  border: 2px solid #7791a7;
  border-radius: 3px;
  background: linear-gradient(#324b62, #182c40 65%);
  color: #f5f8fb;
  box-shadow:
    inset 0 0 0 2px #102234,
    inset 0 4px #cee3f218,
    0 3px #060f1b;
  text-shadow: 0 2px 2px #0008;
  touch-action: manipulation;
}
body :is(dialog, #lobby) button.primary {
  background: linear-gradient(#ffe287, #ffc13f 52%, #e59a14);
  border-color: #ffe9a4;
  color: #241c0b;
  text-shadow: none;
  box-shadow:
    inset 0 0 0 2px #b87a14,
    inset 0 4px #fff5,
    0 4px #74480c;
}
body :is(dialog, #lobby) button:hover:not(:disabled) {
  border-color: #c3efff;
  filter: brightness(1.12);
}
body :is(dialog, #lobby) button:active:not(:disabled) {
  transform: translateY(2px);
  filter: brightness(0.95);
}
body :is(dialog, #lobby) button:focus-visible {
  outline: 3px solid var(--game-cyan);
  outline-offset: 3px;
}
body :is(dialog, #lobby) button:disabled {
  opacity: 0.48;
  filter: saturate(0.2);
  cursor: default;
}
body :is(dialog, #lobby) button[aria-pressed="true"] {
  border-color: var(--game-gold);
  box-shadow:
    inset 0 0 0 2px #a57622,
    0 0 12px #ffbf4220;
}
body :is(.screen, dialog) :is(input, select) {
  color: #eef6fc;
  background: #0b1c2d;
  border: 1px solid #6f8da6;
  min-height: 46px;
  border-radius: 3px;
  box-shadow: inset 0 3px 6px #0005;
}
body :is(.screen, dialog) :is(input, select):focus-visible {
  outline: 2px solid var(--game-cyan);
  outline-offset: 2px;
}
body :is(.screen, .utilities, #workshop-nav) button {
  touch-action: manipulation;
}
#mast {
  background: linear-gradient(#0b1827fa, #0b1827df 70%, transparent);
}
body:not(.playing) .utilities {
  padding: 5px 8px;
  background: #0a1928c9;
  border: 1px solid #556f84;
  border-radius: 3px;
}
body:not(.playing) #wallet {
  color: #ffd772;
  border-left: 1px solid #51697c;
  padding-left: 12px;
  font-weight: 850;
}
body:not(.playing) :is(.equipment-panel, .shop-detail, .deploy-card) {
  border-color: #7790a4;
  background: linear-gradient(145deg, #21364be8, #0a1a2af5);
}
body:not(.playing) #workshop-nav button {
  min-height: 58px;
}
body:not(.playing) :is(.shop-item, .dino-card):focus-visible {
  outline: 3px solid #85edff;
  outline-offset: -5px;
}
body #lobby {
  width: min(720px, calc(100% - 28px));
  max-height: calc(
    100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  z-index: 10;
}
#lobby #room-title {
  font-size: clamp(24px, 4vw, 34px);
}
#lobby #room-code {
  font-size: clamp(20px, 4vw, 32px);
  letter-spacing: 4px;
  padding: 12px 16px;
  margin: 0 0 18px;
  background: #081421;
  border: 1px solid #4d697f;
  color: #c9eeff;
}
#lobby #room-players {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}
#lobby .room-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid #4c6881;
  border-left: 4px solid #54c5e5;
  background: linear-gradient(100deg, #263d53a8, #102235);
  margin: 0;
}
#lobby .room-player[data-team="1"] {
  border-left-color: #ed9c68;
}
#lobby .room-player > img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border: 1px solid #647e94;
  background: #091c2a;
}
#lobby .room-player > div {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
#lobby .room-player strong {
  font-size: 17px;
}
#lobby .room-player small {
  font-size: 12px;
  color: #b4c9da;
  overflow-wrap: anywhere;
}
.room-ready {
  font-size: 12px;
  padding: 6px 9px;
  border: 1px solid #52697c;
  color: #b6cbdc;
  background: #142536;
  white-space: nowrap;
}
[data-ready="true"] > .room-ready {
  color: #b7f0dd;
  border-color: #5ca58a;
  background: #1c473b;
}
#lobby > .row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
#lobby > .row > button {
  width: 100%;
  font-size: 20px;
}
#team-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
#team-controls > button {
  flex: 1;
}
body #wave-upgrade-dialog {
  width: min(900px, calc(100% - 24px));
}
#wave-upgrade-cards > button {
  min-height: 220px;
  position: relative;
  padding: 20px 16px;
  border-color: #7c99b1;
}
#wave-upgrade-cards .game-icon {
  grid-column: 1/-1;
  width: 48px;
  height: 48px;
  padding: 8px;
  box-sizing: content-box;
  color: #fbd275;
  background: #0b1b2a;
  border: 1px solid #66839b;
}
#wave-upgrade-cards .upgrade-effect {
  font-size: 14px;
  line-height: 1.6;
}
#wave-upgrade-countdown {
  color: #d4e5f0;
}
body #quest-dialog {
  padding-top: 0;
}
#quest-dialog .quest-board-heading {
  background: #14263a;
  padding-top: 12px;
  border-bottom: 1px solid #5d788f;
}
#quest-dialog .field-quest {
  background: linear-gradient(145deg, #273e54, #122538);
  border-color: #617e96;
  border-radius: 3px;
}
#quest-dialog .field-quest[data-ready="true"] {
  border-color: #e5b455;
  background: linear-gradient(135deg, #3e3829, #262a29);
}
body #battle-menu {
  width: min(430px, calc(100% - 24px));
}
body #battle-menu > button {
  width: 100%;
  margin: 6px 0;
}
#battle-menu #leave-game {
  color: #ffcc9b;
  border-color: #a47554;
}
body :is(.trait-choice, .trait-option) {
  border-color: #617f98;
  background: #152a3e;
}
body .departure-dialog > p {
  color: #c4d6e6;
  line-height: 1.6;
}
body .departure-dialog form {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
body .departure-dialog form > button {
  flex: 1;
}
#result-stats .game-icon {
  color: #b6d9ec;
  width: 24px;
  height: 24px;
}
@media (max-width: 600px) {
  #lobby .room-player {
    gap: 8px;
    padding: 9px;
    flex-wrap: wrap;
  }
  #lobby .room-player > img {
    width: 48px;
    height: 48px;
  }
  #lobby .room-player strong {
    font-size: 15px;
  }
  #lobby .room-player > .room-ready {
    margin-left: auto;
  }
  #lobby #room-code {
    letter-spacing: 2px;
    font-size: 20px;
  }
  body #wave-upgrade-dialog {
    padding: 18px 14px;
  }
  #wave-upgrade-cards > button {
    min-height: 120px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 6px 10px;
  }
  #wave-upgrade-cards .game-icon {
    grid-column: 1;
    grid-row: 1/3;
    width: 34px;
    height: 34px;
    padding: 7px;
  }
  #wave-upgrade-cards strong {
    grid-column: 2;
    font-size: 18px;
  }
  #wave-upgrade-cards .upgrade-rank {
    grid-column: 3;
    grid-row: 1;
  }
  #wave-upgrade-cards .upgrade-effect {
    grid-column: 2/4;
    font-size: 13px;
  }
  body :is(dialog, #lobby) {
    padding: 18px 14px;
  }
  #lobby > .row > button {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body button {
    transition: none !important;
  }
}
