:root{--fg: #f4f4f4;--panel: rgba(16, 20, 32, .88);--accent: #3cb371;--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;height:100%;overflow:hidden;background:#000;color:var(--fg);font-family:var(--font)}#game,#game canvas{position:fixed;inset:0;display:block;image-rendering:pixelated}.panel{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(340px,calc(100vw - 32px));padding:24px;background:var(--panel);border-radius:12px;display:flex;flex-direction:column;gap:14px}.panel h1{margin:0;font-size:22px;text-align:center}.panel input:not([type=radio]),#chat-input{width:100%;margin-top:4px;padding:8px 10px;font:inherit;color:var(--fg);background:#ffffff14;border:1px solid rgba(255,255,255,.2);border-radius:6px;outline:none}.avatars{display:flex;gap:18px}#login button,.panel>button{padding:10px;font:inherit;font-weight:600;color:#fff;background:var(--accent);border:0;border-radius:6px;cursor:pointer}.error{margin:0;min-height:1em;color:#ff7676;font-size:14px}#map-name{position:fixed;top:12px;left:12px;padding:8px 16px;background:var(--panel);border-radius:6px;font-weight:600;letter-spacing:.04em;opacity:0;transition:opacity .3s;pointer-events:none}#map-name.show{opacity:1}#chat{position:fixed;left:12px;bottom:12px;width:min(420px,calc(100vw - 24px));font-size:14px}#chat-log{max-height:30vh;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;text-shadow:0 1px 2px #000}#chat-log b{color:#ffd75e}#chat-input{opacity:.35}#chat-input:focus{opacity:1}#help{position:fixed;right:12px;bottom:12px;font-size:12px;opacity:.6;text-shadow:0 1px 2px #000}.dialog{position:fixed;left:50%;bottom:16px;transform:translate(-50%);width:min(720px,calc(100vw - 32px));min-height:96px;padding:16px 44px 16px 20px;background:#f8f8f8;color:#303030;border:4px solid #4a6b8a;border-radius:10px;box-shadow:0 0 0 3px #f8f8f8,0 6px 24px #00000080;font-size:18px;line-height:1.5;white-space:pre-line;z-index:20;cursor:pointer}.dialog-arrow{position:absolute;right:16px;bottom:10px;color:#d04040;font-size:14px;animation:bob .8s infinite}@keyframes bob{50%{transform:translateY(3px)}}.menu{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);min-width:220px;max-width:calc(100vw - 32px);padding:12px;background:#f8f8f8;color:#303030;border:4px solid #4a6b8a;border-radius:10px;box-shadow:0 6px 24px #00000080;z-index:30}.menu-title{margin:2px 6px 10px;font-weight:700}.menu-items{display:grid;grid-template-columns:repeat(var(--cols, 1),minmax(0,1fr));gap:6px}.menu-item{display:flex;align-items:center;gap:8px;padding:8px 12px 8px 22px;font:inherit;font-weight:600;text-align:left;color:inherit;background:transparent;border:0;border-radius:6px;cursor:pointer;position:relative}.menu-item.active{background:#e3ecf5}.menu-item.active:before{content:"►";position:absolute;left:6px;color:#d04040;font-size:12px}.menu-item:disabled{opacity:.4;cursor:default}.menu-detail{margin-left:auto;font-weight:400;font-size:13px;opacity:.75}.menu-icon{width:48px;height:48px;image-rendering:pixelated}.menu.starter .menu-item{flex-direction:column;padding:12px 18px}.menu.starter .menu-icon{width:128px;height:128px}.menu.small{min-width:200px}.hpbar{height:8px;background:#384850;border:2px solid #384850;border-radius:4px;overflow:hidden}.hpbar-fill{height:100%;border-radius:2px}.hp-high{background:#58d080}.hp-mid{background:#f8c838}.hp-low{background:#f05838}.expbar{height:5px;margin-top:4px;background:#384850;border-radius:3px;overflow:hidden}.expbar-fill{height:100%;background:#40a8f8}.status{padding:0 5px;border-radius:3px;font-size:11px;font-weight:700;color:#fff;background:#888}.status-brn{background:#e06030}.status-par{background:#c8a820}.status-slp{background:#8890a0}.status-frz{background:#60b0e0}.status-psn,.status-tox{background:#a050c0}.status-fnt{background:#c04040}.party{width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;z-index:25}.party h2{margin:0;font-size:18px}.party-list{display:flex;flex-direction:column;gap:6px}.party-row{display:flex;align-items:center;gap:12px;padding:6px 10px;border-radius:8px;background:#ffffff0d;cursor:pointer}.party-row.active{background:#3cb37140;outline:2px solid var(--accent)}.party-row.fainted{opacity:.6}.party-icon{width:48px;height:48px;image-rendering:pixelated}.party-info{flex:1;display:flex;flex-direction:column;gap:4px}.party-top{display:flex;gap:8px;align-items:center}.party-hp{font-size:12px;opacity:.8}.party-detail{padding:10px;border-radius:8px;background:#ffffff0d}.move-line{display:flex;justify-content:space-between;margin-top:6px}.muted{opacity:.65;font-size:13px}.hint{text-align:center}.gender{color:#8fc1ff}.battle{position:fixed;inset:0;z-index:15;display:grid;grid-template-rows:1fr auto;grid-template-columns:1fr auto;background:#000}.battle.intro{animation:battle-in .7s steps(1) forwards}.battle.intro>*{visibility:hidden}@keyframes battle-in{0%,30%,60%{background:#fff}15%,45%,75%,to{background:#000}}.battle.outro{animation:fade-out .35s forwards}@keyframes fade-out{to{opacity:0}}.battle-scene{grid-column:1 / -1;position:relative;overflow:hidden;background:linear-gradient(#f8f0d8,#e8f0c0 55%,#b8d890)}.battle-scene.rom{background:#000}.battle-stage{position:absolute;left:50%;top:50%;width:240px;height:112px;transform:translate(-50%,-50%) scale(var(--k, 1));overflow:hidden}.battle-scene:not(.rom) .battle-stage{background:radial-gradient(ellipse 52px 13px at 176px 64px,#6cb06c 60%,transparent 62%),radial-gradient(ellipse 62px 15px at 72px 108px,#6cb06c 60%,transparent 62%)}.battle-bg{position:absolute;left:0;top:0;width:240px;height:160px;image-rendering:pixelated;display:none}.battle-scene.rom .battle-bg{display:block}.bsprite{position:absolute;width:64px;height:64px;image-rendering:pixelated;opacity:0;transition:opacity .25s,transform .25s}.bsprite.engine{visibility:hidden}.bsprite.show{opacity:1}.bsprite.foe{left:144px;top:8px}.bsprite.own{left:40px;top:48px}.bsprite.faint{opacity:0;transform:translateY(40%)}.bsprite.gone{opacity:0}.bsprite.hit{animation:blink .4s steps(2) 1}@keyframes blink{50%{opacity:.1}}.bsprite.own.lunge{transform:translate(6%,-4%)}.bsprite.foe.lunge{transform:translate(-6%,4%)}.bsprite.shake{opacity:1;animation:shake .35s}@keyframes shake{25%{transform:rotate(-12deg) scale(.3)}75%{transform:rotate(12deg) scale(.3)}}.bbox{position:absolute;width:min(300px,42vw);padding:8px 12px 10px;background:#f8f8e8;color:#303030;border:3px solid #506858;border-radius:10px 4px;box-shadow:0 3px #0003}.bbox:not(.own){left:calc(var(--sl, 0px) + var(--sw, 100%) * .03);top:calc(var(--st, 0px) + var(--sh, 100%) * .06)}.bbox.own{right:calc(var(--sl, 0px) + var(--sw, 100%) * .03);bottom:calc(var(--st, 0px) + var(--sh, 100%) * .06)}.bbox-head{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-weight:700}.bbox-level{margin-left:auto}.bbox-hp{margin-top:4px;text-align:right;font-weight:600;font-size:14px}.battle-text{min-height:92px;padding:16px 20px;background:#283850;color:#f8f8f8;border-top:4px solid #c8a848;font-size:19px;line-height:1.45;white-space:pre-line}.battle-menu{position:relative;background:#283850;border-top:4px solid #c8a848}.battle-menu .menu{position:static;transform:none;margin:8px;min-width:min(380px,48vw)}.battle-menu .menu.switch{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}@media(max-width:640px){.battle{grid-template-columns:1fr}.battle-menu .menu{min-width:0}}.party-hud{position:fixed;top:12px;right:12px;width:190px;display:flex;flex-direction:column;gap:4px;padding:6px;background:var(--panel);border-radius:8px;cursor:pointer;z-index:5}.ph-row{display:flex;align-items:center;gap:6px}.ph-row.fainted{opacity:.5}.ph-icon{flex:none;width:32px;height:32px;background-size:32px 64px;background-repeat:no-repeat;image-rendering:pixelated;animation:icon-bob .5s steps(1) infinite}.ph-row.fainted .ph-icon{animation:none}@keyframes icon-bob{0%{background-position:0 0}50%{background-position:0 -32px}}.ph-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.ph-top{display:flex;gap:4px;align-items:center;font-size:11px;font-weight:600}.ph-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ph-level{margin-left:auto;opacity:.8}.party-hud .hpbar{height:5px;border-width:1px}.bsprite.trainer{z-index:1}@media(max-width:640px){.party-hud{width:140px}}.bag,.shop{width:min(460px,calc(100vw - 32px));max-height:calc(100vh - 32px);z-index:25}.bag h2{margin:0;font-size:18px}.bag-tabs{display:flex;flex-wrap:wrap;gap:4px}.bag-tab{padding:4px 8px;font:inherit;font-size:12px;font-weight:700;color:var(--fg);background:#ffffff0f;border:0;border-radius:6px;cursor:pointer}.bag-tab.active{background:var(--accent)}.bag-list{display:flex;flex-direction:column;gap:2px;min-height:160px;max-height:46vh;overflow:auto}.bag-row{display:flex;justify-content:space-between;padding:6px 10px;border-radius:6px;cursor:pointer}.bag-row.active{background:#3cb37140;outline:2px solid var(--accent)}.bag-desc{min-height:3em;padding:8px 10px;font-size:13px;background:#ffffff0d;border-radius:6px}.shop{padding:0;background:transparent}.shop .menu{position:static;transform:none;width:100%}.shop-list .menu-items{max-height:60vh;overflow:auto}.qty{text-align:center;z-index:40}.qty-value{font-size:28px;font-weight:700}.qty-total{margin-bottom:6px;font-weight:600}.ph-list{display:flex;flex-direction:column;gap:4px}.ph-money{padding-top:4px;border-top:1px solid rgba(255,255,255,.12);font-size:12px;font-weight:700;text-align:right}.party{width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto}.party-head{display:flex;justify-content:space-between;align-items:baseline}.party-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:14px}.party-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;align-content:start}.party-slot{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:132px;padding:8px;border-radius:10px;background:#ffffff0f;border:2px solid transparent;cursor:grab;user-select:none;touch-action:none}.party-slot.empty{background:#ffffff05;border:2px dashed rgba(255,255,255,.12);cursor:default}.party-slot.active{border-color:var(--accent);background:#3cb3712e}.party-slot.moving{border-color:#ffd75e;border-style:dashed}.party-slot.drop{border-color:#ffd75e;background:#ffd75e26}.party-slot.fainted{opacity:.55}.party-slot .party-info{width:100%;text-align:center}.party-slot .party-top{justify-content:center;font-size:12px}.drag-ghost{position:fixed;z-index:100;pointer-events:none;transform:translate(-50%,-50%) rotate(-3deg);opacity:.9;box-shadow:0 8px 24px #00000080}.party-summary{display:flex;flex-direction:column;gap:10px;padding:10px;border-radius:10px;background:#ffffff0d;min-width:0}.summary-tabs{display:flex;gap:4px}.summary-info{display:grid;grid-template-columns:112px 1fr;gap:12px}.summary-left{display:flex;flex-direction:column;gap:6px}.summary-pic{width:112px;height:112px;image-rendering:pixelated;background:#ffffff0f;border-radius:8px}.summary-rows{display:flex;flex-direction:column;gap:4px;font-size:13px}.summary-row{display:flex;justify-content:space-between;gap:8px}.summary-types{display:flex;gap:4px}.summary-exp{margin-top:8px}.stats-table{width:100%;border-collapse:collapse;font-size:13px}.stats-table th,.stats-table td{padding:4px 6px;text-align:right}.stats-table th:first-child{text-align:left}.stats-table tr+tr{border-top:1px solid rgba(255,255,255,.06)}.stats-table tr.up th{color:#ff8a7a}.stats-table tr.down th{color:#7ab4ff}.stats-table .perfect{color:#ffd75e;font-weight:700}.stats-table .stat-value,.stats-table .totals{font-weight:700}.stat-base{display:flex;align-items:center;justify-content:flex-end;gap:6px}.stat-bar{width:60px;height:5px;border-radius:3px;background:#ffffff1a;overflow:hidden}.stat-bar-fill{height:100%;background:var(--accent)}.summary-moves{display:flex;flex-direction:column;gap:6px}.move-card{padding:8px 10px;border-radius:8px;background:#ffffff0d}.move-top{display:flex;justify-content:space-between;align-items:center}.move-stats{margin-top:4px}.type{padding:1px 6px;border-radius:4px;font-size:10px;font-weight:700;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.4)}.type-0{background:#a8a878}.type-1{background:#c03028}.type-2{background:#a890f0}.type-3{background:#a040a0}.type-4{background:#e0c068}.type-5{background:#b8a038}.type-6{background:#a8b820}.type-7{background:#705898}.type-8{background:#b8b8d0}.type-9{background:#68a090}.type-10{background:#f08030}.type-11{background:#6890f0}.type-12{background:#78c850}.type-13{background:#f8d030}.type-14{background:#f85888}.type-15{background:#98d8d8}.type-16{background:#7038f8}.type-17{background:#705848}@media(max-width:700px){.party-body{grid-template-columns:1fr}}.fx{position:absolute;z-index:3;pointer-events:none;image-rendering:pixelated;background-repeat:no-repeat}@keyframes fx-frames{to{background-position-x:var(--fx-end)}}.fx-stat{position:absolute;z-index:3;pointer-events:none;mask-image:var(--mask);-webkit-mask-image:var(--mask);mask-size:100% 100%;-webkit-mask-size:100% 100%;opacity:.75;mix-blend-mode:screen}.fx-stat.up{background:repeating-linear-gradient(0deg,#ff5a3ce6 0 6px,#ffd25066 6px 14px);animation:stat-rise .9s linear}.fx-stat.down{background:repeating-linear-gradient(0deg,#3c78ffe6 0 6px,#78c8ff66 6px 14px);animation:stat-fall .9s linear}@keyframes stat-rise{0%{background-position-y:0}to{background-position-y:-112px}}@keyframes stat-fall{0%{background-position-y:0}to{background-position-y:112px}}
