/* Game content only. Header/buttons/guide visuals are never duplicated here. */
#main {min-height:0}
#gameFrame {width:min(100%,920px);margin:auto}
body[data-unblock-screen="stage"],body[data-unblock-screen="battle"] {height:100dvh;overflow:hidden;overscroll-behavior:none}
html:has(body[data-unblock-screen="stage"]),html:has(body[data-unblock-screen="battle"]) {overflow:hidden;overscroll-behavior:none}
#gameFrame:has(#main[hidden]) {height:calc(100dvh - 56px);overflow:hidden}
#gameFrame .canvas {height:100%;max-height:100%;position:relative;direction:ltr}
#stageGrid {height:100%;min-height:0;padding-block:16px;direction:ltr}
#stage .stage-card {border-radius:4px;max-height:100%!important;min-height:0!important}
#battleLive {height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:60px minmax(0,1fr) 48px;padding:6px;gap:8px;direction:ltr;container-type:size}
#battleLive > * {min-width:0}
#battleLive #board {width:min(100%,500px,calc(100cqh - 124px));max-height:100%;margin:0;border-radius:4px;background:#745436;box-shadow:inset 0 0 0 3px #b99969}
#board .cell {border-radius:2px;background:#d9bc82}
#board .block {border-radius:3px;background-size:contain}
#board .art-hero {background-image:url('../../assets/animal-unblock-hero-block-v22.webp');filter:drop-shadow(0 0 2px #fff4a0)}
#board .art-h2 {background-image:url('../../assets/animal-unblock-h2-block-v22.webp')}
#board .art-h3 {background-image:url('../../assets/animal-unblock-h3-block-v22.webp')}
#board .art-v2 {background-image:url('../../assets/animal-unblock-v2-block-v22-proportional.webp')}
#board .art-v3 {background-image:url('../../assets/animal-unblock-v3-block-v22-proportional.webp')}
#board .cell.exit {background:#fff3bf url('../../assets/animal-unblock-gate-block-v22.webp') center/contain no-repeat}
#battleLive #status {grid-row:1;max-width:100%;margin:0;color:var(--wp-ui-text);font-size:14px;line-height:1.3;align-self:center;overflow-wrap:anywhere}
#battleLive .tools {width:100%;max-width:460px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#battleLive .tools button {min-width:0}
#generalReserve {height:56px;width:min(100%,920px);margin:0 auto}
#battle dialog {position:absolute;inset:8px 0 auto;margin:0 auto;width:calc(100% - 16px);max-width:620px;max-height:calc(100dvh - 72px);overflow:auto;box-sizing:border-box;background:var(--wp-ui-surface);color:var(--wp-ui-text);border:2px solid var(--wp-ui-line);border-radius:var(--wp-ui-radius);padding:16px}
#battle dialog::backdrop {background:#071a20db}
#battle .result-character {width:112px;height:112px;object-fit:contain}
.leave-actions {display:grid;gap:12px}
body[data-unblock-covered="true"] #battleLive {visibility:hidden;pointer-events:none}
html[dir="rtl"] #mainGuide,html[dir="rtl"] #battle #status,html[dir="rtl"] #battle dialog {direction:rtl}
@media(min-width:681px) and (max-height:560px) {
 #battleLive {grid-template-columns:minmax(0,1fr) 260px;grid-template-rows:minmax(0,1fr) 48px;gap:8px}
 #battleLive #board {grid-column:1;grid-row:1/3;width:min(100%,calc(100cqh - 12px));height:auto}
 #battleLive #status {grid-column:2;grid-row:1}
 #battleLive .tools {grid-column:2;grid-row:2;max-width:none}
#battle .result-character {width:72px;height:72px}
}

/* Interface 7 semantic compatibility and bounded compact-landscape Stage. */
@layer wp-frame-contract {
  html[data-wp-shared-interface="7"] body[data-wp-game-id="animal-unblock"] .game-page-info,
  html[data-wp-shared-interface="7"] body[data-wp-game-id="animal-unblock"] .game-info-section {
    border-radius:18px!important;
  }
  html[data-wp-shared-interface="7"] body[data-wp-game-id="animal-unblock"] .game-info-section {
    padding:16px!important;
    background:var(--wp-ui-background)!important;
  }
}
@media (min-width:700px) {
  html[data-wp-shared-interface="7"] body[data-wp-game-id="animal-unblock"] .hero[data-wp-frame-content="main"] {
    grid-template-columns:420px minmax(0,1fr)!important;
  }
}
@media (min-width:700px) and (max-height:560px) and (orientation:landscape) {
  html[data-wp-shared-interface="7"] body[data-wp-game-id="animal-unblock"] #stageGrid .stage-card {
    height:calc(100% - 16px)!important;
    min-height:0!important;
    max-height:calc(100% - 16px)!important;
  }
}
