:root{padding:0}
body{padding-top:env(safe-area-inset-top)}
#portrait{display:none}
@media (orientation:landscape){
  #portrait{position:fixed;inset:0;display:grid;place-items:center;text-align:center;background:var(--surface);color:var(--ink);z-index:2147483647;padding:1rem;font:700 1.7rem var(--f-title)}
  #app,.t-ov{visibility:hidden}
  body{overflow:hidden}
}
[hidden]{display:none!important}
.logo-img{width:min(300px,75vw);height:auto;display:block;margin:auto}
.top .res{white-space:nowrap}
.scene,.account,.wait{margin:12px;padding:14px}
.scene h2,.account h2{margin:0 0 8px;font-family:var(--f-title);line-height:1.12}
.scene h3,.account h3{margin:.4rem 0;font-family:var(--f-title)}
.scene p,.account p{margin:8px 0}
.scene .place{color:var(--ink2);font-weight:700}
.scene .book{color:var(--rose-d);font-weight:800;font-size:13px}
.scene .line{font:1.11rem/1.45 var(--f-title)}
.scene .line b{display:block;color:var(--rose-d);font-size:.92rem}
.stack{display:grid;gap:9px}
.split{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
label{display:grid;gap:3px;font-weight:700}
input,select{width:100%;min-height:44px;border:1px solid var(--line2);border-radius:11px;padding:6px 9px;background:#fff;color:var(--ink);font:inherit}
.auth-form{width:min(100%,340px);text-align:left}
.auth-form .btn{padding-inline:6px}
.hero-cover{height:154px;background:#805a62 url(ruines.webp) center 44%/cover}
.hero-cover img{height:136px;width:auto;max-width:90%;object-fit:contain}
.unit{width:min(93px,26vw);color:var(--ink)}
.unit .ua{display:grid;place-items:center;background-color:var(--rose-l);color:var(--rose-d);font:700 19px var(--f-title);overflow:hidden}
.unit .ua img,.tile .ua img{width:100%;height:100%;object-fit:cover}
.unit .ua span{line-height:1}
.cb-foes{background:#c8a49d url(ruines.webp) center/cover}
.cb-foes .row-label{color:#412d31;background:#fffaf5d9}
.row-label{font-size:10px;margin:4px 0;text-align:center;text-transform:uppercase;letter-spacing:.045em;font-weight:800}
.cb-head .mini button{padding-inline:8px}
.cb .cb-head h1{font-size:18px}
.cb-objective{margin:6px 10px 0;font-size:13px;text-align:center}
.cb .sk{width:100%;min-height:42px;padding:5px 7px}
.cb .sk .n{font-size:15px}
.cb-panel p{margin:5px 0}
.cb-panel .action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.cb-panel .btn{margin-top:6px}
.cb .cb-allies{padding-bottom:7px}
.cb-hint{margin:6px 10px;padding:6px 9px;background:#fff9eb;border:1px solid var(--gold);border-radius:9px;font-size:14px}
.cb-intentions{margin:6px 10px 0;color:var(--rose-d);font-size:13px}
.cb-intentions p{margin:2px 0}
.cb-details{margin:3px 12px;font-size:12px}
.cb-details ol{padding-left:1.3rem}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.tile{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px;text-align:left;color:var(--ink)}
.tile b{font-family:var(--f-title);display:block}
.tile small{display:block}
.tile .ua{aspect-ratio:2.2;display:grid;place-items:center;border-radius:6px;background:var(--rose-l);color:var(--rose-d);margin-bottom:5px;font:700 20px var(--f-title);overflow:hidden}
.rarity{background:var(--pill);padding:0 .35em;border-radius:.3em;font-weight:800}
.book-list{list-style:none;padding:0;margin:0}
.book-list li{padding:.65rem 0;border-bottom:1px solid var(--line)}
.map{width:100%;height:auto;display:block;border-radius:12px}
.t-frm{display:none}
.t-art.art-conquest-default{background:#c9a08d url(decor.webp) center/cover}
@media (max-height:720px) and (orientation:portrait){
  .unit .ua,.unit.ally .ua{aspect-ratio:1.85}
  .cb .row-label{margin:1px 0}
  .cb-panel .action-grid .sk{min-height:36px}
  .cb-panel .btn{min-height:42px}
}
.cb-panel > .btn{display:flex;width:100%}
.action-grid > .sk:only-child{grid-column:1/-1}
#view{background-position:center top;background-size:cover;background-attachment:fixed}
.chapter-illustration{display:block;width:100%;max-height:215px;object-fit:cover;border-radius:10px;margin-bottom:10px}
.portrait-card{display:block;width:min(160px,55%);border-radius:9px;margin:8px 0}
.gear-art{width:58px;height:58px;object-fit:cover;float:right;border-radius:7px}
.skill-icon{width:24px;height:24px;object-fit:cover;border-radius:5px;vertical-align:middle;margin-right:5px}
.t-art img{width:100%;height:100%;object-fit:cover}
.book-thumb{width:57px;height:34px;object-fit:cover;vertical-align:middle;margin-right:7px;border-radius:5px}

.guide{padding:.55rem .7rem;border:1px solid #d7b889;border-radius:.65rem;background:#fff9e9;color:#3e3430}
.guide-page{margin:.65rem .8rem}
.guide-hub .guide+.guide,.mode .guide{margin-top:.45rem}
.guide summary,.fight-guide summary{cursor:pointer;font-weight:700}
.guide summary small{margin-left:.25rem;font-weight:600;color:#765c43}
.guide ol{padding-left:1.35rem;margin:.55rem 0}
.guide li+li{margin-top:.35rem}
.guide .btn{min-height:38px;padding:.15rem .6rem}
.fight-guide{border-left:3px solid #bc8a4c;padding-left:.55rem}
.fight-guide p{margin:.3rem 0}
.equipment-guide{display:grid;gap:.45rem;min-width:0;margin:.35rem 0;padding:.45rem;border:1px solid #dac6b4;border-radius:.55rem}
.equipment-guide legend{font-weight:700}
.gear-slot{padding:.4rem;border-bottom:1px solid #e7d8ca}
.gear-slot:last-child{border-bottom:0}
.gear-slot p{margin:.2rem 0}

.level-gate {
    margin-top: 1rem;
    padding: .85rem;
    background: #f1dfcf;
    border-radius: .65rem;
    color: #412a26;
}
.dungeon-door {
    padding: .85rem 0;
    border-top: 1px solid #a987794d;
    scroll-margin-top: 1rem;
}
.dungeon-door label {
    display: block;
    margin-bottom: .65rem;
}
.maze-grid {
    display: grid;
    grid-template-columns: repeat(var(--maze-columns,9),minmax(0,1fr));
    gap: 2px;
    padding: 5px;
    border-radius: .5rem;
    background: #1e1a20;
}
.maze-cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: .22rem;
    background: #655251;
    color: #fff3dd;
    font: inherit;
    font-size: clamp(.61rem,3.25vw,1rem);
}
.maze-cell[data-tile-type="?"] { background: #231d25; }
.maze-cell[data-tile-type="#"] { background: #3e323b; }
.maze-cell[data-tile-type="T"] { color: #ffe194; }
.maze-cell.visited { background: #897067; }
button.maze-cell {
    border: 1px solid #f8db9b;
    background: #754750;
    cursor: pointer;
}
button.maze-cell:focus-visible { outline: 2px solid #fff2a1; }
.maze-cell.position {
    background: #f4d9a4;
    color: #422f34;
}
.maze-legend { font-size: .86rem; }
.maze-loot { margin-bottom: .65rem; }
.maze-arrows { display: grid; grid-template-columns: repeat(4,1fr); gap: .4rem; margin-top: .65rem; }
.maze-arrow.btn { min-height: 44px; padding: .35rem; font-size: 1.35rem; }
