/* Large-display reading size, without zooming the scene or its pointer coordinates.
   Height gate preserves compact laptop layouts and browser zoom accessibility. */
@media (min-width: 1600px) and (min-height: 900px) {
  :root { font-size: clamp(18px, 1vw, 32px); }
  #app { padding: 4.75rem 1.5rem 1.25rem; }
  .topbar { min-height: 3.75rem; padding: .65rem 1.25rem; }
  .top-tools .icon-button { width: 2.25rem; height: 2.25rem; }
  .top-tools .icon { width: 1.15rem; height: 1.15rem; }
  input, select { min-height: 2.75rem; }
  label { font-size: .9rem; }
  .screen.lobby { max-width: 80rem; gap: 1.5rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .screen.lobby:before { background: linear-gradient(125deg,#191b1ff5,#191b1feb); border: 1px solid #d7c6a442; border-radius: 1rem; }
  .lobby .lobby-build,.lobby .lobby-roster,.lobby .lobby-settings { padding: 1.5rem; }
  .lobby .identity-fields { margin: 1.1rem 0 1.4rem; gap: .9rem; }
  .lobby .portrait-choice { height: 8.5rem; }
  .lobby .portrait-choice .art-img { height: 5.5rem; }
  .lobby .portrait-choice span { font-size: .9rem; }
  .lobby .portrait-choice small { font-size: .75rem; }
  .lobby .selection-preview { min-height: 6.25rem; gap: 1rem; }
  .lobby .selection-preview>button { width: 8rem; padding: .7rem .5rem; margin-top: .8rem; }
  .lobby .selection-preview p { line-height: 1.5; color: #dddcd0; }
  .lobby .seat-avatar { width: 2.5rem; height: 3rem; }
  .lobby .player-seat { min-height: 4rem; gap: .8rem; }
  .lobby .remove-ai { font-size: .8rem; min-height: 2.5rem; }
  .lobby .match-options { grid-template-columns: minmax(0,1fr); gap: .8rem; }
  .lobby .match-options label { display:grid; grid-template-columns: 9rem minmax(0,1fr); align-items:center; gap:.6rem; }
  .home { max-width: 84rem; grid-template-columns: minmax(0,1fr) 23rem; }
  .home-menu { max-height: calc(100dvh - 6rem); }
  .home-title p:last-child { max-width: 24rem; }
  .menu-button small,.home-footnote { font-size: .85rem; }
  .modal { width: min(45rem,94vw); }
  .modal.wide,.modal:has(.creature-growth) { width: min(90rem,94vw); }
  .modal:has(.profile-account) { width: min(36rem,94vw); height: min(48rem,92dvh); }
  .combat-status-tooltip { max-width: min(24rem,90vw); font-size: .9rem; padding:.7rem .9rem; }
  .hover-preview-note { font-size:.8rem; max-width:36rem; }
  body:has(.battle) { overflow:hidden; }
  #app:has(.battle) { height:100dvh; min-height:0; }
  #app>.battle { height:calc(100dvh - 6rem); min-height:0; }
  .catalyst-meter { font-size:.8rem; }
  /* Hand dimensions grow together with rules text. Keep the established stacking. */
  .two-lane-battle .hand-zone { height: 17rem; bottom: 3rem; }
  .two-lane-battle .hand-slot { width: 12rem; flex-basis: 12rem; height: 17rem; }
  .two-lane-battle .hand-slot .game-card { padding: .45rem; }
  .two-lane-battle .hand-slot .card-art { height: 6rem; min-height: 4.5rem; }
  .two-lane-battle .hand-slot .card-rules { font-size: .8rem; line-height: 1.3; min-height: 4rem; padding: .4rem .25rem; }
  .card-topline { min-height: 2rem; gap: .25rem; }
  .card-cost { width: 1.8rem; height: 1.8rem; flex-basis: 1.8rem; }
  .card-speed { flex-basis: 1.4rem; }
  .card-footer { height: 1.15rem; font-size: .65rem; }
  .card-catalyst { font-size: .7rem!important; }
  .two-lane-battle .lock-control { width: 11rem; bottom: 2rem; }
  .two-lane-battle .energy-constellation { bottom: 2.6rem; }
  .two-lane-battle .energy-pip { width: 1.5rem; height: 1.5rem; }
  .two-lane-battle .energy-pips { max-width: 9rem; gap: .5rem; }
  .two-lane-battle .battle-heading { top: 4rem; }
  .two-lane-battle .battle-status { font-size: .8rem; }
  .battle-teams { top: 4.4rem; }
  .two-lane-battle .battle-tools { top: 6.5rem; gap: .4rem; }
  .two-lane-battle .battle-tools button { font-size: .8rem; padding:.4rem .6rem; }
  .two-lane-battle .lane-combatant .combatant-name { height: 1.5rem; }
  .two-lane-battle .lane-combatant .combatant-name h3 { font-size: 1rem; }
  .two-lane-battle .lane-combatant .health-shell { height: 1.9rem; min-height:1.9rem; }
  .two-lane-battle .lane-combatant .health-text { font-size: 1rem; }
  .two-lane-battle .lane-combatant .status-list { top:calc(var(--intent-offset) - 2rem); left:2.6rem; width:calc(100% - 2.75rem); height:1.6rem; min-height:1.6rem; }
  .two-lane-battle .lane-combatant .pet-intent { height:2.15rem; min-height:2.15rem; font-size:1rem; max-width:calc(100% - 2.75rem); left:calc(50% + 1.25rem); }
  .battle .intent-effect,.battle .intent-value,.battle .combat-status { font-size:.95rem; }
  .battle .intent-effects { height:1.5rem; gap:.5rem; }
  .battle .combat-status .icon,.battle .pet-intent .icon { width:1.35rem; height:1.35rem; }
  .two-lane-battle .pet-initiative { width:2.15rem; height:2.15rem; }
  #tactic-choice { bottom:20rem; } #card-target-hint { bottom:19rem; max-width:28rem; }
  /* Graft and mutation workbenches use the same reading scale. */
  .starter-screen { max-width:90rem; grid-template-columns:19rem minmax(0,1fr); gap:1.25rem 1.75rem; padding:1rem 1.75rem!important; }
  .starter-heading h2 { font-size:2.2rem; }
  .starter-heading>p,.starter-heading .eyebrow { font-size:.85rem; }
  .starter-source { grid-template-rows:4.25rem 1.4rem 1.25rem; }
  .starter-source .art-img { height:4.25rem; }
  .starter-source strong,.starter-slot strong { font-size:.9rem; }
  .starter-source small,.starter-role { font-size:.75rem; }
  .starter-source-bank .pet-description-preview { height:8rem; min-height:8rem; max-height:8rem; padding:.75rem; }
  .starter-source-bank .pet-description-preview p { font-size:.85rem; }
  .starter-screen[data-starter-count="1"] .starter-build { grid-template-columns:minmax(0,1fr) 16rem; grid-template-rows:2rem 9rem 19rem 4rem; gap:.75rem 1.4rem; }
  .starter-build-heading { font-size:.8rem; height:2rem; }
  .starter-slot { height:8rem; grid-template-rows:1.2rem 5rem 1.5rem; }
  .starter-slot .art-img { height:5rem; }
  .starter-screen[data-starter-count="1"] .starter-result,.starter-screen[data-starter-count="1"] .starter-packages { height:19rem; }
  .starter-screen[data-starter-count="1"] .starter-result .starter-hybrid-art { height:13rem; }
  .starter-screen[data-starter-count="1"] .starter-result-name strong { font-size:1.5rem; }
  .starter-screen[data-starter-count="1"] .starter-package strong { font-size:1rem; }
  .starter-screen[data-starter-count="1"] .starter-package>span,.starter-result p { font-size:.85rem; }
  .starter-result p { max-width:26rem; max-height:3rem; }
  .starter-package small,.starter-donor-moves span,.starter-confirm small { font-size:.75rem; }
  .starter-donor-moves { height:4rem; }
  .starter-confirm { min-height:4rem; padding:.75rem; }
  .starter-confirm small { max-width:22rem; }
  .starter-confirm>span { font-size:.9rem; }
  .camp { max-width:90rem; }
  .growth-heading h3 { font-size:1.65rem; }
  .growth-wallet strong { font-size:1.6rem; }
  .growth-workbench { gap:1rem; }
  .growth-anatomy { height:22rem; }
  .growth-part { min-width:5rem!important; padding:.5rem .65rem!important; font-size:.8rem!important; }
  .growth-part-head,.growth-part-tail { top:2rem; }
  .growth-part-core { top:8rem; }
  .growth-part-arms,.growth-part-legs { bottom:1.5rem; }
  .growth-node { min-height:3.25rem; padding:.6rem!important; }
  .growth-tier-nodes { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .growth-node strong { font-size:.85rem; max-width:none; width:auto; }
  .growth-node-mark { display:none!important; }
  .growth-preview-heading h4 { font-size:1rem; }
  .growth-preview-heading span,.growth-all-moves summary,.growth-all-moves summary span { font-size:.8rem; }
  .growth-node small,.growth-node span,.growth-stage,.growth-stage small,.growth-wallet small,
  .growth-choice-help,.growth-confirm-help,.growth-build span,.growth-build small,.growth-build p,
  .growth-part-heading span,.growth-detail-title small,.growth-kicker { font-size:.75rem; line-height:1.5; }
  .growth-build strong,.growth-part-heading h4,.growth-detail-title h4 { font-size:1rem; }
  .growth-node-detail { min-height:11rem; padding:1rem; }
  .growth-node-detail p { font-size:.9rem; line-height:1.5; }
  .growth-pair .growth-move-art { height:10rem!important; flex-basis:10rem!important; }
  .growth-pair .growth-move-copy>strong { font-size:1.15rem; }
  .growth-pair .growth-move p { font-size:.85rem!important; line-height:1.5; }
  .growth-pair .growth-delta,.growth-move-values { font-size:.8rem; }
  .growth-reset { font-size:.75rem!important; }
  .deployment-tray { min-width:32rem; padding:1rem; }
  .deployment-sprite { min-width:7rem; }
  .deployment-sprite>.art-img { width:7rem; height:6rem; }
  .deployment-sprite>span { font-size:.9rem; }
  .deployment-sprite small,.deployment-tray small { font-size:.8rem; }
}

/* Reserve the right half of the actual world for the selected trainer and pet.
   Only the controls scroll; the character showcase stays visible. */
@media (min-width: 761px) {
  .screen.lobby {
    display: flex; flex-direction: column; width: 46vw; max-width: 54rem;
    height: calc(100dvh - 6rem); max-height: calc(100dvh - 6rem);
    margin: 0 auto 0 0; gap: .5rem; overflow: auto; padding: .5rem;
    background: linear-gradient(110deg,#191b1ff2,#191b1fdb);
    border: 1px solid #d7c6a442; border-radius: 1rem;
  }
  .screen.lobby:before { display: none; }
  .lobby .lobby-build,.lobby .lobby-roster,.lobby .lobby-settings { padding: .75rem; }
  .lobby .lobby-meta { display: grid; gap: .5rem; width: 100%; }
  .lobby .portrait-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: .3rem; }
  .lobby .portrait-choice { height: 6rem; min-width: 0; padding: .3rem; }
  .lobby .portrait-choice .art-img { height: 3.75rem; }
  .lobby .identity-fields { margin: .6rem 0 .8rem; }
  .lobby .selection-preview { min-height: 0; gap: .7rem; padding-top: .6rem; }
  .lobby .selection-preview>button { margin-top: 0; }
  .lobby .match-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; }
  .lobby .match-options label { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; }
  .lobby .player-seat { min-height: 3rem; }
}

@media (min-width: 761px) {
  /* A single scrolling flow: never shrink sections over their own contents. */
  .screen.lobby > .lobby-build,.screen.lobby > .lobby-meta {
    flex: 0 0 auto; min-height: min-content; height: auto; overflow: visible;
  }
  .lobby .lobby-build > * { flex-shrink: 0; }
  .lobby .lobby-meta { grid-template-rows: auto auto; }
  .lobby .lobby-roster,.lobby .lobby-settings {
    position: static; height: auto; min-height: min-content; overflow: visible;
  }
  .lobby .selection-preview { height: auto; min-height: min-content; margin-bottom: .75rem; }
}

@media(min-width:761px){
 .screen.starter-world-screen{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;width:44vw;max-width:54rem;height:calc(100dvh - 6rem);overflow:hidden;margin:0 auto 0 0;padding:1rem;background:#191b1fe8;border:1px solid #d7c6a442;border-radius:1rem}
 .starter-world-screen .starter-source-bank{grid-template-columns:repeat(4,minmax(0,1fr))}
 .starter-world-screen .starter-build-grid{display:flex;flex-direction:column;gap:1rem;min-height:0;overflow:auto;width:100%;align-self:stretch}
 .starter-world-screen .starter-build{display:flex;flex-direction:column;height:auto;min-height:0;gap:.6rem;padding:.7rem;flex-shrink:0}
 .screen.starter-world-screen[data-starter-count] .starter-result{height:auto;min-height:0;padding:.5rem;flex-shrink:0}
 .starter-world-screen .starter-result:after{display:none}
 .starter-world-screen .starter-result .starter-hybrid-art{display:none}
 .starter-world-screen .starter-parent-slots{min-height:7rem}
 .screen.starter-world-screen[data-starter-count] .starter-packages{height:auto;min-height:0;max-height:none;overflow:visible}
 .starter-world-screen .starter-confirm{position:static;margin-top:1rem;flex-wrap:wrap}
 .starter-meld-caption{position:absolute;left:2rem;top:30%;width:35vw;background:#191b1feb}
}
/* The 3D operating room stays visible while its rules and purchase controls scroll. */
body.mutation-world-active .world-shade,body.fusion-world-active .world-shade{background:linear-gradient(90deg,#090b0f66,transparent 55%)!important}
@media(min-width:761px){
 body.mutation-world-active .modal-backdrop:not(:has([data-document="help"],[data-document="duel-review"])){background:transparent;backdrop-filter:none;align-items:flex-start;justify-content:flex-start;padding:5rem 1.5rem 1rem}
 body.mutation-world-active .modal:not([data-document="help"]):not([data-document="duel-review"]){width:46vw!important;max-width:56rem!important;max-height:calc(100dvh - 6rem);background:#191b1ff2!important;margin:0;overflow:auto}
 body.mutation-world-active .screen.camp{width:46vw;max-width:56rem;margin:0 auto 0 0;height:calc(100dvh - 6rem);overflow:auto;background:#191b1fed}
 body.mutation-world-active .camp-content,body.mutation-world-active .development-layout,body.mutation-world-active .growth-development{overflow:visible!important;max-height:none!important;height:auto!important}
 body.mutation-world-active .growth-workbench{display:flex;flex-direction:column;gap:1rem}
 body.mutation-world-active .growth-anatomy{height:auto;display:flex;flex-wrap:wrap;gap:.5rem;padding:.5rem}
 body.mutation-world-active .growth-anatomy .growth-part{position:static;transform:none;flex:1 1 auto}
 body.mutation-world-active .growth-anatomy .growth-creature,body.mutation-world-active .growth-anatomy .growth-body-halo{display:none}
 body.mutation-world-active .growth-node-detail{min-height:0}
 body.mutation-world-active .growth-pair>.growth-move{min-height:0}
 body.mutation-world-active .camp-footer{position:static}
}
body.mutation-world-active .battlefield-deployment{visibility:hidden}
@media(min-width:761px){
 body.mutation-world-active .screen.camp{padding-bottom:1.5rem;scroll-padding-bottom:1.5rem}
 body.mutation-world-active .screen.camp>.camp-content,
 body.mutation-world-active .screen.camp>.camp-footer,
 body.mutation-world-active .screen.camp>.camp-context{flex:0 0 auto;min-height:min-content}
 body.mutation-world-active .camp-footer{margin-top:1rem;padding-top:1rem;padding-bottom:.5rem;flex-wrap:wrap}
}
/* Match secondary mutation captions to the large-display body scale. */
@media (min-width:1600px) and (min-height:900px){
 body.mutation-world-active .pet-description-preview{height:auto;min-height:4rem;max-height:9rem;padding:.65rem .85rem}
 body.mutation-world-active .pet-description-preview strong{font-size:1rem;line-height:1.35}
 body.mutation-world-active .pet-description-preview p,
 body.mutation-world-active .pet-description{font-size:.85rem;line-height:1.5}
 body.mutation-world-active .growth-reset small,
 body.mutation-world-active .growth-traits span{font-size:.75rem;line-height:1.5}
}
/* Between-round fusion uses the same world lab as starter selection. */
@media(min-width:761px){
 body.fusion-world-active .screen.camp{width:46vw;max-width:56rem;margin:0 auto 0 0;height:calc(100dvh - 6rem);overflow:auto;background:#191b1fed;padding-bottom:1.5rem;scroll-padding-bottom:1.5rem}
 body.fusion-world-active .camp-content,body.fusion-world-active .development-layout,body.fusion-world-active .development-main{overflow:visible!important;max-height:none!important;height:auto!important;min-height:min-content;flex:0 0 auto}
 body.fusion-world-active .camp-footer,body.fusion-world-active .camp-context{position:static;flex:0 0 auto;margin-top:1rem}
 body.fusion-world-active .fusion-pedestals{min-height:0;height:auto}
 body.fusion-world-active .pedestal-figure,body.fusion-world-active .pedestal-stone,body.fusion-world-active .fusion-conduit,body.fusion-world-active .fusion-manifestation{display:none}
 body.fusion-world-active .fusion-pedestal{min-height:5rem}
 body.fusion-world-active .development-layout{display:block;min-width:0}
 body.fusion-world-active .development-layout>.roster-rail{display:none}
 body.fusion-world-active .development-main{width:100%;min-width:0;padding:.75rem}
 body.fusion-world-active .fusion-pedestals{gap:.75rem}
 body.fusion-world-active .fusion-pedestal{grid-template-rows:auto auto;padding:.75rem}
 body.fusion-world-active .fusion-result-header{display:block}
 body.fusion-world-active .fusion-source{width:calc(50% - .75rem);max-width:12rem}
 body.fusion-world-active .fusion-empty-preview{min-height:6rem}
 body.fusion-world-active .fusion-vortex{display:none}
 body.fusion-world-active .modal-backdrop:not(:has([data-document="help"],[data-document="duel-review"])){background:transparent;backdrop-filter:none;justify-content:flex-start;padding:5rem 1.5rem 1rem}
 body.fusion-world-active .modal:not([data-document="help"]):not([data-document="duel-review"]){width:46vw!important;max-width:56rem!important;background:#191b1ff2!important}
}
body.fusion-world-active .battlefield-deployment{visibility:hidden}
/* The patient is the lab's subject; move rules read as specimen notes. */
@media (min-width:901px){
 body.mutation-world-active .growth-pair{grid-template-columns:minmax(0,1fr);gap:.65rem}
 body.mutation-world-active .growth-pair>.growth-move{display:grid;grid-template-columns:5rem minmax(0,1fr);align-items:start;gap:.85rem;padding:.85rem;min-height:0;border-radius:3px;background:linear-gradient(110deg,#262c22,#16181d);border-color:#a38b584d}
 body.mutation-world-active .growth-pair .growth-move-art{width:5rem!important;height:6rem!important;min-height:0;flex-basis:auto!important;border-radius:2px}
 body.mutation-world-active .growth-pair .growth-move-copy>strong{font-size:1rem;line-height:1.25}
 body.mutation-world-active .growth-pair .growth-move-values{min-height:0!important;margin:.4rem 0}
 body.mutation-world-active .growth-pair .growth-move p{min-height:0;font-size:.85rem!important;line-height:1.5;margin:.4rem 0 0!important}
 body.mutation-world-active .growth-node-detail{border-radius:3px;border-left:2px solid #c5a46a}
}
@media (min-width:901px){
 body.mutation-world-active .growth-body-column{padding:.5rem .65rem;border-radius:3px}
 body.mutation-world-active .growth-build{padding:.5rem .2rem}
 body.mutation-world-active .growth-build p{margin:.3rem 0}
 body.mutation-world-active .growth-tier-nodes{grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));gap:.5rem}
 body.mutation-world-active .growth-tree-column{border-radius:3px}
}
/* Multi-lane readout: one overhead band leaves the living creatures room. */
@media(min-width:761px){
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .combatant-name{height:calc(18px * var(--compact-hud-scale,1));align-items:center}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .combatant-name h3{font-size:calc(14px * var(--compact-hud-scale,1));line-height:1.1}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .health-shell{height:calc(22px * var(--compact-hud-scale,1));min-height:calc(22px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .health-text{font-size:calc(14px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .status-list{top:var(--intent-offset);left:calc(36px * var(--compact-hud-scale,1));width:calc(100% - 136px * var(--compact-hud-scale,1));height:calc(32px * var(--compact-hud-scale,1));min-height:0;justify-content:center;gap:calc(4px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .pet-intent{left:auto;right:0;transform:none;top:var(--intent-offset);height:calc(32px * var(--compact-hud-scale,1));min-height:0;max-width:calc(96px * var(--compact-hud-scale,1));padding:calc(3px * var(--compact-hud-scale,1));gap:calc(4px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .pet-initiative{left:calc(17px * var(--compact-hud-scale,1));width:calc(32px * var(--compact-hud-scale,1));height:calc(32px * var(--compact-hud-scale,1));font-size:calc(14px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant :is(.intent-value,.intent-effect,.combat-status){font-size:calc(14px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant :is(.combat-status,.pet-intent) .icon{width:calc(17px * var(--compact-hud-scale,1));height:calc(17px * var(--compact-hud-scale,1))}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .status-list{flex-wrap:wrap!important;align-content:center;row-gap:0;overflow:visible;scrollbar-width:none}
 .battle.two-lane-battle:not([data-lane-count="1"]) .lane-combatant .status-list::-webkit-scrollbar{display:none}
}
