.campaign-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  min-width: 0;
  margin: 0 auto .85rem;
  max-width: 79rem;
  color: var(--game-ink, #f0f5ff);
}
.campaign-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .48rem; }
.campaign-open { color: #382407; background: #ffdf9a; border-color: #e9bd63; }
.campaign-rank::before { content: '✦'; margin-right: .38em; color: var(--game-accent, #ffd37a); }
.campaign-label { display: grid; gap: .18rem; padding-left: .65rem; border-left: .22rem solid #eaa735; }
.campaign-label strong { font-size: .94rem; color: var(--game-ink, #f0f5ff); }
.campaign-label span { font-size: .82rem; color: var(--game-muted, #c4d3ea); }
body[data-campaign-stage] [data-campaign-practice] { display: none !important; }
.game-screen .campaign-controls { width: min(100%, 79rem); }
.campaign-dialog { width: min(calc(100vw - 1.3rem), 35rem); }
.campaign-intro { color: var(--game-muted, #c5d4eb); line-height: 1.6; }
.campaign-summary { color: var(--game-accent, #ffde9b); font-weight: 740; }
.campaign-meter { display: block; width: 100%; height: .65rem; margin: .5rem 0 .85rem; accent-color: #e0a038; }
.campaign-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.campaign-chapter { color: var(--game-accent, #ffde9b); padding: .55rem .18rem .1rem; font-weight: 780; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-controls { color: #293959; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-label strong { color: #223454; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-label span { color: #4d5f7d; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-rank::before { color: #9e6200; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-intro,
.game-leaderboard .campaign-intro { color: #465574; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-summary,
.game-leaderboard .campaign-summary { color: #503314; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-chapter { color: #433316; }
.campaign-stage {
  text-align: left;
  display: grid;
  align-items: center;
  grid-template-columns: auto 1fr auto;
  gap: .6rem;
  width: 100%;
  min-height: 3.45rem;
  border: 1px solid #d5dcea;
  border-radius: .8rem;
  color: #283756;
  background: #f5f7fc;
  padding: .6rem .7rem;
  font: inherit;
  cursor: pointer;
  transition: transform var(--xh-dur-instant, 110ms) var(--xh-ease-press, ease), border-color var(--xh-dur-fast, 180ms) var(--xh-ease-spring, ease), background-color var(--xh-dur-fast, 180ms) var(--xh-ease-spring, ease);
}
.campaign-stage:not(:disabled):active { transform: scale(.986); }
@media (hover: hover) {
  .campaign-stage:not(:disabled):hover { transform: translateY(-1px); border-color: #9bb3df; }
}
.campaign-stage small { display: block; margin-top: .15rem; color: #4f5e7b; font-size: .78rem; }
.campaign-stage .campaign-stage-reward { color: #86501b; font-weight: 760; }
.campaign-node { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #e6ebf6; font-weight: 780; }
.campaign-stage-stamp { font-size: .77rem; font-weight: 720; }
.campaign-stage[data-state="next"] { background: #fff5dc; border-color: #e7b858; }
.campaign-map[open] .campaign-stage[data-state="next"] .campaign-node { animation: unlock-glow .65s ease-out both; }
.campaign-stage[data-state="passed"] { background: #eff8ed; border-color: #b5d5ae; }
.campaign-stage[data-state="passed"] .campaign-node { background: #d2edc7; }
.campaign-stage[data-state="passed"] .campaign-stage-stamp { color: #86530b; letter-spacing: .08em; }
.campaign-stage:disabled { cursor: default; background: #eff2f7; color: #586780; }
.campaign-stage:focus-visible { outline: 2px solid #1746a6; outline-offset: 3px; }
.campaign-reveal {
  text-align: center;
  padding: 1.3rem .8rem 1.15rem;
  border-radius: 1rem;
  color: #fff3cf;
  background: radial-gradient(ellipse at 50% 0%, #37567d, transparent 72%), #172844;
  overflow: hidden;
}
.campaign-emblem {
  display: grid; place-items: center; margin: 0 auto .55rem;
  width: 3.1rem; height: 3.1rem; border-radius: 1rem; rotate: -7deg;
  color: #321c05; background: #ffdd8c; border: 2px solid #fff0c1;
  box-shadow: 0 0 1.75rem #e8b65e80; font-size: 1.45rem; font-weight: 810;
}
.campaign-stars { color: #ffda71; letter-spacing: .18em; margin: .2rem 0; font-size: 1.35rem; }
.campaign-reveal strong { font-size: clamp(1.3rem, 6vw, 1.85rem); }
.campaign-reveal p { margin: .42rem auto 0; font-size: .92rem; color: #ebeffb; }
.campaign-result[open][data-passed="true"] .campaign-emblem { animation: campaign-emblem .62s cubic-bezier(.15,.7,.2,1) both; }
@keyframes campaign-emblem { from { opacity: .25; transform: scale(.65) rotate(13deg); } 70% { transform: scale(1.14); } }
@keyframes unlock-glow { from { box-shadow: 0 0 0 .38rem #f6bb52a1; } to { box-shadow: 0 0 .7rem #f6bb521a; } }
.campaign-prize { min-height: 1.4rem; color: var(--game-accent, #ffe0a0); font-weight: 725; }
:is(.match-page, .mines-page, .claw-page, .party-page, .games-hall-page) .campaign-prize { color: #784a10; }
.campaign-rank-scroll { overflow-x: auto; border-radius: .65rem; border: 1px solid #dbe3ef; }
.campaign-rank-scroll table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
.campaign-rank-scroll :is(th, td) { padding: .58rem .48rem; border-bottom: 1px solid #e7edf6; }
.campaign-rank-scroll th { background: #edf3fc; color: #2e435f; white-space: nowrap; }
.campaign-rank-scroll td:nth-child(2) { overflow-wrap: anywhere; }
.game-checkout { width: min(calc(100vw - 1.3rem), 27rem); text-align: center; }
.game-checkout h2 { margin: .6rem 0 .5rem; }
.game-checkout .merge-dialog-actions { justify-content: center; }
@media (max-width: 520px) {
  .campaign-controls { margin-bottom: .66rem; }
  .campaign-actions .merge-button { min-height: 42px; }
  .campaign-stage { gap: .42rem; padding: .53rem .56rem; }
  .campaign-stage-stamp { font-size: .71rem; }
}
@media (prefers-reduced-motion: reduce) { :is(.campaign-emblem, .campaign-node, .klotski-chapter) { animation: none !important; } }
.game-reduced-motion :is(.campaign-emblem, .campaign-node, .klotski-chapter) { animation: none !important; }
