/* Fantasy presentation on the original central battlefield and corner HUD. */
:root { --gold: #d9bd7e; --hand-card-width: clamp(120px,15vh,148px); }
body { height: 100dvh; min-height: 0; overflow: hidden; background-color: #08070d; color: #ece3d1; }
body:has(#tutorial-panel:not([hidden])) { min-height: 0; }
.battle-shell { position: relative; display: flex; width: 100%; height: 100%; min-height: 0; background: radial-gradient(ellipse at center,transparent 25%,#07050bb8 100%); }
.battle-header, .battle-footer { display: contents; }
.battle-toolbar { display: contents; }
.battle-brand { display: none; }
.side-menu-buttons { position: absolute; left: 16px; right: auto; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 12px; z-index: 105; }
.side-btn-float { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 2px solid #ad8c50; background: radial-gradient(circle at 35% 25%,#514333,#18121f 65%); color: #f0dca8; box-shadow: 0 3px 9px #000b,inset 0 0 0 3px #18111f,inset 0 0 0 4px #bd985740; font: 700 22px Cinzel,serif; }
.side-btn-float span { display: none; }
.floating-ui { position: absolute; padding: 20px; gap: 10px; z-index: 100; }
.floating-ui.left { width: 220px; }
.floating-ui.top { top: 0; }
.floating-ui.bottom { bottom: 0; }
.floating-ui.right { right: 0; align-items: stretch; width: 188px; }
.floating-ui.left { left: 0; }
.floating-ui.right .action-btn, .floating-ui.right .mana-slots { width: 100%; }
.player-stats-header { display: flex; align-items: center; gap: 12px; margin: 0; }
.deck-display { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; background: none; min-width: 44px; }
.deck-display img { width: 40px; height: 58px; object-fit: cover; border: 1px solid #b29257; border-radius: 4px; box-shadow: 3px 3px 0 #211b27,4px 4px 0 #7f6540,0 5px 12px #000b; }
.deck-display .deck-count { font: 800 18px 'Segoe UI',sans-serif; color: #f3ddb0; }
.pile-label { font-size: 11px; color: #b8a78d; }
.player-stats-header .deck-display:last-child:not(:has(img)) { display: none; }
.arena-slot { width: 56px; height: 78px; margin: 0; border: 1px solid #ab8d5659; border-radius: 8px; background: #12101c9e; box-shadow: inset 0 0 15px #0008; }
.arena-slot-text { color: #baac91; font: 11px Cinzel,serif; }
.arena-slot .card { width: 128px; height: 188px; transform: scale(.43); }
.arena-slot .card:hover { transform: scale(.85); }
.hero-stats-container { position: relative; order: initial; min-width: 0; width: 100%; box-sizing: border-box; padding: 10px 12px; background: linear-gradient(135deg,#28202ae8,#110e19e8); border: 1px solid #aa8a526f; border-radius: 12px 4px 12px 4px; box-shadow: 0 8px 20px #0008,inset 0 0 0 3px #100d18,inset 0 0 0 4px #a58c4f26; }
.hero-stats-container::before { content: ''; position: absolute; width: 7px; height: 7px; top: -4px; left: 50%; transform: rotate(45deg); background: #caa564; box-shadow: 0 0 9px #d7ab6266; }
.hero-name { font: 700 16px Cinzel,Georgia,serif; letter-spacing: .6px; margin: 0 0 5px; color: #e9cfa0; }
.stat-row { position: static; display: flex; align-items: center; gap: 7px; margin: 0; }
.hero-target-row { min-height: 44px; border-radius: 8px; }
.bar-wrapper { width: 116px; height: 14px; border: 1px solid #856742; border-radius: 3px 9px 3px 9px; background: #120b11; }
.hp-fill { background: linear-gradient(#ef655d,#921924 60%,#480e18); animation: none; box-shadow: inset 0 2px 3px #ffba8a50; }
.stat-val-out { width: 34px; height: 34px; display: flex; justify-content: center; align-items: center; font: 800 21px 'Segoe UI',sans-serif; background: linear-gradient(145deg,#591923,#230b13); border: 1px solid #af5356; border-radius: 10px 3px 10px 3px; box-shadow: inset 0 0 0 2px #220d15; }
.stat-row:not(.hero-target-row) { min-height: 28px; }
.stat-row:not(.hero-target-row) .bar-wrapper { display: block; height: 7px; border-color: #506e8c; }
.stat-row:not(.hero-target-row) .stat-val-out { height: 24px; font-size: 15px; border-color: #456d93; background: #111a2c; box-shadow: inset 0 0 0 2px #0b111e; }
.armor-fill { background: linear-gradient(#87b0d5,#334c69); animation: none; }
.stat-icon { font-size: 16px; }
.mana-caption { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #b9aed0; }
.mana-caption strong { color: #b1d7ff; font: 700 17px 'Segoe UI',sans-serif; }
.mana-slots { display: flex; width: 100%; height: 24px; gap: 5px; padding: 0; margin: 0 0 8px; }
.mana-slot { border: 1px solid #374b69; background: #0b101c; border-radius: 3px; transform: skewX(-13deg); box-shadow: inset 0 0 5px #000; }
.mana-slot.filled { background: linear-gradient(140deg,#d1edff,#5da5ef 40%,#253e98 90%); border-color: #accfff; box-shadow: inset 0 0 0 2px #90bde847,0 0 9px #70bfff50; }
.mana-slot.locked { visibility: hidden; }
button.action-btn { font-family: Cinzel,Georgia,serif; border-radius: 5px; border-color: #ac8b52; background: linear-gradient(160deg,#302636,#17101f); box-shadow: inset 0 0 0 3px #140e1e,inset 0 0 0 4px #ad8d4f25,0 5px 14px #0009; }
#end-turn-btn-bottom, #end-turn-btn-top { position: relative; padding: 14px 12px; min-height: 58px; font-size: 18px; border: 2px solid #d2ae66; background: linear-gradient(145deg,#8a6539,#4b3427 50%,#261b2a); color: #ffedc4; text-shadow: 0 2px 3px #000; }
#end-turn-btn-bottom:disabled, #end-turn-btn-top:disabled { background: #211a27; color: #a99baf; border-color: #66516b; font-size: 14px; }
#end-turn-btn-bottom:not(:disabled), #end-turn-btn-top:not(:disabled) { background: linear-gradient(145deg,#8a6539,#4b3427 50%,#261b2a); }
#surrender-btn { position: static; min-height: 34px; width: 100%; margin: 0; padding: 6px 10px; font-size: 12px; border-color: #78505c; color: #c4a8b0; background: #251421ae; }
.game-area { display: flex; flex-direction: column; flex: 1; width: 100%; height: 100%; min-height: 0; overflow: hidden; padding: 40px 0 16px; box-sizing: border-box; }
#interaction-status, #challenge-objective { position: absolute; left: 260px; right: 240px; margin: 0 auto; max-width: none; padding: 0; font-size: 12px; line-height: 1.4; text-align: center; color: #d1bf98; pointer-events: none; }
#challenge-objective { top: 10px; }
#interaction-status { top: 30px; color: #bfb0cb; }
#connection-status { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 20; font-size: 12px; }
.field-label { display: none !important; }
.board { flex: 1 1 50%; width: 100%; min-height: 0; padding: 4px 245px; box-sizing: border-box; gap: 12px; border: 0; border-radius: 0; background: none; justify-content: center; align-items: center; overflow: visible; }
.player-board { border-top: 1px solid #b1966028; background: radial-gradient(ellipse at top,#68439d10,transparent 70%); }
.board.is-my-turn { box-shadow: none; }
.board:empty::before { content: none; }
.board.drag-over { background: radial-gradient(ellipse at center,#8556c330,transparent 70%); }
.card { background: linear-gradient(145deg,#534039,#18111d 32%,#281b2b); border: 2px solid #826847; border-radius: 11px 4px 11px 4px; box-shadow: 0 7px 14px #000b,inset 0 0 0 2px #130d18,inset 0 0 0 3px #ceb27932; }
.card::before { inset: 4px; border-color: #d7b67826; border-radius: 7px 2px 7px 2px; }
.board .card { width: clamp(112px,calc((100vw - 548px)/5),158px); height: clamp(174px,25vh,230px); margin: 0 !important; box-sizing: border-box; }
.card-img { flex-shrink: 0; height: 49%; margin: 6px 6px 0; border: 1px solid #b6985a; border-radius: 6px 2px 6px 2px; }
.card-img img { pointer-events: none; filter: saturate(1.05) contrast(1.02); }
.card-name { flex-shrink: 0; font: 700 13px/1.25 Cinzel,Georgia,serif; padding: 7px 4px 5px; letter-spacing: 0; color: #f0d59c; background: linear-gradient(#241725,#170e1d); border: 0; }
.card-desc-container { min-height: 0; flex: 1; background: linear-gradient(#1b1320,#16101c); }
.card-desc-text { position: static; transform: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font: 600 12px/1.25 'Segoe UI',sans-serif; padding: 4px 7px; color: #e6dbc6; }
.board .card-desc-text { -webkit-line-clamp: 2; }
.card-lore-text { display: none; }
.card-img:hover ~ .card-desc-container .card-desc-text { opacity: 1; }
.card-stats { position: static; flex-shrink: 0; height: 37px; padding: 3px 7px 5px; }
.card-cost, .stat { width: 28px; height: 28px; font: 800 18px 'Segoe UI',sans-serif; border: 1px solid; text-shadow: 0 1px 2px #000; box-shadow: inset 0 0 0 2px #110b18,0 2px 4px #0008; }
.card-cost { background: linear-gradient(135deg,#5e69b4,#151e45); border-color: #a4b6e2; border-radius: 5px 12px 5px 12px; }
.stat.atk { background: linear-gradient(135deg,#9d6b26,#42230b); border-color: #ddb16c; border-radius: 50%; }
.stat.hp { background: linear-gradient(135deg,#ad3946,#451323); border-color: #e18085; border-radius: 8px 3px 8px 3px; }
.stats-right { gap: 4px; box-shadow: none; }
.trait-icons-container { top: 8px; left: 8px; font-size: 15px; gap: 3px; filter: none; }
.trait-icons-container > div { background: #130f19d9; border: 1px solid #a28b595e; border-radius: 5px; padding: 1px 2px; }
.card.spell { border-color: #9670b9; background: linear-gradient(145deg,#593265,#1e122b 35%,#24142d); }
.playable { animation: none; border-color: #b38be3 !important; box-shadow: 0 0 0 1px #8863b866,0 6px 15px #000b,0 0 14px #9763d830; }
.board .card.ready { border-color: #77b29e; box-shadow: 0 0 0 1px #77b29e60,0 8px 16px #000b; }
.board .card.exhausted { filter: saturate(.75); opacity: .82; }
.effect-divine-shield { border-color: #eed28e !important; box-shadow: 0 0 14px #e2bf6c50,inset 0 0 0 2px #e2bf6c35 !important; }
.board .card.selected-for-play { transform: translateY(-6px) !important; outline: 2px solid #f0d99f; outline-offset: 2px; }
.legal-target { outline: 2px solid #efcf86; outline-offset: 3px; box-shadow: 0 0 20px #caa25a55 !important; }
.hand { --hand-count: 4; --hand-space: calc(100vw - 520px); --fan-overlap: clamp(24px,calc((var(--hand-count) * var(--hand-card-width) - var(--hand-space)) / (var(--hand-count) - 1)),100px); flex: 0 0 23vh; min-height: 0; padding: 0 245px; box-sizing: border-box; gap: 0; overflow: visible; perspective: 1000px; pointer-events: none; justify-content: center; }
.hand .card { pointer-events: auto; width: var(--hand-card-width); height: clamp(176px,23vh,218px); margin-left: calc(-1 * var(--fan-overlap)); transition: transform .18s,filter .18s; }
.hand .card:first-child { margin-left: 0; }
#player-hand { padding-bottom: 30px; }
.hand.active-hand .card:hover, .hand.active-hand .card:focus-visible { transform: translateY(-26px) rotate(0deg) scale(1.1) !important; z-index: 50; }
.hand .card.selected-for-play { transform: translateY(-26px) rotate(0deg) scale(1.1) !important; outline: 2px solid #f0d99f; outline-offset: 2px; z-index: 51; }
.hand .card.dragging-modern { transition: none; }
#enemy-hand { flex: 0 0 19vh; min-height: 0; padding: 0 245px; }
.hidden-hand .card { width: 64px; height: 94px; margin-left: -24px; transform: none !important; pointer-events: none; border-color: #7a6145; box-shadow: 0 7px 10px #0008; }
.hidden-hand .card:first-child { margin-left: 0; }
.hidden-hand .card::before { border-color: #cba4553d; }
#enemy-hand.active-hand { flex-basis: 23vh; }
body[data-mode="pvp"][data-turn="enemy"] #player-hand { display: none; }
#selection-panel { position: absolute; right: 18px; top: 49%; transform: translateY(-50%); z-index: 110; box-sizing: border-box; width: 204px; padding: 13px; margin: 0; background: linear-gradient(145deg,#2b2032f5,#120d1bf5); border: 1px solid #b39860; border-radius: 10px 3px 10px 3px; box-shadow: 0 8px 22px #0009,inset 0 0 0 3px #bc9f5e14; }
#selection-copy strong { font: 700 14px/1.4 Cinzel,Georgia,serif; color: #e7cea0; display: block; margin-bottom: 7px; }
#selection-copy p { font-size: 13px; line-height: 1.4; color: #d8cbdc; margin: 5px 0; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.selection-actions button { flex: 1; min-height: 44px; padding: 7px; color: #ecd7ac; border: 1px solid #91764f; background: #33243c; border-radius: 5px; cursor: pointer; }
.selection-actions #selection-play { flex-basis: 100%; background: #674631; }
#tutorial-panel { position: relative; align-self: center; width: min(580px,calc(100% - 500px)); margin: 0; padding: 10px 14px; background: #211629e8; border-color: #ad8b4f; border-radius: 8px 2px 8px 2px; }
#tutorial-copy strong { font: 700 16px Cinzel,Georgia,serif; }
#tutorial-copy p { font-size: 14px; }
#tutorial-panel button { font-size: 12px; }
body:has(#tutorial-panel:not([hidden])) #enemy-hand { flex-basis: 8vh; }
body:has(#tutorial-panel:not([hidden])) .board .card { height: clamp(166px,22vh,202px); }
.action-log-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 120; padding: 10px 18px; max-width: 440px; border-color: #b39359; border-radius: 7px 2px; background: #191020ed; box-shadow: 0 5px 20px #000b; }
.action-log-container.visible { transform: translate(-50%,-50%); }
.action-log-title { display: none; }
.action-log-text { font: 600 17px 'Segoe UI',sans-serif; }
.history-panel { position: absolute; top: 50%; left: 80px; right: auto; transform: translateY(-50%); width: 300px; max-height: 60vh; box-sizing: border-box; z-index: 300; background: #1a1223f5; border-color: #ab8c55; border-radius: 10px 3px; }
.history-title { font: 700 16px Cinzel,Georgia,serif; }
.history-item { font-size: 14px; line-height: 1.5; }

/* Menus keep the original centered composition and share the card materials. */
.menu-box, .wiki-modal, .card-details { border: 1px solid #b89558; border-radius: 12px 3px 12px 3px; background: radial-gradient(ellipse at top,#382a3ce8,#15101ef7 75%); box-shadow: 0 16px 45px #000b,inset 0 0 0 4px #160f21,inset 0 0 0 5px #b2934d24; }
#main-menu .home-menu { display: block; width: min(610px,100%); padding: 30px 44px; text-align: center; }
.menu-eyebrow, .home-tip, .menu-intro > p { display: none; }
#main-menu h1 { font-size: clamp(42px,5vw,62px); text-shadow: 0 2px 3px #000,0 0 28px #cfa76436; margin: 0 0 6px; }
.menu-subtitle { margin: 0 0 24px; }
#main-menu .menu-btn { text-align: center; background: linear-gradient(145deg,#3d2e44,#1b1326); border-color: #9c7c50; padding: 13px; }
#main-menu .primary-menu-btn { border-color: #d3af68; background: linear-gradient(145deg,#735331,#3a2538); }
.menu-btn small { font-family: 'Segoe UI',sans-serif; font-size: 13px; color: #c8bcd1; }
.menu-multiplayer { gap: 10px; }
.filter-select { border-color: #937958; background: #16101f; border-radius: 5px; }
.builder-card-wrapper > .card { height: 248px; }
.builder-card-wrapper .card-desc-text { font-size: 14px; -webkit-line-clamp: 4; }
.builder-card-controls button { background: #2c1e35; border-color: #a28652; color: #edd6a6; }
.deck-summary { background: #1c1324; border-color: #8e7049; border-radius: 9px 3px; }
.selected-deck-row { background: #302239; }
.deck-builder-actions #confirm-deck-btn { background: linear-gradient(145deg,#755337,#3c253f); }
.card-details { padding: 24px; }
.detail-stats span { background: #382540; color: #eedcbe; border: 1px solid #a3865540; }

@media (max-width: 1100px) and (min-width: 701px) {
  .floating-ui { padding: 14px; }
  .floating-ui.left { width: 180px; }
  .floating-ui.right { width: 158px; }
  .hero-stats-container { padding: 8px; }
  .bar-wrapper { width: 94px; }
  .stat-val-out { width: 28px; font-size: 18px; }
  .player-stats-header { gap: 8px; }
  .board { padding-inline: 200px; gap: 8px; }
  .board .card { width: clamp(96px,calc((100vw - 450px)/5),130px); }
  .hand { --hand-space: calc(100vw - 410px); padding-inline: 200px; }
  #enemy-hand { padding-inline: 200px; }
  #selection-panel { top: auto; bottom: 23vh; left: 50%; right: auto; transform: translateX(-50%); width: min(560px,calc(100vw - 410px)); padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
  #selection-copy p { display: none; }
  #selection-copy strong { font: 600 13px 'Segoe UI',sans-serif; margin: 0; }
  .selection-actions { flex-wrap: nowrap; margin: 0; }
  .selection-actions #selection-play { flex-basis: auto; }
  #tutorial-panel { width: calc(100% - 410px); }
  #interaction-status, #challenge-objective { left: 210px; right: 180px; font-size: 11px; }
  .deck-workspace { grid-template-columns: minmax(0,1fr) 260px; gap: 12px; }
  .deck-builder-filters { flex-wrap: wrap; }
  #filter-search { flex-basis: 100%; }
}
@media (max-width: 700px) {
  :root { --hand-card-width: 112px; }
  body { height: auto; min-height: 940px; overflow-y: auto; background-attachment: scroll; }
  body:has(#tutorial-panel:not([hidden])) { min-height: 1040px; }
  .battle-shell { min-height: 940px; height: 100dvh; }
  body:has(#tutorial-panel:not([hidden])) .battle-shell { min-height: 1040px; }
  .floating-ui { padding: 10px; gap: 6px; }
  .floating-ui.left { width: 152px; }
  .floating-ui.right { width: 112px; }
  .player-stats-header { gap: 7px; }
  .arena-slot { width: 38px; height: 50px; }
  .arena-slot-text { font-size: 9px; }
  .arena-slot .card { transform: scale(.29); }
  .deck-display { min-width: 36px; gap: 2px; }
  .deck-display img { width: 27px; height: 39px; }
  .deck-display .deck-count { font-size: 16px; }
  .pile-label { font-size: 10px; }
  .hero-stats-container { padding: 7px; }
  .hero-name { font-size: 13px; margin-bottom: 2px; }
  .stat-row { gap: 4px; }
  .bar-wrapper { width: 76px; height: 11px; }
  .stat-val-out { width: 24px; height: 28px; font-size: 18px; }
  .stat-icon { font-size: 14px; }
  .stat-row:not(.hero-target-row) .stat-val-out { width: 24px; height: 22px; }
  .mana-caption { font-size: 10px; }
  .mana-caption strong { font-size: 15px; }
  .mana-slots { height: 18px; gap: 3px; }
  #end-turn-btn-bottom, #end-turn-btn-top { padding: 10px 5px; min-height: 48px; font-size: 15px; }
  #end-turn-btn-bottom:disabled, #end-turn-btn-top:disabled { font-size: 11px; }
  .side-menu-buttons { left: auto; right: 10px; top: 174px; transform: none; flex-direction: row; gap: 5px; }
  .side-btn-float { width: 38px; height: 40px; font-size: 18px; }
  .game-area { padding: 200px 0 188px; min-height: 940px; }
  #interaction-status { left: 12px; right: 140px; top: 168px; font-size: 11px; text-align: left; }
  #challenge-objective { left: 174px; right: 12px; top: 125px; font-size: 10px; }
  #connection-status { top: 215px; }
  .board { padding: 8px; gap: 6px; flex: 1 1 50%; }
  .board .card { width: calc((100vw - 48px)/5); min-width: 0; height: 124px; border-width: 1px; border-radius: 7px 2px; }
  .card-img { height: 45%; margin: 3px 3px 0; }
  .board .card-name { font: 700 10px/1.2 'Segoe UI',sans-serif; padding: 4px 2px; }
  .board .card-desc-text { font-size: 10px; line-height: 1.2; padding: 2px; -webkit-line-clamp: 1; }
  .board .card-stats { height: 27px; padding: 2px; }
  .board .card-cost, .board .stat { width: 18px; height: 21px; font-size: 14px; }
  .board .stats-right { gap: 2px; }
  .trait-icons-container { top: 4px; left: 4px; font-size: 11px; }
  .trait-icons-container > div { padding: 0 1px; }
  .hand { --hand-space: calc(100vw - 32px); padding: 0 16px; flex-basis: 188px; }
  .hand .card { width: 112px; height: 168px; }
  .hand .card-name { font: 700 12px/1.25 'Segoe UI',sans-serif; padding: 5px 3px; }
  .hand .card-desc-text { font-size: 12px; padding: 3px 5px; }
  .hand .card-stats { height: 31px; padding: 2px 5px; }
  .hand .card-cost, .hand .stat { width: 24px; height: 25px; font-size: 16px; }
  #player-hand { padding-bottom: 16px; }
  .hand.active-hand .card:hover, .hand.active-hand .card:focus-visible, .hand .card.selected-for-play { transform: translateY(-20px) rotate(0deg) scale(1.08) !important; }
  #enemy-hand { flex-basis: 64px; padding: 0 16px; }
  .hidden-hand .card { width: 38px; height: 56px; margin-left: -14px; }
  #enemy-hand.active-hand { flex-basis: 188px; }
  #selection-panel { top: auto; left: 12px; right: 12px; bottom: 180px; transform: none; width: auto; padding: 10px 12px; }
  #selection-copy strong { font: 700 14px 'Segoe UI',sans-serif; margin: 0 0 5px; }
  #selection-copy p { font-size: 12px; margin: 4px 0; }
  #selection-copy p:last-child { display: none; }
  .selection-actions { margin: 7px 0 0; flex-wrap: nowrap; }
  .selection-actions #selection-play { flex-basis: auto; }
  #tutorial-panel { width: calc(100% - 24px); padding: 10px 12px; margin-bottom: 10px; }
  #tutorial-copy strong { font-size: 14px; }
  #tutorial-copy p { font-size: 13px; }
  body:has(#tutorial-panel:not([hidden])) .board .card { height: 124px; }
  body:has(#tutorial-panel:not([hidden])) #enemy-hand { flex-basis: 48px; }
  .history-panel { position: absolute; top: 235px; left: auto; right: 10px; transform: none; width: calc(100vw - 20px); max-height: 380px; }
  #main-menu .home-menu { padding: 24px; }
  #main-menu h1 { font-size: 42px; }
  .menu-subtitle { font-size: 13px; margin-bottom: 18px; }
  .menu-multiplayer { grid-template-columns: 1fr 1fr; }
  #main-menu .menu-multiplayer .menu-btn { font-size: 13px; padding: 10px 7px; }
  .fullscreen-overlay, .wiki-modal-overlay { padding: 12px; }
  .deck-builder-menu-box { height: calc(100dvh - 24px); width: 100%; padding: 16px; }
  .deck-builder-title { font-size: 24px; margin-bottom: 12px; }
  .deck-manager-bar { gap: 6px; margin-bottom: 10px; }
  .deck-select { min-width: 100%; }
  .deck-manager-btn { padding: 8px 10px !important; font-size: 13px !important; }
  .deck-workspace { display: flex; flex-direction: column-reverse; gap: 10px; }
  .deck-summary { flex-shrink: 0; max-height: 30dvh; padding: 10px 12px; }
  .deck-summary > details > summary { font-size: 17px; }
  .deck-collection { flex: 1; }
  .deck-builder-filters { flex-wrap: wrap; }
  #filter-search { flex-basis: 100%; }
  .deck-builder-filters .filter-select { font-size: 14px; flex: 1; min-width: 0; }
  .catalog-toolbar { font-size: 13px; }
  .deck-builder-instructions { display: none; }
  .deck-builder-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px 3px; gap: 12px; }
  .builder-card-wrapper > .card { height: 220px; }
  .builder-card-wrapper .card-desc-text { font-size: 13px; }
  .builder-card-controls { grid-template-columns: 40px 1fr 40px 40px; gap: 2px; }
  .builder-card-controls button { width: 40px; min-width: 40px; height: 44px; }
  .builder-card-controls span { font-size: 12px; min-width: 16px; }
  .deck-builder-actions { gap: 8px; margin-top: 12px; }
  .deck-builder-actions .action-btn { flex: 1; min-width: 0; width: auto; padding: 10px 8px; font-size: 13px; }
  .wiki-modal { padding: 22px; max-height: 85dvh; }
  .card-details { padding: 18px; }
  .card-details img { height: 160px; }
  .card-details h2 { font-size: 24px; }
  .card-details p { font-size: 16px; }
  .mulligan-grid-custom, .discard-grid { flex-wrap: nowrap; overflow-x: auto; justify-content: safe center; }
}
@media (prefers-reduced-motion: reduce) {
  .hand .card { transition: none; }
}

.exile-heading { grid-column: 1 / -1; width: 100%; color: #dac1ef; padding: 12px 0; border-top: 1px solid #a78953; font: 600 16px/1.4 'Segoe UI', sans-serif; }
.exiled-card { opacity: .65; border-color: #a17bc1; }
.passive-marker { color: #e7caff; }
.passive-marker.used { color: #b8a7c0; opacity: .75; }
.arena-passive-status { position: absolute; top: -3px; right: -3px; z-index: 5; background: #3b2351; border: 1px solid #b28bd1; border-radius: 50%; padding: 2px; color: #e7caff; font: 700 11px/1.3 'Segoe UI',sans-serif; pointer-events: none; }
.arena-passive-status.used { background: #302536; color: #b8a7c0; }
.hero-portrait { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid #b89b52; vertical-align: middle; margin-right: 5px; }
.hero-resource { display: block; color: #dcc1ec; font: 600 10px/1.3 'Segoe UI',sans-serif; margin-top: 3px; }
.hero-power-btn { min-height: 44px; padding: 6px 8px !important; background: linear-gradient(135deg,#483159,#201327) !important; border-color: #b68ad0 !important; font-size: 14px !important; }
.hero-power-btn[hidden] { display: none !important; }
.hero-choice { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 8px; margin-bottom: 12px; text-align: left; }
.hero-choice p { grid-column: 1 / -1; color: #d1c0de; font: 13px/1.4 'Segoe UI',sans-serif; margin: 0; }
.hero-choice select { min-width: 0; }
.hero-resource-particle { position: fixed; pointer-events: none; z-index: 9900; font: 700 21px Georgia,serif; text-shadow: 0 0 8px currentColor; animation: heroResourceFlow var(--particle-duration,650ms) ease-out forwards; }
@keyframes heroResourceFlow { from {opacity:0;transform:translate(var(--particle-x),-70px) scale(.6);} 30% {opacity:1;} to {opacity:0;transform:translate(0,0) scale(1.2);} }
@media(max-width:700px){
  .hero-choice{grid-template-columns:1fr;} .hero-choice p{grid-column:auto;} .hero-power-btn{font-size:12px!important;}
  .deck-builder-menu-box {display:block;overflow-y:auto;}
  .deck-collection {flex:none;}
  .deck-builder-grid {flex:none;height:48dvh;max-height:380px;min-height:240px;}
}
.floating-damage.feedback-passive { font: 700 11px/1.3 'Segoe UI', sans-serif; color: #d8b8fb; max-width: 105px; text-align: center; white-space: pre-line; }

/* Readable names and explicit states without changing the table layout. */
.card-name { white-space: normal; text-overflow: clip; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 32px; box-sizing: border-box; padding-top: 4px; padding-bottom: 3px; }
.card-state { position: absolute; top: calc(49% - 13px); left: 8px; right: 8px; z-index: 3; padding: 3px 4px; text-align: center; font: 700 10px/1.2 'Segoe UI',sans-serif; color: #eee0c8; background: #18121ce8; border: 1px solid #9a856650; border-radius: 3px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-state.state-ready { color: #e6ffdf; background: #163a2de8; border-color: #9cd3a8; }
.hand .card-state.state-ready { background: #45315ce8; border-color: #caacec; color: #f2e2ff; }
.board .card.exhausted { opacity: .94; filter: saturate(.75); cursor: help; }
.card:focus-visible, .side-btn-float:focus-visible, .selection-actions button:focus-visible { outline: 2px solid #ffdf99; outline-offset: 3px; }
.inspection-navigation { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#zoom-modal-overlay { transition: opacity .12s ease; }
.inspection-navigation span { flex: 1; text-align: center; color: #e6d0a5; }
.card-details .inspection-navigation button { flex: 0 0 48px; width: 48px; font-size: 26px; }
.card-details { max-height: 85dvh; overflow-y: auto; box-sizing: border-box; scrollbar-width: thin; background: linear-gradient(145deg,#302333,#140f1c); box-shadow: inset 0 0 0 3px #b89b5224,0 16px 60px #000a; }
.card-details h2 { font-family: Cinzel,Georgia,serif; }
.wiki-modal, .history-panel { border-color: #a78953; background: linear-gradient(145deg,#302333f5,#130e1bf5); box-shadow: inset 0 0 0 3px #ad915d18,0 10px 35px #000a; }
.match-statistics { margin: 18px 0; text-align: left; color: #d9c9df; }
.match-statistics summary { cursor: pointer; color: #e6c78e; padding: 12px 0; }
.match-statistics p, .match-statistics li { font: 14px/1.5 'Segoe UI',sans-serif; }
.match-statistics button { padding: 10px; min-height: 44px; border: 1px solid #91744a; border-radius: 5px; background: #322238; color: #eed4aa; cursor: pointer; }
.statistics-table { overflow-x: auto; }
.statistics-table table { width: 100%; border-collapse: collapse; font: 13px 'Segoe UI',sans-serif; }
.statistics-table th, .statistics-table td { padding: 9px 6px; border-bottom: 1px solid #a58b5638; text-align: left; }
.statistics-table caption { text-align: left; padding: 8px 0; color: #c7b5cc; }
.match-summary { color: #cfc0d6; font-size: 15px; }
.floating-damage { font-size: 30px; }
.feedback-mana, .feedback-armor, .feedback-draw, .feedback-shield { font: 700 16px/1.2 'Segoe UI',sans-serif; }
.floating-damage.feedback-armor { margin-left: 20px; }
.impact-ring { position: fixed; z-index: 9990; pointer-events: none; box-sizing: border-box; border: 2px solid currentColor; border-radius: 10px; box-shadow: inset 0 0 20px currentColor; animation: impactFade .5s ease-out forwards; }
@keyframes impactFade { from { opacity: .8; } to { opacity: 0; } }
body.fast-animations .impact-ring { animation-duration: .16s; }
@media (max-width: 700px) {
  .board .card-name { min-height: 27px; padding: 2px; }
  .hand .card-name { min-height: 32px; padding: 3px; }
  .board .card-img { height: 40%; }
  .card-state { top: calc(45% - 12px); left: 4px; right: 4px; font-size: 9px; padding: 2px 1px; }
  .board .card-state { top: calc(40% - 10px); font-size: 8px; }
  .card-details { padding: 16px; }
  .card-details img { height: 160px; }
  .card-details h2 { font-size: 23px; }
  .card-details p { font-size: 16px; }
  .floating-damage { font-size: 24px; }
  .feedback-mana, .feedback-armor, .feedback-draw, .feedback-shield { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #zoom-modal-overlay { transition: none; }
  .impact-ring { animation: none; opacity: .4; }
  .floating-damage { animation: none; transform: translate(-50%,-50%); }
}

/* Complete the menu materials and readable ability inspection. */
.home-settings { display: block; margin: 14px auto 0; padding: 10px 16px; min-height: 44px; border: 1px solid #9b805150; border-radius: 5px; background: #1b1224; color: #dbc5a0; font: 14px 'Segoe UI',sans-serif; cursor: pointer; }
.home-settings:hover { border-color: #d2b271; background: #322238; }
.home-settings:focus-visible { outline: 2px solid #ffdf99; outline-offset: 3px; }
.menu-box h2, .wiki-modal h2 { font-family: Cinzel,Georgia,serif; color: #ecd19d; }
.menu-box .action-btn:not(.menu-btn):not(:disabled), .wiki-modal .action-btn:not(:disabled) { background: linear-gradient(145deg,#664a34,#322039); border-color: #ba985c; color: #f2deb6; font-family: Cinzel,Georgia,serif; }
.menu-box .action-btn:disabled { opacity: .55; cursor: default; }
.menu-box .filter-select, .menu-box input[type="text"] { min-height: 44px; box-sizing: border-box; border: 1px solid #987c50; background-color: #171020; color: #e8d9c0; }
.challenge-option { background: linear-gradient(135deg,#332237,#18101f); border-color: #9e7f494d; box-shadow: inset 0 0 0 2px #d2ae6220; border-radius: 8px 2px; }
.challenge-option p { font-size: 14px; color: #d6c7d7; }
.challenge-option .action-btn { min-height: 44px; }
.ability-guide { list-style: none; padding: 0; margin: 12px 0; border-top: 1px solid #ac8a524a; }
.ability-guide li { padding: 10px 0; border-bottom: 1px solid #ac8a522a; font: 15px/1.5 'Segoe UI',sans-serif; }
.ability-guide strong { display: block; color: #e7cc97; margin-bottom: 3px; }
.ability-guide span { color: #ded0e1; }
.card-details .inspection-state { font: 600 14px 'Segoe UI',sans-serif; color: #b6d9c3; }
#custom-dialog-overlay { z-index: 4000; }
.wiki-modal-overlay { transition: opacity .18s ease; }
.wiki-modal { transition: transform .18s ease; }
@media (max-width: 700px) {
  .wiki-modal { padding: 20px; max-height: 86dvh; max-width: 100%; box-sizing: border-box; }
  .wiki-modal h2 { font-size: 22px; letter-spacing: .5px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .action-btn { min-height: 44px; flex: 1; }
  .mulligan-menu-box, .discard-menu-box { padding: 16px; max-height: 90dvh; overflow-y: auto; }
  .mulligan-grid-custom, .discard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 5px; }
  .mulligan-grid-custom .card, .discard-grid .card { width: 100%; height: 216px; min-width: 0; box-sizing: border-box; }
  .ability-guide li { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .wiki-modal-overlay, .wiki-modal { transition: none; }
}
