:root{--bg:#102326;--surface:#193335;--surface2:#203d3d;--edge:#315155;--ink:#f0f6e9;--soft:#b0c6bf;--dim:#829a95;--mint:#b7f38f;--cream:#fff5db;--gold:#ffda75;--orange:#eeb66d;--shadow:0 18px 50px #03131780;--cell:50px;color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink)}body{background:radial-gradient(ellipse at 30% -30%,#234647 0,transparent 45%),var(--bg)}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,.tile:focus-visible{outline:3px solid var(--gold);outline-offset:2px}button,.button{transition:background .15s,transform .15s,border-color .15s}button:hover:not(:disabled){filter:brightness(1.09)}.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;padding:12px 21px;gap:18px;border-bottom:1px solid #2d4a4a;background:#10272ac4;position:relative;z-index:5}.brand{display:flex;align-items:center;gap:12px;flex-shrink:0}.brandmark{background:linear-gradient(145deg,#cef9a2,#81bfa2);color:#16433b;height:44px;width:44px;border-radius:13px;display:grid;place-items:center;font-size:27px;font-weight:900;box-shadow:inset -4px -4px 0 #29534625,0 0 0 4px #244440}.brand-name{font-weight:1000;font-size:23px;letter-spacing:-1.5px;line-height:1}.brand-name span{color:var(--mint)}.brand-sub{font-size:9px;letter-spacing:2px;font-weight:800;color:#80a89c;margin-top:7px}.top-center{display:flex;align-items:center;gap:9px;min-width:0}.top-divider{height:36px;width:1px;background:var(--edge);margin:0 13px}.eyebrow{font-size:10px;letter-spacing:1.7px;color:#a6c4b8;font-weight:900}.top-center select{background:#244341;border:1px solid #3f6560;color:#fff8e7;border-radius:9px;padding:10px 12px;max-width:235px}.top-actions{display:flex;align-items:center;gap:7px}.button,.iconbtn{border:1px solid #45625d;border-radius:10px;padding:11px 13px;background:#294342;color:#ebf5e9;font-size:12px;font-weight:800;white-space:nowrap}.button.primary{background:var(--mint);border-color:#bbf997;color:#18382e;box-shadow:0 5px 0 #5b8b60}.button.primary:hover{transform:translateY(-2px);box-shadow:0 7px 0 #5b8b60}.button.quiet{background:#1c3638}.button.tiny{padding:9px 10px}.button.danger{color:#ffd4b6}.iconbtn{font-size:18px;padding:6px 12px}.shell{display:grid;grid-template-columns:265px minmax(440px,1fr) 275px;gap:0;min-height:calc(100vh - 82px);height:calc(100vh - 82px)}.panel{background:#172f31;border-right:1px solid #2d4c4c;min-width:0}.rightpane{border-left:1px solid #2d4c4c;border-right:0;display:flex;flex-direction:column}.leftpane{display:flex;flex-direction:column;overflow:hidden}.section-top,.right-head{padding:24px 19px 15px}.section-title{font-size:21px;letter-spacing:-.8px;font-weight:950;margin:5px 0}.section-title span{color:var(--gold)}.section-top p,.right-head p{font-size:12px;color:var(--dim);line-height:1.6;margin:5px 0 0}.tool-tabs{padding:0 12px 14px;display:grid;grid-template-columns:1fr 1fr;gap:7px;border-bottom:1px solid #2a4c4d}.tool-tabs button{background:#203a3b;border:1px solid #345353;border-radius:10px;padding:12px 5px;font-size:12px;font-weight:800;color:#a6c6ba}.tool-tabs button.active{background:#c0ef9c;color:#18392f;border-color:#e3f7af;box-shadow:inset 0 -3px 0 #72aa65}.tools-content{overflow:auto;flex:1;padding:16px 13px 25px;scrollbar-color:#466360 transparent}.tool-title{font-weight:900;font-size:13px;margin:0 2px 6px}.tool-help{color:#829e97;font-size:11px;line-height:1.55;margin:0 2px 15px}.palette{display:grid;grid-template-columns:1fr 1fr;gap:8px}.palette-card{position:relative;min-height:92px;background:#244343;border:1px solid #42625b;border-radius:12px;text-align:left;padding:9px;color:var(--ink)}.palette-card.is-active{border-color:var(--mint);background:#31544a;box-shadow:0 0 0 2px #b7f38f3b}.palette-card .big-emoji{display:block;font-size:27px;line-height:33px}.palette-card strong{font-size:11px;display:block;margin-top:6px}.palette-card small{font-size:9px;color:#b1c5bc}.palette-card .selected-dot{position:absolute;top:8px;right:8px;color:var(--mint)}.poke-search{width:100%;border:1px solid #4b6a65;background:#102a2d;padding:11px;border-radius:10px;color:white;margin-bottom:11px;outline:none}.poke-filters{display:flex;gap:7px;margin-bottom:12px;flex-wrap:wrap}.poke-filters button{font-size:10px;background:#274443;border:1px solid #4b6961;border-radius:20px;color:#c3d3cd;padding:6px 10px}.poke-filters button.active{background:var(--mint);color:#14372d}.pokemon-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.poke-choice{border:1px solid #3c6159;border-radius:11px;background:#24403f;min-width:0;padding:6px 4px 8px;color:white;position:relative}.poke-choice.active{border-color:#b7f38f;box-shadow:0 0 0 2px #b7f38f55}.poke-choice img{display:block;width:66px;height:66px;object-fit:contain;margin:0 auto;filter:drop-shadow(0 5px 1px #0c1b1f80)}.poke-choice strong{display:block;font-size:11px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.poke-choice small{color:#a5bbb5;font-size:10px}.poke-choice .dex{position:absolute;right:7px;top:7px;font-size:9px;color:#849d98}.loadmore{width:100%;background:#244645;color:var(--mint);border:1px solid #476c64;margin-top:12px;border-radius:9px;padding:11px;font-weight:800;font-size:12px}.item-list{display:grid;gap:8px}.item-choice{display:flex;gap:10px;align-items:center;text-align:left;border:1px solid #42605d;background:#22403e;border-radius:10px;padding:8px;color:white}.item-choice.active{border-color:var(--mint);background:#31534a}.item-choice .item-icon{width:35px;height:35px;display:grid;place-items:center;background:#314e4b;border-radius:8px;font-size:22px}.item-choice strong{font-size:11px}.item-choice small{display:block;font-size:10px;color:#a4c0b7}.left-foot{margin-top:auto;border-top:1px solid #2a4d4d;background:#1c3938;padding:19px 17px}.tiny-title{color:var(--mint);font-size:10px;letter-spacing:1px;font-weight:900}.left-foot p{color:#a7c4b6;font-size:11px;line-height:1.6;margin:8px 0 12px}.autosave{color:#7da99d;font-size:10px;display:flex;gap:7px;align-items:center}.live-dot{height:7px;width:7px;border-radius:50%;background:#aff398;box-shadow:0 0 0 4px #aff39819}.centerpane{min-width:0;display:flex;flex-direction:column;padding:24px 25px 21px;gap:14px;overflow:hidden}.workspace-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.world-title{display:flex;gap:10px;align-items:center;font-size:27px;font-weight:1000;letter-spacing:-1px;margin-top:5px}.map-pill{font-size:9px;font-weight:1000;color:#1d3a2e;background:#b8e9a1;letter-spacing:1px;padding:5px 8px;border-radius:20px}.muted{color:#6d9a90;margin-left:9px}.subhead{font-size:12px;color:#91aca5;margin-top:4px}.canvas-actions{display:flex;gap:7px;align-items:center}.canvas-actions label{font-size:11px;color:#9ab9b1;display:flex;gap:6px;align-items:center}.canvas-actions input{accent-color:var(--mint);width:95px}.board-outer{flex:1;min-height:250px;border:1px solid #49614b;border-radius:17px;background:#17382e;box-shadow:var(--shadow),0 0 0 5px #142d2f;display:flex;flex-direction:column;overflow:hidden}.board-label{height:40px;flex:0 0 40px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(90deg,#38523d,#284c40);border-bottom:2px solid #67825b;color:#e2edc1;font-size:10px;letter-spacing:1px;font-weight:900;padding:0 15px}.board-label span:last-child{font-size:10px;color:#abc7ab;font-weight:500;letter-spacing:0}.board-scroller{flex:1;overflow:auto;scrollbar-color:#7fa67f #2f4a3e;background:radial-gradient(ellipse at 50% 50%,#395e49 0,#203d35 75%)}.board-deck{min-width:max-content;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.board{position:relative;display:grid;grid-template-columns:repeat(var(--cols),var(--cell));grid-auto-rows:var(--cell);border:7px solid #7e6240;outline:3px solid #b59a63;box-shadow:0 12px 0 #453e2c,0 19px 20px #05181799;background:#679654;touch-action:pan-x pan-y}.tile{width:var(--cell);height:var(--cell);border:1px solid #14302211;position:relative;display:grid;place-items:center;overflow:visible;user-select:none;cursor:crosshair;isolation:isolate;padding:0;color:inherit;border-radius:0}.tile .terrain-detail{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:calc(var(--cell)*.38);opacity:.65;pointer-events:none;text-shadow:0 2px 1px #0e442866}.tile.g{background:linear-gradient(130deg,#8ec777,#71b46b)}.tile.g:nth-child(3n){background:linear-gradient(35deg,#80ba69,#8ac470)}.tile.t{background:linear-gradient(135deg,#629f56,#4f8d54)}.tile.t .terrain-detail{font-size:calc(var(--cell)*.42);opacity:1;filter:drop-shadow(0 2px 1px #24643a)}.tile.p{background:linear-gradient(135deg,#d7b88c,#caa677)}.tile.p .terrain-detail{opacity:.28;font-size:12px}.tile.f{background:linear-gradient(115deg,#3e8057,#2c6b4e)}.tile.f .terrain-detail{font-size:calc(var(--cell)*.8);opacity:1;filter:drop-shadow(1px 3px 1px #173d32)}.tile.w{background:repeating-linear-gradient(140deg,#4da8b9 0,#4da8b9 8px,#58bfd0 9px,#58bfd0 14px)}.tile.w .terrain-detail{opacity:.65;color:#eaf8f2}.tile.s{background:repeating-linear-gradient(20deg,#f4de9d 0,#f4de9d 10px,#eed38a 11px,#eed38a 14px)}.tile.r{background:linear-gradient(120deg,#999f86,#737f77)}.tile.r .terrain-detail{font-size:calc(var(--cell)*.62);opacity:.9}.tile.h{background:linear-gradient(135deg,#92c978,#7dbb6b)}.tile.h .terrain-detail{opacity:.9}.tile:hover{z-index:15;box-shadow:inset 0 0 0 3px #fff4b8}.tile.selected{z-index:14;box-shadow:inset 0 0 0 3px #ffef91}.tile .object-stack{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}.object{position:absolute;display:grid;place-items:center;width:100%;height:100%;inset:0;filter:drop-shadow(1px 3px 2px #0b29276e);pointer-events:none}.object.building{font-size:calc(var(--cell)*.67);transform:translateY(-8px);filter:drop-shadow(2px 7px 1px #16331d66)}.object.building:before{content:'';position:absolute;bottom:1px;left:9%;width:82%;height:18%;background:#3e5e37;transform:skewX(-30deg);border-radius:50%}.object.building span{z-index:1}.object.building i{position:absolute;bottom:1px;background:#183a33;border:2px solid #f4e7be;border-radius:9px;font:900 7px system-ui;letter-spacing:.2px;padding:2px 3px;white-space:nowrap;z-index:2;color:#fff}.object.pokemon{transform:translateY(-13px)}.object.pokemon img{height:calc(var(--cell)*1.28);width:calc(var(--cell)*1.28);object-fit:contain;z-index:2;filter:drop-shadow(0 3px 0 #13383088)}.object.pokemon:after{content:'';position:absolute;bottom:3px;left:17%;width:66%;height:13px;border:3px solid #f0da89;background:#60766a;border-radius:50%;z-index:1;box-shadow:0 3px 0 #334c38}.object.item{font-size:calc(var(--cell)*.55);transform:translateY(-5px);filter:drop-shadow(0 5px 0 #315431)}.object.pokemon:before,.object.item:before{content:'✦';position:absolute;right:1px;top:0;color:#fff0a6;font-size:11px;z-index:6}.object.marked{box-shadow:inset 0 0 0 3px #ffe87b}.hidden-marker{position:absolute;bottom:0;right:1px;background:#102b2b;border:1px solid #dff5ac;color:#e3f4ae;font:900 8px system-ui;border-radius:20px;padding:1px 3px}.board-footer{height:38px;flex:0 0 38px;display:flex;align-items:center;justify-content:space-between;padding:0 15px;color:#acc7af;font-size:10px;background:#284333;border-top:1px solid #567552}.legend{display:flex;gap:13px}.legend span{display:flex;align-items:center;gap:6px}.legend-square{width:9px;height:9px;border-radius:2px;background:#8ec777}.legend-square.two{background:#487d48}.legend-square.three{background:#f3cc75}.board-coord{letter-spacing:.7px}.statsbar{display:grid;grid-template-columns:repeat(4,1fr);background:#203a37;border:1px solid #3b5953;border-radius:13px;padding:13px 5px;gap:3px}.statsbar>div{display:grid;grid-template-columns:auto auto;justify-content:center;align-items:center;gap:0 8px;border-right:1px solid #405c55}.statsbar>div:last-child{border:0}.stat-icon{grid-row:span 2;font-size:25px}.statsbar strong{font-size:19px;line-height:20px}.statsbar small{font-size:10px;color:#93aca2}.inspector{padding:12px 17px 20px;flex:1;overflow:auto}.inspector-empty{text-align:center;border:1px dashed #547067;border-radius:14px;padding:24px 9px;margin:10px 0;color:#9eb7ae}.inspector-empty .oversized{font-size:57px;margin:0 0 12px}.inspector-empty strong{display:block;color:#eaf2dc;margin:6px}.inspector-empty p{font-size:12px;line-height:1.6}.detail-card{background:#22403e;border:1px solid #45635a;padding:13px;border-radius:13px}.detail-head{display:flex;gap:12px;align-items:center;margin-bottom:16px}.detail-head .symbol{font-size:32px;background:#35534b;border-radius:10px;width:54px;height:54px;display:grid;place-items:center}.detail-head img{width:62px;height:62px;object-fit:contain;filter:drop-shadow(0 4px 3px #0f2427)}.detail-head strong{font-size:15px;display:block}.detail-head small{color:#a1bcb4;font-size:11px}.field-label{font-size:11px;font-weight:800;color:#a9c9b7;display:block;margin:14px 0 6px}.text-field,.field-select,.number-field,textarea.text-field{background:#132c2d;border:1px solid #4a6c62;border-radius:9px;color:#f4f9e8;width:100%;padding:10px;outline:none;font-size:12px}.text-field:focus,.field-select:focus,.number-field:focus{border-color:#b1e593}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.inspector p{font-size:12px;line-height:1.55;color:#9fbbb0}.secret-banner{background:#2f493e;border:1px dashed #c7cf8c;border-radius:9px;color:#deefad;font-size:11px;padding:10px;margin:13px 0}.action-row{display:flex;gap:7px;margin-top:14px}.action-row .button{flex:1;padding:9px 8px;white-space:normal}.quicktip{display:flex;gap:10px;margin:18px 16px;background:#2a443f;border:1px solid #4b6c55;border-radius:12px;padding:12px}.tip-star{color:var(--gold);font-size:19px}.quicktip strong{font-size:12px}.quicktip p{font-size:11px;line-height:1.5;color:#adbbac;margin:7px 0 0}.toast{position:fixed;z-index:2200;bottom:25px;left:50%;transform:translate(-50%,110px);background:#f5f1d6;color:#1b3832;border:2px solid #8bb885;border-radius:12px;padding:13px 18px;font-weight:800;font-size:12px;box-shadow:0 9px 35px #071c1c88;opacity:0;transition:transform .25s,opacity .25s;max-width:min(460px,90vw);text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}.overlay{position:fixed;z-index:1000;inset:0;background:#0e2427;overflow:auto}.hidden{display:none!important}.play-shell{min-height:100%;display:flex;flex-direction:column}.play-top{display:flex;justify-content:space-between;align-items:center;padding:14px 22px;gap:10px;background:#122d30;border-bottom:1px solid #45615b}.brand.mini .brandmark{width:37px;height:37px;font-size:21px}.brand.mini .brand-name{font-size:20px}.play-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.player-chooser{display:flex;gap:6px}.player-chooser button{border:1px solid #5b7770;border-radius:9px;padding:10px;color:#c0d2c5;background:#25433c;font-weight:800;font-size:12px}.player-chooser button.active{color:#19352b;background:#c7eea8}.play-columns{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;padding:22px;flex:1;min-height:0}.play-map-area{min-width:0}.play-banner{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:0 5px 15px}.play-banner h2{font-size:25px;margin:4px 0 5px}.play-banner p{font-size:12px;color:#a9c3b7;margin:0}.badge-shelf{color:var(--gold);font-size:13px}.play-board-wrap{background:#254236;border:1px solid #536c4c;border-radius:17px;padding:22px;overflow:auto;display:flex;justify-content:center;align-items:center;min-height:400px;box-shadow:var(--shadow)}.play-board-wrap .board{--cell:clamp(31px,3.3vw,54px)}.play-board-wrap .tile{cursor:pointer}.play-instructions{font-size:12px;color:#adc7b6;margin:16px 8px}.play-sidebar{display:flex;flex-direction:column;gap:13px;min-width:0}.player-card,.encounter-card,.play-log{background:#213c3a;border:1px solid #45655c;border-radius:13px;padding:15px}.player-card-header{display:flex;justify-content:space-between;align-items:center}.player-card-header h3{margin:0;font-size:19px}.player-card-header .coins{background:#3f4e35;border:1px solid #899353;border-radius:20px;padding:7px 9px;color:#ffe297;font-weight:900;font-size:12px}.trainer-tools{display:flex;gap:7px;margin:12px 0;flex-wrap:wrap}.trainer-tools button,.small-action{border:1px solid #456b61;background:#305349;border-radius:9px;padding:8px 10px;color:#e5f6de;font-size:11px;font-weight:800}.pokemon-party{display:flex;gap:8px;overflow:auto;margin-top:10px}.party-mon{min-width:88px;flex:0 0 88px;text-align:center;border-radius:11px;border:1px solid #4b6e5b;background:#2b4c46;padding:7px;cursor:pointer}.party-mon.active{border-color:var(--gold);background:#3b584a}.party-mon img{width:58px;height:58px;object-fit:contain}.party-mon strong{font-size:10px;display:block}.party-mon small{color:#c1d6c6;font-size:9px}.bag-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.bag-chip{border:1px solid #507166;border-radius:8px;background:#284740;padding:5px 7px;font-size:10px;color:#d3e7d6}.encounter-card h3{font-size:17px;margin:0 0 8px}.encounter-card p{font-size:12px;line-height:1.6;color:#b9cfbd}.encounter-art{height:140px;display:grid;place-items:center;position:relative;background:radial-gradient(ellipse at 50% 70%,#6b987a 0,#345e56 40%,#1c383a 80%);border-radius:12px;border:1px solid #58755c;margin-bottom:11px}.encounter-art img{width:145px;height:137px;object-fit:contain;filter:drop-shadow(0 9px 1px #1c3838aa);animation:bob 2s ease-in-out infinite}.encounter-art:after{content:'';height:9px;width:90px;background:#16312a77;border-radius:50%;position:absolute;bottom:12px;left:calc(50% - 45px)}@keyframes bob{50%{transform:translateY(-7px)}}.roll-input{display:flex;align-items:center;gap:8px;margin:11px 0}.roll-input input{max-width:75px;background:#102b2e;border:2px solid #a6d58f;border-radius:9px;padding:12px;font-size:20px;font-weight:900;text-align:center;color:#fff}.play-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.play-action-grid .button{white-space:normal;min-height:46px}.play-log{flex:1;min-height:100px;max-height:230px;overflow:auto}.play-log h3{font-size:12px;letter-spacing:1px;color:#c0d4c4;margin:0 0 10px}.log-line{font-size:11px;color:#bfd1c4;line-height:1.45;padding:8px 0;border-top:1px solid #38544c}.market-row{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:8px 0;border-bottom:1px solid #3b5e53;padding-bottom:7px}.market-row .nm{font-size:11px}.market-row button{border:1px solid #8bb681;background:#c8efaa;color:#17362d;font-size:11px;border-radius:7px;font-weight:800;padding:8px}.hp-track{height:8px;background:#142d2b;border-radius:15px;overflow:hidden;margin:5px 0 8px}.hp-fill{height:100%;background:linear-gradient(90deg,#9de68d,#c8ef9f)}.modal-wrap{position:fixed;z-index:2000;inset:0;display:grid;place-items:center;background:#031916bb;padding:20px}.modal-card{width:min(440px,96vw);background:#24413f;border:1px solid #85a479;border-radius:17px;padding:19px;box-shadow:var(--shadow)}.modal-header{display:flex;align-items:center;justify-content:space-between}.modal-header h2{font-size:20px;margin:0}.round-close{border:0;background:#34574c;color:#d8f1db;font-size:25px;width:34px;height:34px;border-radius:50%}.modal-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:18px}.modal-card p{font-size:12px;color:#a8c4b7;line-height:1.6}.modal-card .field-label{margin-top:14px}.modal-card input{font-size:14px}.divider{height:1px;background:#426259;margin:15px 0}.mini-label{font-size:10px;font-weight:900;color:#a9c0b8;letter-spacing:1px;margin-bottom:7px}
@media(max-width:1220px){.shell{grid-template-columns:225px minmax(380px,1fr) 235px}.centerpane{padding:19px 13px}.top-center .eyebrow{display:none}.top-actions .quiet{padding:8px}.right-head,.section-top{padding-left:13px;padding-right:13px}.inspector{padding-left:10px;padding-right:10px}}@media(max-width:1030px){.shell{grid-template-columns:230px minmax(380px,1fr)}.rightpane{display:none}.topbar{flex-wrap:wrap;height:auto}.top-center .top-divider{display:none}.centerpane{height:calc(100vh - 100px)}}@media(max-width:680px){.topbar{padding:13px;gap:11px}.top-actions{width:100%;justify-content:space-between}.top-actions .button{padding:9px 7px;font-size:11px}.top-center{flex:1;justify-content:flex-end}.top-center select{max-width:170px}.shell{display:block;height:auto}.leftpane{border-right:0}.section-top{padding:15px 13px 6px}.section-top p{display:none}.tool-tabs{display:flex;gap:5px;overflow:auto;padding:8px 12px}.tool-tabs button{white-space:nowrap;padding:9px}.tools-content{max-height:260px;overflow:auto}.palette{grid-template-columns:repeat(4,1fr)}.palette-card{min-height:72px}.left-foot{display:none}.centerpane{height:640px;padding:13px}.world-title{font-size:21px}.canvas-actions label{display:none}.canvas-actions .danger{display:none}.board-deck{padding:12px}.board{--cell:38px!important}.board-label span:last-child{display:none}.legend{gap:6px}.legend span{font-size:9px}.statsbar small{font-size:9px}.play-top{flex-wrap:wrap;padding:12px}.play-columns{display:block;padding:10px}.play-board-wrap{min-height:330px;padding:12px;justify-content:flex-start}.play-board-wrap .board{--cell:36px!important}.play-sidebar{margin-top:14px}.player-chooser button{padding:8px}.play-top .button{padding:8px;font-size:10px}.play-banner h2{font-size:21px}} 

/* Keep clear placeholder standees visible until online 3D-renders finish loading. */
.object.pokemon img+span{position:absolute;left:0;right:0;top:13px;text-align:center;z-index:1;pointer-events:none}.object.pokemon img{position:relative;z-index:2}.poke-choice{position:relative}.poke-choice img+span{position:absolute;top:20px;left:0;right:0;text-align:center;z-index:0;pointer-events:none}.poke-choice img{position:relative;z-index:1}.party-mon{position:relative}.party-mon img+span{position:absolute;top:16px;left:0;right:0;text-align:center;z-index:0;pointer-events:none}.party-mon img{position:relative;z-index:1}.encounter-art img+span{position:absolute;top:35px;left:0;right:0;text-align:center;z-index:0;pointer-events:none}.encounter-art img{position:relative;z-index:1}.detail-head img+span{position:absolute;left:20px;top:16px;pointer-events:none}

.sprite-fallback{font-size:calc(var(--cell)*.46);line-height:1}.poke-choice .sprite-fallback{font-size:37px}.party-mon .sprite-fallback{font-size:34px}.encounter-art .sprite-fallback{font-size:70px}.detail-head .sprite-fallback{font-size:35px}

/* V2: locally bundled, illustrated 2.5D buildings & real Poké Ball loot */
.board{isolation:isolate}
.building-model{position:absolute;left:calc(var(--cell)*var(--left));top:calc(var(--cell)*(var(--top) - .93));width:calc(var(--cell)*var(--wide));height:calc(var(--cell)*(var(--high) + .93));display:flex;align-items:center;justify-content:center;pointer-events:none;filter:drop-shadow(0 7px 3px #153b2885)}
.building-model img{display:block;width:111%;height:110%;max-width:none;object-fit:contain;user-select:none;pointer-events:none}
.building-model .building-plaque{position:absolute;bottom:calc(var(--cell)*.01);left:50%;transform:translateX(-50%);white-space:nowrap;border:1.5px solid #ebda9b;background:linear-gradient(#20463f,#14332f);padding:3px 7px;border-radius:8px;color:#fbefd0;font-size:clamp(8px,calc(var(--cell)*.18),11px);line-height:1.15;font-weight:900;max-width:110%;text-overflow:ellipsis;overflow:hidden;box-shadow:0 3px 0 #09241c8a}
.building-model.sign .building-plaque{display:none}
.building-model.is-selected img{filter:drop-shadow(0 0 7px #fbea7b)}
.building-model.is-selected .building-plaque{background:#bca44e;color:#142e2f}
.board .tile.selected{box-shadow:inset 0 0 0 2px #ffe77b}
.object.item{transform:translateY(-7px)}
.object.item .ball-model{width:calc(var(--cell)*.9);height:calc(var(--cell)*.9);object-fit:contain;z-index:3;filter:drop-shadow(0 5px 2px #1f3b28ab);animation:ball-bob 2.6s ease-in-out infinite}
@keyframes ball-bob{50%{transform:translateY(-3px)}}
.object.item:before{content:''}
.object.item .hidden-marker{z-index:4;bottom:-7px;font-size:7px}
.tool-building-thumb{width:95%;height:56px;object-fit:contain;margin:-7px auto -3px;filter:drop-shadow(0 5px 2px #001a1b66)}
.detail-head img.detail-building-thumb{width:75px;height:70px;object-fit:contain;background:#35534b;border-radius:10px}
.detail-head img.detail-ball-thumb{width:52px;height:52px;object-fit:contain;background:#35534b;border-radius:10px;padding:4px}
.visibility-choice{display:flex;align-items:center;gap:9px;color:#edffdb;font-size:11px;line-height:1.4;padding:10px 8px;background:#2b4b42;border:1px solid #64846d;border-radius:8px;margin:13px 0 7px}
.visibility-choice input{width:18px;height:18px;accent-color:#c9e5a6;flex-shrink:0}
.loot-reveal{display:grid;place-items:center;height:125px;margin-bottom:5px;background:radial-gradient(ellipse,#507b61 0,transparent 68%)}
.loot-reveal img{width:115px;height:115px;object-fit:contain;filter:drop-shadow(0 12px 5px #10251faa)}
@media(max-width:680px){.tool-building-thumb{height:43px}.building-model .building-plaque{font-size:8px;padding:2px 4px}}

/* v3: editable research laboratory, starter display and doorway */
.tile.i {background:repeating-linear-gradient(0deg,#eee6d0 0,#eee6d0 23px,#d7cebb 24px,#eee6d0 25px)}
.tile.a {background:linear-gradient(145deg,#67929a,#3a6573);border:1px solid #274a59}
.tile.a .terrain-detail{opacity:.26}
.tile.c{background:repeating-linear-gradient(90deg,#428fbb,#428fbb 12px,#3479a0 13px,#3479a0 24px)}
.tile.d{background:linear-gradient(180deg,#e2b685 0%,#c9925d 30%,#97673f 32%,#6a513d 100%);box-shadow:inset 0 3px 0 #f5dbac}
.tile.i .terrain-detail,.tile.d .terrain-detail{color:#51717e;text-shadow:none}
.building-model.lab img{width:110%;height:112%}
.lab-object{transform:translateY(-6px);position:absolute;z-index:7}
.lab-object.lab-starter{transform:translateY(-12px)}
.lab-object .ball-model{width:calc(var(--cell)*.93);height:calc(var(--cell)*.93);object-fit:contain;filter:drop-shadow(0 5px 2px #1d3e49);animation:ball-bob 2.7s ease-in-out infinite}
.lab-object small{position:absolute;bottom:-9px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:calc(var(--cell)*.17);font-weight:900;color:#fff6cc;background:#24494cdd;border:1px solid #c8dbb9;border-radius:5px;padding:1px 3px;z-index:9}
.lab-object b{font-size:calc(var(--cell)*.75);filter:drop-shadow(0 3px 2px #122f30);line-height:1}
.lab-starter:before{content:'';position:absolute;bottom:0;left:7%;width:86%;height:18%;border-radius:50%;background:#50706f;border:2px solid #ffe3a9;box-shadow:0 4px 2px #25494c}
.lab-edit-btn{display:block;width:100%;white-space:normal;margin:14px 0}
.starter-notice{background:#384c46;border:1px solid #a1be7f;color:#fff1be;border-radius:9px;font-size:11px;line-height:1.5;padding:10px;margin:12px 0}
.starter-earned{font-size:11px;color:#e8d99c;margin:6px 0}
.starter-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:12px 0}
.starter-gallery>div{background:#33584f;border:1px solid #59826a;border-radius:10px;text-align:center;padding:6px 2px}
.starter-gallery img{width:75px;height:77px;max-width:100%;object-fit:contain}
.starter-gallery strong{display:block;font-size:10px}
.starter-gallery .sprite-fallback{font-size:30px}
.starter-art img{width:150px;height:140px;object-fit:contain}
@media(max-width:680px){.tool-tabs{flex-wrap:wrap}.tool-tabs button{font-size:10px}}

/* v4 Trainer Studio — touch-first live vector avatar creator */
.studio-top-button{background:#395d72;border-color:#7bacc0;color:#f8fbff}
.creator-overlay{position:fixed;inset:0;z-index:1500;background:#0a2328f0;display:flex;justify-content:center;align-items:center;padding:18px;overflow:auto;color:#1D3642}
.creator-overlay.hidden{display:none}
.creator-shell{width:min(1120px,100%);max-height:min(920px,calc(100dvh - 32px));background:#fffbef;overflow:hidden;border:6px solid #d5f1c9;border-radius:28px;box-shadow:0 28px 0 #0002,0 40px 90px #001817b8;display:flex;flex-direction:column}
.creator-topbar{min-height:70px;padding:12px 25px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:#f6fff1;border-bottom:2px solid #d8e9d2}
.creator-brand{display:flex;align-items:center;gap:10px}.creator-brand-star{background:#27504a;color:#c7f4a4;border-radius:11px;width:40px;height:40px;display:grid;place-items:center;font-size:24px}.creator-brand strong{display:block;font-size:17px;font-weight:1000;letter-spacing:-.7px;color:#214c47}.creator-brand small{font-size:9px;font-weight:900;letter-spacing:2px;color:#60908c}
.creator-tabs{display:flex;gap:7px;background:#e2eee0;border-radius:30px;padding:4px}.creator-tabs button{padding:10px 18px;border:0;border-radius:30px;background:transparent;color:#526e68;font-weight:900;font-size:12px}.creator-tabs button.active{background:#2C695E;color:#faffed;box-shadow:0 2px 0 #1c4c40}
.creator-close{border:0;border-radius:50%;background:#e4eee0;color:#47645d;font-size:17px;width:42px;height:42px}
.creator-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(440px,1.03fr);min-height:0;flex:1;overflow:hidden}
.creator-stage{background:linear-gradient(160deg,#bce7db 0%,#d8efff 49%,#f8ecbe 100%);padding:26px 36px 22px;position:relative;overflow:hidden;display:flex;flex-direction:column;min-height:500px}
.creator-stage-header{position:relative;z-index:4}.creator-step{font-size:10px;letter-spacing:2.5px;font-weight:950;color:#367d6d}.creator-stage-header h2{font-size:clamp(31px,3vw,43px);margin:12px 0 6px;line-height:1.07;font-weight:1000;letter-spacing:-1.5px;color:#24484d}.creator-stage-header h2 em{color:#4f9b7f;font-style:normal}.creator-stage-header p{font-size:13px;font-weight:600;color:#4e7676;margin:6px 0}
.creator-art-scene{position:relative;display:grid;place-items:center;flex:1;min-height:230px;isolation:isolate}.creator-sun{position:absolute;width:122px;height:122px;right:9%;top:1%;background:#fff3b4;border:13px solid #fff7c978;border-radius:50%;filter:blur(.4px)}.creator-hill{position:absolute;width:120%;height:46%;border-radius:50% 50% 0 0;left:-10%;bottom:-8%;background:#98cda5;z-index:-1}.creator-hill-two{bottom:-29%;left:25%;background:#69af8c;transform:rotate(-10deg)}.creator-ring{position:absolute;width:min(280px,68%);aspect-ratio:1;border:17px solid #f7fff075;background:#ffffff34;border-radius:50%;top:0;box-shadow:0 0 0 12px #ffffff22}.creator-portrait{position:relative;z-index:4;height:min(330px,100%);width:100%;display:grid;place-items:end center;filter:drop-shadow(0 11px 3px #335a4f28)}.trainer-illustration{width:100%;height:100%;display:block}.creator-portrait svg{width:min(290px,100%);height:100%}.creator-ground{position:absolute;bottom:0;width:75%;height:16px;background:#2e5a4c2e;border-radius:50%;filter:blur(5px)}
.creator-player-bar{position:relative;z-index:4;display:flex;align-items:center;gap:12px;background:#ffffffd9;border:2px solid #f9ffef;border-radius:17px;padding:7px 13px;min-height:75px;box-shadow:0 7px 22px #35735b18}.creator-minitoken{width:48px;height:56px;background:#b6dec8;border-radius:11px;overflow:hidden;display:grid;place-items:center;flex-shrink:0}.creator-minitoken svg{height:66px;width:55px;transform:translateY(5px)}.creator-player-bar span{display:block;font-size:10px;font-weight:900;letter-spacing:1px;color:#4b887b}.creator-player-bar strong{display:block;font-size:18px;font-weight:1000;color:#284448;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}.creator-ready{margin-left:auto;background:#e6f3cc;border-radius:22px;padding:8px 10px;font-size:9px!important;color:#397556!important;white-space:nowrap}
.creator-customize{background:#fffdf5;display:flex;flex-direction:column;overflow:hidden}.creator-customize-header{padding:24px 30px 13px;display:flex;justify-content:space-between;align-items:center}.creator-customize-header h2{font-size:27px;letter-spacing:-1.2px;margin:5px 0 0;color:#244d48}.creator-sparkle{font-size:33px;color:#e7b94c}
.creator-controls{padding:0 30px 20px;overflow:auto;min-height:0;flex:1;scrollbar-color:#afcbbb transparent}.creator-block{padding:14px 0 18px;border-bottom:1px solid #e5ebdd}.creator-label{font-size:10px;letter-spacing:1.1px;font-weight:1000;color:#2C7566;margin-bottom:12px;display:flex;align-items:center;gap:8px}.creator-label span{background:#DBEFE4;border-radius:7px;padding:5px 8px;color:#408774}.creator-field-label{display:block;color:#48645b;font-weight:850;font-size:12px;margin:8px 0 10px}.creator-name-input{background:#fff;border:2px solid #b0cec1;color:#26483f;border-radius:13px;padding:14px 15px;font-size:17px;font-weight:900;width:100%;outline-offset:3px}.creator-name-input:focus{border-color:#3c987a;outline:none;box-shadow:0 0 0 3px #95d8bd70}.creator-style-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.creator-style{border:2px solid #d2e1d3;border-radius:11px;background:#f3f8ec;padding:11px 5px;color:#58736c;font-size:12px;font-weight:900}.creator-style.active{background:#c9efdc;border-color:#4b9d80;color:#1b644d;box-shadow:inset 0 -3px #82c7a5}
.creator-color-group{padding:9px 0}.creator-swatch-row{display:flex;gap:9px;flex-wrap:wrap}.creator-swatch{border:3px solid transparent;border-radius:50%;background:var(--swatch);width:38px;height:38px;display:grid;place-items:center;box-shadow:inset 0 0 0 2px #ffffff99,0 2px 4px #253b362a}.creator-swatch.active{outline:3px solid #316f60;outline-offset:2px}.creator-swatch span{font-size:20px;color:#fff;text-shadow:0 1px 4px #14221b;font-weight:900}
.creator-actions{padding:16px 27px 21px;display:flex;justify-content:flex-end;gap:12px;background:#f2f7eb;border-top:2px solid #e1e9dc}.creator-actions .button{font-size:14px;padding:14px 20px}.creator-actions .button.quiet{color:#436760;background:#fff;border-color:#b8d5bc}.creator-actions .button.primary{background:#b8ed91;border-color:#83c96d;color:#24503d}
.trainer-identity{display:flex;align-items:center;gap:8px;min-width:0}.trainer-card-avatar{height:58px;width:50px;overflow:hidden;border-radius:9px;background:linear-gradient(#b3ddd7,#f0eec1);border:2px solid #b2daca;flex-shrink:0}.trainer-card-avatar svg{height:63px;width:52px;transform:translateY(3px)}.trainer-edit-avatar{border:1px solid #84baaf;background:#315f59;color:#d7f9d3;border-radius:9px;padding:7px;margin-top:6px;font-size:10px;font-weight:900}.trainer-chooser-icon{display:inline-flex;width:26px;height:30px;overflow:hidden;border-radius:7px;background:#b8dcce;vertical-align:middle;margin-right:6px}.trainer-chooser-icon svg{height:35px;min-width:28px;width:28px;transform:translateY(1px)}
.trainer-map-token{position:absolute;width:calc(var(--cell)*1);height:calc(var(--cell)*1.4);transform:translateY(calc(var(--cell)*-.45));pointer-events:none;display:flex;flex-direction:column;align-items:center;justify-content:end}.trainer-map-art{height:calc(var(--cell)*1.14);width:calc(var(--cell)*.97);border-radius:50%;background:#e9ffdf70;box-shadow:0 0 0 2px #f2edd0,0 5px 3px #1e332a7a;overflow:hidden}.trainer-map-art svg{width:100%;height:100%;object-fit:contain}.trainer-map-name{font-size:calc(var(--cell)*.14);font-weight:1000;white-space:nowrap;color:#fff5df;padding:1px 4px;border-radius:5px;background:#28564fd9;max-width:calc(var(--cell)*1.7);text-overflow:ellipsis;overflow:hidden}.trainer-map-token.active .trainer-map-art{box-shadow:0 0 0 3px #ffe58b,0 7px 4px #163325ba}
@media(max-width:760px){.creator-overlay{padding:0;align-items:stretch}.creator-shell{height:100dvh;max-height:none;border:0;border-radius:0;width:100%}.creator-topbar{padding:11px 13px;min-height:60px}.creator-tabs button{padding:8px 10px;font-size:11px}.creator-brand strong{font-size:13px}.creator-brand small{font-size:8px}.creator-brand-star{width:33px;height:33px}.creator-close{width:36px;height:36px}.creator-main{display:block;overflow:auto}.creator-stage{min-height:320px;max-height:390px;padding:14px 19px 12px}.creator-stage-header h2{font-size:28px;margin:7px 0}.creator-stage-header p{font-size:11px}.creator-art-scene{height:160px;min-height:145px;max-height:175px}.creator-portrait{height:190px}.creator-ring{width:195px;border-width:11px}.creator-player-bar{min-height:50px;padding:5px 10px}.creator-minitoken{width:34px;height:40px}.creator-minitoken svg{height:48px;width:37px}.creator-player-bar strong{font-size:14px}.creator-ready{font-size:8px!important}.creator-customize{overflow:visible}.creator-customize-header{padding:19px 17px 4px}.creator-customize-header h2{font-size:24px}.creator-controls{overflow:visible;padding:0 17px}.creator-actions{position:sticky;bottom:0;z-index:5;padding:9px 13px;box-shadow:0 -3px 14px #193b3019}.creator-actions .button{font-size:13px;padding:12px}.creator-swatch{width:38px;height:38px}.top-actions{flex-wrap:wrap}}
@media(min-width:761px) and (max-height:740px){.creator-shell{max-height:calc(100dvh - 12px)}.creator-stage{min-height:400px}.creator-stage-header h2{font-size:31px}.creator-portrait{height:285px}.creator-controls{padding-bottom:8px}.creator-block{padding:8px 0 10px}}

/* v5 — high detail standing tabletop miniatures with real directional walk cycles */
.trainer-map-token.pf-3d-mini{
 width:calc(var(--cell)*1.6);height:calc(var(--cell)*2.45);
 margin:0;padding:0;display:flex;flex-direction:column;justify-content:flex-end;
 align-items:center;pointer-events:none;background:none;
 transform:translate(-50%,-58%);transform-origin:center 80%;
 filter:drop-shadow(0 5px 3px #123a287d);overflow:visible;
}
.pf-mini-base{display:block;position:relative;width:calc(var(--cell)*1.6);height:calc(var(--cell)*2.24);overflow:visible;flex-shrink:0;}
.pf-mini-pose{width:100%;height:100%;position:absolute;left:0;top:0;object-fit:contain;image-rendering:auto;pointer-events:none;user-select:none;}
.pf-mini-pose.mini-step{opacity:0}
.pf-mini-shadow{position:absolute;left:10%;right:10%;bottom:5%;height:10%;background:#153d2599;border-radius:50%;filter:blur(6px)}
.pf-mini-active-ring{position:absolute;left:5%;right:5%;bottom:5%;height:19%;border-radius:50%;border:3px solid #76cfff;box-shadow:0 0 8px 3px #46dcffbb,0 0 20px #48cfff66;opacity:0;}
.trainer-map-token.pf-3d-mini.active .pf-mini-active-ring{opacity:1;animation:pfPulse 1.8s ease-in-out infinite;}
.trainer-map-token.pf-3d-mini .trainer-map-name{background:linear-gradient(#255c50,#15382e);color:#fff8d8;font-size:clamp(9px,calc(var(--cell)*.20),13px);font-weight:1000;border:1px solid #e1c379a6;box-shadow:0 2px 4px #15261b8e;text-shadow:0 1px 1px #09140e;letter-spacing:.1px;padding:2px 7px;max-width:calc(var(--cell)*2.3);line-height:1.12;}
.trainer-map-token.pf-3d-mini.moving .mini-step{animation:pfMiniStep .27s steps(1,end) infinite;}
.trainer-map-token.pf-3d-mini.moving .mini-idle{animation:pfMiniIdle .27s steps(1,end) infinite;}
.trainer-map-token.pf-3d-mini.moving .pf-mini-base{animation:pfMiniBounce .27s ease-in-out infinite;}
.trainer-map-token.pf-3d-mini.before-move{transform:translate(calc(-50% + var(--cell)*var(--move-x)),calc(-58% + var(--cell)*var(--move-y)));}
@keyframes pfMiniStep{0%,49%{opacity:0}50%,100%{opacity:1}}
@keyframes pfMiniIdle{0%,49%{opacity:1}50%,100%{opacity:0}}
@keyframes pfMiniBounce{0%,100%{translate:0 0}50%{translate:0 -3px}}
@keyframes pfPulse{0%,100%{opacity:.9;filter:brightness(1)}50%{opacity:1;filter:brightness(1.4)}}
@media(prefers-reduced-motion:reduce){.trainer-map-token.pf-3d-mini,.trainer-map-token.pf-3d-mini *{animation:none!important;transition:none!important}}

/* v5 polish — legible tabletop scale, readable nameplates, trainer studio mini preview */
.trainer-map-token.pf-3d-mini{width:calc(var(--cell)*2);height:calc(var(--cell)*2.82)}
.pf-mini-base{width:calc(var(--cell)*2);height:calc(var(--cell)*2.58)}
.trainer-map-token.pf-3d-mini[data-slot="1"] .trainer-map-name{transform:translateX(-17px)}
.trainer-map-token.pf-3d-mini[data-slot="2"] .trainer-map-name{transform:translateX(17px)}
.creator-tabletop-mini{position:absolute;right:5px;bottom:6px;z-index:5;width:120px;min-height:142px;display:flex;align-items:center;flex-direction:column;justify-content:end;pointer-events:none;}
.creator-tabletop-mini img{width:120px;height:120px;object-fit:contain;filter:drop-shadow(0 4px 2px #21483a8c)}
.creator-tabletop-mini span{font-size:8px;letter-spacing:.5px;background:#1f594ddb;color:#f6fff0;padding:4px 6px;border-radius:9px;font-weight:950;white-space:nowrap}
@media(max-width:760px){.creator-tabletop-mini{width:84px;right:0;bottom:0;min-height:96px}.creator-tabletop-mini img{width:84px;height:84px}.creator-tabletop-mini span{font-size:7px}}
/* v6 — tablet trainer sheet / inventory / adventure D-pad */
.sheet-overlay{position:fixed;inset:0;z-index:950;display:flex;justify-content:center;align-items:center;padding:14px;background:#071a20e8;backdrop-filter:blur(10px)}
.sheet-overlay.hidden{display:none}
.sheet-shell{--teal:#1b766d;--cream:#fffbf3;width:min(1100px,100%);max-height:min(96dvh,950px);background:#f7f8ea;border:2px solid #a4e1bd;border-radius:22px;box-shadow:0 25px 75px #001716a9;display:flex;flex-direction:column;overflow:hidden;color:#183d39;font-family:inherit}
.sheet-shell *{box-sizing:border-box}
.sheet-shell button{font-family:inherit;cursor:pointer;transition:transform .1s,filter .1s}
.sheet-shell button:active{transform:scale(.95)}
.sheet-shell button:disabled{opacity:.43;cursor:not-allowed}
.sheet-top{background:#173c41;color:#fff;display:flex;align-items:center;gap:12px;padding:12px 19px;min-height:67px;border-bottom:3px solid #6fbb93}
.sheet-logo{display:flex;align-items:center;gap:9px;min-width:0}.sheet-logo>span{background:#e9f4af;color:#2a6753;display:grid;place-items:center;border-radius:11px;width:38px;height:38px;font-size:25px}
.sheet-logo strong{font-weight:1000;letter-spacing:1.4px;display:block;font-size:20px}.sheet-logo small{font-size:9px;letter-spacing:1.1px;color:#9dddc4;display:block}
.sheet-online{font-size:11px;color:#c9f2dd;margin-left:auto;font-weight:800;text-align:right}.sheet-close{width:39px;height:39px;display:grid;place-items:center;border-radius:11px;background:#426668;color:white;border:1px solid #7fb4a2;font-size:18px}
.sheet-page{padding:18px;overflow:auto;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(275px,0.9fr);grid-template-rows:auto 1fr;gap:14px;min-height:0}
.sheet-profile{grid-column:1/-1;display:flex;gap:20px;align-items:center;background:linear-gradient(110deg,#d5f6cf,#f6f2ce 65%,#d6f2db);border:2px solid #afd8bb;padding:12px 21px;border-radius:20px;min-height:145px}
.sheet-figure{flex:none;width:112px;height:114px;border-radius:22px;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at bottom,#9dcf9d 0,#d8f2c4 55%,#eaf9dc 90%);box-shadow:inset 0 -4px #8cc39b}.sheet-figure img{width:118px;height:126px;object-fit:contain;filter:drop-shadow(0 6px 3px #285b4785)}
.sheet-person{min-width:0}.sheet-person>span{font-size:11px;letter-spacing:1px;color:#40836e;font-weight:950}.sheet-person h1{font-size:clamp(25px,3vw,39px);line-height:1.1;margin:3px 0;color:#1f574e;overflow-wrap:anywhere}.sheet-person p{font-size:12px;color:#5b8670;margin:5px 0 12px;font-weight:750}.sheet-person button{border:1px solid #81bc9e;background:white;color:#316d60;padding:7px 12px;border-radius:9px;margin-right:6px;font-size:11px;font-weight:950}
.sheet-main{display:flex;flex-direction:column;min-height:365px;border-radius:18px;background:white;border:2px solid #d6e4d7;overflow:hidden}
.sheet-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:7px;background:#edf5eb;border-bottom:2px solid #dbe9d9}.sheet-tabs button{border:1px solid transparent;border-radius:10px;padding:11px 3px;font-size:11px;font-weight:950;color:#5a7f71;background:transparent}.sheet-tabs button.active{background:#296b60;color:white;box-shadow:0 3px 0 #16483c}
.sheet-body{padding:13px;overflow:auto;min-height:220px;max-height:430px;flex:1}.sheet-section-title{display:flex;justify-content:space-between;gap:6px;align-items:center;margin:4px 1px 13px}.sheet-section-title strong{font-size:17px}.sheet-section-title span{font-size:11px;color:#5c917b;font-weight:900;background:#e7f6e9;border-radius:999px;padding:5px 9px}
.sheet-mon{display:flex;align-items:center;gap:10px;border:1px solid #d4e6da;background:#f6fbf5;border-radius:13px;margin-bottom:8px;min-height:76px;padding:7px 8px;overflow:hidden}.sheet-mon.is-active{border:2px solid #e0bb4c;background:#fff9dd}.sheet-mon-img{height:58px;width:58px;flex:none;background:#ebf5e8;border-radius:11px;display:grid;place-items:center}.sheet-mon-img img{height:54px;width:54px;object-fit:contain}.sheet-mon-img .sprite-fallback{display:none}.sheet-mon-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.sheet-mon-copy strong{font-size:13px;color:#244e43}.sheet-mon-copy span{font-size:10px;color:#6a8679;font-weight:700}.sheet-hp-bar{height:6px;border-radius:8px;background:#dbe9dd;overflow:hidden;width:100%}.sheet-hp-bar i{display:block;height:100%;border-radius:8px}.sheet-mon-actions{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.sheet-mon-actions button{border:1px solid #a7d4b1;background:#e4f4e7;border-radius:8px;padding:6px 7px;color:#326b50;font-size:10px;font-weight:900;white-space:nowrap}.sheet-mon.is-active .sheet-mon-actions button:first-child{background:#fae8a3;border-color:#e7cd67;color:#7e631d}
.sheet-mon.sheet-empty{min-height:51px;color:#a6bbad;justify-content:center;gap:12px;background:#fafbf6;border-style:dashed}.sheet-mon.sheet-empty span{font-size:22px}.sheet-mon.sheet-empty strong{font-size:11px}
.sheet-tip{border-radius:10px;padding:10px 12px;background:#f2f8e7;color:#4e7b64;font-size:11px;font-weight:700;line-height:1.5}.sheet-blank{text-align:center;font-size:15px;font-weight:850;color:#719984;padding:25px 8px;line-height:2}
.sheet-bag-heading{font-size:10px;font-weight:950;letter-spacing:1.1px;background:#e5f1e9;padding:8px 12px;border-radius:7px;margin-top:11px;color:#518374}.sheet-item{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #e7f1e7}.sheet-item-icon{font-size:24px;width:32px;text-align:center}.sheet-item>div{flex:1;min-width:0}.sheet-item strong{display:block;font-size:12px}.sheet-item small{display:block;font-size:10px;color:#718f7c;line-height:1.4;margin-top:2px}.sheet-item>b{font-size:12px;white-space:nowrap;color:#316858}.sheet-item button{font-size:11px;font-weight:900;background:#d5f0d7;color:#326650;border:1px solid #9dcc9e;padding:7px 10px;border-radius:9px}.sheet-badges{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.sheet-badge{padding:16px 8px;text-align:center;border-radius:12px;background:#fff8dc;border:1px solid #f0d783;font-size:12px;font-weight:900;line-height:2}
.sheet-controls{border:2px solid #bcdac3;background:linear-gradient(#e4f4df,#f9f8e9);padding:14px;border-radius:18px;display:flex;flex-direction:column;gap:11px;min-height:365px}.sheet-controls-head{display:flex;gap:5px;align-items:start;justify-content:space-between}.sheet-controls-head .sheet-kicker{font-size:9px;color:#488d74;letter-spacing:1px;font-weight:950}.sheet-controls-head h2{font-size:19px;margin:3px 0;color:#235d4c}.sheet-move-hint{font-size:10px;color:#76a088;padding:7px 8px;background:#fcfff5;border-radius:10px;white-space:nowrap}
.sheet-pad-row{display:flex;align-items:center;flex-direction:column;gap:8px;min-width:0}.sheet-dpad{display:grid;grid-template-columns:repeat(3,58px);grid-template-rows:repeat(3,55px);gap:5px;align-items:stretch;justify-content:center;touch-action:manipulation;user-select:none}.sheet-dpad button{background:linear-gradient(#346f66,#204e4a);border:2px solid #9bd1b9;box-shadow:0 5px 0 #173d37;color:white;font-size:26px;border-radius:13px;font-weight:900}.sheet-dpad button:active{background:#79b996}.dpad-up{grid-column:2;grid-row:1}.dpad-left{grid-column:1;grid-row:2}.dpad-middle{grid-column:2;grid-row:2;display:grid;place-items:center;border-radius:15px;color:#d4c967;font-size:28px;background:#28574d}.dpad-right{grid-column:3;grid-row:2}.dpad-down{grid-column:2;grid-row:3}
.sheet-context{margin-top:8px;border-radius:12px;background:#fffdf7;border:1px solid #cfdfca;padding:12px;min-height:124px;width:100%;display:flex;flex-direction:column;gap:7px}.sheet-context strong{font-size:13px;color:#2d5f4e}.sheet-context small{font-size:11px;line-height:1.35;color:#6c9079}.sheet-context button{background:#c9f2c4;border:1px solid #8bc58e;padding:9px 12px;border-radius:10px;font-size:11px;font-weight:950;color:#306349}.sheet-context-buttons{display:flex;gap:6px;flex-wrap:wrap}.sheet-context-buttons button{flex:1}.sheet-context select{border:1px solid #a8c9af;border-radius:9px;padding:8px;font-size:11px;max-width:100%}.sheet-dice{display:flex;align-items:center;gap:10px}.sheet-dice label{font-size:11px;font-weight:950;color:#417a63}.sheet-dice input{flex:1;width:65px;min-width:65px;max-width:130px;border:2px solid #a5d0a9;border-radius:9px;padding:9px;font-size:17px;color:#245946;font-weight:950;background:white}.sheet-invite{font-size:10px;color:#567e6e;text-align:center}.sheet-invite a{color:#226b7f;text-decoration:underline}
@media(max-width:790px){.sheet-overlay{padding:0;align-items:stretch}.sheet-shell{border:0;border-radius:0;max-height:100dvh;height:100dvh}.sheet-top{padding:9px 12px;min-height:52px}.sheet-logo strong{font-size:16px}.sheet-logo small{font-size:8px}.sheet-online{font-size:9px}.sheet-page{display:flex;flex-direction:column;padding:10px;gap:9px}.sheet-profile{min-height:105px;padding:9px 12px;gap:10px}.sheet-figure{width:75px;height:85px}.sheet-figure img{width:90px;height:92px}.sheet-person h1{font-size:25px}.sheet-person p{margin:3px 0 8px}.sheet-person button{font-size:10px;padding:6px 8px}.sheet-main{min-height:260px;overflow:visible;flex:none}.sheet-tabs{padding:5px;gap:2px}.sheet-tabs button{font-size:10px;padding:9px 2px}.sheet-body{max-height:335px;overflow:auto}.sheet-controls{min-height:300px;padding:12px}.sheet-pad-row{flex-direction:row;align-items:center;gap:9px}.sheet-dpad{grid-template-columns:repeat(3,47px);grid-template-rows:repeat(3,47px);gap:3px;flex:none}.sheet-dpad button{font-size:22px;border-radius:9px}.sheet-context{margin:0;min-height:142px;flex:1;max-width:100%;padding:9px}.sheet-context strong{font-size:12px}.sheet-context small{font-size:10px}.sheet-dice{flex-wrap:wrap}.sheet-context-buttons{flex-wrap:wrap}.sheet-context-buttons button{font-size:10px;padding:7px}.sheet-shell .sheet-mon-img{width:48px;height:48px}.sheet-shell .sheet-mon-img img{width:47px;height:47px}.sheet-mon-copy strong{font-size:12px}.sheet-mon-actions button{font-size:9px}}
@media(max-width:420px){.sheet-dpad{grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,42px)}.sheet-context{padding:8px}.sheet-logo>span{width:28px;height:28px}.sheet-shell .sheet-online{display:none}.sheet-mon{gap:6px}.sheet-mon-actions button{padding:5px}.sheet-controls-head h2{font-size:17px}}
/* Character sheet must be above the TV play overlay (z-index:1000) and below trainer creator (1500). */
.sheet-overlay{z-index:1250}
/* 8–11 inch tablets should use every pixel of the screen, not a centered desktop dialog. */
@media(min-width:791px) and (max-width:1100px){.sheet-overlay{padding:0;align-items:stretch}.sheet-shell{width:100%;height:100dvh;max-height:100dvh;border-radius:0}.sheet-page{flex:1;grid-template-columns:minmax(0,1.15fr) minmax(275px,.85fr);align-content:start}.sheet-body{max-height:calc(100dvh - 305px);min-height:260px}}

/* v7 — Pokémon battle arena, type attacks and tablet move tiles */
.battle-arena {position:absolute;inset:72px 0 0;z-index:70;background:rgba(4,19,30,.93);display:flex;justify-content:center;align-items:center;padding:16px;overflow:auto;}
.battle-arena.hidden{display:none!important;}
.play-shell{position:relative;}
.battle-stage{position:relative;width:min(1120px,100%);height:min(835px,calc(100vh - 115px));min-height:620px;background:#112b32;border:2px solid #4caea9;border-radius:22px;box-shadow:0 26px 80px #0009;overflow:hidden;color:#f4fff7;display:flex;flex-direction:column;}
.battle-header{padding:18px 24px 14px;display:flex;justify-content:space-between;align-items:center;gap:16px;background:linear-gradient(95deg,#173b4a,#185a52);min-height:90px;flex-shrink:0;}
.battle-header h2{font-size:24px;line-height:1.18;margin:4px 0 0;color:#fff;}.battle-overline{font-size:11px;letter-spacing:.13em;color:#b8e6d3;font-weight:900;}.battle-rule-tag{background:#12313e;color:#c2f6eb;border:1px solid #4ec6b0;padding:10px 14px;border-radius:40px;font-weight:800;white-space:nowrap;font-size:12px;}
.battle-field{position:relative;flex:1;min-height:245px;overflow:hidden;background:linear-gradient(180deg,#65cafa 0%,#c6edfa 53%,#80c493 54%,#4c9b74 78%,#2f7d62 100%);isolation:isolate;}
.battle-sky{position:absolute;inset:0 0 45%;background:radial-gradient(ellipse at 20% 40%,#fff9 0 3%,transparent 4%),radial-gradient(ellipse at 61% 26%,#fff8 0 4%,transparent 5%),radial-gradient(ellipse at 90% 38%,#fff6 0 4%,transparent 5%);}
.battle-hill{position:absolute;width:65%;height:165px;border-radius:50% 50% 0 0;background:#55a77d;bottom:22%;}.battle-hill.h-one{left:-10%;}.battle-hill.h-two{right:-10%;bottom:20%;background:#48996c;}.battle-ground{position:absolute;bottom:0;width:100%;height:26%;background:repeating-linear-gradient(95deg,#7abf65 0 20px,#83c56c 21px 40px);opacity:.9;}
.battle-side{position:absolute;top:0;bottom:0;width:48%;z-index:2;}.enemy-side{right:0;}.player-side{left:0;}.battle-status{position:absolute;z-index:6;top:12px;background:#fcfff0f2;border:2px solid #357d73;border-radius:13px;padding:10px 15px;min-width:195px;max-width:75%;box-shadow:0 4px 0 #2b6259;color:#154645;display:grid;gap:2px;}.battle-status strong{font-size:19px;}.battle-status span,.battle-status small{font-size:12px;color:#3b6460;font-weight:800;}.enemy-side .battle-status{right:4%;}.player-side .battle-status{left:4%;top:auto;bottom:17px;}.battle-health{height:12px;background:#c4d4cd;border-radius:99px;border:1px solid #91b9ad;overflow:hidden;}.battle-health i{display:block;height:100%;transition:width .5s;}
.battle-poke{position:absolute;z-index:4;width:min(255px,46vw);height:min(255px,46vw);max-width:80%;bottom:11%;display:flex;align-items:end;justify-content:center;filter:drop-shadow(0 10px 4px #0b4c3455);}.battle-poke img{width:100%;max-height:100%;height:auto;object-fit:contain;image-rendering:auto;filter:drop-shadow(1px 6px 5px #16482f55);animation:battle-idle 2.6s ease-in-out infinite alternate;}.enemy-poke{right:15%;bottom:15%;}.player-poke{left:15%;}.player-side .battle-poke img{transform:scaleX(-1);animation:battle-idle-player 2.6s ease-in-out infinite alternate;}.battle-poke-fallback{font-size:100px;}
.battle-plinth{position:absolute;z-index:3;bottom:10%;width:63%;height:20%;border-radius:50%;background:radial-gradient(ellipse,#95da7c 0%,#5ca862 62%,#346f4b 100%);border-bottom:8px solid #356f55;box-shadow:0 9px 0 #14432b77;}.enemy-plinth{right:5%;bottom:12%;}.player-plinth{left:5%;bottom:8%;}
@keyframes battle-idle{from{translate:0 0}to{translate:0 -7px}}@keyframes battle-idle-player{from{translate:0 0}to{translate:0 -7px}}
.battle-bottom{display:grid;grid-template-columns:1fr 258px;gap:14px;padding:15px;background:linear-gradient(180deg,#193b42,#112b32);flex-shrink:0;}.battle-bottom-title{font-size:12px;font-weight:900;letter-spacing:.08em;margin-bottom:10px;color:#bdf4d0;}.battle-move-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}.battle-move{display:flex;align-items:center;gap:10px;text-align:left;padding:10px 12px;border:2px solid #457e7e;border-radius:13px;color:#f5fff4;background:#28515d;cursor:pointer;min-height:67px;}.battle-move.selected{border-color:#ffdc7c;background:#336863;box-shadow:0 0 0 2px #f9cd3d40 inset;}.battle-move strong{font-size:15px;display:block;}.battle-move small{display:block;font-size:11px;opacity:.83;}.bm-icon{font-size:28px;}.battle-legend{font-size:11px;opacity:.8;margin-top:11px;}.battle-roll-area{display:flex;flex-direction:column;gap:9px;justify-content:flex-start;}.battle-roll-area label{font-size:12px;font-weight:900;color:#b9f2dc;}.battle-roll-area input,.battle-catch-row select{width:100%;background:#e6fff4;color:#183f40;border-radius:10px;border:2px solid #74cab9;padding:12px;font-size:22px;font-weight:900;}.battle-catch-row{display:flex;gap:5px;}.battle-catch-row select{font-size:11px;flex:1;width:40px;padding:7px;}.battle-catch-row button{font-size:12px;min-width:90px;}.battle-run{border:none;background:transparent;color:#b7d7d0;text-decoration:underline;padding:7px;cursor:pointer;}
.battle-fx{position:absolute;z-index:25;top:27%;width:41%;height:48%;pointer-events:none;display:flex;align-items:center;justify-content:center;}.battle-fx.target-enemy{right:4%;}.battle-fx.target-player{left:4%;}.fx-flare{position:absolute;inset:16%;border-radius:50%;background:radial-gradient(circle,#fff9,#ffe87d88 30%,transparent 65%);animation:fx-flash .48s ease-in-out 2;}.fx-icons{position:absolute;inset:0;}.fx-icons b{position:absolute;left:calc(18% + var(--idx)*10%);top:calc(12% + var(--idx)*7%);font-size:clamp(30px,5.2vw,85px);animation:fx-bolt 1s cubic-bezier(.2,.9,.25,1) both;animation-delay:calc(var(--idx)*58ms);filter:drop-shadow(0 0 14px #fff);}.fx-impact{z-index:3;position:absolute;bottom:12%;font-weight:1000;font-size:clamp(20px,3vw,36px);color:#fff;text-shadow:0 3px 1px #173f54,0 0 15px #09353c;animation:fx-impact .9s both;text-align:center;}.fx-electric .fx-icons b{color:#f9eb39;filter:drop-shadow(0 0 14px yellow)}.fx-fire .fx-flare{background:radial-gradient(circle,#fff8,#ff6f3388,transparent 70%)}.fx-water .fx-flare{background:radial-gradient(circle,#d9ffffaa,#23aeef88,transparent 70%)}.fx-grass .fx-flare{background:radial-gradient(circle,#e6ffafaa,#7bca3e88,transparent 70%)}.fx-ice .fx-flare{background:radial-gradient(circle,#fff8,#83dbff88,transparent 70%)}.fx-ghost .fx-flare,.fx-psychic .fx-flare{background:radial-gradient(circle,#fff7,#a961ebaa,transparent 70%)}
@keyframes fx-bolt{0%{transform:translate(-100px,-115px) rotate(-50deg) scale(.3);opacity:0}35%{opacity:1}70%{opacity:1}100%{transform:translate(40px,90px) rotate(20deg) scale(1.6);opacity:0}}@keyframes fx-flash{0%,100%{opacity:0;scale:.6}50%{opacity:1;scale:1.3}}@keyframes fx-impact{0%{opacity:0;transform:translateY(25px) scale(.6)}25%{opacity:1;transform:translateY(-15px) scale(1.2)}75%{opacity:1}100%{opacity:0;transform:translateY(-35px)}}
.battle-finish{justify-content:center;align-items:center;text-align:center;gap:16px;background:radial-gradient(circle at 50% 30%,#428b7d,#163b51 75%);}.battle-finish h2{font-size:36px;color:#fff;margin:0;}.battle-finish p{max-width:450px;font-size:19px;color:#baf9e7;margin:0}.battle-finish-poke img{width:200px;max-height:220px;object-fit:contain;animation:battle-idle 1.5s infinite alternate;}.battle-confetti{font-size:80px;color:#fbdc55;}
.sheet-battle-head{display:grid;gap:10px;}.sheet-battle-head>strong{font-size:14px;color:#d9f9cb;}.sheet-battle-pokemon{display:flex;align-items:center;gap:9px;background:#113949;padding:7px;border:1px solid #366e79;border-radius:12px;}.sheet-battle-pokemon>img{width:60px;height:60px;object-fit:contain;}.sheet-battle-pokemon>div{flex:1;min-width:0;}.sheet-battle-pokemon b{font-size:13px;}.sheet-battle-pokemon small{font-size:11px;}.sheet-battle-pokemon .sheet-hp-bar{margin-top:6px;}.sheet-battle-pokemon.mymon{background:#22504c;}.sheet-context-label{font-size:11px;color:#b6eace;font-weight:900;letter-spacing:.06em;margin:12px 0 6px;}.sheet-battle-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}.sheet-battle-moves button{border:2px solid #487b8b;background:#214454;border-radius:12px;color:white;min-height:71px;padding:7px;display:grid;text-align:center;justify-items:center;cursor:pointer;}.sheet-battle-moves button.selected{border-color:#f5d35c;background:#315f5a;}.sheet-battle-moves button span{font-size:22px;}.sheet-battle-moves button strong{font-size:12px;}.sheet-battle-moves button small{font-size:9px;opacity:.85}.sheet-context-buttons button.sheet-use-move{background:#d1ed71;color:#183e39;min-height:40px;font-size:13px;font-weight:900;}.sheet-context .sheet-dice input{font-size:20px;min-height:43px;}
@media(max-width:800px){.battle-arena{padding:4px;inset:50px 0 0}.battle-stage{height:auto;min-height:600px;max-height:calc(100vh - 70px);overflow-y:auto;}.battle-header{padding:12px}.battle-header h2{font-size:17px}.battle-rule-tag{font-size:10px;padding:6px}.battle-field{min-height:225px}.battle-poke{width:min(175px,44vw);height:180px}.battle-status{min-width:100px;max-width:150px;padding:7px}.battle-status strong{font-size:13px}.battle-status small,.battle-status span{font-size:9px}.battle-bottom{grid-template-columns:1fr;padding:10px}.battle-roll-area{flex-direction:row;align-items:center;flex-wrap:wrap}.battle-roll-area>input{max-width:90px}.battle-catch-row{flex:1}.battle-legend{font-size:10px}.battle-move-grid{gap:4px}.battle-move{padding:7px;min-height:51px}.battle-move strong{font-size:12px}.battle-move small{font-size:9px}.bm-icon{font-size:18px}}

/* v7.1 battle polish — no network connection still has visible element miniatures. */
.battle-poke .sprite-fallback {width:180px;height:180px;align-self:flex-end;justify-items:center;align-content:center;gap:4px;border-radius:55% 55% 48% 48%;border:4px solid #ffffffb9;background:radial-gradient(circle at 30% 20%,#ffffffea,#7ac9bf 40%,#37678e 95%);box-shadow:inset 0 -16px 20px #0846514a,0 16px 26px #1039346b;transform:translateY(-5px);animation:battle-idle 2s ease-in-out infinite alternate;color:#fff;text-shadow:0 3px 4px #183d52;}
.battle-poke .sprite-fallback[data-type="Electric"]{background:radial-gradient(circle at 30% 20%,#fffbd0,#edbf28 50%,#c67809 96%)}
.battle-poke .sprite-fallback[data-type="Fire"]{background:radial-gradient(circle at 30% 20%,#fff7c8,#fb7b42 50%,#be2935 96%)}
.battle-poke .sprite-fallback[data-type="Grass"]{background:radial-gradient(circle at 30% 20%,#f0ffdc,#75cb70 50%,#297a63 96%)}
.battle-poke .sprite-fallback[data-type="Water"]{background:radial-gradient(circle at 30% 20%,#e7ffff,#57c9f0 50%,#247ab7 96%)}
.battle-poke .sprite-fallback .fallback-symbol{font-size:76px;line-height:1.1;filter:drop-shadow(0 5px 2px #17363555)}
.battle-poke .sprite-fallback .fallback-species{font-size:20px;font-weight:1000;letter-spacing:.03em}
/* Strong, distinct electric bolt. */
.battle-fx.fx-electric::before{content:"";position:absolute;left:24%;top:-100%;width:45%;height:230%;background:linear-gradient(90deg,#fff2b7,#fffccd 40%,#ffe02c 65%,#f8a700);clip-path:polygon(41% 0%,75% 0%,48% 31%,79% 32%,24% 98%,40% 52%,15% 50%);filter:drop-shadow(0 0 12px #ffff00);animation:giant-thunder 1.05s steps(2,end) both;z-index:2;pointer-events:none}
@keyframes giant-thunder{0%,11%,33%,65%,100%{opacity:0;transform:scale(.8)}12%,32%,44%,64%{opacity:.95;transform:scale(1)}}
.battle-fx.fx-fire .fx-icons b{filter:drop-shadow(0 0 18px #ff4d00)}
.battle-fx.fx-water .fx-icons b{filter:drop-shadow(0 0 18px #00c6ff)}
.battle-move:disabled,.battle-run:disabled,.battle-roll-area .button:disabled,.sheet-context-buttons button:disabled{opacity:.5;cursor:wait}
@media(max-width:800px){.battle-poke .sprite-fallback{width:115px;height:115px}.battle-poke .sprite-fallback .fallback-symbol{font-size:51px}.battle-poke .sprite-fallback .fallback-species{font-size:13px}}
@media(prefers-reduced-motion:reduce){.battle-poke .sprite-fallback,.battle-fx.fx-electric::before{animation:none}}

/* v8: tabletop battle miniatures and visual elemental projectiles */
.battle-field{background:linear-gradient(180deg,#66c9fa 0%,#d3eeea 49%,#8ec785 50%,#428861 100%)}
.battle-board-3d{position:absolute;inset:47% -4% -38%;z-index:1;transform:perspective(750px) rotateX(57deg);transform-origin:50% 25%;background-color:#74b86e;background-image:repeating-linear-gradient(0deg,#356b4670 0 2px,transparent 2px 92px),repeating-linear-gradient(90deg,#356b4670 0 2px,transparent 2px 92px),radial-gradient(circle at 15% 30%,#c7e98c 0%,#6bb773 48%,#377c58 100%);border:9px solid #765d3e;border-radius:16px;box-shadow:0 22px 4px #234b3550,inset 0 0 26px #2c674780;pointer-events:none}
.battle-plinth{z-index:4;background:radial-gradient(ellipse at 48% 34%,#d3e79c,#6ea968 53%,#244c40 73%,#2d3940 75%);border:5px solid #455350;border-bottom:14px solid #273a36;box-shadow:0 10px 0 #1d3e33a6,0 18px 18px #132d3199, inset 0 5px 3px #ffffff85;height:22%}
.battle-poke{z-index:5;filter:drop-shadow(0 14px 4px #0d3e3770)}
.battle-mini-label{position:absolute;z-index:6;bottom:7%;background:#223d40e9;color:#eefce7;padding:3px 12px;font-size:11px;font-weight:900;letter-spacing:.13em;border:1px solid #d2e9bd;border-radius:40px;box-shadow:0 2px 7px #14433c88}
.enemy-mini-label{right:14%}.player-mini-label{left:14%;bottom:3%}
.battle-projectile{position:absolute;inset:0;z-index:24;pointer-events:none;overflow:hidden;}
.battle-projectile i{position:absolute;z-index:1;top:47%;left:19%;font-size:clamp(39px,7vw,88px);font-style:normal;filter:drop-shadow(0 0 12px #fff);animation:projectile-forward 780ms cubic-bezier(.14,.48,.13,.97) forwards}
.battle-projectile em{position:absolute;top:55%;left:19%;width:52px;height:6px;border-radius:40px;background:linear-gradient(90deg,transparent,#ffffffdd,#ffdb43);box-shadow:0 0 20px #fffeb3;animation:projectile-trail-forward 780ms ease-out both}
.battle-projectile.projectile-to-player i{left:76%;animation-name:projectile-back}
.battle-projectile.projectile-to-player em{left:76%;animation-name:projectile-trail-back}
.battle-projectile.projectile-electric i{filter:drop-shadow(0 0 25px #ffea2a)}
.battle-projectile.projectile-fire em{background:linear-gradient(90deg,transparent,#ffb900,#ff3b16);box-shadow:0 0 19px #ff7c00}
.battle-projectile.projectile-water em{background:linear-gradient(90deg,transparent,#ddffff,#25abff);box-shadow:0 0 20px #00c6ff}
.battle-projectile.projectile-grass em{background:linear-gradient(90deg,transparent,#ddff9d,#3ea359);box-shadow:0 0 19px #8bef70}
@keyframes projectile-forward{0%{left:19%;transform:scale(.5) rotate(-20deg);opacity:0}10%{opacity:1}76%{left:71%;transform:scale(1.2) rotate(15deg)}100%{left:73%;transform:scale(1.8);opacity:0}}
@keyframes projectile-back{0%{left:76%;transform:scale(.5);opacity:0}10%{opacity:1}76%{left:23%;transform:scale(1.2)}100%{left:21%;transform:scale(1.8);opacity:0}}
@keyframes projectile-trail-forward{0%{left:19%;opacity:0}20%{opacity:1}95%{left:71%;opacity:0}100%{opacity:0}}
@keyframes projectile-trail-back{0%{left:76%;opacity:0}20%{opacity:1}95%{left:23%;opacity:0}100%{opacity:0}}
.damage-phase-banner,.matchup-readout{display:grid;gap:5px;padding:10px;border-radius:12px;border:1px solid #a6dda1;background:#275349;color:#f0ffe0;font-size:13px;font-weight:800}
.damage-phase-banner{background:linear-gradient(110deg,#776020,#355d56);border:2px solid #ffd06c;animation:damage-pulse 1.7s ease-in-out infinite}
.damage-phase-banner strong,.matchup-readout strong{font-size:19px;color:#fff4b3}.damage-phase-banner small{font-size:11px;color:#fff8d0}
@keyframes damage-pulse{50%{box-shadow:0 0 0 3px #ffda5d52}}
.sheet-damage-phase,.sheet-matchup{padding:10px 12px;margin:10px 0;border:1px solid #91c8ad;border-radius:12px;background:#20494c;color:#eeffdb;font-size:12px;display:grid;gap:4px}
.sheet-damage-phase{background:#65522f;border:2px solid #ffcd55}
.sheet-damage-phase strong{font-size:15px}.sheet-damage-phase small{color:#ffe8a6}
@media(max-width:800px){.battle-mini-label{font-size:8px;padding:3px 6px}.battle-board-3d{inset:47% -4% -37%}.battle-poke{bottom:13%}.battle-roll-area{display:flex;flex-wrap:wrap}.battle-roll-area .damage-phase-banner{width:100%}}
@media(prefers-reduced-motion:reduce){.battle-projectile i,.battle-projectile em{animation:none}.damage-phase-banner{animation:none}}
/* Improve legibility of type matchups and damage rolling on small tablets */
.sheet-context .sheet-damage-phase,.sheet-context .sheet-matchup{color:#fff!important}
.sheet-context .sheet-damage-phase strong,.sheet-context .sheet-matchup strong{color:#fff5c1!important}
.sheet-context .sheet-battle-pokemon b{color:#fff!important}
.sheet-context .sheet-battle-pokemon small{color:#e4fff4!important}
.sheet-context .sheet-battle-moves button strong{color:white!important}
.sheet-context .sheet-battle-moves button small{color:#e1f2f4!important;opacity:1}
.sheet-context .sheet-battle-moves button:disabled{opacity:.75!important}
.sheet-context .sheet-battle-head>strong,.sheet-context .sheet-context-label{color:#1c615b}
.sheet-battle-pokemon .sprite-fallback{display:grid;flex:0 0 54px;width:54px;max-width:54px;height:54px;min-height:54px;align-items:center;justify-items:center;overflow:hidden;color:#fff}
.sheet-battle-pokemon .sprite-fallback .fallback-species{display:none}
.sheet-battle-pokemon .sprite-fallback .fallback-symbol{font-size:29px;line-height:1}
.sheet-mon-img .sprite-fallback{display:grid;font-size:27px;color:#356b7e;align-items:center;justify-items:center}
.sheet-mon-img .sprite-fallback .fallback-symbol{font-size:28px}
.sheet-mon-img .sprite-fallback .fallback-species{display:none}

/* v9: complete type matchups on TV and tablet */
.type-guide-overlay{position:fixed;inset:0;background:#061a24db;z-index:10000;display:flex;align-items:center;justify-content:center;padding:14px;backdrop-filter:blur(6px)}
.type-guide-overlay.hidden{display:none}
.type-guide-dialog{width:min(1200px,100%);height:min(860px,95vh);background:#f7fbf5;color:#19323d;border:4px solid #a6d7b9;border-radius:22px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 75px #061720a9}
.type-guide-dialog>header{background:#173e51;color:white;display:flex;align-items:center;justify-content:space-between;padding:14px 20px;gap:10px}
.type-guide-dialog>header>div{display:grid;gap:3px}.type-guide-dialog>header strong{font-size:19px}.type-guide-dialog>header small{font-size:11px;color:#c6ecdc;letter-spacing:.08em}
#typeGuideClose{background:#fff2;border:1px solid #fff7;color:white;border-radius:12px;font-size:22px;padding:8px 15px;cursor:pointer}
#typeGuideContent{padding:18px 20px;overflow:auto;overscroll-behavior:contain}#typeGuideContent h3{margin:20px 0 10px;font-size:17px}#typeGuideContent p{font-size:13px;line-height:1.55;color:#40565a;margin:10px 0}
.type-legend{display:flex;flex-wrap:wrap;gap:6px}.type-legend b{font-size:12px;padding:6px 11px;border-radius:9px;border:1px solid #d1dddd}
.type-die-0{background:#c5c3c8!important;color:#3d3b42!important}.type-die-4{background:#f4c7d0!important;color:#6c2b45!important}.type-die-6{background:#e5e9ee!important;color:#3b5062!important}.type-die-10{background:#a7e4be!important;color:#16513d!important}.type-die-12{background:#ffd784!important;color:#614018!important}
.type-selector{display:flex;gap:12px;flex-wrap:wrap;margin:14px 0}.type-selector label{display:grid;gap:3px;font-weight:800;color:#244359;font-size:12px}.type-selector select{background:white;color:#204456;border:1px solid #a8c9b9;border-radius:10px;padding:8px 12px;font-weight:700;min-width:180px}
.type-match-grid{display:grid;grid-template-columns:repeat(6,minmax(115px,1fr));gap:7px}.type-match-tile{border-radius:12px;padding:9px;display:grid;gap:2px;border:1px solid #fff6}.type-match-tile span{font-size:12px;font-weight:800}.type-match-tile strong{font-size:20px}.type-match-tile small{font-size:10px}
.type-matrix-scroll{max-width:100%;overflow:auto;border:1px solid #c9ddca;border-radius:12px}.type-matrix{border-collapse:separate;border-spacing:2px;white-space:nowrap;font-size:11px;width:max-content;min-width:100%}.type-matrix th{background:#1d4953;color:white;padding:8px 6px;position:sticky;top:0;z-index:1}.type-matrix th:first-child{left:0;z-index:3;position:sticky;text-align:left}.type-matrix tbody th{position:sticky;left:0;z-index:2;text-align:left;font-weight:900}.type-matrix thead th span{display:block;font-size:9px}.type-matrix td{text-align:center;border-radius:5px;padding:7px 5px;min-width:39px;font-weight:900}
.type-guide-sheet-btn{border:1px solid #e8d499;color:#ffe6a1;border-radius:9px;background:#274d54;padding:7px 10px;font-size:11px;font-weight:900;white-space:nowrap;cursor:pointer}
@media(max-width:760px){.type-guide-dialog{height:96vh}.type-match-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.type-selector select{min-width:130px}.type-guide-dialog>header strong{font-size:16px}}

/* PokéForge v10: NPC trainer map tokens + host-only game master workspace */
.npc-token{display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;gap:1px;filter:drop-shadow(0 2px 4px #172e30a6)}
.npc-avatar{font-size:31px;line-height:1.03;background:linear-gradient(135deg,#f3ca81,#ffeaaf);border:2px solid #775d30;border-radius:46%;padding:2px 4px;box-shadow:inset 0 1px 5px #fff8}
.npc-token small{white-space:nowrap;max-width:92px;text-overflow:ellipsis;overflow:hidden;font-weight:900;background:#122e38da;color:#ffe2a1;font-size:8px;padding:3px 5px;border-radius:10px}
.npc-token em{position:absolute;right:-5px;top:-5px;background:#289f76;padding:3px;border-radius:50%}
.npc-tool-card{display:grid;justify-items:center;gap:9px;background:#193d42;border:1px solid #507c7a;padding:24px 10px;border-radius:17px;text-align:center}
.npc-tool-card .npc-tool-icon{font-size:48px}.npc-tool-card strong{color:#ffdda1}.npc-tool-card small{max-width:260px;color:#c4d4ce}
.npc-inspector-avatar{font-size:38px;background:#f4d8a0;border-radius:13px;padding:10px}
.npc-team-row{display:flex;gap:5px;align-items:center;padding:7px 0;border-bottom:1px solid #ffffff15}
.npc-team-row select{min-width:0;flex:1;padding:9px 2px;font-size:12px}.npc-team-row .npc-number{color:#e8bb65;font-weight:900}
.npc-team-row label{font-size:11px;color:#e5dfc6;display:flex;align-items:center;gap:2px}.npc-team-row input{width:54px;padding:8px 2px}.npc-team-row button{border:1px solid #d35a68;border-radius:8px;background:#592d42;color:white;padding:8px}
.npc-add{margin-top:12px;width:100%}.npc-preview-party{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.npc-preview-party>span{display:grid;justify-items:center;background:#16404f;border-radius:9px;padding:7px;min-width:0}.npc-preview-party img{width:48px;height:48px;object-fit:contain}.npc-preview-party small{font-size:10px;color:#d8dce7}
.dm-launch{border:1px solid #e3b45b!important;background:#4a3558!important;color:#ffe9ba!important}
.dm-panel{position:fixed;z-index:100100;top:0;right:0;width:min(432px,100vw);height:100dvh;overflow-y:auto;background:#122b36;color:#f8f4e6;box-shadow:-16px 0 60px #07171bc9;border-left:2px solid #caa06a;font-family:inherit}
.dm-panel.hidden{display:none!important}.dm-head{position:sticky;top:0;z-index:3;display:flex;justify-content:space-between;align-items:center;padding:17px 19px;background:#1f3d49;border-bottom:1px solid #c99a695e}
.dm-head small{font-size:10px;letter-spacing:2px;color:#f7c886;font-weight:900}.dm-head h2{margin:4px 0 0;color:#fff1ca;font-size:21px}
.dm-head button{background:#48606d;color:#fff;border:1px solid #8f9aa0;border-radius:12px;font-size:19px;padding:7px 12px;cursor:pointer}
.dm-body{padding:18px;display:grid;gap:13px}.dm-body>label,.dm-battle>label{font-size:11px;text-transform:uppercase;font-weight:900;letter-spacing:.9px;color:#e7c48a}
.dm-body select,.dm-dice-row input{width:100%;border:1px solid #4e889a;border-radius:10px;padding:11px;color:#fff;background:#0a2733;font:inherit}
.dm-toggle{display:flex;gap:10px;justify-content:space-between;align-items:center;background:#294957;border-radius:13px;padding:12px}
.dm-toggle strong{display:block;font-size:13px}.dm-toggle small{display:block;font-size:11px;margin-top:3px;color:#c2d5d8}.dm-toggle input{min-width:22px;height:22px;accent-color:#e2ae62}
.dm-tip,.dm-footnote{font-size:11px;color:#c1cdd2}.dm-battle{padding:13px;border:1px solid #8b7187;background:#1b3742;border-radius:15px;display:grid;gap:9px}
.dm-status{display:flex;gap:8px;justify-content:space-between;font-size:11px;font-weight:900;color:#ffe2b0}.dm-status span{color:#a5e8ce}.dm-battle h3{margin:0;font-size:21px;color:#fff}.dm-battle h3 small{display:block;color:#b9d1cf;font-size:12px}.dm-battle p{font-size:12px;color:#e1dfd8;margin:0}
.dm-turn-ready,.dm-turn-wait,.dm-dice-prompt,.dm-waiting-banner{border-radius:12px;background:#3b3746;padding:12px;font-size:13px;color:#f9e4af}.dm-turn-ready small,.dm-dice-prompt small{display:block;margin-top:4px;color:#d9d7eb}
.dm-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.dm-moves button{border:1px solid #5e7d84;color:#f6f8f9;background:#133643;border-radius:11px;padding:10px;text-align:left;font-weight:850;cursor:pointer}
.dm-moves button.active{background:#4d4668;border-color:#f4c876}.dm-moves small{display:block;font-size:10px;font-weight:500;color:#bed1d1;margin-top:5px}
.dm-dice-row{display:grid;grid-template-columns:1fr auto auto;gap:6px}.dm-dice-row button,.dm-encounter button{border-radius:10px;padding:9px 10px;border:1px solid #efc270;background:#ddb16b;color:#182b35;font-weight:900;cursor:pointer}
.dm-skip{border:1px solid #91abb0;color:#fff;background:#25414f;border-radius:9px;padding:10px;cursor:pointer}
.dm-encounters{display:grid;gap:7px}.dm-encounters h3{font-size:14px;margin:12px 0 3px;color:#ffe0a2}.dm-encounter{display:flex;justify-content:space-between;gap:8px;align-items:center;background:#244552;border-radius:9px;padding:9px}.dm-encounter strong{font-size:12px}.dm-encounter small{font-size:10px;color:#b9d4da;display:block;margin-top:5px;line-height:1.4}.dm-encounter button:disabled,.dm-dice-row button:disabled{opacity:.4;cursor:not-allowed}
.dm-lineup{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.dm-lineup button{background:#19323d;color:#fff;border:1px solid #60808c;border-radius:8px;padding:8px 2px;font-size:11px}.dm-lineup .current{background:#806349;color:#fff3d0}.dm-lineup small{display:block;color:#d4e6e7;margin-top:3px}.dm-lineup button:disabled{opacity:.67}
.dm-waiting-banner strong{display:block}.dm-waiting-banner p{font-size:12px;margin:6px 0}
@media(max-width:680px){.dm-panel{width:100vw}.dm-head h2{font-size:18px}}

/* v10 private Game Master phone controls */
.dm-remote-body #app,.dm-remote-body #playOverlay,.dm-remote-body #sheetOverlay{display:none!important}
.dm-remote-body .dm-panel{display:block!important;width:100vw;max-width:100vw;border:0;box-shadow:none}
.dm-remote-body .dm-body{max-width:560px;margin:0 auto}
.dm-remote-pin{font-size:24px;padding:15px;border-radius:11px;background:#0a2835;border:1px solid #72b9bf;color:white;letter-spacing:8px;text-align:center}
.dm-primary{background:#ebbb69;border:0;border-radius:12px;padding:14px;font-weight:900;color:#21333b}
.dm-online{font-size:12px;padding:10px;background:#275345;border-radius:9px;color:#cbffe8;font-weight:900}

/* NPC appears as an upright tabletop figurine, distinct from player miniatures. */
.npc-mini-figure{display:grid;place-items:center;width:49px;height:66px;padding:0;overflow:visible;background:transparent;border:0;box-shadow:none;border-radius:0}
.npc-mini-figure img{display:block;width:54px;height:69px;object-fit:contain;filter:hue-rotate(82deg) saturate(.8) drop-shadow(0 2px 3px #09231e80)}

/* v11 trainer progression — fit inside the existing tablet sheet */
.xp-label{margin-top:8px;display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:11px;color:#ffe1a0}
.xp-label small{font-size:10px;color:#b9d4d4}
.xp-meter{height:7px;border-radius:99px;background:#1b3642;overflow:hidden;margin-top:4px}
.xp-meter i{display:block;height:100%;background:linear-gradient(90deg,#72d4df,#fbda72);border-radius:99px}
.sheet-known-moves{display:flex;gap:4px;flex-wrap:wrap;margin-top:9px}
.sheet-known-moves span{padding:4px 7px;background:#1b4950;border:1px solid #38757e;border-radius:999px;font-size:10px;font-weight:700;color:#fff}
.sheet-known-moves>small{width:100%;font-size:10px;color:#adccd1}
.sheet-learn-controls{margin-top:10px;padding:10px;border:1px solid #ffd37c;background:#253e47;border-radius:12px;display:flex;flex-wrap:wrap;gap:6px;align-items:end}
.sheet-learn-header{width:100%;font-size:11px;font-weight:900;color:#ffe5a5}
.sheet-learn-controls label{flex:1 1 110px;font-size:10px;color:#c8dadd}
.sheet-learn-controls select{display:block;min-width:0;width:100%;margin-top:4px;border-radius:7px;padding:7px;background:#0e313c;color:white;border:1px solid #67868e;font-size:12px}
.sheet-learn-controls button{background:#f9d779;color:#21383b;border:0;border-radius:8px;padding:9px;font-weight:900;font-size:11px;cursor:pointer}
.sheet-mon-copy{min-width:0}
@media(max-width:650px){.sheet-mon .sheet-mon-copy{width:100%}.sheet-learn-controls{padding:8px}}

/* v12: encounter zone editor and physical Poké Ball throwing effects */
.enc-zone-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 0}
.enc-zone-btn{display:flex;align-items:center;flex-direction:column;gap:5px;min-height:62px;border-radius:11px;border:2px solid #486676;background:#203b46;color:#eafaf3;padding:7px 4px;cursor:pointer;font-size:11px;font-weight:800}
.enc-zone-btn b{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#4c9f71;color:white}
.enc-zone-btn.z1 b{background:#bd8a4d}.enc-zone-btn.z2 b{background:#8b7cce}
.enc-zone-btn.active{border-color:#eac568;box-shadow:0 0 0 2px #eac56833}
.enc-field{margin:9px 0}.enc-field label{display:block;font-size:11px;font-weight:850;color:#c0d8cf;margin-bottom:4px}
.enc-field input,.enc-entry select,.enc-entry input{background:#f8faf7;border:1px solid #b9c7c2;color:#21333b;border-radius:8px;padding:8px;min-width:0;max-width:100%;box-sizing:border-box;width:100%;font-size:12px}
.enc-rate{display:flex;align-items:center;gap:8px}.enc-rate input{width:100px}.enc-table-head{font-weight:900;font-size:11px;margin-top:14px;color:#f3d886;display:flex;justify-content:space-between}.enc-table-head small{font-weight:600;color:#c4d4d0}
.enc-entry{background:#25424a;border:1px solid #4d6d68;border-radius:12px;margin:10px 0;padding:10px}.enc-species{display:flex;align-items:center;gap:5px}.enc-species button{border:0;background:#753e46;color:white;border-radius:7px;padding:8px;cursor:pointer}.enc-entry-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:9px}.enc-entry-grid label{color:#dce9db;font-size:9px}.enc-entry-grid input{padding:5px 2px;text-align:center;margin-top:4px;font-size:12px}.enc-rarity{font-size:10px;color:#b2d8c0;margin-top:7px}
.enc-add{width:100%;padding:11px 7px;border-radius:10px;color:white;background:#317555;border:1px solid #67a47b;font-weight:850;cursor:pointer}
.tile.enc-zone-tile{position:relative}.tile.enc-zone-tile.z0{box-shadow:inset 0 0 0 3px #4bc89f}.tile.enc-zone-tile.z1{box-shadow:inset 0 0 0 3px #deb35c}.tile.enc-zone-tile.z2{box-shadow:inset 0 0 0 3px #bb9bf0}
.enc-zone-marker{position:absolute;top:1px;right:2px;z-index:3;background:#253b46;color:white;border-radius:50%;width:15px;height:15px;display:grid;place-items:center;font:900 10px/1 system-ui;pointer-events:none}
.pf-catch-hint,.pf-sheet-catch-hint{border:1px solid #e5b5b4;background:#fff2dc;color:#633b34;border-radius:8px;font-size:11px;padding:7px 9px;margin:5px 0;font-weight:700}.pf-sheet-catch-hint{width:100%;font-size:11px;grid-column:1/-1}
.pf-ball-throw{position:absolute;z-index:65;width:76px;height:76px;left:32%;top:65%;filter:drop-shadow(2px 8px 7px #0008);animation:pfThrow 1.1s ease-in forwards;pointer-events:none}
.pf-catch-victory .pf-caught-ball{width:56px;height:56px;object-fit:contain;animation:pfCatchBounce 1.25s ease-in-out both;filter:drop-shadow(0 10px 12px #152d3544)}
@keyframes pfThrow{0%{transform:translate(0,0) scale(.65) rotate(0);opacity:1}45%{transform:translate(140%,-150%) scale(1.1) rotate(540deg);opacity:1}100%{transform:translate(280%,-25%) scale(.7) rotate(1080deg);opacity:0}}
@keyframes pfCatchBounce{0%{transform:translateY(-90px) scale(1.3) rotate(-10deg)}35%{transform:translateY(0) scale(1) rotate(8deg)}55%{transform:translateY(-25px) rotate(-8deg)}80%{transform:translateY(0) rotate(8deg)}100%{transform:translateY(0) rotate(0)}}

/* v13 — co-op/tandem battle arena and Poké Ball animations */
.coop-stage{background:#14383d}.coop-field{position:relative;display:grid;grid-template-columns:1fr 36px 1fr;gap:8px;align-items:center;min-height:360px;padding:33px 18px 28px;background:radial-gradient(ellipse at 50% 90%,#82d8a2 1%,#427d6d 43%,#204d58 73%,#183c53);overflow:hidden}.coop-allies,.coop-enemies{display:flex;align-items:end;justify-content:space-evenly;gap:8px}.coop-side-title{position:absolute;top:8px;left:22px;color:#b6f4dc;font-size:12px;font-weight:900;letter-spacing:.09em}.coop-side-title-right{left:auto;right:22px}.coop-divider{font-size:26px;text-align:center;color:#ffe08b}.coop-mini{flex:1;min-width:0;position:relative;border:2px solid #ffffff38;border-radius:16px;padding:12px 7px 18px;text-align:center;color:#fff;background:#173d42a8;min-height:270px;max-width:240px;display:flex;flex-direction:column;align-items:center;gap:4px;box-shadow:0 8px 20px #0826313d;overflow:hidden}.coop-mini.is-turn{border-color:#63f7c0;box-shadow:0 0 0 3px #74ffcb3b,0 8px 20px #102b2bd4}.coop-foe{cursor:pointer;font:inherit}.coop-foe.is-target{border-color:#ffd576;box-shadow:0 0 0 3px #ffc6485e}.coop-foe:disabled{opacity:1;cursor:default}.coop-player-tag{font-size:10px;font-weight:900;letter-spacing:.025em;color:#dcf7e7;min-height:20px}.coop-poke{height:158px;max-width:100%;width:160px;display:flex;align-items:end;justify-content:center;z-index:2}.coop-poke img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 7px 5px #11211b95)}.coop-plinth{height:14px;width:90%;max-width:150px;z-index:1;background:linear-gradient(#739b7e,#2b4750);border:3px solid #243a40;border-radius:50%;box-shadow:0 8px 8px #112b2d7d;margin-top:-12px}.coop-mini strong{font-size:13px;line-height:1.3}.coop-mini small{font-size:10px;color:#ddf8e2}.coop-hp-track{height:9px;border-radius:9px;background:#102e34;border:1px solid #81b5aa;width:95%;overflow:hidden}.coop-hp-track i{height:100%;display:block;background:linear-gradient(90deg,#39c97b,#87edb0)}.coop-controls{display:grid;grid-template-columns:1fr 245px;gap:14px;padding:15px;background:#12343a}.coop-controls h3{margin:0 0 4px;font-size:17px;color:#eafdf0}.coop-controls p{margin:0 0 10px;font-size:12px;color:#b9d5d0}.coop-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.coop-moves button{border:2px solid #608f92;background:#28575d;border-radius:10px;padding:9px;color:#fff;text-align:left;font-size:13px;cursor:pointer}.coop-moves button.selected{border-color:#ffd571;background:#3a686a}.coop-moves button small{display:block;font-size:10px}.coop-roll-controls{display:flex;flex-direction:column;gap:8px}.coop-roll-controls label{font-size:11px;font-weight:900;color:#c4f2e4}.coop-roll-controls input,.coop-roll-controls select{min-height:38px;padding:8px;border-radius:8px;border:1px solid #73bdb5;font-size:15px}.coop-roll-controls button,.coop-catch-group button{border:0;border-radius:9px;padding:11px 10px;background:#60d6a8;color:#103c40;font-weight:900;cursor:pointer}.coop-catch-group{display:flex;flex-direction:column;gap:5px}.coop-catch-group button{background:#ffd26f;color:#493420}.coop-roll-controls .coop-forfeit{background:transparent;color:#b6d3d0;text-decoration:underline;font-size:11px}.coop-wait-message{padding:14px;background:#345e63;border-radius:12px;font-size:12px;color:#fff}.coop-attack-flash{position:absolute;z-index:8;left:40%;top:22%;font-size:65px;animation:coopStrike .75s ease-out forwards;pointer-events:none;filter:drop-shadow(0 0 14px #ffea92)}.coop-attack-flash small{display:block;font-size:16px;color:white;text-shadow:0 2px 7px #333}.sheet-context .coop-sheet-call{padding:10px;background:#fff5d8;color:#273d38;border:1px solid #e9bd5e;border-radius:12px;display:grid;gap:8px}.coop-sheet-call small{display:block}.coop-sheet-call button{background:#2e8972;border:0;border-radius:8px;color:#fff;padding:12px;font-weight:900;min-height:44px}.coop-sheet-call button:disabled{opacity:.5}.coop-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:8px}.coop-targets button{padding:8px 5px;border:1px solid #8fb6ac;background:#edfdf5;color:#204742;border-radius:7px;font-size:12px;font-weight:800}.coop-targets button.selected{border:3px solid #f3b84d}.coop-dm select{width:100%;margin:7px 0 14px;padding:12px;border-radius:8px}.pf-catch-animation{position:absolute;inset:0;z-index:60;pointer-events:none;overflow:hidden}.pf-animated-ball{position:absolute;z-index:5;width:66px;height:66px;left:31%;top:62%;filter:drop-shadow(3px 8px 10px #193f39a8);animation:pfThrowToTarget 1.5s cubic-bezier(.3,.65,.4,1) forwards}.pf-catch-animation.catch-success .pf-animated-ball{animation:pfCatchSuccess 1.9s ease-in-out forwards}.pf-catch-animation.catch-fail .pf-animated-ball{animation:pfCatchFail 1.55s ease-in forwards}.pf-catch-aura{position:absolute;left:65%;top:40%;border-radius:100%;width:90px;height:90px;background:#ffffc592;opacity:0;animation:pfCatchFlash .45s ease-out .7s}.pf-catch-flash{position:absolute;z-index:70;left:40%;top:17%;padding:10px 16px;border-radius:12px;background:#fff4dc;color:#29444b;font-weight:1000;font-size:18px;letter-spacing:.04em;opacity:0;animation:pfCatchText .8s ease-in-out .85s forwards}.catch-fail .pf-catch-flash{background:#e3f3fc}.pf-catch-success .pf-caught-ball{animation:pfCatchBounce 1.25s ease-in-out both}@keyframes pfCatchSuccess{0%{left:31%;top:62%;transform:scale(.75) rotate(-60deg);opacity:1}38%{left:59%;top:22%;transform:scale(1.25) rotate(130deg);opacity:1}53%{left:66%;top:48%;transform:scale(1.1) rotate(250deg)}69%{left:66%;top:70%;transform:rotate(310deg) scale(.92)}79%{left:66%;top:70%;transform:rotate(290deg) scale(.85)}89%{left:66%;top:70%;transform:rotate(330deg) scale(.9)}100%{left:66%;top:70%;transform:rotate(315deg) scale(.9);opacity:1}}@keyframes pfCatchFail{0%{left:31%;top:62%;transform:scale(.7) rotate(-45deg);opacity:1}40%{left:66%;top:22%;transform:scale(1.15) rotate(140deg)}58%{left:69%;top:56%;transform:scale(1.05) rotate(240deg)}72%{left:80%;top:40%;transform:rotate(400deg) scale(1)}90%{left:98%;top:78%;transform:rotate(660deg) scale(.75);opacity:1}100%{left:112%;top:86%;transform:rotate(850deg) scale(.5);opacity:0}}@keyframes pfCatchFlash{20%,60%{opacity:1;transform:scale(2)}100%{opacity:0;transform:scale(3)}}@keyframes pfCatchText{0%,100%{opacity:0;transform:translateY(8px)}25%,80%{opacity:1;transform:translateY(0)}}@keyframes coopStrike{0%{opacity:0;transform:scale(.4) translateX(-90px)}40%{opacity:1;transform:scale(1.3)}100%{opacity:0;transform:scale(.9) translateX(80px)}}
@media(max-width:960px){.coop-field{min-height:265px;padding:30px 8px 12px}.coop-mini{min-height:210px;padding:8px 3px}.coop-poke{height:107px}.coop-mini strong{font-size:11px}.coop-player-tag{font-size:9px}.coop-controls{grid-template-columns:1fr}.coop-moves button{font-size:12px}}@media(max-width:600px){.coop-field{grid-template-columns:1fr 20px 1fr;gap:2px}.coop-mini{min-height:165px;padding:5px 1px}.coop-poke{height:80px}.coop-mini strong{font-size:10px}.coop-mini small{display:none}.coop-divider{font-size:16px}.coop-player-tag{font-size:8px}.coop-side-title{font-size:9px}.coop-moves{grid-template-columns:repeat(2,1fr)}}

/* Keep type-symbol Pokémon standees legible if external sprite hosting is offline. */
.coop-poke .sprite-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;width:120px;max-width:100%;height:132px;background:radial-gradient(circle at 50% 35%,#ffffffb8,#a1bcb65c 62%,transparent 72%);border-radius:56px;gap:0;overflow:hidden;}
.coop-poke .sprite-fallback .fallback-symbol{font-size:60px;line-height:1.2;display:block;filter:drop-shadow(0 6px 5px #20403775)}
.coop-poke .sprite-fallback .fallback-species{font-size:12px;font-weight:950;color:#f8fff4;text-shadow:1px 1px 3px #132e2a,0 0 9px #132e2a;}
@media(max-width:600px){.coop-poke .sprite-fallback{height:82px}.coop-poke .sprite-fallback .fallback-symbol{font-size:42px}.coop-poke .sprite-fallback .fallback-species{font-size:10px}}

/* ================= v14: actual 3D Pokémon miniature display ================= */
.pf-figurine{height:100%;width:100%;position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;min-height:80px;--pf-base-top:#88bb79;--pf-base-edge:#334e52}
.pf-figure-art{position:absolute;inset:0 0 13% 0;z-index:3;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 5px 4px #162d3280);animation:pf-mini-idle 2.6s ease-in-out infinite alternate;transform-origin:50% 100%}
.pf-model-viewer{height:100%;width:100%;position:absolute;inset:0;z-index:2;opacity:0;transition:opacity .35s;background:transparent;--poster-color:transparent;touch-action:pan-y;}
.pf-model-ready .pf-model-viewer{opacity:1}
.pf-figure-fallback{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:1;transition:opacity .3s;pointer-events:none}
.pf-model-ready .pf-figure-fallback{opacity:0}
.pf-figure-fallback>img{height:98%;width:95%;object-fit:contain;filter:drop-shadow(1px 8px 5px #1b322a8c);animation:pf-mini-fallback 2.4s ease-in-out infinite alternate}
.pf-figure-fallback .sprite-fallback{height:70%;width:75%;max-height:185px;border-radius:48% 48% 35% 35%;background:radial-gradient(circle at 30% 18%,#eef9d7a8,#83b19a 55%,#2b5453);display:flex;justify-content:center;align-items:center;flex-direction:column;border:2px solid #dffad669;box-shadow:inset 0 6px 13px #e0ffff4a,0 10px 20px #0b2b3190}
.pf-figure-fallback .fallback-symbol{font-size:clamp(30px,7vw,65px)}
.pf-figure-fallback .fallback-species{font-size:clamp(9px,1.2vw,14px);font-weight:900;color:#f1fff4;text-shadow:0 2px 4px #000}
.pf-miniature-base{position:absolute;bottom:1%;height:21%;width:80%;max-width:205px;z-index:1;border-radius:50%;background:linear-gradient(180deg,#d3e6bb 0%,var(--pf-base-top) 10%,#639864 55%,#1c4044 58%,#28464d 89%);border:3px solid #203c43;box-shadow:0 12px 11px #0b263c85,inset 0 4px 0 #d9f6c8a3;transform:perspective(380px) rotateX(53deg);pointer-events:none}
.pf-miniature-base:before{content:'';position:absolute;left:12%;top:9%;width:76%;height:55%;border-radius:50%;background:radial-gradient(ellipse,#97cb7e,#4c855c);box-shadow:0 0 0 2px #e0efcc4b}
.pf-miniature-base span{position:absolute;left:34%;top:15%;width:30%;height:45%;border-radius:50%;background:#152f3580;filter:blur(6px)}
.pf-figurine-aura{position:absolute;bottom:9%;height:28%;width:94%;border:3px solid #c5fbd3;border-radius:50%;opacity:.2;box-shadow:0 0 12px #83cdec88;z-index:0}
.coop-mini.is-turn .pf-figurine-aura{border-color:#77ffdd;opacity:1;box-shadow:0 0 17px #4effb2}
.coop-mini.is-target .pf-figurine-aura{border-color:#ffd363;opacity:1;box-shadow:0 0 17px #ffb821}
.coop-poke{width:min(100%,184px);height:165px;flex-shrink:0;overflow:visible;position:relative}
.coop-mini{overflow:visible;padding-bottom:14px}
.coop-mini .pf-figure-art{inset:0 0 9% 0}
.coop-mini .pf-miniature-base{bottom:-2%;width:84%}
.battle-poke{height:min(265px,45vw);width:min(260px,45vw);bottom:11%}
.battle-poke .pf-figurine{width:100%;height:100%}
/* Override the v7 image-flip rules: true 3D models rotate themselves. */
.player-side .battle-poke .pf-figure-fallback img{transform:scaleX(-1);animation:none}
.pf-under-attack .pf-figure-art{animation:pf-mini-hit .6s ease-out 1}
.pf-capture-target.catch-winning .pf-figure-art,.pf-single-catch-target.catch-winning .pf-figure-art{animation:pf-mini-absorb 1.45s ease-in both}
.pf-capture-target.catch-escaping .pf-figure-art,.pf-single-catch-target.catch-escaping .pf-figure-art{animation:pf-mini-escape 1.35s ease-out both}
@keyframes pf-mini-idle{0%{transform:translateY(0) rotate(-1deg)}100%{transform:translateY(-4px) rotate(1deg)}}
@keyframes pf-mini-fallback{0%{transform:translateY(0)}100%{transform:translateY(-4px)}}
@keyframes pf-mini-hit{0%,100%{transform:translateX(0)}23%{transform:translateX(-12px) rotate(-7deg)}50%{transform:translateX(9px) rotate(6deg)}72%{transform:translateX(-4px)}}
@keyframes pf-mini-absorb{0%,38%{opacity:1;transform:scale(1)}57%{opacity:.9;filter:brightness(3);transform:scale(.86)}70%{opacity:.4;transform:translate(8%,-16%) scale(.3)}100%{opacity:0;transform:translate(15%,23%) scale(.01)}}
@keyframes pf-mini-escape{0%,45%{transform:scale(1)}60%{transform:translateY(-10px) scale(1.14)}74%{transform:rotate(-8deg) scale(.92)}100%{transform:scale(1);opacity:1}}
/* Position the physical Poké Ball over whichever target the player selected. */
@keyframes pfCatchSuccess{0%{left:31%;top:62%;transform:scale(.75) rotate(-60deg);opacity:1}38%{left:calc(var(--pf-catch-x) - 5%);top:22%;transform:scale(1.25) rotate(130deg);opacity:1}53%{left:var(--pf-catch-x);top:48%;transform:scale(1.1) rotate(250deg)}69%{left:var(--pf-catch-x);top:70%;transform:rotate(310deg) scale(.92)}79%{left:var(--pf-catch-x);top:70%;transform:rotate(290deg) scale(.85)}89%{left:var(--pf-catch-x);top:70%;transform:rotate(330deg) scale(.9)}100%{left:var(--pf-catch-x);top:70%;transform:rotate(315deg) scale(.9);opacity:1}}
@keyframes pfCatchFail{0%{left:31%;top:62%;transform:scale(.7) rotate(-45deg);opacity:1}40%{left:var(--pf-catch-x);top:22%;transform:scale(1.15) rotate(140deg)}58%{left:var(--pf-catch-x);top:56%;transform:scale(1.05) rotate(240deg)}72%{left:80%;top:40%;transform:rotate(400deg) scale(1)}90%{left:98%;top:78%;transform:rotate(660deg) scale(.75);opacity:1}100%{left:112%;top:86%;transform:rotate(850deg) scale(.5);opacity:0}}
/* All party/storage entries now stand on matching mini bases. */
.pf-miniature-portrait{position:relative;display:inline-flex;width:65px;height:70px;flex:0 0 65px;align-items:center;justify-content:center;isolation:isolate}
.pf-miniature-portrait>img{position:relative;z-index:2;object-fit:contain;max-width:94%!important;max-height:83%!important;width:94%!important;height:83%!important;filter:drop-shadow(0 4px 4px #05232588)}
.pf-miniature-portrait>.sprite-fallback{position:relative;z-index:2;max-width:90%;max-height:84%;overflow:hidden}
.pf-miniature-portrait-base{position:absolute;bottom:0;left:9%;width:82%;height:19%;z-index:1;border-radius:50%;background:linear-gradient(180deg,#c2e4a9,#649868 50%,#274c50 51%,#173239);border:2px solid #203639;box-shadow:0 4px 5px #15252992}
.sheet-mon-img .pf-miniature-portrait{width:84px;height:90px}
.sheet-battle-pokemon .pf-miniature-portrait{width:64px;height:69px}
.party-mon .pf-miniature-portrait{width:65px;height:70px}
.party-mon .pf-miniature-portrait img{width:62px!important;height:62px!important}
.battle-finish-poke .pf-miniature-portrait{width:200px;height:190px}
.battle-finish-poke .pf-miniature-portrait img{width:180px!important;height:170px!important}
@media(max-width:960px){.coop-poke{height:130px}.coop-mini{min-height:230px}.pf-figure-fallback .fallback-symbol{font-size:40px}}
@media(max-width:600px){.coop-poke{height:96px}.coop-mini{min-height:180px}.pf-miniature-base{border-width:2px}.pf-figure-fallback .fallback-symbol{font-size:26px}.coop-mini .pf-figure-fallback .fallback-species{font-size:9px}}
@media(prefers-reduced-motion:reduce){.pf-figure-art,.pf-figure-fallback>img{animation:none!important}.pf-model-viewer{--auto-rotate-delay:999999}}

/* Offline miniature preview: toy-like SVG forms replace type-only symbols. */
.pf-toy-preview-svg{display:block;width:100%;height:100%;max-height:100%;filter:drop-shadow(2px 6px 4px #0e292c7d)}
.pf-figure-fallback{overflow:visible}.pf-figure-fallback>.pf-toy-preview-svg{width:94%;height:98%}
.pf-miniature-portrait .pf-thumb-toy{position:absolute;inset:3% 5% 10%;z-index:1;display:flex;align-items:center;justify-content:center;pointer-events:none}
.pf-miniature-portrait .pf-thumb-toy svg{height:100%;width:100%}
.pf-miniature-portrait>img{transition:opacity .2s}
.coop-mini .pf-figurine{flex:1}
/* PokéForge v15 — online family lobby, television presentation, DM dice guide */
#pf-cloud-dock{position:fixed;bottom:14px;left:14px;z-index:15000;color:#f7f5e8;font-family:inherit;pointer-events:none;max-width:min(430px,95vw)}
#pf-cloud-dock>*{pointer-events:auto}
.pf-cloud-buttons{display:flex;gap:8px;flex-wrap:wrap}
.pf-cloud-buttons button,.pf-cloud-link button,.pf-cloud-link a{border:1px solid #7eab8a;border-radius:11px;background:#1b4239;color:#e4f8e1;padding:10px 12px;font-weight:900;font-size:12px;text-decoration:none;box-shadow:0 5px 18px #06232199}
.pf-cloud-buttons button:first-child{background:#b7f38f;color:#164232}
.pf-cloud-sharing{max-height:min(530px,72vh);overflow-y:auto;margin-top:9px;background:#0f2e34f5;border:1px solid #78a47a;border-radius:16px;padding:16px;box-shadow:0 8px 35px #09272ac9;backdrop-filter:blur(15px)}
.pf-cloud-sharing[hidden]{display:none!important}
.pf-cloud-title{font-size:17px;font-weight:1000}.pf-cloud-room{margin-top:6px;font-size:12px}.pf-cloud-room strong{letter-spacing:2px;color:#b7f38f;font-size:17px}
.pf-cloud-tip{font-size:11px;line-height:1.5;color:#b7d3cb;margin:8px 0 12px}
.pf-cloud-link{display:flex;align-items:center;gap:7px;padding:10px 0;border-top:1px solid #325653}
.pf-cloud-link b{font-size:12px;flex:1;min-width:85px}
.pf-cloud-link button,.pf-cloud-link a{padding:8px 10px;font-size:11px;box-shadow:none}
.pf-cloud-pin{margin-top:10px;border-radius:10px;padding:10px;background:#294f48;font-size:13px;font-weight:800}
.pf-cloud-pin strong{color:#ffe7a0;letter-spacing:3px;font-size:22px;margin-left:8px}
.pf-cloud-toast{opacity:0;transform:translateY(8px);transition:.2s;pointer-events:none;background:#def6c4;color:#113f31;padding:9px 12px;border-radius:9px;font-size:12px;font-weight:900;margin-top:7px}
.pf-cloud-toast.visible{opacity:1;transform:translateY(0)}
.pf-tv-mode #playOverlay{inset:0;overflow:hidden}.pf-tv-mode #playOverlay .play-top,.pf-tv-mode #playOverlay .play-sidebar,.pf-tv-mode #playOverlay .play-banner,.pf-tv-mode #playOverlay .play-instructions{display:none!important}
.pf-tv-mode #playOverlay .play-shell{height:100dvh;min-height:100dvh;display:block}
.pf-tv-mode #playOverlay .play-columns{display:block;height:100dvh;min-height:0;padding:0}
.pf-tv-mode #playOverlay .play-map-area{height:100dvh;width:100vw}
.pf-tv-mode #playOverlay .play-board-wrap{min-height:100dvh;height:100dvh;width:100vw;padding:10px;border:0;border-radius:0;overflow:hidden;display:flex;justify-content:center;align-items:center;background:radial-gradient(circle,#325c4b 10%,#153d3c 80%)}
.pf-tv-mode #playOverlay .battle-arena{inset:0;padding:8px}
.pf-tv-mode #pf-cloud-dock{opacity:.55;transition:opacity .2s}.pf-tv-mode #pf-cloud-dock:hover,.pf-tv-mode #pf-cloud-dock:focus-within{opacity:1}
.dm-head-tools{display:flex;gap:8px;align-items:center}
.dm-chart-button{background:#2b5e56;color:#fff6d8;border:1px solid #7bab90;border-radius:9px;padding:9px;font-size:11px;font-weight:900;white-space:nowrap}
/* Type guide must appear OVER the private DM panel, including on phones. */
.type-guide-overlay{z-index:200500!important}
@media(max-width:600px){#pf-cloud-dock{bottom:8px;left:8px}.pf-cloud-buttons button{font-size:10px;padding:7px 8px}.dm-head{gap:6px}.dm-chart-button{padding:7px 6px;font-size:10px}}

/* v16 dashboard-paste D1 worker setup */
.pf-cloud-api{background:#0d3435f7;color:#eaffde;border:1px solid #b1dc97;border-radius:13px;padding:12px 14px;margin-bottom:9px;box-shadow:0 8px 26px #0822209b}
.pf-cloud-api[hidden]{display:none!important}
.pf-cloud-api strong{font-size:13px}.pf-cloud-api p{font-size:11px;line-height:1.4;margin:5px 0 8px;color:#b9d8c8}
.pf-cloud-api input{display:block;width:100%;background:#f7fff1;color:#203d39;padding:12px 9px;border-radius:9px;border:0;margin-bottom:8px;font-size:13px}
.pf-cloud-api button{width:100%;padding:10px;background:#b5e98c;color:#193d35;border:0;border-radius:9px;font-weight:900;cursor:pointer}

/* v17.2: Show full trainer and DM URLs for easy sharing/selection on TV or Chromebook. */
#pf-cloud-dock{max-width:min(550px,96vw)}
.pf-cloud-sharing{max-height:min(680px,80dvh)}
.pf-cloud-ready{color:#bdf6ad;background:#1b4b41;padding:9px 10px;border-radius:9px;font-weight:800;font-size:12px;margin:9px 0}
.pf-cloud-link{display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:13px 0}
.pf-cloud-link-name{font-size:14px;color:#e7ffc5}
.pf-cloud-url{display:block;box-sizing:border-box;width:100%;min-height:62px;padding:10px;border-radius:9px;border:1px solid #7ca69b;color:#e7fff8;background:#0b222b;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere;resize:vertical;cursor:text}
.pf-cloud-url:focus{outline:2px solid #b8eea2;outline-offset:2px}
.pf-cloud-link-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.pf-cloud-link-actions button,.pf-cloud-link-actions a{padding:9px 12px}
.pf-cloud-retry{width:100%;padding:11px;border:1px solid #b9e7ab;border-radius:10px;background:#1e5549;color:#fff;font-weight:800;cursor:pointer;margin:10px 0}
@media(max-width:600px){#pf-cloud-dock{left:8px;right:8px;max-width:none}.pf-cloud-sharing{max-height:78dvh;padding:13px}.pf-cloud-url{font-size:11px}}

/* v18: One short address + room code instead of three long credential URLs. */
.pf-cloud-shortlink{display:flex;flex-direction:column;align-items:flex-start;gap:9px;padding:14px;border-radius:12px;background:#16453d;border:1px solid #679785;margin:12px 0}
.pf-cloud-shortlink a{font-size:clamp(15px,2vw,21px);color:#ceffac;font-weight:900;text-decoration:underline;overflow-wrap:anywhere}
.pf-cloud-shortlink button{background:#d4ffb1;color:#18392f;border:0;border-radius:9px;padding:10px 14px;font-weight:900;cursor:pointer}
.pf-cloud-bigroom{font:900 clamp(17px,2.3vw,25px) ui-monospace,monospace;letter-spacing:0.07em;color:white;overflow-wrap:anywhere}
.pf-cloud-shortcode{display:flex;align-items:center;justify-content:space-between;padding:11px 14px;border-radius:10px;background:#123740;border:1px solid #487679;margin:8px 0}
.pf-cloud-shortcode b{font:900 26px ui-monospace,monospace;letter-spacing:.14em;color:#d1ffac}
@media(max-width:600px){.pf-cloud-shortcode b{font-size:22px}}

/* v19 — mobile/tablet gamepad layout: viewport-sized, no page scrolling. */
html:has(.dm-remote-body),body.dm-remote-body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body:has(.sheet-overlay:not(.hidden)){overflow:hidden}
.sheet-overlay:not(.hidden){inset:0;padding:0!important;align-items:stretch;justify-content:stretch;overflow:hidden;overscroll-behavior:contain}
.sheet-shell{width:100%!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;border:0!important;display:flex;overflow:hidden}
.sheet-top{flex:0 0 auto;min-height:46px!important;padding:5px max(10px,env(safe-area-inset-right)) 5px max(10px,env(safe-area-inset-left))!important;gap:7px}
.sheet-logo>span{width:27px;height:27px;font-size:17px;border-radius:8px}.sheet-logo strong{font-size:15px}.sheet-logo small{display:none}
.sheet-top .sheet-online{font-size:10px;margin-left:auto;white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.sheet-top .type-guide-sheet-btn{font-size:10px;padding:7px 8px}.sheet-top .sheet-close{width:31px;height:31px;padding:4px;flex:none}
.sheet-page{display:grid!important;flex:1;min-height:0;min-width:0;padding:8px!important;gap:7px!important;grid-template-columns:1fr minmax(300px,.9fr);grid-template-rows:54px minmax(0,1fr);overflow:hidden!important;align-items:stretch;align-content:stretch}
.sheet-profile{grid-column:1/-1;grid-row:1;min-height:0!important;gap:8px;padding:3px 11px!important;border-radius:11px}
.sheet-figure{width:46px;height:46px;border-radius:9px}.sheet-figure img{width:56px;height:56px}
.sheet-person{display:flex;align-items:center;gap:9px;flex:1;min-width:0}
.sheet-person>span{display:none}.sheet-person h1{font-size:17px;margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:35%}.sheet-person p{margin:0!important;font-size:11px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:30%}
.sheet-person button{font-size:10px;padding:6px 7px;white-space:nowrap;margin:0 0 0 auto}.sheet-person button+button{margin-left:0}
.sheet-main{grid-column:1;grid-row:2;min-height:0!important;min-width:0;overflow:hidden!important;border-radius:12px}
.sheet-tabs{flex:0 0 auto;padding:4px;gap:2px}.sheet-tabs button{padding:8px 2px;font-size:11px;border-radius:7px;min-height:35px}
.sheet-body{padding:7px!important;overflow:hidden!important;min-height:0!important;max-height:none!important;display:block;flex:1;position:relative}
.sheet-section-title{margin:3px 2px 5px}.sheet-section-title strong{font-size:13px}.sheet-section-title span{font-size:9px;padding:3px 7px}
.sheet-mon{min-height:0!important;padding:5px;margin-bottom:5px;gap:6px;border-radius:8px;max-height:none}
.sheet-mon .sheet-mon-img{width:38px!important;height:38px!important;border-radius:8px}.sheet-mon .sheet-mon-img img{width:36px!important;height:36px!important}.sheet-mon-img .pf-miniature-portrait{width:44px;height:43px}
.sheet-mon .sheet-mon-copy strong{font-size:11px}.sheet-mon .sheet-mon-copy span{font-size:9px}
.sheet-mon-actions{gap:3px}.sheet-mon-actions button{padding:5px!important;font-size:9px;min-height:27px}
.sheet-mon .xp-label,.sheet-mon .xp-meter,.sheet-mon .sheet-known-moves,.sheet-mon .sheet-learn-controls{display:none!important}
.sheet-mon.pf-expanded .xp-label,.sheet-mon.pf-expanded .xp-meter,.sheet-mon.pf-expanded .sheet-known-moves,.sheet-mon.pf-expanded .sheet-learn-controls{display:flex!important}
.sheet-mon.pf-expanded{align-items:start}.sheet-mon.pf-expanded .sheet-mon-copy{min-width:0}.sheet-mon.pf-expanded .sheet-learn-controls{flex-wrap:wrap}
.sheet-mon.sheet-empty{min-height:40px!important;padding:6px}
.sheet-bag-heading[hidden],.sheet-item[hidden],.sheet-mon[hidden]{display:none!important}
.sheet-item{padding:7px 1px;gap:6px}.sheet-item-icon{font-size:20px;width:28px}.sheet-item small{display:none}.sheet-item strong{font-size:11px}
.pf-list-pager{display:flex;gap:8px;justify-content:space-between;align-items:center;min-height:31px;padding:3px 2px;margin-bottom:5px}
.pf-list-pager strong{font-size:10px;color:#326b59}
.pf-list-pager button{border:1px solid #a5d4ac;border-radius:7px;background:#e0f7e0;color:#265449;padding:5px 9px;font-size:11px;font-weight:900}
.pf-list-pager button:disabled{opacity:.3}
.sheet-controls{grid-column:2;grid-row:2;min-height:0!important;min-width:0;overflow:hidden;gap:6px;padding:8px!important;border-radius:12px;display:flex;flex-direction:column}
.sheet-controls-head{flex:0 0 auto}.sheet-controls-head h2{font-size:15px;margin:0}.sheet-controls-head .sheet-kicker{display:none}.sheet-move-hint{padding:3px 5px;font-size:9px}
.sheet-pad-row{display:flex;flex:1;flex-direction:column;min-height:0;align-items:stretch;gap:5px}
.sheet-dpad{flex:none;grid-template-columns:repeat(3,clamp(40px,5.7dvh,52px));grid-template-rows:repeat(3,clamp(40px,5.7dvh,52px));gap:3px}.sheet-dpad button{font-size:22px;border-radius:10px}
.sheet-context{flex:1;min-height:0!important;width:100%;margin:0!important;padding:7px!important;gap:5px;overflow:hidden;justify-content:flex-start}
.sheet-context strong{font-size:11px}.sheet-context small{font-size:10px;line-height:1.16}.sheet-context button{padding:7px!important;min-height:30px}
.sheet-context-buttons{display:flex;flex-wrap:wrap;gap:4px}.sheet-context-buttons button{font-size:10px;flex:1 1 auto}.sheet-context-buttons select{max-width:100%;min-width:0;flex:1 1 65px}
.sheet-context .sheet-dice{gap:5px;flex-wrap:nowrap}.sheet-context .sheet-dice input{min-height:36px;font-size:17px;padding:5px;max-width:75px}.sheet-context .sheet-dice label{font-size:10px}
.sheet-invite{display:none}.sheet-context .pf-sheet-catch-hint{font-size:9px}
/* On a fight screen, replace the movement pad with the full attack interface. */
.pf-sheet-battle .sheet-dpad,.pf-sheet-battle .sheet-controls-head,.pf-sheet-battle .sheet-invite{display:none!important}
.pf-sheet-battle .sheet-context{background:#f8fdf5;display:flex;flex-direction:column;overflow:hidden}
.pf-sheet-battle .sheet-pad-row{display:block;flex:1;min-height:0}
.pf-sheet-battle .sheet-battle-head{display:grid;grid-template-columns:1fr 1fr;gap:4px;flex:none}
.pf-sheet-battle .sheet-battle-head>strong{grid-column:1/-1;font-size:11px}
.pf-sheet-battle .sheet-battle-pokemon{padding:3px;gap:3px;min-width:0}
.pf-sheet-battle .sheet-battle-pokemon .pf-miniature-portrait,.pf-sheet-battle .sheet-battle-pokemon .sprite-fallback{width:38px!important;height:38px!important;min-height:38px}
.pf-sheet-battle .sheet-battle-pokemon b{font-size:10px}.pf-sheet-battle .sheet-battle-pokemon small{font-size:9px}.pf-sheet-battle .sheet-battle-pokemon .sheet-hp-bar{margin:2px 0}
.pf-sheet-battle .sheet-context-label{margin:1px 0;font-size:10px;flex:none}
.pf-sheet-battle .sheet-battle-moves{gap:4px;flex:none}
.pf-sheet-battle .sheet-battle-moves button{padding:4px;min-height:48px;gap:0;border-radius:8px}
.pf-sheet-battle .sheet-battle-moves button span{font-size:16px}.pf-sheet-battle .sheet-battle-moves button strong{font-size:11px}.pf-sheet-battle .sheet-battle-moves button small{font-size:9px}
.pf-sheet-battle .sheet-matchup,.pf-sheet-battle .sheet-damage-phase{padding:5px 7px;margin:2px 0;font-size:10px;gap:2px;flex:none}
.pf-sheet-battle .sheet-context .sheet-dice{min-height:35px;flex:none}
.pf-sheet-battle .sheet-context-buttons{flex:1;align-content:start;gap:4px}
.pf-sheet-battle .sheet-context-buttons button{min-height:35px!important;font-size:11px}
.pf-sheet-battle .sheet-battle-head>strong,.pf-sheet-battle .sheet-context-label{color:#235e4b}
/* DM mobile full-screen. Settings and action tabs remain visible. */
.dm-panel:not(.hidden){inset:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;border:0;box-shadow:none;overflow:hidden!important;display:flex!important;flex-direction:column;padding:0!important}
.dm-remote-body .dm-panel{height:100dvh!important}
.dm-head{position:relative!important;flex:0 0 auto;padding:8px max(9px,env(safe-area-inset-right)) 8px max(9px,env(safe-area-inset-left));min-height:48px;gap:6px}
.dm-head small{font-size:8px;letter-spacing:.8px}.dm-head h2{font-size:17px;margin:1px 0 0}.dm-head button{padding:7px 8px;font-size:13px}
.dm-head-tools{gap:5px}.dm-chart-button{font-size:10px!important;padding:7px 8px!important;white-space:nowrap}
.dm-body.pf-dm-compact{width:100%;max-width:100%!important;min-height:0;flex:1;overflow:hidden!important;display:flex;flex-direction:column;gap:6px;padding:7px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));}
.pf-dm-tabs{order:0;flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;gap:5px}
.pf-dm-tabs button{font-size:12px;font-weight:900;padding:9px 7px;border-radius:9px;border:1px solid #467a80;background:#244550;color:#d0e4e3}
.pf-dm-tabs button.current{background:#e6bf72;color:#273c3a;border-color:#f6d58b}.pf-dm-tabs button:disabled{opacity:.55}
.pf-dm-compact>.dm-online{order:1;font-size:9px;padding:5px 7px;flex:0 0 auto}
.pf-dm-compact>.dm-toggle{order:2;padding:5px 8px;min-height:37px;flex:0 0 auto;border-radius:9px}.pf-dm-compact>.dm-toggle strong{font-size:10px}.pf-dm-compact>.dm-toggle small{display:none}
.pf-dm-compact>label{order:3;font-size:9px;flex:0 0 auto;letter-spacing:0}.pf-dm-compact>select{order:4;padding:6px!important;min-height:33px;flex:0 0 auto}
.pf-dm-compact>.pf-dm-section{order:5;flex:1;min-height:0;overflow:hidden!important;display:flex;flex-direction:column;gap:5px}
.pf-dm-compact>.pf-dm-section[hidden]{display:none!important}
.pf-dm-compact>.dm-footnote{display:none}
.pf-dm-compact>.dm-tip{order:6;font-size:11px}
.pf-dm-compact>.dm-battle{padding:7px;border-radius:9px;gap:5px;justify-content:start;align-content:start}
.pf-dm-compact .dm-status{font-size:10px}.pf-dm-compact .dm-battle h3{font-size:16px;margin:0}.pf-dm-compact .dm-battle h3 small{font-size:10px;display:inline}
.pf-dm-compact .dm-battle p{font-size:10px;margin:0;line-height:1.2}
.pf-dm-compact .dm-turn-ready,.pf-dm-compact .dm-turn-wait,.pf-dm-compact .dm-dice-prompt{padding:6px;font-size:10px;border-radius:7px}
.pf-dm-compact .dm-battle>label{font-size:9px}.pf-dm-compact .dm-moves{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.pf-dm-compact .dm-moves button{padding:7px 6px;border-radius:7px;font-size:11px;min-height:45px}.pf-dm-compact .dm-moves small{font-size:9px;margin-top:2px}
.pf-dm-compact .dm-lineup{gap:4px}.pf-dm-compact .dm-lineup button{padding:5px 2px;font-size:10px}
.pf-dm-compact .dm-dice-row{gap:4px;flex:none}.pf-dm-compact .dm-dice-row input{padding:7px;min-height:40px;font-size:16px}.pf-dm-compact .dm-dice-row button{padding:7px 9px;min-height:40px;font-size:11px}
.pf-dm-compact .dm-skip{padding:6px;font-size:10px}
.pf-dm-compact>.dm-encounters{padding:5px 0;gap:5px}.pf-dm-compact>.dm-encounters h3{margin:0;font-size:11px}.pf-dm-compact .dm-encounter{padding:8px;min-height:62px}
.pf-dm-compact .dm-encounter strong{font-size:12px}.pf-dm-compact .dm-encounter small{font-size:10px}
.pf-dm-compact .dm-encounter button{min-height:40px}
.dm-encounter[hidden]{display:none!important}
.pf-dm-compact .pf-list-pager{margin-top:auto}.pf-dm-compact .pf-list-pager strong{color:#ffe6aa}.pf-dm-compact .pf-list-pager button{background:#294e58;color:white;border-color:#517780}
/* portrait phone: battle first, trainer party below. Neither screen itself scrolls. */
@media(max-width:790px) and (orientation:portrait){
 .sheet-page{grid-template-columns:1fr;grid-template-rows:45px minmax(0,1fr) minmax(0,.76fr)}
 .sheet-profile{grid-column:1;grid-row:1}.sheet-main{grid-column:1;grid-row:3}.sheet-controls{grid-column:1;grid-row:2}
 .sheet-person h1{font-size:16px;max-width:35%}.sheet-person p{display:none}.sheet-person button{font-size:9px;padding:4px}
 .sheet-controls-head{display:none}.sheet-pad-row{flex-direction:row}.sheet-dpad{grid-template-columns:repeat(3,clamp(42px,6.5dvh,54px));grid-template-rows:repeat(3,clamp(42px,6.5dvh,54px))}
 .sheet-context{align-self:stretch}
 .pf-sheet-battle .sheet-page{grid-template-rows:40px minmax(0,1fr) minmax(96px,.34fr)}
 .pf-sheet-battle .sheet-main{grid-row:3}
 .pf-sheet-battle .sheet-controls{grid-row:2}
 .pf-sheet-battle .sheet-battle-head{gap:3px}
 .pf-sheet-battle .sheet-battle-pokemon .pf-miniature-portrait{height:34px!important;width:34px!important}
 .pf-sheet-battle .sheet-battle-moves button{min-height:45px;padding:3px}
 .pf-sheet-battle .sheet-context{gap:3px}
}
/* landscape tablet uses all three panels side-by-side */
@media(min-width:791px) and (orientation:landscape){
 .sheet-page{grid-template-columns:minmax(120px,.22fr) minmax(0,1fr) minmax(330px,.85fr);grid-template-rows:minmax(0,1fr)}
 .sheet-profile{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:start;gap:10px;padding:10px 5px!important}
 .sheet-figure{width:90px;height:90px}.sheet-figure img{width:97px;height:103px}
 .sheet-person{flex-direction:column;width:100%;gap:6px;text-align:center}
 .sheet-person>span{display:block;font-size:9px}.sheet-person h1{font-size:17px;max-width:100%}.sheet-person p{display:block;max-width:100%;white-space:normal}
 .sheet-person button{margin:0;width:95%}.sheet-main{grid-column:2;grid-row:1}.sheet-controls{grid-column:3;grid-row:1}
 .sheet-dpad{grid-template-columns:repeat(3,clamp(46px,7.2dvh,57px));grid-template-rows:repeat(3,clamp(46px,7.2dvh,57px))}
}
@media(max-width:790px) and (orientation:landscape){
 .sheet-page{grid-template-columns:minmax(190px,.44fr) minmax(0,1fr);grid-template-rows:1fr}
 .sheet-profile{display:none}.sheet-main{grid-column:1;grid-row:1}.sheet-controls{grid-column:2;grid-row:1}
 .sheet-dpad{grid-template-columns:repeat(3,36px);grid-template-rows:repeat(3,36px)}
 .sheet-pad-row{flex-direction:row}
 .pf-sheet-battle .sheet-context .sheet-battle-head{display:none}
}
@media(max-height:700px){
 .dm-head{min-height:40px;padding-top:4px;padding-bottom:4px}.pf-dm-compact>.dm-online{display:none}
 .pf-dm-compact>.dm-toggle{min-height:30px;padding:3px 7px}.pf-dm-compact>label{display:none}
 .pf-dm-compact>select{min-height:29px;padding:4px!important}
 .pf-dm-compact .dm-turn-ready{padding:4px}.pf-dm-compact .dm-moves button{min-height:39px;padding:5px}
 .pf-dm-compact .dm-lineup button{padding:3px 2px}
 .sheet-top{min-height:40px!important}.sheet-page{padding:4px!important;gap:4px!important}
 .sheet-person h1{font-size:14px}
 .pf-sheet-battle .sheet-battle-head>strong{display:none}
 .pf-sheet-battle .sheet-battle-moves button{min-height:38px}
 .pf-sheet-battle .sheet-matchup{display:none}
}
/* Focused Pokémon details replace the list, not the movement controls with a scroll. */
.pf-sheet-details .sheet-body>.sheet-section-title,.pf-sheet-details .sheet-body>.sheet-tip{display:none}
@media(max-width:790px) and (orientation:portrait){
 .pf-sheet-details .sheet-page{grid-template-rows:40px minmax(0,1fr)}
 .pf-sheet-details .sheet-controls{display:none}
 .pf-sheet-details .sheet-main{grid-row:2}
 .pf-sheet-details .sheet-mon.pf-expanded{display:flex;align-items:start}
 .pf-sheet-details .sheet-mon.pf-expanded .sheet-mon-copy{flex:1}
 .pf-sheet-details .sheet-mon.pf-expanded .sheet-known-moves{gap:4px}
 .pf-sheet-details .sheet-mon.pf-expanded .sheet-learn-controls{padding:6px}
}

/* v20 automatic evolution and move learning — compact phone/tablet detail view */
.pf-progress-next{display:grid;gap:3px;margin-top:5px;font-size:11px;font-weight:700;color:#b5e6ce;line-height:1.28}
.pf-progress-next>span{color:#ffdf86}.pf-progress-next>small{font-size:9px;color:#92b5c6;font-weight:500}
.pf-progress-news{display:flex;align-items:center;gap:5px;padding:5px 8px;border-radius:9px;background:#183b44;color:#e5fff2;min-height:27px;font-size:10px;flex-shrink:0;overflow:hidden}
.pf-progress-news>span{max-width:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pf-progress-news>button{margin-left:auto;padding:4px 7px;background:#35797f;border:0;border-radius:6px;color:white;flex-shrink:0;cursor:pointer}
@media(max-width:500px){.pf-progress-news>span:nth-of-type(n+2){display:none}.pf-progress-news>span{max-width:120px}}

.pf-v20-victory-events{display:grid;gap:3px;max-width:420px;margin:4px auto 8px;color:#d6ffe8;font-size:12px;line-height:1.2}
.pf-v20-victory-events>div{border:1px solid #43827a;border-radius:6px;background:#1b4544;padding:3px 6px}
.pf-v20-victory-events>div:has(+div){animation:pfNewMove .65s ease-out}
@keyframes pfNewMove{0%{opacity:0;transform:translateY(5px)}100%{opacity:1;transform:translateY(0)}}

.pf-evolution-victory{display:flex;justify-content:center;align-items:center;gap:8px;margin:7px auto;padding:6px;background:rgba(20,80,66,.8);border-radius:12px;max-width:340px;border:1px solid #92dda8;color:#ffefaa}
.pf-evolution-victory b{display:grid;font-size:13px;gap:1px}.pf-evolution-victory small{color:#dff;white-space:nowrap;font-size:10px}
.pf-evolution-mini{width:58px;height:58px;overflow:hidden;display:flex;justify-content:center;align-items:center;flex-shrink:0}
.pf-evolution-mini img{max-width:55px;max-height:55px;object-fit:contain}
.pf-evolution-mini.pf-evolved{animation:pfEvolutionGlow .9s 2 ease-in-out}
@keyframes pfEvolutionGlow{0%{filter:brightness(1);transform:scale(.8)}50%{filter:brightness(2.2) drop-shadow(0 0 10px #e9e4a4);transform:scale(1.18)}100%{filter:brightness(1);transform:scale(1)}}

/* v4: compact inclusive trainer selection in every tablet/desktop creator */
.creator-gender-row{grid-template-columns:repeat(2,minmax(0,1fr));}
.creator-gender-row .creator-style{font-size:15px;padding:13px 9px;min-height:46px;}
.creator-gender-row .creator-style.active{box-shadow:inset 0 -3px #82c7a5,0 0 0 2px #4b9d8060;}
