/* Edition-wide skin. Card rules and the field-card background stay independent. */
.royal-menu-icon, .home-deck-leader, .battle-leader-art, .battle-leader-name { display: none; }
.home-leader[hidden] { display: none; }
.theme-feijin {
  --bg: #0b1712; --panel: #10231b; --panel-2: #193429; --line: #b49a6147;
  --text: #f4ead4; --muted: #b9c3b4; --gold: #ddc38b; --blue: #99c6c0;
  --red: #de8992; --green: #aad4ac;
}
.theme-feijin :is(button, input, select, summary) { letter-spacing: 0; }
.theme-feijin :is(button, input, select, summary):focus-visible { outline: 2px solid #ead4a2; outline-offset: 3px; }
.theme-feijin :is(.ghost-button, .primary-button, .theme-button, .library-tab, .difficulty-button) {
  border: 1px solid #ae905876; border-radius: 3px; background: #14291fe8;
  color: #f2e5c7; box-shadow: none; font-weight: 600; letter-spacing: 0;
  transition: background 140ms, border-color 140ms;
}
.theme-feijin :is(.ghost-button, .theme-button, .library-tab, .difficulty-button):not(:disabled):hover { background: #244132; border-color: #dbc48c; }
.theme-feijin :is(.primary-button, .theme-button.active, .library-tab.active, .difficulty-button.active) { background: #692a38; border-color: #d0b271; color: #fff0d3; }
.theme-feijin .primary-button:not(:disabled):hover { background: #823746; border-color: #f0dcae; }
.theme-feijin button:disabled { cursor: not-allowed; }
.theme-feijin :is(input, select) { color: #f4ead4; background: #0d2018; border-color: #a4895666; accent-color: #cba565; }

.theme-feijin .intro-overlay {
  padding: 0; overflow: hidden; background: #102219 url('./assets/feijin/ui/home-salon.png') center / cover no-repeat;
}
.theme-feijin .home-leader {
  position: absolute; inset: 3% auto 1% 2%; margin: 0; width: 48%; z-index: 1;
  pointer-events: none;
}
.theme-feijin .home-leader > img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 14px 24px #0009); }
.theme-feijin .home-leader figcaption { position: absolute; left: 9%; bottom: 4%; display: grid; gap: 7px; padding: 12px 20px; border-left: 2px solid #ceac66; background: #0d1911c9; text-shadow: 0 2px 6px #000; }
.theme-feijin .home-leader small { color: #d1bc8c; font-size: 12px; }
.theme-feijin .home-leader strong { font: 500 25px/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif; color: #f6e7c5; }
.theme-feijin .intro-content {
  position: absolute; left: 51%; top: 50%; transform: translateY(-50%);
  width: min(560px, 43%); max-height: calc(100dvh - 64px); min-height: 0; overflow: auto;
  display: grid; justify-items: stretch; align-content: center; gap: 14px; padding: 12px 4px;
  border: 0; background: none; box-shadow: none; border-radius: 0; text-align: left;
  scrollbar-width: thin; scrollbar-color: #b2945d transparent;
}
.theme-feijin .intro-kicker { margin: 0; font-size: 14px; font-weight: 500; color: #d8bd82; letter-spacing: 0; }
.theme-feijin .intro-content .intro-title { margin: 0; font: 600 54px/1.2 "Songti SC", "Noto Serif CJK SC", Georgia, serif; color: #f8e6bb; letter-spacing: 0; text-shadow: 0 3px 14px #0009; animation: none; }
.theme-feijin .intro-subtitle { margin: 0 0 8px; padding: 0; font: 400 17px/1.5 "Songti SC", Georgia, serif; color: #d8ccb0; }
.theme-feijin .intro-cast { display: none; }
.theme-feijin .intro-actions { width: 100%; margin: 0; flex-wrap: nowrap; justify-content: stretch; }
.theme-feijin #startIntroButton {
  display: flex; gap: 14px; align-items: center; justify-content: center; flex: 1 1 auto;
  min-height: 64px; clip-path: none; padding: 12px 22px; border: 1px solid #ddbc7a;
  border-radius: 3px; background: #712e3b; color: #f9e9c4; font: 500 26px/1.3 "Songti SC", Georgia, serif;
  box-shadow: inset 0 0 0 4px #712e3b, inset 0 0 0 5px #c4a5665c, 0 6px 18px #0004; animation: none;
}
.theme-feijin #startIntroButton:hover { background: #893b48; }
.theme-feijin .royal-menu-icon { display: block; width: 21px; height: 21px; flex: 0 0 21px; color: #d3b477; }
.theme-feijin .home-deck-leader { display: block; margin: -3px 0 1px; font-size: 12px; color: #bfc7b7; }
.theme-feijin .difficulty-panel { width: 100%; padding: 10px 0 15px; border: 0; border-bottom: 1px solid #b2945d50; border-radius: 0; background: none; }
.theme-feijin .difficulty-copy strong { color: #c7ba9c; font-size: 13px; font-weight: 400; }
.theme-feijin .difficulty-copy small { display: none; }
.theme-feijin .difficulty-options { gap: 0; flex-wrap: nowrap; }
.theme-feijin .difficulty-button { min-height: 30px; border-radius: 0; padding: 0 14px; font-size: 12px; }
.theme-feijin .difficulty-button + .difficulty-button { border-left: 0; }
.theme-feijin .intro-content .cover-menu { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.theme-feijin .cover-menu .home-option { display: flex; align-items: center; justify-content: flex-start; min-height: 48px; padding: 10px 18px; gap: 13px; text-align: left; border-color: #9e84544d; background: #10251ac9; }
.theme-feijin .cover-menu .home-option span { font: 500 16px/1.3 "Songti SC", Georgia, serif; }
.theme-feijin .cover-menu .home-option small { display: none; }
.theme-feijin .cover-menu .home-option:disabled { opacity: .38; }
.theme-feijin .cover-menu .home-option:not(:disabled):hover { border-color: #d8ba7c; background: #213c2ddd; }
.theme-feijin .cover-menu .danger-button { color: #dbadad; }
.theme-feijin .home-notice { min-height: 20px; margin: 0; font-size: 12px; line-height: 1.6; font-weight: 400; color: #c3c9b9; }
.theme-feijin .intro-content .home-stats { display: flex; flex-wrap: wrap; width: 100%; margin: 0; gap: 16px; }
.theme-feijin .home-stats span { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: 11px; font-weight: 400; color: #aaae99; }
.theme-feijin .home-stats span:nth-child(2), .theme-feijin .home-stats span:nth-child(3) { display: none; }
.theme-feijin .intro-video, .theme-feijin .intro-canvas { z-index: 3; }
.theme-feijin .intro-overlay.playing .intro-content { z-index: 4; }

/* All home destinations share the same materials and controls. */
.theme-feijin :is(.guide-overlay, .library-overlay, .changelog-overlay, .settings-overlay, .deck-builder-overlay, .online-overlay) {
  background: #102219 url('./assets/feijin/ui/home-salon.png') center / cover no-repeat; padding: 32px 5%;
}
.theme-feijin :is(.guide-panel, .library-panel, .changelog-panel, .settings-panel, .deck-builder-panel, .online-panel) {
  width: min(1240px, 100%); max-height: calc(100dvh - 64px); border: 0; border-top: 1px solid #af945b88;
  border-bottom: 1px solid #af945b88; border-radius: 0; padding: 28px 32px;
  background: #0c1c15ed; box-shadow: none; scrollbar-width: thin; scrollbar-color: #9f8857 #10251b;
}
.theme-feijin :is(.settings-panel, .online-panel) { width: min(880px, 100%); }
.theme-feijin :is(.guide-panel, .changelog-panel) { width: min(1040px, 100%); }
.theme-feijin .library-header { padding-bottom: 18px; border-bottom: 1px solid #ab915b50; }
.theme-feijin .library-header .eyebrow { color: #a3936e; letter-spacing: 0; font-size: 11px; }
.theme-feijin .library-header h2 { margin: 4px 0 0; font: 500 28px/1.3 "Songti SC", Georgia, serif; color: #efd7a4; }
.theme-feijin :is(.settings-section, .library-series-intro, .version-card, .changelog-list article, .deck-builder-toolbar, .online-card, .room-share, .online-room-lobby) {
  border: 0; border-bottom: 1px solid #a88e5940; border-radius: 0; background: none; box-shadow: none;
}
.theme-feijin .settings-section { padding: 22px 0; }
.theme-feijin .settings-section strong { font: 500 16px/1.4 "Songti SC", Georgia, serif; }
.theme-feijin .theme-options { gap: 0; }
.theme-feijin .theme-button { border-radius: 0; }
.theme-feijin .theme-button + .theme-button { border-left: 0; }
.theme-feijin :is(.sound-preference, .salon-preferences) { padding: 14px 0; }
.theme-feijin .library-tabs { gap: 0; border-bottom: 1px solid #a88e5959; }
.theme-feijin .library-tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.theme-feijin .library-tab.active { background: #742d3a55; color: #efdcac; border-bottom-color: #d3b575; }
.theme-feijin :is(.skill-item, .guide-step, .flow-step) { background: #172f24; border-color: #a78d5759; border-radius: 3px; box-shadow: none; }
.theme-feijin :is(.deck-builder-card, .library-card) { background: #14291f; border-color: #9b895547; border-radius: 4px; }
.theme-feijin :is(.deck-builder-count, .deck-copy-count) { color: #f2d9a3; }
.theme-feijin .deck-builder-actions { flex-wrap: wrap; }
.theme-feijin .result-overlay { background: #06120fce; }
.theme-feijin .result-panel { border: 1px solid #bba06a; border-radius: 4px; background: #11291f; }
.theme-feijin :is(.card-inspector, .remaining-deck-dialog) { background: #0e2119; color: #f4e7cd; border-color: #bea16a; }
.theme-feijin #libraryOverlay.library-gallery-mode { background: #102219 url('./assets/feijin/ui/home-salon.png') center / cover no-repeat; }
.theme-feijin #libraryOverlay.library-gallery-mode .library-panel { background: #0c1c15ed; }
.theme-feijin #cardGallery { --gallery-gold: #d5b97e; --gallery-cyan: #bad0b8; --gallery-ink: #f1e7d2; }
.theme-feijin #cardGallery :is(.gallery-catalog-label select, .gallery-series-tabs button) { background: #11291e; color: #e7d3a4; border-color: #a68e5b70; }
.theme-feijin #cardGallery .gallery-series-tabs [aria-pressed="true"] { background: #642b38; border-color: #d0b075; }
@media (min-width: 851px) {
  .theme-feijin #libraryOverlay.library-gallery-mode { padding: 24px 4%; }
  .theme-feijin #libraryOverlay.library-gallery-mode .library-panel { max-height: calc(100dvh - 48px); padding: 24px; }
}
@media (min-width: 851px) and (max-height: 780px) {
  .theme-feijin #libraryOverlay.library-gallery-mode .library-panel { padding-block: 14px; }
}

/* Portraits occupy the existing hero hit targets, not the seven-card board. */
@media (min-width: 1000px) {
  .battle-layout .player-panel, .battle-salon .battle-layout .player-panel { grid-template-columns: minmax(0, 1fr) 170px; }
  .battle-layout .opponent-panel, .battle-salon .battle-layout .opponent-panel { grid-template-columns: minmax(0, 1fr) 170px; }
  .battle-layout .opponent-panel #enemyBoard { grid-area: 1 / 1; }
  .battle-layout .opponent-panel .hero { grid-area: 1 / 2; }
  .battle-layout .hero.has-deck-leader, .battle-salon .battle-layout .hero.has-deck-leader {
    position: relative; isolation: isolate; width: 100%; height: 100%; min-height: 132px; max-height: 310px;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; align-self: stretch;
  }
  .battle-layout .hero .battle-leader-art {
    display: block; position: absolute; inset: 0 0 24px; width: 100%; height: calc(100% - 24px);
    max-width: none; max-height: none; object-fit: cover; object-position: center 20%; border: 0; border-radius: 0;
    mask-image: linear-gradient(#000 65%, transparent); pointer-events: none; z-index: -1;
  }
  .battle-layout .hero.leader-cutout .battle-leader-art { object-fit: contain; object-position: center bottom; mask-image: none; filter: drop-shadow(0 6px 8px #0009); }
  .battle-layout .hero:not(.leader-cutout) .battle-leader-art { mask-image: radial-gradient(ellipse closest-side at 50% 43%, #000 64%, transparent 100%); }
  .battle-layout .hero.has-deck-leader > div {
    position: absolute; top: 8px; right: 0; min-width: 43px; padding: 5px 4px; border: 1px solid #c8af7688;
    border-radius: 3px 3px 12px 12px; background: #542532e8; text-shadow: 0 1px 3px #000;
  }
  .battle-layout .hero.has-deck-leader .health-line { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .battle-layout .hero.has-deck-leader strong { font-size: 27px; line-height: 1.1; color: #fff0cf; }
  .battle-layout .hero.has-deck-leader .role { font-size: 10px; color: #eee0c5; }
  .battle-layout .hero.has-deck-leader .ping-badge { font-size: 8px; min-height: 12px; padding: 1px 2px; opacity: .8; }
  .battle-layout .hero.has-deck-leader .mana, .battle-layout .hero.has-deck-leader .evo { position: absolute; left: 0; bottom: 52px; min-width: 44px; height: 21px; background: #0e281dec; border: 1px solid #b69b6077; font-size: 12px; }
  .battle-layout .hero.has-deck-leader .evo { bottom: 28px; }
  .battle-layout .hero .battle-leader-name { display: block; position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font: 500 13px/1.3 "Songti SC", Georgia, serif; color: #ebd4a2; text-shadow: 0 2px 4px #000; }
  .battle-layout .hero.has-deck-leader.attack-drop-ready { outline: 2px solid #d7c080; outline-offset: 1px; }
}
@media (min-width: 1000px) and (max-height: 760px) {
  .theme-feijin .intro-content { gap: 9px; max-height: calc(100dvh - 32px); }
  .theme-feijin .intro-content .intro-title { font-size: 44px; }
  .theme-feijin .intro-subtitle { margin-bottom: 0; }
  .theme-feijin #startIntroButton { min-height: 54px; }
  .theme-feijin .difficulty-panel { padding: 4px 0 10px; }
  .theme-feijin .cover-menu .home-option { min-height: 43px; }
}
@media (prefers-reduced-motion: reduce) { .theme-feijin :is(button, .intro-content) { transition: none; animation: none; } }
