:root {
  color-scheme: light;
  --ink: #24253c;
  --muted: #595d67;
  --edge: #c9c7ba;
  --paper: #fbf9ef;
  --gold: #e0b65e;
  --dark: #232439;
  --aqua: #aad2c6;
  --green: #336053;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #eeede5;
  color: var(--ink);
  font:
    16px/1.5 'PingFang SC',
    'Microsoft YaHei',
    system-ui,
    sans-serif;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #b15e20;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 1.14rem;
}
h3 {
  font-size: 1rem;
}
.mast {
  background: var(--dark);
  color: #f6eed7;
  border-bottom: 3px solid var(--gold);
}
.mastInner,
main,
footer {
  max-width: 1040px;
  margin: auto;
  padding: 0 26px;
}
.mastInner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.wordmark small,
.kicker,
.mono {
  font:
    700 0.79rem/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.12em;
}
.wordmark small {
  color: #d5c8a6;
  border-left: 1px solid #757387;
  padding-left: 10px;
}
.stack {
  height: 21px;
  width: 16px;
  background: var(--gold);
  border: 2px solid #f7e3b1;
  border-radius: 3px;
  box-shadow: -3px 3px 0 #777285;
  transform: rotate(8deg);
}
.ghost,
.quiet {
  background: transparent;
  border: 1px solid #818092;
  border-radius: 7px;
  color: inherit;
  padding: 6px 13px;
  font-size: 0.9rem;
}
.pageHead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 30px 0 19px;
  gap: 12px;
}
.kicker {
  color: var(--green);
  margin-bottom: 4px;
}
.pageHead h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: 0.04em;
}
.pageHead > p {
  color: var(--muted);
  font-weight: 650;
  text-align: right;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start;
  gap: 18px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 3px 0 #24243b0e;
}
.sectionTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sectionTitle small,
.note,
small.sub {
  color: var(--muted);
  font-size: 0.86rem;
}
.primary,
.secondary {
  background: #253c39;
  color: white;
  border: 1px solid #21352e;
  border-radius: 8px;
  min-height: 42px;
  padding: 8px 16px;
  font-weight: 700;
}
.secondary {
  background: #ede9dc;
  color: var(--ink);
  border-color: #c9c4ae;
}
.block {
  width: 100%;
}
.gap {
  margin-top: 13px;
}
.line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.line input,
.invite {
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid #b9b9aa;
  border-radius: 7px;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
}
.line .secondary {
  flex-shrink: 0;
}
.poolGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.choice {
  border: 1px solid #c9c5b5;
  background: #f5f2e8;
  border-radius: 7px;
  padding: 8px 5px;
  font-weight: 620;
}
.choice[aria-pressed='true'],
.alt[aria-pressed='true'],
.weapon[aria-pressed='true'] {
  border-color: #345d51;
  background: #e0eee6;
  box-shadow: inset 0 0 0 1px #345d51;
}
.alts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.alt {
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #fffdf7;
  text-align: left;
  padding: 8px 10px;
}
.alt span,
.alt small {
  display: block;
}
.alt span {
  font-weight: 700;
}
.alt small {
  font-size: 0.82rem;
  color: var(--muted);
}
.portrait {
  position: relative;
  overflow: hidden;
  border: 2px solid #444058;
  border-radius: 11px;
  background: #32344e;
  color: white;
}
.portrait img {
  display: block;
  width: 100%;
  height: clamp(130px, 18vw, 204px);
  object-fit: cover;
  image-rendering: pixelated;
}
.caption {
  padding: 11px 14px;
  background: #303247;
  color: #f8f1dc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
}
.caption strong {
  overflow-wrap: anywhere;
  font-size: 1.12rem;
}
.caption small {
  color: #d2d1d6;
  white-space: nowrap;
}
.moveText {
  margin-top: 10px;
}
.moveText b,
.weaponText b {
  margin-right: 5px;
}
.moveText p,
.weaponText p {
  color: var(--muted);
  font-size: 0.93rem;
}
.weaponList {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.weapon {
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 7px 3px;
  background: #f5f2e8;
  font-size: 0.83rem;
  display: grid;
  justify-items: center;
  gap: 3px;
}
.weapon i {
  font-family: serif;
  font-weight: 800;
  font-size: 1.17rem;
  font-style: normal;
  width: 30px;
  line-height: 30px;
  color: #fff;
  background: var(--grade);
  border-radius: 6px;
}
.weaponText {
  margin-top: 12px;
}
.room {
  border-top: 4px solid #676080;
}
.roomcode {
  font:
    750 1.25rem/1.5 ui-monospace,
    monospace;
  letter-spacing: 0.08em;
}
.invite {
  font-size: 0.85rem;
  margin: 7px 0;
}
.battleHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.fighter {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
}
.fighter img {
  width: 100%;
  height: clamp(75px, 13vw, 134px);
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
}
.fighterBody {
  padding: 10px 13px;
}
.who {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 700;
}
.fighter h2 {
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.meter {
  height: 8px;
  background: #deddd2;
  border-radius: 5px;
  overflow: hidden;
  margin: 6px 0;
}
.meter i {
  display: block;
  height: 100%;
  background: #6a9d83;
}
.enemy .meter i {
  background: #ab6a61;
}
.stats,
.gear {
  font-size: 0.85rem;
  color: #4c5057;
}
.stats {
  font-weight: 700;
}
.gear {
  margin-top: 5px;
}
.buff {
  color: #644b77;
  font-weight: 600;
}
.moves {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 5px;
  background: #fffdf7;
  border: 1px solid #adaf9f;
  border-radius: 9px;
  padding: 11px;
}
.action:not(:disabled):hover,
.choice:not(:disabled):hover,
.alt:not(:disabled):hover {
  background: #eaf1e7;
}
.action small {
  color: var(--green);
  font-weight: 650;
}
.action b {
  font-size: 1.09rem;
}
.action span {
  color: var(--muted);
  font-size: 0.88rem;
}
.roundLog {
  border-top: 1px solid #d5d2c6;
  padding: 10px 0;
}
.roundLog summary {
  cursor: pointer;
  font-weight: 650;
}
.logPair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}
.logPair p {
  color: var(--muted);
  font-size: 0.86rem;
}
.result {
  background: #253c39;
  color: white;
}
.result .note {
  color: #d4e7d9;
}
.result .primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #252638;
}
.quiet {
  border-color: #bbb8a9;
}
.desc {
  color: var(--muted);
  margin: 5px 0 12px;
}
.tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#notice {
  border: 1px solid #baa472;
  background: #fff3d3;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.inlineInfo {
  color: #365c4f;
  font-size: 0.92rem;
  min-height: 1.5em;
  margin-top: 8px;
}
footer {
  display: flex;
  justify-content: space-between;
  margin: 28px auto 20px;
  font-size: 0.8rem;
  color: #646674;
}
footer a {
  color: inherit;
}
dialog {
  max-width: min(480px, 90vw);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 22px;
  color: var(--ink);
}
dialog::backdrop {
  background: #22243788;
}
dialog p {
  margin: 12px 0;
}
.spacer {
  margin-top: 18px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 680px) {
  .mastInner,
  main,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .mastInner {
    height: 49px;
  }
  .pageHead {
    margin: 18px 0 13px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .layout > div {
    display: contents;
  }
  .layout .panel {
    width: 100%;
  }
  .layout .room {
    order: -1;
  }
  .panel {
    padding: 14px;
  }
  .moves {
    gap: 5px;
  }
  .action {
    padding: 9px 6px;
  }
  .action b {
    font-size: 0.97rem;
  }
  .action span {
    font-size: 0.79rem;
  }
  .versus {
    gap: 6px;
  }
  .fighterBody {
    padding: 8px;
  }
  .fighter h2 {
    font-size: 0.91rem;
  }
  .wordmark small {
    font-size: 0.65rem;
  }
  .caption strong {
    font-size: 1rem;
  }
  .portrait img {
    height: 145px;
  }
  .sectionTitle {
    margin-bottom: 8px;
  }
  .poolGrid {
    gap: 4px;
  }
}
.gameNav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gameNav button {
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  background: transparent;
  color: #f8eedb;
  border: 1px solid #706e82;
  border-radius: 7px;
  padding: 6px 12px;
}
.gameNav button[aria-pressed='true'] {
  background: #f3d889;
  border-color: #f3d889;
  color: #27263b;
}
#packsPanel {
  height: calc(100dvh - 65px);
}
#packsPanel iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #171827;
}
.inviteBanner {
  text-align: center;
  color: #263b37;
  background: #eddeb7;
  padding: 5px 10px;
  font-size: 0.9rem;
}
.inviteBanner:not([hidden]) + #packsPanel {
  height: calc(100dvh - 100px);
}
.fighter canvas,
.portrait canvas {
  display: block;
  width: 100%;
  height: clamp(75px, 13vw, 134px);
  object-fit: cover;
  image-rendering: pixelated;
}
.portrait canvas {
  height: clamp(130px, 18vw, 204px);
}
.turnPage {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}
.weapon i {
  background: #496966;
}
.weaponList {
  grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
}
@media (max-width: 680px) {
  .gameNav {
    gap: 3px;
  }
  .gameNav button {
    padding: 5px 7px;
    font-size: 0.82rem;
  }
  .wordmark small {
    display: none;
  }
  #packsPanel {
    height: calc(100dvh - 52px);
  }
  .inviteBanner:not([hidden]) + #packsPanel {
    height: calc(100dvh - 90px);
  }
  .fighter canvas {
    height: 75px;
  }
}
