.tactics-feature {
  --feature-gold: #ffcf85;
  --feature-paper: #fff1d5;
  --feature-pixel: "Pixelify Sans", monospace;
  width: min(900px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 16px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 2px solid #6daba7;
  border-top: 4px solid #f1c28a;
  background: #111f30;
  color: var(--feature-paper);
  box-shadow: 0 7px #080d18, 0 22px 80px #060913a8;
}
.tactics-feature[open] { animation: tactics-feature-in .3s cubic-bezier(.2,.75,.2,1) both; }
.tactics-feature::backdrop { background: #080c19dc; animation: tactics-feature-veil .22s ease-out both; }
@keyframes tactics-feature-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes tactics-feature-veil { from { opacity: 0; } }
body:has(.tactics-feature[open]) { overflow: hidden; }

.tactics-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "label art" "copy art";
}
.tactics-feature-header {
  grid-area: label;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 0;
  color: #b4e6db;
  font: 700 .76rem/1 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: .2em;
}
.tactics-feature-header button {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #9ab9b8;
  color: var(--feature-paper);
  background: #142537ed;
  font: 500 1.55rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.tactics-feature-header button:hover { background: #2f4956; }
.tactics-feature-copy { grid-area: copy; padding: 13px 28px 24px; }
.tactics-feature-copy h2 {
  margin: 0;
  color: var(--feature-paper);
  font: 700 clamp(2.25rem, 4vw, 3.25rem)/.94 var(--feature-pixel);
  letter-spacing: -.055em;
  text-shadow: 3px 4px #6b4148;
}
.tactics-feature-name { margin: .65rem 0 .35rem; color: var(--feature-gold); font: 700 1.55rem/1 var(--feature-pixel); }
.tactics-feature-description, .tactics-feature-help p { margin: .45rem 0; color: #d9e0e2; font-size: .94rem; line-height: 1.42; }
.tactics-feature-copy h2 span { display: block; }
.tactics-feature-rating { margin: .65rem 0 .35rem; font-size: .86rem; }
.tactics-feature-rating > span { color: var(--feature-gold); }
.tactics-feature-rating small { margin-left: .35rem; color: #ffcf85; font-size: .73rem; }
.tactics-feature-copy blockquote { margin: 0 0 .8rem; padding-left: .55rem; border-left: 2px solid #6daba7; color: #d4e0e8; font-size: .8rem; }
.tactics-feature-play {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: .55rem .8rem;
  border: 2px solid #d2fff0;
  background: #9eeacc;
  box-shadow: inset 0 -4px #57a69d, 3px 4px #091524;
  color: #142735;
  font: 700 clamp(1.07rem, 2vw, 1.35rem)/1 var(--feature-pixel);
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .1s;
}
.tactics-feature-play:hover { background: #c4ffe5; }
.tactics-feature-play:active { transform: translate(3px, 4px); box-shadow: inset 0 -1px #57a69d; }
.tactics-feature :focus-visible { outline: 2px solid #ffdf9d; outline-offset: 2px; }
.tactics-feature-help summary {
  display: list-item;
  min-height: 44px;
  padding-block: 12px;
  cursor: pointer;
  font-size: .85rem;
  color: #d3e2ec;
}
.tactics-feature-art {
  grid-area: art;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  min-width: 0;
  background: linear-gradient(#10293844, #11243a18 35%, #111c31b0),
    url('/labs/brawl-tactics/menu-overlook.webp') 66% center / cover;
  border-inline-start: 1px solid #557582;
}
.tactics-feature-art canvas { display: block; width: 100%; image-rendering: pixelated; }
.tactics-feature-wave {
  position: absolute;
  right: 10px;
  bottom: 11px;
  padding: 5px 7px;
  color: var(--feature-gold);
  border: 1px solid #ae8172;
  background: #1a2439;
  font: 700 .85rem/1 ui-monospace, monospace;
  letter-spacing: .09em;
}
.tactics-feature-dev {
  position: fixed; z-index: 4; bottom: 8px; right: 8px; max-width: calc(100% - 16px);
  padding: .45rem .6rem; border: 1px solid #476273; background: #182431; color: #e7f4ee;
  font: .78rem/1.35 system-ui, sans-serif;
}
.tactics-feature-dev summary { cursor: pointer; }
.tactics-feature-dev div { display: grid; gap: 6px; margin-top: 8px; }
.tactics-feature-dev button { cursor: pointer; }
.tactics-feature-dev pre { max-width: min(72vw, 480px); max-height: 45vh; overflow: auto; white-space: pre-wrap; }

.tactics-feature[data-layout="mobile"] { max-width: 410px; }
.tactics-feature[data-layout="mobile"] .tactics-feature-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "label" "art" "copy";
}
.tactics-feature[data-layout="mobile"] .tactics-feature-header { min-height: 58px; padding: 0 16px; }
.tactics-feature[data-layout="mobile"] .tactics-feature-art { height: 180px; border: 0; }
.tactics-feature[data-layout="mobile"] canvas { width: min(100%, 270px); justify-self: center; }
.tactics-feature[data-layout="mobile"] .tactics-feature-copy { padding: 14px 16px 8px; }
.tactics-feature[data-layout="mobile"] h2 { font-size: 2.9rem; }
.tactics-feature[data-layout="mobile"] h2 br { display: none; }
@media (max-width: 640px) {
  .tactics-feature { width: calc(100% - 24px); }
  .tactics-feature .tactics-feature-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "label" "art" "copy";
  }
  .tactics-feature .tactics-feature-header { min-height: 58px; padding: 0 16px; }
  .tactics-feature .tactics-feature-art { height: clamp(135px, 24dvh, 190px); border: 0; }
  .tactics-feature canvas { position: absolute; width: auto; height: 100%; max-width: 100%; justify-self: center; }
  .tactics-feature .tactics-feature-copy { padding: 14px 16px 8px; }
  .tactics-feature h2 { font-size: clamp(2.48rem, 10vw, 3.2rem); }
  .tactics-feature h2 br { display: none; }
  .tactics-feature-copy h2 span { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .tactics-feature[open], .tactics-feature::backdrop { animation: none; }
  .tactics-feature-play { transition: none; }
}
