:root {
  color-scheme: dark;
  --ink: #17231f;
  --ink-soft: #2b3932;
  --paper: #eee4cc;
  --paper-deep: #d7c59c;
  --verm: #ad5146;
  --gold: #c49a53;
  --teal: #4d8580;
  --shadow: 0 20px 60px rgba(3, 9, 10, .32);
}

.status-line.status-line--payoff,
.status-line.status-line--promotion {
  color: #ffe7a6;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(244, 195, 109, .55);
  animation: zhao-payoff-beat 520ms ease-out both;
}

.status-line.status-line--promotion {
  color: #b9f6d0;
  text-shadow: 0 0 12px rgba(91, 220, 154, .55);
}

@keyframes zhao-payoff-beat {
  0% { opacity: .55; transform: translateY(2px); }
  45% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .status-line.status-line--payoff,
  .status-line.status-line--promotion {
    animation: none;
  }
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #18231f;
}

body[data-wp-game-id="zhao-yun-a-dou"] {
  color: var(--paper);
  font-family: Georgia, "Noto Serif TC", "Noto Serif SC", serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background:
    radial-gradient(circle at 80% 10%, rgba(191, 151, 75, .12), transparent 26rem),
    linear-gradient(135deg, #15211d 0%, #20332b 46%, #111a17 100%);
}

body[data-wp-game-id="zhao-yun-a-dou"] button,
body[data-wp-game-id="zhao-yun-a-dou"] select {
  font: inherit;
}

body[data-wp-game-id="zhao-yun-a-dou"] .screen {
  box-sizing: border-box;
}

.main-screen,
.stage-canvas,
.battle {
  width: min(100%, 920px);
  min-height: calc(100svh - 56px);
  margin: 0 auto;
}

body[data-wp-game-id="zhao-yun-a-dou"] > .game-page-info {
  box-sizing: border-box;
  width: min(100%, 920px);
  margin-inline: auto;
}

.main-screen {
  padding: 20px 16px 56px;
}

.main-header,
.scene-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  gap: 12px;
}

.battle .scene-header {
  grid-template-columns: 48px minmax(0, 1fr) auto 48px;
}

.main-header strong,
.scene-header h2 {
  min-width: 0;
  margin: 0;
  color: var(--paper);
  font-size: 20px;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.return,
.scene-header button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--paper);
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.battle-utility {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--paper);
  background: rgba(255, 255, 255, .08);
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.return img {
  display: none;
}

.return .wp-shell-return-arrow,
.scene-header button span {
  font-family: Arial, sans-serif;
  font-size: 26px;
}

.locale {
  display: grid;
  gap: 2px;
  justify-items: end;
  color: #d5cba9;
  font-size: 12px;
}

.locale select {
  max-width: 100px;
  border: 1px solid rgba(239, 228, 204, .28);
  border-radius: 8px;
  color: var(--paper);
  background: #26372e;
  padding: 5px 7px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(22px, 5vw, 56px);
  padding: 34px 0 24px;
}

.ink-poster {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(238, 228, 204, .28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 68% 32%, rgba(218, 188, 121, .54) 0 8%, transparent 9%),
    radial-gradient(ellipse at 36% 66%, rgba(22, 40, 34, .95) 0 18%, transparent 19%),
    linear-gradient(140deg, #d8c8a2 0%, #82958a 42%, #243e35 100%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.poster-art {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ink-poster::before,
.ink-poster::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
}

.ink-poster::before {
  opacity: .5;
  background: repeating-linear-gradient(113deg, transparent 0 22px, rgba(19, 34, 29, .12) 23px 25px, transparent 26px 46px);
  mix-blend-mode: multiply;
}

.ink-poster::after {
  background: linear-gradient(180deg, transparent 55%, rgba(7, 14, 12, .48));
}

.poster-moon {
  position: absolute;
  z-index: 2;
  top: 13%;
  right: 14%;
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(246, 231, 185, .76);
  box-shadow: 0 0 24px rgba(246, 231, 185, .24);
}

.poster-flag {
  position: absolute;
  z-index: 3;
  top: 37%;
  display: grid;
  place-items: center;
  width: 19%;
  aspect-ratio: 2 / 3;
  color: #f4e9c7;
  font-size: clamp(26px, 6vw, 62px);
  font-weight: 700;
  background: var(--verm);
  clip-path: polygon(0 0, 100% 8%, 84% 100%, 50% 85%, 13% 100%);
}

.poster-flag-left { left: 17%; transform: rotate(-6deg); }
.poster-flag-right { right: 19%; transform: rotate(7deg); background: #385f58; }

.poster-brush {
  position: absolute;
  z-index: 4;
  left: 20%;
  bottom: 19%;
  width: 62%;
  height: 8%;
  border-radius: 50%;
  background: rgba(24, 34, 30, .8);
  filter: blur(2px);
  transform: rotate(-12deg);
}

.poster-title {
  position: absolute;
  z-index: 5;
  right: 8%;
  bottom: 8%;
  color: #f4e9c7;
  font-size: clamp(24px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: .12em;
  writing-mode: vertical-rl;
  text-shadow: 0 4px 10px rgba(0, 0, 0, .36);
}

.hero-copy {
  max-width: 470px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #d3a85e;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.06;
}

.main-summary {
  max-width: 48ch;
  margin: 0 0 16px;
  color: #d5d9c9;
  font-size: 17px;
}

.prototype-pill {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 10px;
  border: 1px solid rgba(211, 168, 94, .45);
  border-radius: 999px;
  color: #e4c681;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

button {
  cursor: pointer;
}

button.primary,
.primary {
  min-height: 52px;
  border: 1px solid #d9ad59;
  border-radius: 14px;
  padding: 0 22px;
  color: #1c251e;
  background: linear-gradient(180deg, #e2bd70, #b8873e);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
  font-weight: 700;
}

button.primary:hover,
button.primary:focus-visible {
  filter: brightness(1.08);
}

.guide {
  box-sizing: border-box;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid rgba(238, 228, 204, .13);
  border-radius: 20px;
  color: #d5d9c9;
  background: rgba(11, 20, 16, .28);
}

.guide h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.guide p,
.guide ul {
  margin: 6px 0;
}

.guide ul {
  padding-left: 20px;
}

.canvas {
  padding: 12px 16px 0;
}

.stage-canvas,
.battle {
  position: relative;
}

body.wp-shell-battle-active #generalReserve {
  display: block;
  width: min(100%, 920px);
  height: 56px;
  min-height: 56px;
  margin: 0 auto;
  background: rgba(9, 20, 16, .9);
  pointer-events: none;
}

.stage-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 10px;
}

.stage-intro .eyebrow {
  margin: 0;
}

.stage-progress {
  margin: 0;
  color: #e0c784;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  padding: 10px 0 72px;
}

.stage-card {
  position: relative;
  min-height: 112px;
  border: 1px solid rgba(238, 228, 204, .24);
  border-radius: 16px;
  padding: 12px;
  color: var(--paper);
  text-align: left;
  background: rgba(44, 61, 51, .78);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.stage-card[disabled] {
  cursor: not-allowed;
  opacity: .5;
  filter: saturate(.4);
}

.stage-card.is-selected,
.stage-card:focus-visible {
  border-color: #e4bd6e;
  box-shadow: 0 0 0 3px rgba(228, 189, 110, .25), 0 10px 22px rgba(0, 0, 0, .18);
}

.stage-card strong,
.stage-card small,
.stage-card span {
  display: block;
}

.stage-card strong {
  font-size: 20px;
}

.stage-card small {
  margin-top: 4px;
  color: #d9c481;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.stage-card span {
  margin-top: 9px;
  color: #cbd3c3;
  font-size: 12px;
}

.stage-card .stage-stars {
  position: absolute;
  right: 10px;
  top: 12px;
  color: #e5bd69;
  letter-spacing: .06em;
}

.stage-tabs {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr minmax(140px, 264px) 1fr;
  align-items: center;
  min-height: 56px;
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--paper);
  background: rgba(16, 27, 22, .95);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, .2);
}

.stage-tab {
  min-height: 44px;
  border: 0;
  color: #f1d58d;
  background: transparent;
  font-weight: 700;
}

.battle-heading {
  min-width: 0;
  text-align: center;
}

.battle-heading small {
  color: #d7ad60;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.battle-heading h2 {
  margin-top: 1px;
}

.wave-readout {
  justify-self: end;
  color: #e0c784;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.battle-content {
  box-sizing: border-box;
  display: grid;
  gap: 4px;
  padding: 4px 0;
}

.battle-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hud-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 10px;
  color: #dce2d4;
  background: rgba(12, 22, 18, .54);
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.hud-card strong {
  color: #f3d38b;
  font-size: 15px;
}

.enemy-hud strong { color: #ec9a82; }
.ally-hud strong { color: #9ed2bd; }

.battle-field {
  position: relative;
  display: grid;
  grid-template-rows: 27px minmax(100px, 1fr) 6px minmax(100px, 1fr) 27px;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  overflow: hidden;
  border: 1px solid rgba(238, 228, 204, .22);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(127, 70, 60, .42), rgba(13, 26, 21, .4) 48%, rgba(42, 105, 94, .48)),
    url("../../assets/zhao-yun-a-dou-battle-background.png") center / cover,
    rgba(13, 26, 21, .72);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.2;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.camp-label {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  color: #d5d9c9;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.camp-label span:last-child {
  color: #f0ca79;
  font-size: 13px;
  font-weight: 700;
}

.enemy-lanes,
.player-lanes {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 10px;
}

.lane-row {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px dashed rgba(238, 228, 204, .16);
  border-radius: 10px;
  background: rgba(245, 234, 204, .035);
}

.lane-row::before {
  position: absolute;
  left: 8px;
  color: rgba(238, 228, 204, .43);
  content: attr(data-lane);
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.player-lanes .lane-row {
  justify-content: flex-end;
  border-color: rgba(105, 181, 165, .25);
}

.enemy-token {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 8px;
  color: #fff0d2;
  background-color: #8f493f;
  background-image: linear-gradient(180deg, rgba(18, 28, 27, .12), rgba(18, 28, 27, .72)), url("../../assets/zhao-yun-a-dou-enemies.png");
  background-repeat: no-repeat;
  background-size: auto, 300% 100%;
  background-position: 0 0, 0 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .22);
  font-size: 13px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: none;
  will-change: left;
}

.enemy-token.enemy-kind-0 { background-position: 0 0, 0 0; }
.enemy-token.enemy-kind-1 { background-position: 0 0, 50% 0; }
.enemy-token.enemy-kind-2 { background-position: 0 0, 100% 0; }

.enemy-token.boss {
  width: 42px;
  height: 32px;
  color: #fff6da;
  background-color: #c1883d;
  background-position: 0 0, 100% 0;
}

.battle-divider {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border-top: 1px solid rgba(231, 194, 110, .36);
  border-bottom: 1px solid rgba(231, 194, 110, .16);
  color: #e8c87e;
  background: rgba(225, 183, 93, .08);
  font-size: 12px;
}

.battle-divider span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(231, 194, 110, .5);
  border-radius: 50%;
  background: #2b3b31;
}

.formation-panel {
  padding: 10px;
  border: 1px solid rgba(238, 228, 204, .15);
  border-radius: 15px;
  background: rgba(10, 19, 16, .35);
}

.formation-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.formation-head strong {
  color: #ecd18e;
  font-size: 15px;
}

.formation-head span {
  color: #bfc9bc;
  font-family: Arial, sans-serif;
  font-size: 11px;
  text-align: right;
}

.formation-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
}

.unit-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 58px;
  border: 1px solid rgba(238, 228, 204, .2);
  border-radius: 11px;
  color: var(--paper);
  background: rgba(255, 255, 255, .055);
  font-size: 16px;
  line-height: 1;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.unit-slot.empty {
  color: rgba(238, 228, 204, .26);
  background: rgba(255, 255, 255, .02);
}

.unit-slot.selected {
  border-color: #f1c86f;
  box-shadow: 0 0 0 3px rgba(241, 200, 111, .25);
}

.unit-slot.general-unit {
  border-color: #d3a456;
  background: linear-gradient(145deg, rgba(211, 164, 86, .3), rgba(111, 75, 43, .35));
  background-image: linear-gradient(145deg, rgba(20, 27, 24, .52), rgba(111, 75, 43, .48)), url("../../assets/zhao-yun-a-dou-generals.png");
  background-repeat: no-repeat;
  background-size: auto, 200% 200%;
}

.unit-slot.general-unit.unit-type-blade { background-position: 0 0; }
.unit-slot.general-unit.unit-type-spear { background-position: 100% 0; }
.unit-slot.general-unit.unit-type-horse { background-position: 0 100%; }
.unit-slot.general-unit.unit-type-bow { background-position: 100% 100%; }

.unit-slot.general-unit .unit-glyph {
  color: #fff3d2 !important;
  text-shadow: 0 1px 2px #101b1b;
}

.unit-glyph {
  display: block;
  color: var(--unit-color, var(--paper));
  font-size: 24px;
  font-weight: 700;
}

.unit-level {
  position: absolute;
  right: 5px;
  bottom: 4px;
  color: #e6cc89;
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.unit-lane {
  position: absolute;
  top: 4px;
  left: 5px;
  color: #b5c4b6;
  font-family: Arial, sans-serif;
  font-size: 9px;
}

.battle-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.action-recruit {
  min-height: 46px !important;
  padding-inline: 18px !important;
}

.action-hint {
  overflow: hidden;
  color: #bdc9ba;
  font-family: Arial, sans-serif;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skills {
  display: flex;
  gap: 6px;
}

.skills.is-preview {
  display: block;
}

.battle-actions.has-skill-preview .skills {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.battle-actions.has-skill-preview {
  grid-template-rows: minmax(44px, auto) auto;
  align-items: start;
}

.battle-actions.has-skill-preview .action-recruit,
.battle-actions.has-skill-preview .action-hint,
.battle-actions.has-skill-preview .ghost-action {
  grid-row: 1;
}

.battle-actions.has-skill-preview .action-recruit {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.battle-actions.has-skill-preview .ghost-action {
  grid-column: 3;
  grid-row: 1;
}

.skill-preview {
  box-sizing: border-box;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(224, 185, 94, .24);
  border-radius: 10px;
  background: rgba(194, 146, 65, .08);
}

.skill-preview-title,
.skill-preview-body,
.skill-preview-item {
  display: block;
}

.skill-preview-title {
  color: #f3d08a;
  font-size: 11px;
}

.skill-preview-body {
  margin-top: 2px;
  color: #bdc9ba;
  font-family: Arial, sans-serif;
  font-size: 10px;
  line-height: 1.3;
}

.skill-preview-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.skill-preview-item {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(238, 228, 204, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
}

.skill-preview-item b,
.skill-preview-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-preview-item b {
  color: #eee4cc;
  font-size: 10px;
}

.skill-preview-item small {
  margin-top: 2px;
  color: #bdc9ba;
  font-family: Arial, sans-serif;
  font-size: 9px;
  line-height: 1.25;
}

.skill-button,
.ghost-action {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(238, 228, 204, .26);
  border-radius: 11px;
  color: var(--paper);
  background: rgba(255, 255, 255, .08);
}

.skill-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-image: linear-gradient(135deg, rgba(13, 25, 24, .88), rgba(13, 25, 24, .52)), url("../../assets/zhao-yun-a-dou-generals.png");
  background-repeat: no-repeat;
  background-size: auto, 200% 200%;
}

.skill-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 35%, rgba(9, 17, 18, .88));
}

.skill-blade { background-position: 0 0; }
.skill-spear { background-position: 100% 0; }
.skill-horse { background-position: 0 100%; }
.skill-bow { background-position: 100% 100%; }

.skill-button.ready {
  border-color: #e0b95e;
  color: #f3d08a;
  background: rgba(194, 146, 65, .18);
}

.skill-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.skill-glyph {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.skill-cooldown {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 9px;
}

.ghost-action {
  padding: 0 11px;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: #e5cb88;
  font-family: Arial, sans-serif;
  font-size: 12px;
  text-align: center;
}

.game-dialog {
  width: min(430px, calc(100vw - 32px));
  box-sizing: border-box;
  border: 1px solid rgba(238, 228, 204, .28);
  border-radius: 20px;
  padding: 24px;
  color: var(--paper);
  background: #20342a;
  box-shadow: var(--shadow);
}

.game-dialog::backdrop {
  background: rgba(2, 7, 5, .72);
  backdrop-filter: blur(4px);
}

.game-dialog h2 {
  margin: 0 0 10px;
  font-size: 27px;
}

.game-dialog p {
  color: #d5d9c9;
}

.game-dialog ol {
  margin: 12px 0 20px;
  padding-left: 22px;
  color: #d5d9c9;
}

.game-dialog li + li {
  margin-top: 8px;
}

.dialog-actions,
.result-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dialog-actions {
  grid-template-columns: 1fr 1fr;
}

.dialog-actions button,
.result-actions button {
  min-height: 46px;
  border: 1px solid rgba(238, 228, 204, .26);
  border-radius: 10px;
  color: var(--paper);
  background: rgba(255, 255, 255, .08);
}

.dialog-actions .primary,
.result-actions .primary {
  color: #1c251e;
  background: linear-gradient(180deg, #e2bd70, #b8873e);
}

.result-dialog {
  text-align: center;
}

.result-replay-goal {
  margin: 10px auto 0;
  max-width: 360px;
  color: #f1d18c !important;
  font-size: 13px;
  line-height: 1.45;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin: 18px auto 22px;
  max-width: 220px;
  color: #c5d0c1;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.result-stats strong {
  color: #f1d18c;
  font-size: 20px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .main-screen {
    padding-top: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 22px;
  }

  .hero-copy {
    max-width: none;
  }

  .hero h1 {
    font-size: 34px;
  }

  .main-summary {
    font-size: 16px;
  }

  .hero-copy .primary {
    width: 100%;
  }

  .guide {
    margin-bottom: 16px;
  }

  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .stage-card {
    min-height: 104px;
    padding: 10px;
  }

  .stage-card strong {
    font-size: 18px;
  }

  .battle {
    padding-inline: 10px;
  }

  .battle-hud {
    gap: 5px;
  }

  .hud-card {
    display: flex;
    height: 38px;
    min-height: 38px;
    justify-content: space-between;
    gap: 3px;
    padding: 4px;
    text-align: center;
    font-size: 10px;
  }

  .hud-card strong {
    font-size: 13px;
  }

  .battle-field {
    min-height: 250px;
  }

  .formation-grid {
    gap: 4px;
  }

  .unit-slot {
    min-height: 52px;
    border-radius: 8px;
  }

  .unit-glyph {
    font-size: 21px;
  }

  .unit-level {
    right: 3px;
    bottom: 3px;
    max-width: calc(100% - 6px);
    overflow: hidden;
    font-size: 8px;
    letter-spacing: -.02em;
    white-space: nowrap;
  }

  .unit-lane {
    top: 3px;
    left: 3px;
    font-size: 8px;
  }

  .formation-head {
    display: block;
  }

  .formation-head span {
    display: block;
    margin-top: 3px;
    text-align: left;
  }

  .battle-actions {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .skills {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .battle-actions.has-skill-preview .skills {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }

  .battle-actions.has-skill-preview .ghost-action {
    grid-column: 2;
    grid-row: 1;
  }

  .skill-preview-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ghost-action {
    justify-self: end;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .main-header,
  .scene-header {
    gap: 6px;
  }

  .main-header strong,
  .scene-header h2 {
    font-size: 17px;
  }

  .locale select {
    max-width: 82px;
  }

  .stage-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stage-card span {
    font-size: 11px;
  }

  .action-hint {
    font-size: 10px;
  }
}

/* Player-facing review repairs: keep the generated shell poster inside its
   pane, make the selected mission unmistakable, and give combat events a
   readable visual vocabulary. */
body[data-wp-game-id="zhao-yun-a-dou"] .wp-standard-main-poster {
  position: relative !important;
}

body[data-wp-game-id="zhao-yun-a-dou"] .wp-standard-main-poster .poster-art {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover !important;
}

body[data-wp-game-id="zhao-yun-a-dou"] .stage-card.is-selected,
body[data-wp-game-id="zhao-yun-a-dou"] .stage-card[data-wp-stage-selected="true"] {
  z-index: 2;
  border: 2px solid #ffe39a !important;
  outline: 2px solid rgba(228, 189, 110, .78);
  outline-offset: 3px;
  background: rgba(65, 87, 69, .96) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22) !important;
  transform: none;
}

.battle-guide {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 42px;
  overflow: hidden;
  padding: 8px 12px;
  border: 1px solid rgba(231, 194, 110, .34);
  border-radius: 12px;
  color: #e8eadc;
  background: rgba(22, 42, 35, .78);
  font-size: 12px;
  line-height: 1.35;
}

.battle-guide strong {
  color: #f5d37f;
  white-space: nowrap;
}

.pressure-cue {
  display: flex;
  align-items: center;
  min-height: 28px;
  box-sizing: border-box;
  margin: 0;
  padding: 5px 10px;
  border-left: 3px solid #d3a85e;
  border-radius: 8px;
  color: #f5d37f;
  background: rgba(22, 42, 35, .62);
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.25;
}

.enemy-token {
  grid-template-rows: 16px 10px 4px;
  gap: 1px;
  width: 58px;
  min-height: 38px;
  height: auto;
  padding: 3px 4px;
  overflow: visible;
}

.enemy-token.boss {
  width: 64px;
  min-height: 42px;
  height: auto;
}

.enemy-glyph {
  font-size: 15px;
  line-height: 1;
}

.enemy-name {
  max-width: 100%;
  overflow: hidden;
  color: #fff0d2;
  font: 700 8px/1 Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enemy-health {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(16, 27, 24, .72);
}

.enemy-health span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffcf75;
  transition: width .15s ease;
}

.enemy-token.is-hit {
  animation: zhao-enemy-hit .24s ease;
}

.enemy-token.is-defeated {
  filter: grayscale(.9);
  opacity: .56;
}

.lane-unit {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  min-width: 42px;
  min-height: 30px;
  margin-left: 4px;
  padding: 2px 4px;
  border: 1px solid rgba(105, 181, 165, .38);
  border-radius: 8px;
  background: rgba(17, 46, 42, .84);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
  font-family: Arial, sans-serif;
  font-size: 10px;
  line-height: 1;
}

.lane-unit-glyph {
  font-family: Georgia, "Noto Serif TC", "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
}

.lane-unit-name {
  max-width: 42px;
  overflow: hidden;
  color: #e5ecdc;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-unit-arrow {
  position: absolute;
  right: -13px;
  color: #ffe19a;
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
}

.lane-unit.is-attacking {
  border-color: #ffe19a;
  background: rgba(107, 81, 39, .92);
  box-shadow: 0 0 0 2px rgba(255, 227, 154, .55), 0 0 16px rgba(255, 206, 107, .55);
  animation: zhao-unit-attack .3s ease both;
}

.lane-unit.is-attacking .lane-unit-arrow {
  opacity: 1;
  animation: zhao-attack-arrow .3s ease both;
}

.combat-effect {
  position: absolute;
  top: 12%;
  z-index: 4;
  pointer-events: none;
  color: #ffe7a2;
  font: 800 12px/1 Arial, sans-serif;
  text-shadow: 0 1px 2px #16221d;
  transform: translate(-50%, -50%);
  animation: zhao-combat-pop .55s ease-out both;
}

.combat-effect.defeat {
  top: 70%;
  color: #fff2c8;
  font-size: 10px;
}

.combat-effect.attack {
  top: 42%;
  max-width: 128px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 227, 154, .5);
  border-radius: 999px;
  color: #fff0bd;
  background: rgba(45, 35, 22, .82);
  font-size: 9px;
  white-space: nowrap;
}

.unit-slot {
  min-height: 64px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.unit-slot.selected {
  z-index: 2;
  border: 3px solid #ffe39a !important;
  outline: 3px solid rgba(255, 227, 154, .32);
  background: rgba(93, 115, 78, .8) !important;
  box-shadow: 0 0 0 4px rgba(17, 34, 28, .92), 0 0 0 7px rgba(241, 200, 111, .9), 0 8px 18px rgba(0, 0, 0, .24) !important;
  transform: translateY(-2px);
}

.unit-slot:active {
  transform: scale(.97);
}

.status-line {
  display: flex;
  align-items: center;
  height: 22px;
  min-height: 22px;
  overflow: hidden;
}

@keyframes zhao-enemy-hit {
  0%, 100% { transform: translate(-50%, -50%); }
  45% { background-color: #f4c36d; transform: translate(calc(-50% + 4px), -50%); }
}

@keyframes zhao-combat-pop {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.82); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(1.08); }
}

@keyframes zhao-unit-attack {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-4px); }
}

@keyframes zhao-attack-arrow {
  0% { transform: translateX(-4px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@media (max-width: 680px) {
  .battle-guide {
    grid-template-columns: 1fr;
    gap: 3px;
    height: 54px;
    padding: 5px 9px;
    font-size: 10px;
    line-height: 1.25;
  }

  .battle-field {
    grid-template-rows: 24px minmax(0, 1fr) 6px minmax(0, 1fr) 24px;
    height: 250px;
    min-height: 250px;
    max-height: 250px;
    align-self: start;
  }

  .enemy-lanes,
  .player-lanes {
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 3px;
    min-height: 0;
    padding: 3px 8px;
  }

  .lane-row {
    min-height: 0;
  }

  .formation-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .unit-slot {
    min-height: 44px;
    max-height: 44px;
  }

  .formation-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
  }

  .formation-head span {
    display: block;
    margin-top: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .formation-panel {
    padding: 8px;
  }

  .enemy-token {
    width: 48px;
    min-height: 32px;
    padding: 2px 3px;
  }

  .enemy-token.boss {
    width: 54px;
    min-height: 34px;
  }

  .enemy-glyph {
    font-size: 13px;
  }

  .enemy-name {
    font-size: 7px;
  }

  .lane-unit {
    min-width: 38px;
    min-height: 28px;
    margin-left: 3px;
    padding-inline: 3px;
  }

  .lane-unit-name {
    max-width: 36px;
    font-size: 7px;
  }

  .lane-unit-glyph {
    font-size: 16px;
  }

  .battle-actions {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 44px 44px;
    gap: 6px;
  }

  .pressure-cue {
    height: 24px;
    min-height: 24px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .battle-actions.has-skill-preview .skill-preview {
    padding: 4px 6px;
  }

  .battle-actions.has-skill-preview .skill-preview-title {
    font-size: 10px;
    line-height: 12px;
  }

  .battle-actions.has-skill-preview .skill-preview-body {
    margin-top: 1px;
    font-size: 9px;
    line-height: 11px;
  }

  .battle-actions.has-skill-preview .skill-preview-list {
    gap: 4px;
    margin-top: 3px;
  }

  .battle-actions.has-skill-preview .skill-preview-item {
    padding: 3px 4px;
  }

  .battle-actions.has-skill-preview .skill-preview-item b {
    font-size: 9px;
    line-height: 11px;
  }

  .battle-actions.has-skill-preview .skill-preview-item small {
    margin-top: 1px;
    font-size: 8px;
    line-height: 10px;
  }

  .battle-actions .action-recruit {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px !important;
    padding-inline: 12px !important;
  }

  .battle-actions .action-hint {
    grid-column: 2;
    grid-row: 1;
  }

  .battle-actions .ghost-action {
    grid-column: 3;
    grid-row: 1;
  }

  .battle-actions .skills {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .battle-actions.has-skill-preview .ghost-action {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (min-width: 681px) and (max-height: 500px) {
  .battle-guide {
    height: 38px;
    padding: 6px 10px;
  }

  .pressure-cue {
    height: 24px;
    min-height: 24px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .battle-field {
    height: 280px;
    min-height: 280px;
    max-height: 280px;
  }
}
