@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');
:root{--navy:#0d1b2a;--panel:#16283a;--panel2:#20364d;--blue:#087bb9;--cyan:#18c5db;--gold:#ffb52e;--ink:#eff6ff;--muted:#b8c7d8}*{box-sizing:border-box}body{margin:0;background:#eef3f8;color:#17283b;font-family:Nunito,Arial,sans-serif}.hero{padding:14px 18px 0;background:linear-gradient(180deg,#06172b,#0b3b63)}.hero-art{height:190px;max-width:1260px;margin:auto;position:relative;overflow:hidden;border:2px solid #35d8ed;border-radius:8px;background:radial-gradient(circle at 25% 35%,#1ecbe2 0,transparent 30%),radial-gradient(circle at 78% 25%,#4377c5 0,transparent 32%),linear-gradient(120deg,#071a43,#0c6a9b 55%,#081c43);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 22px #0004}.brand{text-align:center;z-index:2;color:white;text-shadow:0 3px 0 #06152d,0 0 18px #00d9ff}.brand-small{font-weight:900;letter-spacing:5px;color:#9af5ff;font-size:12px}.brand h1{font-size:clamp(40px,6vw,72px);line-height:.95;margin:8px 0;font-weight:900;font-style:italic;letter-spacing:-2px}.brand h1 em{color:#ffcb35;font-style:normal}.brand p{font-size:14px;letter-spacing:3px;font-weight:900}.mascot{position:absolute;font-size:94px;filter:drop-shadow(0 4px 7px #001a37)}.mascot.left{left:6%;transform:rotate(-18deg)}.mascot.right{right:7%;font-size:88px}.orb{position:absolute;border-radius:50%;background:#a3f7ff3b;border:1px solid #bafaff55}.orb1{width:170px;height:170px;left:25%;top:-85px}.orb2{width:250px;height:250px;right:20%;bottom:-200px}.topnav{max-width:1260px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;gap:22px;background:#0a2440;color:white}.topnav a{color:#e8f8ff;text-decoration:none;font-weight:800}.topnav a:hover{color:#ffcc44}.nav-user{margin-left:auto;color:#a6f4ff}.logout-form{margin:0}.nav-logout{background:#203b59;border:1px solid #54718d;color:white;border-radius:8px;padding:7px 12px;cursor:pointer}.nav-admin{display:inline-flex;align-items:center;background:#087bb9;border:1px solid #31b8d0;color:white!important;text-decoration:none;border-radius:8px;padding:7px 12px;font-weight:800}.nav-admin:hover{background:#0a91ce;color:white!important}.layout{max-width:1260px;margin:18px auto;display:grid;grid-template-columns:205px minmax(0,1fr) 205px;gap:16px;padding:0 12px;align-items:start}.sidebar{border:1px solid #b9d3e1;border-radius:10px;overflow:hidden;background:#fff;box-shadow:0 4px 12px #163c5520}.sidebar section+section{border-top:1px solid #d7e4ed}.sidebar h3{margin:0;padding:11px 13px;background:linear-gradient(90deg,#0874b3,#15c4d8);color:#fff;font-size:14px}.sidebar a,.sidebar p{display:block;margin:0;padding:8px 13px;color:#39546c;text-decoration:none;font-size:13px}.sidebar a:hover{background:#e8faff;color:#0875ae}.sidebar p{line-height:1.5}.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#26c281;margin-right:4px}.content{min-width:0}.welcome,.form-wrap,.character-wrap,.game-welcome{background:#fff;border:1px solid #d3e1eb;border-radius:14px;box-shadow:0 8px 25px #183b5517;padding:30px}.welcome{text-align:center;min-height:450px}.eyebrow{font-size:11px;letter-spacing:2.5px;color:#0b8db4;font-weight:900}.welcome h2,.form-wrap h2,.character-wrap h2,.game-welcome h2{color:#064f89;font-size:clamp(25px,3vw,36px);margin:8px 0 15px;font-weight:900}.welcome p{max-width:690px;margin:12px auto;color:#536579;line-height:1.65}.welcome .lead{font-size:18px;color:#263e55}.cta-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:28px auto;max-width:650px}.cta{display:flex;flex-direction:column;gap:5px;text-align:left;padding:15px 18px;border-radius:12px;text-decoration:none;border:1px solid #d3e0e9}.cta span{font-size:13px;color:#5c6e7e}.cta b{font-size:18px}.cta.primary{background:#fff5b8;border-color:#ffda50;color:#895000}.cta.secondary{background:#e9f7ff;color:#075a92}.feature-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:25px}.feature-row div{padding:14px 6px;background:#f3f8fc;border-radius:10px;font-size:24px;display:flex;flex-direction:column;gap:4px}.feature-row b{font-size:13px;color:#29445b}.feature-row small{font-size:11px;color:#778b9c}.form-wrap{max-width:540px;margin:0 auto;padding:36px}.form-wrap.narrow{max-width:480px}.form-wrap>p,.character-wrap>p{color:#687a8b}.stack-form{display:flex;flex-direction:column;gap:17px;margin-top:25px}.stack-form label,.field-label{display:flex;flex-direction:column;gap:7px;font-weight:800;color:#233e56;font-size:14px}.stack-form input,.dark-input{height:45px;border:1px solid #bdcedb;border-radius:8px;padding:0 13px;font:inherit;outline:none;background:#fbfdff}.stack-form input:focus,.dark-input:focus{border-color:#168bc1;box-shadow:0 0 0 3px #168bc122}.button{display:inline-flex;justify-content:center;align-items:center;border:0;border-radius:9px;background:linear-gradient(110deg,#087fbd,#06b5c8);color:white;font:800 15px Nunito,Arial,sans-serif;padding:13px 18px;cursor:pointer;text-decoration:none;box-shadow:0 4px 10px #078bb52c}.button:hover{filter:brightness(1.05);transform:translateY(-1px)}.form-foot{font-size:13px!important;margin-top:20px!important}.form-foot a{color:#087db6;font-weight:900}.alert{max-width:800px;margin:14px auto 0;padding:12px 16px;border-radius:9px}.error{background:#fff0ef;color:#a62b28;border:1px solid #ffc7c3}.character-wrap{background:#0e1c2c;color:#edf5ff;border:1px solid #203a52;padding:24px}.character-wrap h2{color:#fff}.character-wrap h3{font-size:17px;margin:22px 0 12px}.gender-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.choice{position:relative;border:1px solid #354e67;border-radius:15px;background:#172a3d;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-direction:column;transition:.15s}.choice input{position:absolute;opacity:0;pointer-events:none}.choice.selected{border-color:#ffad25;box-shadow:0 0 0 2px #ffad2538;background:#20374e}.gender-choice{min-height:145px;gap:4px}.avatar{font-size:49px}.choice b{letter-spacing:1px}.field-label{margin-top:23px;color:#c7d5e4}.dark-input{background:#0e1b2b;border-color:#3b536d;color:#fff;height:54px;margin-top:1px}.character-wrap .starter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.starter-choice{min-height:185px;padding:13px 7px 12px;gap:7px}.number{position:absolute;left:10px;top:10px;background:#f4f7fa;color:#152536;padding:2px 7px;border-radius:5px;font-size:12px;font-weight:900;letter-spacing:2px}.creature{font-size:53px;width:75px;height:67px;display:grid;place-items:center;filter:drop-shadow(0 5px 3px #0003)}.types{display:flex;gap:5px;flex-wrap:wrap;justify-content:center}.type{font-size:12px;font-weight:900;color:#fff;padding:5px 9px;border-radius:6px}.type.planta{background:#88c843;color:#12220b}.type.veneno{background:#b16ac4}.type.fuego{background:#f17d2e}.type.agua{background:#489bd1}.selected-info{display:flex;align-items:center;gap:13px;margin-top:16px;padding:15px;background:#192d41;border-radius:13px}.big-emoji{font-size:39px}.selected-info>div{flex:1}.selected-info p{font-size:12px;color:#b5c8d9;margin:3px 0 0}.selected-info .button{background:#2a435d;box-shadow:none;border:1px solid #4b6580;white-space:nowrap}.game-welcome{background:#f8fbff}.player-card,.companion-card,.coming-soon{display:flex;align-items:center;gap:18px;padding:18px;border-radius:12px;background:#eaf4fb;margin-top:15px}.player-avatar,.companion-art{width:76px;height:76px;display:grid;place-items:center;background:#d2eaf8;border-radius:14px;font-size:43px}.player-card small,.companion-card small{font-size:10px;letter-spacing:1px;color:#648198;font-weight:900}.player-card h3,.companion-card h3{margin:3px 0;color:#104e7b}.player-card span,.companion-card p{font-size:13px;color:#5c7183}.companion-card{align-items:flex-start}.companion-art{font-size:47px;background:#fff0d4}.companion-card .types{justify-content:flex-start}.coming-soon{background:#fff6d9;color:#604b18}.coming-soon>span{font-size:32px}.coming-soon p{margin:4px 0;font-size:13px}.link-button{margin-top:18px}footer{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap;text-align:center;padding:22px;color:#647a8d;font-size:12px}footer b{color:#15527b}@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{display:none}.topnav{flex-wrap:wrap}.nav-user{margin-left:0}.hero-art{height:160px}.mascot{font-size:62px}.mascot.right{font-size:60px}.welcome{min-height:0}}@media(max-width:540px){.hero{padding:8px 8px 0}.hero-art{height:135px}.brand h1{font-size:39px}.brand p{font-size:9px;letter-spacing:1px}.brand-small{font-size:9px;letter-spacing:2px}.mascot.left{left:2%;font-size:43px}.mascot.right{right:2%;font-size:42px}.topnav{gap:13px;padding:12px;font-size:13px}.layout{margin:12px auto;padding:0 9px}.welcome,.form-wrap,.character-wrap,.game-welcome{padding:20px}.cta-row{grid-template-columns:1fr}.feature-row{grid-template-columns:1fr}.feature-row div{flex-direction:row;align-items:center;text-align:left;padding:10px}.feature-row small{margin-left:auto}.character-wrap .starter-grid{gap:7px}.starter-choice{min-height:155px}.creature{font-size:41px;width:55px}.starter-choice b{font-size:12px}.type{font-size:10px;padding:4px 6px}.selected-info{flex-wrap:wrap}.selected-info .button{width:100%}.number{left:5px;top:5px;font-size:10px}.gender-choice{min-height:120px}}

/* Imágenes locales del proyecto en assets/Img */
.avatar{display:flex;align-items:center;justify-content:center;height:72px}
.avatar img{width:64px;height:64px;object-fit:contain;image-rendering:pixelated}
.creature img{width:100%;height:100%;object-fit:contain}
.big-emoji{width:66px;height:66px;flex:0 0 66px;display:grid;place-items:center}
.big-emoji img{width:100%;height:100%;object-fit:contain}
.player-avatar{padding:4px}
.saved-avatar{width:64px;height:64px;object-fit:contain;image-rendering:pixelated}
.companion-art{padding:4px;flex:0 0 76px}
.companion-art img{width:100%;height:100%;object-fit:contain}

.menu-count{float:right;font-size:10px;color:#0b91b5;font-weight:900}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.profile-stats div{background:#eef6fc;border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:4px}.profile-stats b{color:#087bb9;font-size:20px}.profile-stats span{font-size:12px;color:#667f93}.companion-art img,.team-pokemon img{width:100%;height:100%;object-fit:contain}.dex-wrap{background:#fff;border:1px solid #d3e1eb;border-radius:14px;box-shadow:0 8px 25px #183b5517;padding:28px}.dex-wrap h2{font-size:32px;color:#064f89;margin:8px 0}.dex-wrap>p{color:#61788b}.dex-summary{padding:15px;background:#eef7fc;border-radius:10px;margin:18px 0}.dex-summary b{font-size:22px;color:#087bb9}.dex-summary small{font-size:13px;color:#61788b}.dex-progress{height:8px;background:#d5e4ef;border-radius:10px;margin-top:10px;overflow:hidden}.dex-progress span{display:block;height:100%;background:linear-gradient(90deg,#0aa9cb,#67d5c5);border-radius:10px}.dex-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.dex-card{min-width:0;position:relative;border:1px solid #d7e3ec;border-radius:10px;padding:10px 6px;text-align:center;display:flex;align-items:center;flex-direction:column;gap:5px;background:#f6f9fc}.dex-card.caught{border-color:#8ed7b6;background:#effcf5}.dex-number{font-size:11px;color:#71889a;font-weight:900;letter-spacing:1px}.dex-image{height:68px;width:100%;display:grid;place-items:center;color:#aab8c4;font-size:34px}.dex-image img{max-width:100%;width:66px;height:66px;object-fit:contain}.dex-card b{font-size:12px;overflow-wrap:anywhere}.dex-status{font-size:10px;color:#73899b}.caught .dex-status{color:#16855a;font-weight:900}.dex-note{font-size:12px;line-height:1.5}.team-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}.team-card{position:relative;display:flex;align-items:center;gap:13px;padding:16px;border-radius:12px;background:#eaf4fb;min-height:135px}.team-slot{position:absolute;left:9px;top:8px;font-size:10px;font-weight:900;color:#67849b}.team-pokemon{flex:0 0 80px;width:80px;height:80px;border-radius:12px;background:#fff0d4;display:grid;place-items:center;font-size:40px;overflow:hidden}.team-card h3{margin:2px 0;color:#104e7b}.team-card p{font-size:12px;color:#60798d;margin:4px 0}.team-card small{font-size:9px;letter-spacing:1px;color:#6c879d;font-weight:900}.team-card .types{justify-content:flex-start}.empty-slot{background:#f5f8fb;border:1px dashed #bfd0dc}.empty-slot .team-pokemon{background:#e4edf4;color:#8ba0b0}.empty-slot h3{font-size:15px}.empty-slot p{line-height:1.4}@media(max-width:700px){.dex-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.team-grid{grid-template-columns:1fr}.profile-stats{grid-template-columns:1fr}.dex-wrap{padding:18px}}@media(max-width:400px){.dex-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Pokédex: criaturas no capturadas en silueta translúcida */
.dex-image img{transition:filter .2s ease,opacity .2s ease}
.dex-image.is-uncaught img{filter:grayscale(1) brightness(.35);opacity:.42}
.dex-image.is-caught img{filter:none;opacity:1}
.dex-card.unknown .dex-image,.dex-card.caught .dex-image{background:transparent}

/* Catálogo de mapas por tipos de Pokémon */
.map-menu-link{font-size:.88rem!important;padding-left:20px!important;border-left:2px solid #d9e8f1;margin-left:8px}
.maps-wrap h2{margin-bottom:8px}
.map-type-filter{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 22px}
.map-filter{display:inline-flex;padding:7px 12px;border:1px solid #c9dce9;border-radius:18px;background:#fff;color:#17486b;text-decoration:none;font-size:.88rem}
.map-filter:hover,.map-filter.active{background:#0baec7;color:#fff;border-color:#0baec7}
.map-list{display:grid;gap:12px}
.map-card{display:flex;align-items:center;gap:15px;padding:16px;border:1px solid #d4e3ef;border-radius:16px;background:#fff;box-shadow:0 4px 14px rgba(20,65,95,.06)}
.map-icon{display:flex;align-items:center;justify-content:center;flex:0 0 58px;height:58px;border-radius:14px;background:#e8f5fb;font-size:30px}
.map-card-body{flex:1;min-width:0}
.map-card h3{margin:0 0 6px;color:#124f83}
.map-card p{margin:6px 0;color:#506b80}
.map-open{white-space:nowrap;text-decoration:none}
.map-back{margin-top:18px}
@media(max-width:700px){.map-card{align-items:flex-start;flex-wrap:wrap}.map-card-body{flex-basis:calc(100% - 78px)}.map-open{margin-left:73px}}

/* Encuentros aleatorios al entrar a una zona */
.wild-encounter{margin:22px 0;padding:22px;border:2px solid #b7e5a0;border-radius:18px;background:linear-gradient(145deg,#eaffd9,#f7fff0);text-align:center;color:#163d27}
.wild-encounter h3{margin:8px 0;font-size:1.45rem;color:#173f2b}
.wild-sprite{display:flex;align-items:center;justify-content:center;min-height:140px}
.wild-sprite img{width:120px;height:120px;object-fit:contain;image-rendering:pixelated}
.wild-sprite span{font-size:76px}
.wild-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:16px}
.wild-actions .button{cursor:pointer;border:0}
.wild-actions .secondary{background:#e3edf5;color:#17486b;text-decoration:none}

/* Etiquetas de encuentro por rareza */
.wild-encounter .rarity-label{display:inline-block;margin:4px;padding:5px 10px;border-radius:14px;background:#e1f2ff;color:#14527a;font-weight:700;font-size:.82rem}
.wild-encounter .rarity-label.legendary{background:#fff0bd;color:#8a5200}

/* Mundo explorable y multijugador de PokeHu */
.world-page{width:100%;min-width:0}
.world-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}
.world-heading h2{margin:5px 0;color:#15568a;font-size:1.8rem}
.world-heading p{margin:0;color:#587187}
.online-pill{white-space:nowrap;border-radius:20px;padding:8px 12px;background:#e3f8eb;color:#187446;font-size:.83rem;font-weight:700}
.online-pill i,.online-dot{display:inline-block;width:8px;height:8px;background:#20b76a;border-radius:50%;margin-right:6px}
.world-layout{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:14px;align-items:start}
.world-board-wrap{min-width:0;overflow:hidden;border:3px solid #c6e5c8;border-radius:14px;background:#78d86c;box-shadow:0 8px 24px rgba(18,70,99,.12)}
#worldCanvas{display:block;width:100%;height:auto;aspect-ratio:22/15;image-rendering:pixelated}
.world-help{padding:10px 12px;background:#f3f8fb;color:#506b80;font-size:.8rem}
.world-side{display:grid;gap:12px}
.world-self,.world-presence{background:#edf6fc;border:1px solid #d3e5f2;border-radius:14px;padding:13px}
.world-self{display:flex;align-items:center;gap:10px}
.world-self img{width:42px;height:42px;image-rendering:pixelated}
.world-self div{display:grid;gap:3px;min-width:0}
.world-self small{font-size:.65rem;letter-spacing:.06em;color:#668198}
.world-self b{color:#174e7c;overflow-wrap:anywhere}
.world-self span{font-size:.76rem;color:#61798b;overflow-wrap:anywhere}
.world-presence h3{font-size:1rem;margin:0 0 8px;color:#174e7c}
.world-presence p{font-size:.8rem;color:#526d82;margin:0 0 10px}
.online-players{display:grid;gap:9px}
.online-player{display:flex;align-items:center;gap:7px;font-size:.82rem;color:#1e4d72;min-width:0}
.online-player span:last-child{display:grid;overflow-wrap:anywhere}
.online-player small{font-size:.7rem;color:#6b8295}
.online-player .online-dot{flex:0 0 8px;margin:0}
.muted{font-size:.78rem;color:#71879a;line-height:1.5}
.world-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:10px;background:#f1f7fc;border:1px solid #d3e5f2;border-radius:14px}
.world-controls button{min-height:40px;border:1px solid #bed5e6;border-radius:9px;background:#fff;color:#164e7a;font-size:1.1rem;font-weight:800;cursor:pointer;touch-action:manipulation}
.world-controls button:active{background:#cceeff;transform:scale(.96)}
.control-center{display:flex;align-items:center;justify-content:center;color:#17a7c4}
.world-status{margin:0;padding:10px;background:#fff8df;border-radius:10px;color:#735b17;font-size:.75rem;line-height:1.5}
@media(max-width:900px){.world-layout{grid-template-columns:1fr}.world-side{grid-template-columns:repeat(2,minmax(0,1fr))}.world-controls{grid-column:1/-1;max-width:280px;width:100%;justify-self:center}.world-status{grid-column:1/-1}}
@media(max-width:560px){.world-heading{align-items:flex-start;flex-direction:column}.world-side{grid-template-columns:1fr}.world-controls{grid-column:auto}.world-status{grid-column:auto}.world-heading h2{font-size:1.4rem}}

/* Wild encounter and evolution interface */
.wild-panel{background:#efffe3;border:1px solid #b6df9b;border-radius:14px;padding:14px;text-align:center;box-shadow:0 5px 16px rgba(31,83,35,.08)}
.wild-panel .eyebrow{color:#3d7b34;font-size:.7rem}
.wild-sprite{height:94px;display:flex;align-items:center;justify-content:center;font-size:3rem}
.wild-sprite img{max-width:92px;max-height:88px;object-fit:contain;image-rendering:pixelated}
.wild-panel h3{margin:3px 0;color:#173e27;font-size:1.05rem}
.wild-panel p{margin:6px 0;color:#345a3d;font-size:.82rem}
.wild-hp{height:8px;background:#d1e2c8;border-radius:10px;overflow:hidden;margin:10px 0}
.wild-hp span{display:block;height:100%;width:100%;background:#48b768;transition:width .2s}
.battle-message{min-height:34px;line-height:1.4}
.wild-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:10px}
.wild-actions .button{width:100%;padding:9px 7px;font-size:.82rem;white-space:normal}
.wild-actions button:disabled{opacity:.45;cursor:not-allowed}
.button.secondary{background:#e7edf3;color:#24465e;border:1px solid #c4d4df}
.evolve-form{margin-top:9px}
.evolve-form .button{white-space:normal;max-width:100%}
.evolve-hint{display:inline-block;margin-top:7px;color:#61798b;font-size:.8rem}
@media(max-width:900px){.wild-panel{grid-column:1/-1}}

/* PokeHu requested layout and starting supplies */
.world-presence{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:12px;width:100%;box-sizing:border-box}
.world-presence h3{margin:0;white-space:nowrap}
.world-presence p{margin:0;white-space:nowrap}
.world-presence .online-players{display:flex;align-items:center;gap:12px;flex:1;flex-wrap:wrap;min-width:0}
.inventory-line{font-size:.76rem!important;background:#fff;border:1px solid #d4e8ca;border-radius:8px;padding:6px;margin:4px 0 10px!important}
.wild-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:700px){.world-presence{align-items:flex-start;gap:8px}.world-presence h3{width:100%}.world-presence .online-players{width:100%}}

/* Battle screen inspired by classic turn-based creature RPGs */
.battle-board,.ball-inventory{margin-top:14px;padding:12px;background:#fff;border:1px solid #d7e1e8;border-radius:12px;color:#18324a}
.battle-player{display:grid;grid-template-columns:76px 1fr;gap:10px;align-items:center;text-align:left;background:#e8f5e3;padding:9px;border-radius:10px}
.battle-player-sprite{height:70px;display:flex;align-items:center;justify-content:center;font-size:2rem}
.battle-player-sprite img{max-width:72px;max-height:68px;object-fit:contain;image-rendering:pixelated}
.battle-player b{display:block;font-size:.9rem}
.battle-player small{display:block;color:#516b7e;font-size:.75rem;margin-top:4px}
.battle-board h4,.ball-inventory h4{margin:12px 0 8px;text-align:center;color:#31495c;font-size:.9rem}
.battle-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:10px}
.battle-move{background:#f3f5f7;border:2px solid #cbd5de;border-radius:9px;padding:10px 6px;cursor:pointer;color:#233b50;min-width:0}
.battle-move b,.battle-move small{display:block;overflow-wrap:anywhere}
.battle-move b{font-size:.8rem}
.battle-move small{font-size:.7rem;margin-top:4px;color:#526779}
.battle-move.selected{background:#e3f8df;box-shadow:inset 0 0 0 1px #5aaf52}
.battle-board>.button,.ball-inventory>.button{display:block;width:100%;margin-top:8px}
.ball-inventory{background:#f8fbff}
.battle-balls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.battle-ball{background:#fff;border:1px solid #d6e0e8;border-radius:8px;padding:8px 5px;text-align:left;cursor:pointer;color:#263d50;font-size:.75rem;min-width:0}
.battle-ball span{font-size:1rem}
.battle-ball small{color:#60758a}
.battle-ball.selected{background:#dff5ff;border-color:#29a6d2;box-shadow:inset 0 0 0 1px #29a6d2}
.battle-ball:disabled{opacity:.42;cursor:not-allowed}
@media(max-width:560px){.battle-moves,.battle-balls{grid-template-columns:1fr 1fr}.battle-player{grid-template-columns:60px 1fr}}


/* Responsive layout cleanup: readable world view on narrow screens */
.world-heading-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.world-open-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;padding:9px 12px;font-size:.82rem;white-space:nowrap}
.world-layout{grid-template-columns:minmax(0,1fr) minmax(250px,310px);gap:18px}
.world-side{min-width:0}
.world-board-wrap,#worldCanvas{width:100%;box-sizing:border-box}
.world-presence{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.world-presence h3{margin:0;white-space:nowrap}
.world-presence p{margin:0}
.world-presence .online-players{display:flex;align-items:center;gap:12px;flex:1;min-width:0;flex-wrap:wrap}
.wild-panel,.battle-board,.ball-inventory{min-width:0;box-sizing:border-box}
.battle-moves,.battle-balls{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:1100px){
  .world-layout{grid-template-columns:minmax(0,1fr)}
  .world-side{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .world-self{grid-column:1/-1}
  .wild-panel{grid-column:1/-1}
  .world-controls{max-width:320px;width:100%;justify-self:center}
  .world-status{grid-column:1/-1}
}
@media(max-width:640px){
  .world-heading-actions{justify-content:flex-start;width:100%}
  .world-open-link{white-space:normal}
  .world-layout{grid-template-columns:minmax(0,1fr);gap:12px}
  .world-side{grid-template-columns:minmax(0,1fr)}
  .world-self,.wild-panel,.world-controls,.world-status{grid-column:auto}
  .world-board-wrap{border-width:2px}
  .world-help{font-size:.75rem;padding:8px}
  .wild-panel{padding:12px}
  .battle-board,.ball-inventory{padding:10px}
  .battle-moves{grid-template-columns:repeat(2,minmax(0,1fr))}
  .battle-move{padding:9px 5px}
  .world-presence{display:grid;grid-template-columns:1fr;gap:8px}
  .world-presence h3,.world-presence p{white-space:normal}
  .world-presence .online-players{width:100%}
}
body.world-standalone{background:#edf4f9}
body.world-standalone>.hero,body.world-standalone>.topnav,body.world-standalone>.alert{display:none!important}
body.world-standalone>.layout{display:block!important;width:min(1500px,calc(100% - 24px))!important;max-width:none!important;margin:12px auto!important;padding:0!important;grid-template-columns:1fr!important}
body.world-standalone>.layout>.sidebar,body.world-standalone>.layout>.right-sidebar{display:none!important}
body.world-standalone>.layout>.content{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
body.world-standalone .world-page{width:100%;max-width:none;margin:0}
body.world-standalone .world-layout{grid-template-columns:minmax(0,1fr) minmax(280px,360px)}
body.world-standalone .world-side{grid-template-columns:1fr}
@media(max-width:900px){
  body.world-standalone>.layout{width:calc(100% - 16px)!important;margin:8px auto!important}
  body.world-standalone .world-layout{grid-template-columns:minmax(0,1fr)}
  body.world-standalone .world-side{grid-template-columns:minmax(0,1fr)}
}

/* Separate wild battle tab and team selection */
.duel-launch{display:flex;justify-content:center;align-items:center;width:100%;box-sizing:border-box;margin:10px 0;text-decoration:none;background:#1260ce;color:#fff!important;border-radius:10px;padding:12px;font-weight:800}
.world-page .battle-board,.world-page .ball-inventory{display:none!important}
.duel-standalone{background:#b8bbc5!important;color:#111!important}
body.duel-standalone>.hero,body.duel-standalone>.topnav,body.duel-standalone>.alert,body.duel-standalone>footer{display:none!important}
body.duel-standalone>.layout{display:block!important;width:min(1100px,calc(100% - 28px))!important;max-width:none!important;margin:24px auto!important;padding:0!important;grid-template-columns:1fr!important}
body.duel-standalone>.layout>.sidebar{display:none!important}
body.duel-standalone>.layout>.content{width:100%!important;max-width:none!important;margin:0!important;padding:24px!important;background:#fff!important;border:1px solid #d0d3dc!important;box-shadow:0 2px 7px #0002!important}
.duel-app{font-family:inherit;color:#111}
.duel-title{width:max-content;max-width:100%;margin:0 auto 26px;padding:10px 24px;background:#fff;border:1px solid #ddd;border-radius:28px;box-shadow:0 2px 5px #0002;font-size:1.4rem;font-variant:small-caps}
.duel-subtitle{text-align:center;margin:0 auto 24px;color:#43546b}
.duel-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:stretch}
.duel-preview{background:#e3f6df;border-radius:26px;padding:22px;min-width:0}
.duel-preview.wild-preview{background:#ffe0bd}
.duel-preview>small,.duel-scoreboard small{display:block;text-align:center;letter-spacing:.08em;font-weight:800}
.duel-preview>img{display:block;width:100px;height:100px;object-fit:contain;margin:12px auto}
.duel-preview h3,.duel-preview p{text-align:center;margin:6px 0}
.duel-emoji{font-size:70px;text-align:center;margin:15px}
.duel-team-form{display:grid;gap:10px;margin-top:12px}
.duel-team-option{display:flex;align-items:center;gap:12px;padding:10px;border:2px solid #d8e0e6;border-radius:12px;background:#fff;cursor:pointer}
.duel-team-option:has(input:checked){border-color:#1260ce;background:#e5f0ff}
.duel-team-option input{accent-color:#1260ce}
.duel-team-sprite{width:64px;height:56px;display:grid;place-items:center;flex:none}
.duel-team-sprite img{width:64px;height:56px;object-fit:contain}
.duel-team-option span:nth-child(3){display:grid;gap:4px}
.duel-team-option small{color:#536477;font-size:.82rem}
.duel-start-button{width:100%;margin-top:8px}
.duel-footer{text-align:center;margin-top:24px}
.duel-scoreboard{display:grid;grid-template-columns:1fr 1fr;gap:26px;margin:8px 0 24px}
.duel-scoreboard section{padding:18px;background:#f0e9d9;border-left:7px solid white;border-radius:0 28px 28px 0;text-align:center;min-width:0}
.duel-scoreboard section+section{background:#e1f7dc;border-radius:28px 0 0 28px;border-left:0;border-right:7px solid #111}
.duel-scoreboard img{width:100px;height:90px;object-fit:contain;display:block;margin:12px auto}
.duel-scoreboard h3{margin:5px 0}
.duel-scoreboard p{margin:8px 0}
.duel-hp{height:10px;background:#d7d7d7;max-width:220px;margin:8px auto;border-radius:2px;overflow:hidden}
.duel-hp span{display:block;width:100%;height:100%;background:#59b85f;transition:width .2s}
.duel-arena{padding:20px;background:#fff;border:1px solid #d1d1d1;box-shadow:0 2px 6px #0002}
.duel-arena>h3{text-align:center}
.duel-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:680px;margin:16px auto}
.duel-moves button{min-height:65px;border:0;border-radius:9px;background:#e9e9e9;font-weight:700;cursor:pointer}
.duel-moves button:hover{background:#d9e9d5}
.duel-moves button:disabled{opacity:.45;cursor:not-allowed}
#duelMessage{text-align:center;min-height:26px;font-weight:700}
.duel-actions{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;margin-top:18px}
.duel-actions form{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:center}
.duel-actions select{padding:10px;border-radius:8px;border:1px solid #bbc7d4}
@media(max-width:650px){
 body.duel-standalone>.layout{width:calc(100% - 12px)!important;margin:6px auto!important}
 body.duel-standalone>.layout>.content{padding:12px!important}
 .duel-preview-grid,.duel-scoreboard{grid-template-columns:1fr;gap:12px}
 .duel-scoreboard section+section{border-radius:0 28px 28px 0;border-right:0;border-left:7px solid #111}
 .duel-moves{gap:8px}
 .duel-moves button{padding:8px 4px}
 .duel-actions{align-items:stretch}
 .duel-actions form{width:100%}
}

/* Combate en la misma pestaña: vista enfocada sin abrir ventanas nuevas */
body.duel-standalone .duel-launch{target-name:none}

/* Acciones de preparación: iniciar batalla a la izquierda y volver al mundo a la derecha */
.duel-footer-actions{display:flex;justify-content:center;align-items:center;gap:14px;flex-wrap:wrap;margin:28px auto 0}
.duel-footer-actions .duel-start-button{width:auto;min-width:210px;margin:0;padding:14px 24px}
.duel-footer-actions .secondary{min-width:170px;text-align:center}
@media(max-width:520px){.duel-footer-actions{flex-direction:column}.duel-footer-actions .duel-start-button,.duel-footer-actions .secondary{width:100%;box-sizing:border-box}}

.capture-result-notice{max-width:1100px;margin:16px auto 0;padding:14px 20px;border-radius:12px;text-align:center;font-size:1.05rem;font-weight:800;box-shadow:0 3px 12px #18324a18}
.capture-result-notice.success{background:#dcfce7;color:#166534;border:1px solid #86efac}
.capture-result-notice.failure{background:#fff1f2;color:#9f1239;border:1px solid #fda4af}

/* Estado visual del buscador de encuentros */
.wild-panel.found{background:#efffe3;border-color:#8bd47a}
.wild-panel.not-found{background:#fff0f0;border-color:#ef7777}
.wild-panel.not-found .eyebrow{color:#b4232c}
.wild-panel.not-found h3{color:#a51f2b}
.wild-panel.not-found p{color:#87343a}
.wild-sprite.is-loading img{width:54px;height:54px;object-fit:contain;image-rendering:auto}

/* Panel lateral de entrenador */
.trainer-summary-profile{display:flex;align-items:center;gap:12px;padding:12px}
.trainer-summary-profile img,.trainer-avatar-placeholder{width:54px;height:54px;object-fit:contain;image-rendering:pixelated;flex:0 0 54px}
.trainer-avatar-placeholder{display:flex;align-items:center;justify-content:center;font-size:2rem;background:#eaf4fb;border-radius:12px}
.trainer-summary-name{display:flex;flex-direction:column;gap:4px;min-width:0}
.trainer-summary-name b{font-size:.8rem;color:#48627b}
.trainer-summary-name span{font-weight:700;overflow-wrap:anywhere}
.trainer-summary-inventory{padding:0 12px 10px}
.trainer-summary-inventory p{margin:7px 0;font-size:.9rem}

/* Iconos de inventario desde assets/Img/Otros */
.trainer-summary-inventory p{display:flex;align-items:center;gap:7px}
.inventory-icon{width:23px;height:23px;object-fit:contain;flex:0 0 23px}


/* Panel de encuentro: color dinámico según el elemento principal del Pokémon */
.wild-panel{
  --element-bg:#efffe3;
  --element-border:#b6df9b;
  --element-ink:#245a31;
  background:var(--element-bg);
  border:1px solid var(--element-border);
  color:var(--element-ink);
  transition:background-color .22s ease,border-color .22s ease,color .22s ease;
}
.wild-panel h3,.wild-panel p{color:var(--element-ink)}
.wild-panel .eyebrow{color:var(--element-ink)}
.wild-panel.element-planta{--element-bg:#e9f9d9;--element-border:#70bd45;--element-ink:#285c24}
.wild-panel.element-veneno{--element-bg:#f3e4fb;--element-border:#a45bc7;--element-ink:#613078}
.wild-panel.element-fuego{--element-bg:#fff0df;--element-border:#f18a3b;--element-ink:#873b16}
.wild-panel.element-agua{--element-bg:#e2f3ff;--element-border:#4aa4e8;--element-ink:#174f83}
.wild-panel.element-electrico{--element-bg:#fff9cf;--element-border:#e0bf26;--element-ink:#695500}
.wild-panel.element-hielo{--element-bg:#e1fbff;--element-border:#63cbd9;--element-ink:#17616d}
.wild-panel.element-lucha{--element-bg:#ffe6e1;--element-border:#d96b55;--element-ink:#7c2e22}
.wild-panel.element-psiquico{--element-bg:#ffe5f0;--element-border:#df77a7;--element-ink:#812c56}
.wild-panel.element-bicho{--element-bg:#f0f8d7;--element-border:#9ab83c;--element-ink:#4a5d18}
.wild-panel.element-roca{--element-bg:#eee8d8;--element-border:#a89b75;--element-ink:#554a32}
.wild-panel.element-tierra{--element-bg:#f7ead2;--element-border:#c69b57;--element-ink:#735020}
.wild-panel.element-fantasma{--element-bg:#ece8ff;--element-border:#8b7ad6;--element-ink:#453b83}
.wild-panel.element-dragon{--element-bg:#e7e9ff;--element-border:#737fe0;--element-ink:#303b91}
.wild-panel.element-normal{--element-bg:#f0f1f3;--element-border:#aeb5bd;--element-ink:#434a52}
.wild-panel.element-volador{--element-bg:#e8f1ff;--element-border:#80a8e8;--element-ink:#31558a}
.wild-panel.element-acero{--element-bg:#e8eef1;--element-border:#94aab6;--element-ink:#3f5965}
.wild-types{
  display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:7px;
  margin:8px auto 12px;padding:8px 10px;max-width:calc(100% - 12px);
  border:2px solid var(--element-border);border-radius:10px;
  background:rgba(255,255,255,.62);box-sizing:border-box;
}
.wild-type-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:58px;padding:4px 10px;border:1px solid currentColor;border-radius:7px;
  background:var(--badge-bg,#fff);color:var(--badge-ink,#333);
  font-size:.78rem;font-weight:700;line-height:1.25;
}
.wild-type-badge.type-planta{--badge-bg:#78c850;--badge-ink:#183b10}
.wild-type-badge.type-veneno{--badge-bg:#a040a0;--badge-ink:#fff}
.wild-type-badge.type-fuego{--badge-bg:#f08030;--badge-ink:#fff}
.wild-type-badge.type-agua{--badge-bg:#6890f0;--badge-ink:#fff}
.wild-type-badge.type-electrico{--badge-bg:#f8d030;--badge-ink:#473900}
.wild-type-badge.type-hielo{--badge-bg:#98d8d8;--badge-ink:#214f53}
.wild-type-badge.type-lucha{--badge-bg:#c03028;--badge-ink:#fff}
.wild-type-badge.type-psiquico{--badge-bg:#f85888;--badge-ink:#fff}
.wild-type-badge.type-bicho{--badge-bg:#a8b820;--badge-ink:#263000}
.wild-type-badge.type-roca{--badge-bg:#b8a038;--badge-ink:#fff}
.wild-type-badge.type-tierra{--badge-bg:#e0c068;--badge-ink:#51401c}
.wild-type-badge.type-fantasma{--badge-bg:#705898;--badge-ink:#fff}
.wild-type-badge.type-dragon{--badge-bg:#7038f8;--badge-ink:#fff}
.wild-type-badge.type-normal{--badge-bg:#a8a878;--badge-ink:#222}
.wild-type-badge.type-volador{--badge-bg:#a890f0;--badge-ink:#fff}
.wild-type-badge.type-acero{--badge-bg:#b8b8d0;--badge-ink:#303044}


/* Muestra la imagen del Pokémon y sus tipos juntos, lado a lado */
.wild-creature-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-height:104px;
  margin:8px auto 4px;
}
.wild-creature-row .wild-sprite{
  flex:0 1 112px;
  width:112px;
  min-width:0;
  min-height:94px;
  height:94px;
  margin:0;
}
.wild-creature-row .wild-sprite img{
  width:92px;
  height:88px;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  image-rendering:pixelated;
}
.wild-creature-row .wild-types{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:center;
  flex:0 1 auto;
  gap:6px;
  max-width:48%;
  margin:0;
  padding:5px;
  border:0;
  background:transparent;
}
.wild-creature-row .wild-type-badge{
  min-width:58px;
  padding:5px 9px;
  border:1px solid rgba(0,0,0,.14);
  border-radius:7px;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
  white-space:nowrap;
}
@media(max-width:480px){
  .wild-creature-row{gap:7px}
  .wild-creature-row .wild-sprite{flex-basis:95px;width:95px}
  .wild-creature-row .wild-sprite img{width:82px;height:82px}
  .wild-creature-row .wild-types{max-width:52%}
  .wild-creature-row .wild-type-badge{font-size:.72rem;padding:4px 6px}
}


/* Barra de experiencia individual para cada Pokémon del equipo */
.pokemon-xp{margin:10px 0 12px;min-width:0}
.pokemon-xp-label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.82rem;color:#31516c;margin-bottom:5px}
.pokemon-xp-label strong{white-space:nowrap;color:#174f87}
.pokemon-xp-track{height:10px;background:#dce6ef;border:1px solid #c3d4e2;border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 2px rgba(10,40,70,.08)}
.pokemon-xp-track span{display:block;height:100%;background:linear-gradient(90deg,#19b86a,#9bdb4b);border-radius:999px;transition:width .25s ease}
.pokemon-xp>small{display:block;margin-top:4px;color:#637b8e;font-size:.75rem}


/* Aviso de recompensas al terminar el combate */
.flash-notice{border-left:5px solid #27b866;background:#effcf1;color:#174d2a;padding:14px 18px;border-radius:12px;margin:12px 0;font-weight:600;box-shadow:0 4px 14px rgba(22,90,50,.10)}

/* Panel lateral: equipo Pokémon del entrenador */
.sidebar-team-list{display:flex;flex-direction:column;gap:9px;padding:10px 12px}
.sidebar-team-pokemon{display:flex;align-items:center;gap:10px;min-width:0;padding:7px 8px;border:1px solid #d9e7f1;border-radius:10px;background:#f5fbff}
.sidebar-team-pokemon img{width:44px;height:44px;object-fit:contain;image-rendering:auto;flex:0 0 44px}
.sidebar-team-pokemon div{display:flex;flex-direction:column;gap:3px;min-width:0}
.sidebar-team-pokemon b{font-size:.9rem;color:#174b79;overflow-wrap:anywhere}
.sidebar-team-pokemon small{font-size:.78rem;color:#647b8f}
.sidebar-team-link{display:block;margin:2px 12px 12px;text-align:center;font-size:.86rem;font-weight:700}
.sidebar-team>p{padding:0 15px}


/* Lista de líderes de gimnasio en la barra lateral */
.gym-leader-list{display:flex;flex-direction:column;gap:7px;padding:10px 11px}
.gym-leader-item{display:flex;align-items:center;gap:10px;min-width:0;padding:6px 8px;border:1px solid #d6e6f0;border-radius:9px;background:#f5fbff}
.gym-leader-item img{width:42px;height:42px;object-fit:contain;flex:0 0 42px}
.gym-leader-item span{display:flex;flex-direction:column;gap:3px;min-width:0}
.gym-leader-item b{font-size:.88rem;color:#174b79}
.gym-leader-item small{font-size:.76rem;color:#637b8e}


/* Desafíos de gimnasio: presentación tipo pantalla de combate */
.gym-leader-item{color:inherit;text-decoration:none;cursor:pointer;transition:transform .15s,filter .15s,background .15s}
.gym-leader-item:hover{transform:translateX(2px);background:#e8f6ff}
.gym-leader-item img{transition:filter .2s,opacity .2s}
.gym-leader-item.gym-defeated img,.gym-challenge-card.gym-defeated>img{filter:grayscale(1) brightness(.12);opacity:.9}
.gym-leader-item.gym-defeated{background:#e8e8e8;border-color:#777}
.gym-leader-item.gym-defeated b,.gym-leader-item.gym-defeated small{color:#333}
.gym-challenge{background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid #d4e4ef;border-radius:18px;padding:clamp(16px,2.5vw,30px);box-shadow:0 8px 24px rgba(20,60,90,.08);max-width:1120px;margin-inline:auto}
.gym-challenge>.eyebrow{font-weight:800;letter-spacing:.18em;color:#0785b5;font-size:.76rem}
.gym-challenge h2{color:#14558b;margin:7px 0 18px;font-size:clamp(1.45rem,2.5vw,2rem)}
.gym-challenge-card{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);align-items:start;gap:clamp(16px,3vw,30px);background:#f0f7ff;border:1px solid #cde3f2;border-radius:18px;padding:clamp(14px,2.5vw,26px);margin:18px 0}
.gym-challenge-card>img{width:100%;height:210px;object-fit:contain;object-position:center;flex:none;padding:10px;background:linear-gradient(180deg,#e0effb,#f8fbff);border:1px solid #d9e9f6;border-radius:14px}
.gym-challenge-card>div{min-width:0;width:100%}
.gym-challenge-card h3{margin:0 0 8px;color:#173f66;font-size:1.3rem}
.gym-challenge-card p{margin:8px 0;color:#35536d;line-height:1.5}
.gym-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:12px;margin:12px 0 18px}
.gym-roster-pokemon{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:145px;padding:12px 9px;background:#fff;border:1px solid #d5e3ef;border-radius:13px;box-shadow:0 3px 9px rgba(22,61,92,.05);text-align:center}
.gym-roster-pokemon img{display:block;width:82px;height:76px;max-width:100%;object-fit:contain;image-rendering:auto}
.gym-roster-pokemon b{display:block;color:#1c3e5b;font-size:.95rem;line-height:1.25}
.gym-roster-pokemon small{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;background:#e8f2fb;color:#315875;font-weight:700;font-size:.78rem;white-space:nowrap}
.gym-battle-form{display:flex;flex-direction:column;gap:10px;width:100%;max-width:560px;margin-top:18px;padding:16px;background:#fff;border:1px solid #d5e4ef;border-radius:14px}
.gym-battle-form label{font-weight:800;color:#173f66}
.gym-battle-form select{width:100%;padding:12px;border:1px solid #c5d8e8;border-radius:10px;background:#fff;color:#17334b}
.gym-battle-form button{padding:13px 16px;border:0;border-radius:10px;background:linear-gradient(100deg,#0785bc,#08b6c6);color:#fff;font-weight:800;cursor:pointer;box-shadow:0 5px 12px rgba(0,142,190,.18)}
.gym-battle-form button:hover{filter:brightness(1.04)}
.gym-battle-form small{color:#627b8d;line-height:1.55}
.gym-live-battle{margin-top:16px;padding:18px;background:#fff;border:1px solid #d6e5ef;border-radius:14px;box-shadow:0 4px 14px rgba(20,60,90,.05)}
.gym-live-battle form{margin-top:10px}
.gym-live-battle .button{min-width:145px}
.gym-battle-log{padding:10px 12px;background:#eef7ff;border-radius:9px;font-weight:700}
.gym-hp{height:10px;overflow:hidden;border-radius:99px;background:#d9e2e9;margin:7px 0 12px}
.gym-hp i{display:block;height:100%;background:linear-gradient(90deg,#27b65b,#8ed64a);border-radius:99px}
.gym-hp.enemy i{background:linear-gradient(90deg,#f2a23a,#e94e4e)}
.gym-win-state{padding:12px 14px;border-radius:10px;background:#e2f9e9;color:#176638;font-weight:800}
.gym-reward{display:inline-block;color:#375b76;font-weight:700;background:#fff6dc;border:1px solid #f0dfa8;padding:10px 14px;border-radius:10px;margin:4px 0 14px}
.gym-challenge>.button{display:inline-flex;margin-top:2px}
@media(max-width:700px){.gym-challenge-card{grid-template-columns:1fr}.gym-challenge-card>img{height:125px;width:100%;max-width:180px;margin-inline:auto}.gym-roster{grid-template-columns:repeat(2,minmax(0,1fr))}.gym-roster-pokemon{min-height:132px}.gym-roster-pokemon img{width:70px;height:65px}}
@media(max-width:380px){.gym-roster{grid-template-columns:1fr 1fr}.gym-challenge{padding:12px}}

/* Portada gráfica local */
.hero{padding:6px 20px;background:#eef3f8}.cover-image{display:block;width:100%;max-width:1575px;height:auto;margin:0 auto;border:2px solid #35d8ed;border-radius:8px;box-shadow:0 8px 22px #0002}@media(max-width:540px){.hero{padding:6px 8px}.cover-image{border-radius:6px}}

/* Portada centrada y de tamaño moderado */
.hero{display:flex;justify-content:center;align-items:center;width:100%;box-sizing:border-box;padding:8px 16px;background:#eef3f8}.cover-image{display:block;width:100%;max-width:1200px;max-height:260px;height:auto;object-fit:contain;object-position:center;margin:0 auto;border:2px solid #35d8ed;border-radius:8px;box-shadow:0 8px 22px #0002;box-sizing:border-box}@media(max-width:700px){.hero{padding:6px 8px}.cover-image{max-height:150px;border-radius:6px}}

/* PokeMarket */
.market-wrap{background:#fff;border:1px solid #d5e5f3;border-radius:18px;padding:28px;box-shadow:0 8px 24px #183c5c0c}.market-wrap h2{color:#15558d;margin:6px 0}.market-wallet{display:flex;align-items:center;gap:10px;background:#fff8dc;border:1px solid #f2d67a;border-radius:12px;padding:12px 16px;margin:18px 0 24px;color:#6a4b00}.market-wallet img,.market-price img{width:26px;height:26px;object-fit:contain}.market-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.market-card{border:1px solid #d9e8f5;border-radius:15px;padding:18px;background:linear-gradient(160deg,#fff,#f4faff);display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0}.market-item-icon{width:76px;height:76px;border-radius:18px;background:#e7f5ff;display:grid;place-items:center}.market-item-icon img{width:52px;height:52px;object-fit:contain}.market-card h3{margin:12px 0 4px;color:#164c7a}.market-card p{margin:6px 0;color:#536b80}.market-price{display:flex;align-items:center;gap:5px;font-weight:700;color:#946200;margin-top:10px}.market-stock{font-size:.9rem}.market-buy{margin-top:auto;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;width:100%;padding-top:10px}.market-buy label{display:flex;align-items:center;gap:6px;font-size:.9rem}.market-buy select{padding:8px;border:1px solid #c6d8e8;border-radius:8px;background:#fff}.market-buy button:disabled{opacity:.45;cursor:not-allowed}.market-note{margin-top:20px;padding:12px;background:#eef8ff;border-radius:10px}@media(max-width:900px){.market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.market-wrap{padding:16px}.market-grid{grid-template-columns:1fr}.market-card{padding:16px}}


/* Vida y curación rápida en el equipo lateral */
.sidebar-team-pokemon{align-items:flex-start}
.sidebar-team-pokemon .sidebar-team-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.sidebar-hp-label{display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:.7rem;color:#486780;line-height:1.2}
.sidebar-hp-label strong{font-size:.7rem;color:#174b79;white-space:nowrap}
.sidebar-hp-track{height:7px;width:100%;background:#e0e9ef;border-radius:99px;overflow:hidden;border:1px solid #d0dce5}
.sidebar-hp-track span{display:block;height:100%;background:linear-gradient(90deg,#18b86a,#69d35b);border-radius:99px;transition:width .2s ease}
.sidebar-hp-track span.medium{background:linear-gradient(90deg,#f1b52a,#f5d65d)}
.sidebar-hp-track span.low{background:linear-gradient(90deg,#e34b4b,#f28a65)}
.sidebar-team-actions{display:flex;gap:5px;width:100%;margin-top:3px}.sidebar-team-actions form{flex:1;min-width:0;margin:0}.sidebar-team-actions button{width:100%;min-height:29px;white-space:nowrap}.sidebar-candy-button{border:0;border-radius:6px;padding:5px 6px;background:#fff0bd;color:#805400;font-weight:800;font-size:.69rem;cursor:pointer}.sidebar-candy-button:hover:not(:disabled){background:#ffe28a}.sidebar-candy-button:disabled{opacity:.48;cursor:not-allowed}.inventory-icon{width:25px;height:25px;object-fit:contain;flex:0 0 25px}
.sidebar-heal-form{margin-top:3px}
.sidebar-heal-button{width:100%;border:0;border-radius:6px;padding:5px 7px;background:#e3f8eb;color:#137846;font-weight:800;font-size:.72rem;cursor:pointer}
.sidebar-heal-button:hover:not(:disabled){background:#c8f0d8}
.sidebar-heal-button:disabled{opacity:.48;cursor:not-allowed}


/* Professional move-learning panel */
.team-card{align-items:flex-start}
.team-info{flex:1;min-width:0}
.move-learning{box-sizing:border-box;width:100%;margin:16px 0 4px;padding:16px;border:1px solid #cfe2f1;border-radius:16px;background:linear-gradient(145deg,#ffffff 0%,#f4f9ff 100%);box-shadow:0 5px 16px rgba(26,82,120,.07);color:#20384d}
.move-learning-heading{display:flex;align-items:flex-start;gap:11px;margin-bottom:12px}
.move-learning-icon{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:#e2f6ff;color:#078bb8;font-size:20px}
.move-learning h4{margin:2px 0 5px;font-size:1rem;line-height:1.3;color:#163b5b}
.move-learning p{margin:0!important;font-size:.9rem!important;line-height:1.5;color:#526b7e}
.move-learning-note{margin:0 0 14px;padding:10px 12px;border-radius:10px;background:#edf5fb;color:#557084;font-size:.82rem;line-height:1.45}
.move-learning-form{display:flex;flex-direction:column;align-items:stretch;gap:8px;min-width:0}
.move-learning-form label{display:block;margin:0;font-size:.84rem;font-weight:800;color:#294b65}
.move-learning-form select{box-sizing:border-box;width:100%;min-width:0;min-height:42px;padding:9px 12px;border:1px solid #bfd4e4;border-radius:10px;background:#fff;color:#20384d;font:600 .92rem Nunito,Arial,sans-serif}
.move-learning-actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:3px}
.move-learning-actions .button{box-sizing:border-box;width:100%;min-height:43px;padding:11px 14px;white-space:normal;text-align:center;line-height:1.3;border-radius:11px;font-size:.9rem}
.move-learning-actions .move-action-primary{box-shadow:0 4px 10px rgba(8,139,181,.14)}
.move-learning-actions .move-action-secondary{background:#edf3f7;color:#31536d;border:1px solid #d4e1e9;box-shadow:none}
.move-learning-actions .button:hover{transform:translateY(-1px)}
@media(max-width:700px){
 .team-card{gap:11px;padding:15px;flex-wrap:wrap}
 .team-pokemon{flex-basis:68px;width:68px;height:68px}
 .team-info{width:100%;flex-basis:100%}
 .move-learning{margin-top:14px;padding:13px;border-radius:14px}
 .move-learning-actions .button{font-size:.88rem}
}


/* Combate de gimnasio: sprites y movimientos seleccionables */
.gym-duel-scene{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin:14px 0;padding:14px;border:1px solid #d9e8f4;border-radius:15px;background:linear-gradient(145deg,#edf7ff,#fff)}
.gym-duel-side{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:0;text-align:center}
.gym-duel-side img{width:clamp(84px,14vw,142px);height:clamp(84px,14vw,142px);object-fit:contain;image-rendering:auto;filter:drop-shadow(0 5px 5px rgba(24,56,84,.12))}
.gym-duel-caption{display:flex;flex-direction:column;gap:3px;max-width:100%}.gym-duel-caption b{color:#183f62;font-size:.95rem;overflow-wrap:anywhere}.gym-duel-caption small{color:#607b91}
.gym-duel-vs{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#e1effb;color:#1776a8;font-weight:900;font-size:.8rem;border:1px solid #c9dfef}
.gym-duel-hp-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.gym-duel-hp-grid p{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;font-size:.83rem;margin:0;color:#294b65}.gym-duel-hp-grid p span{font-variant-numeric:tabular-nums}
.gym-moves-form{margin-top:14px;padding:14px;border:1px solid #d6e5ef;border-radius:13px;background:#f8fbff}.gym-moves-form h4{margin:0 0 10px;color:#173f66}.gym-move-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.gym-move-button{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;padding:12px;border:1px solid #c9ddea;border-radius:12px;background:#fff;color:#1b3e5b;text-align:left;cursor:pointer;box-shadow:0 2px 7px rgba(23,63,102,.04);transition:transform .15s,border-color .15s}.gym-move-button:hover{transform:translateY(-1px);border-color:#0aa6c0}.gym-move-button b{font-size:.95rem;overflow-wrap:anywhere}.gym-move-type{padding:3px 8px;border-radius:999px;background:#e5f3fc;color:#17648c;font-size:.75rem;font-weight:800}.gym-move-button small{color:#657f92;font-size:.77rem}.gym-flee-form{margin-top:10px}.gym-flee-form .button{min-width:0}
@media(max-width:480px){.gym-live-battle{padding:12px}.gym-duel-scene{gap:5px;padding:9px}.gym-duel-side img{width:82px;height:82px}.gym-duel-vs{width:30px;height:30px;font-size:.7rem}.gym-duel-hp-grid{grid-template-columns:1fr}.gym-move-grid{grid-template-columns:1fr 1fr}.gym-move-button{padding:10px 8px}}


/* Cambio de Pokémon durante los combates de gimnasio */
.gym-switch-form{margin:14px 0;padding:16px;border:1px solid #c9e0f4;border-radius:15px;background:linear-gradient(145deg,#f8fcff,#edf6ff);display:flex;flex-direction:column;gap:10px}
.gym-switch-form h4{margin:0;color:#174875;font-size:1.08rem}
.gym-switch-form p{margin:0;color:#4b6680;line-height:1.5}
.gym-switch-form label{font-weight:800;color:#244d70;font-size:.9rem}
.gym-switch-form select{width:100%;box-sizing:border-box;min-height:44px;padding:10px 12px;border:1px solid #bfd8ed;border-radius:10px;background:#fff;color:#203d57;font:inherit}
.gym-switch-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:2px}
.gym-switch-actions .button{flex:1 1 180px;min-height:44px;white-space:normal}
@media(max-width:560px){.gym-switch-form{padding:13px}.gym-switch-actions{flex-direction:column}.gym-switch-actions .button{width:100%;flex-basis:auto}}


/* Medallas de gimnasio en el panel Entrenador */
.trainer-medals{margin-top:16px;padding-top:14px;border-top:1px solid #e1eaf2}
.trainer-medals h4{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 11px;color:#244765;font-size:.98rem}
.trainer-medals h4 span{padding:3px 8px;border-radius:999px;background:#e8f3fc;color:#176b9a;font-size:.76rem;font-weight:800}
.trainer-medals-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.trainer-medal{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:9px 3px 8px;border:1px solid #dbe6ef;border-radius:11px;background:#f7fafc;text-align:center}
.trainer-medal-emblem{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;border:2px solid #d3dce5;background:#e3e8ed;color:#9aa8b4;font-size:21px;font-weight:900;line-height:1}
.trainer-medal.earned{background:#f4fbff;border-color:#b9dced;box-shadow:0 2px 7px rgba(22,100,145,.07)}
.trainer-medal.earned .trainer-medal-emblem{background:color-mix(in srgb,var(--medal-color) 16%,white);border-color:var(--medal-color);color:var(--medal-color);text-shadow:0 1px 0 #fff}
.trainer-medal-name{max-width:100%;overflow-wrap:anywhere;color:#294a66;font-size:.7rem;font-weight:800;line-height:1.2}
.trainer-medal small{font-size:.61rem;line-height:1.2;color:#8998a6}
.trainer-medal.earned small{color:#27825b;font-weight:800}
@media(max-width:400px){.trainer-medals-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.trainer-medal{padding:7px 2px}.trainer-medal-emblem{width:30px;height:30px;font-size:19px}.trainer-medal-name{font-size:.64rem}}


/* Medallas oficiales del proyecto: grises hasta ganar el gimnasio */
.trainer-medal{transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease}
.trainer-medal-image{display:block;width:46px;height:42px;object-fit:contain;filter:grayscale(1);opacity:.28;transition:filter .25s ease,opacity .25s ease,transform .25s ease}
.trainer-medal.locked .trainer-medal-image{filter:grayscale(1);opacity:.25}
.trainer-medal.earned .trainer-medal-image{filter:none;opacity:1;transform:scale(1.04)}
.trainer-medal.earned{background:#f1fbf5;border-color:#a8dfbf;box-shadow:0 3px 10px rgba(32,135,80,.12)}
.trainer-medal.earned .trainer-medal-name{color:#21764a}
.trainer-medal.earned small{color:#21804d}
.trainer-medal-emblem{display:none!important}
@media(max-width:400px){.trainer-medal-image{width:39px;height:37px}}


/* Ajuste de distribución: medallas con espacio y lectura cómoda */
.trainer-medals{margin-top:18px;padding-top:16px}
.trainer-medals h4{margin-bottom:14px}
.trainer-medals-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  align-items:stretch;
}
.trainer-medal{
  box-sizing:border-box;
  min-height:112px;
  padding:11px 8px 10px;
  gap:6px;
  border-radius:13px;
}
.trainer-medal-image{
  width:52px;
  height:48px;
  margin:1px auto 2px;
  object-fit:contain;
}
.trainer-medal-name{
  font-size:.78rem;
  line-height:1.25;
  overflow-wrap:normal;
  word-break:normal;
  text-align:center;
}
.trainer-medal small{
  font-size:.68rem;
  line-height:1.25;
  text-align:center;
}
@media(max-width:360px){
  .trainer-medals-grid{gap:8px}
  .trainer-medal{min-height:105px;padding:9px 5px}
  .trainer-medal-image{width:46px;height:43px}
  .trainer-medal-name{font-size:.73rem}
  .trainer-medal small{font-size:.64rem}
}


/* Encabezado de Medallas a juego con el encabezado Entrenador */
.trainer-medals{
  margin-top:18px;
  padding-top:0;
  border-top:0;
  overflow:hidden;
  border:1px solid #d2e4f1;
  border-radius:13px;
  background:#fff;
}
.trainer-medals-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:43px;
  margin:0 0 12px;
  padding:0 13px;
  color:#fff;
  background:linear-gradient(110deg,#0786bd 0%,#12b9c9 100%);
}
.trainer-medals-header h4{
  margin:0;
  color:#fff;
  font-size:.94rem;
  font-weight:800;
  line-height:1.2;
}
.trainer-medals-header>span{
  flex:0 0 auto;
  padding:4px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.9);
  color:#0878a8;
  font-size:.76rem;
  font-weight:900;
}
.trainer-medals-grid{
  padding:0 10px 10px;
}


/* Selección visual del Pokémon para iniciar gimnasio */
.gym-team-pick-title{display:block;margin:0 0 12px;color:#244b70;font-size:1.05rem;font-weight:800}
.gym-team-pick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 14px}
.gym-team-pick-card{
  box-sizing:border-box;display:flex;flex-direction:column;align-items:center;min-width:0;
  padding:13px 10px 12px;border:1px solid #cfe2f3;border-radius:15px;
  background:linear-gradient(180deg,#fff 0%,#f4f9ff 100%);color:#244764;
  font:inherit;text-align:center;cursor:pointer;box-shadow:0 3px 10px rgba(26,84,125,.06);
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.gym-team-pick-card:hover:not(:disabled),.gym-team-pick-card:focus-visible{
  transform:translateY(-2px);border-color:#10a9c7;box-shadow:0 7px 16px rgba(9,145,183,.14);outline:none;
}
.gym-team-pick-art{display:flex;align-items:center;justify-content:center;width:100%;height:94px;margin-bottom:7px}
.gym-team-pick-art img{display:block;max-width:100%;width:92px;height:92px;object-fit:contain;image-rendering:auto}
.gym-team-pick-name{font-weight:900;font-size:.98rem;line-height:1.25;overflow-wrap:anywhere}
.gym-team-pick-level{margin-top:4px;padding:3px 9px;border-radius:999px;background:#e8f3fc;color:#38627f;font-size:.78rem;font-weight:800}
.gym-team-pick-hp{margin-top:8px;color:#355b78;font-size:.8rem;font-weight:700}
.gym-team-pick-bar{display:block;width:100%;height:6px;margin-top:5px;border-radius:999px;overflow:hidden;background:#dce6ee}
.gym-team-pick-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#20b86a,#8bd548)}
.gym-team-pick-cta{display:block;width:100%;box-sizing:border-box;margin-top:10px;padding:8px 5px;border-radius:9px;background:linear-gradient(110deg,#0789bf,#0cb8c6);color:white;font-size:.78rem;font-weight:900;line-height:1.3}
.gym-team-pick-card.is-fainted{cursor:not-allowed;opacity:.58;background:#f0f2f4;border-color:#d7dde2;box-shadow:none}
.gym-team-pick-card.is-fainted .gym-team-pick-art img{filter:grayscale(1)}
.gym-team-pick-card.is-fainted .gym-team-pick-cta{background:#dfe5e9;color:#596b79}
.gym-team-pick-help{display:block;margin:0 0 8px;color:#55738c;line-height:1.5}
@media(max-width:420px){
 .gym-team-pick-grid{gap:9px}
 .gym-team-pick-card{padding:10px 7px;border-radius:13px}
 .gym-team-pick-art{height:78px}
 .gym-team-pick-art img{width:78px;height:78px}
 .gym-team-pick-cta{font-size:.72rem}
}


/* Caja Pokémon / almacenamiento y reemplazo de compañeros */
.box-deposit-form{margin-top:12px}
.box-deposit-form .button{width:100%;font-size:.82rem}
.box-page .box-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:18px 0;padding:13px 15px;border:1px solid #d6e7f3;border-radius:13px;background:#eef7ff;color:#315570}
.box-summary strong{display:grid;place-items:center;min-width:32px;height:32px;padding:0 8px;border-radius:50%;background:#0a9fc0;color:#fff}
.storage-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.storage-card{box-sizing:border-box;min-width:0;padding:14px 12px;border:1px solid #d2e4f2;border-radius:15px;background:linear-gradient(180deg,#fff,#f5faff);box-shadow:0 4px 12px rgba(34,87,125,.06);display:flex;flex-direction:column;align-items:center;text-align:center}
.storage-art{height:100px;width:100%;display:flex;align-items:center;justify-content:center}
.storage-art img{width:94px;height:94px;object-fit:contain}
.storage-card h3{margin:5px 0 4px;color:#234766;font-size:1rem;overflow-wrap:anywhere}
.storage-level{padding:3px 9px;border-radius:999px;background:#e6f2fc;color:#3d6380;font-size:.78rem;font-weight:800}
.storage-hp{margin-top:8px;color:#547187;font-size:.78rem}
.storage-actions{display:flex;flex-direction:column;gap:8px;width:100%;margin-top:12px}
.storage-actions label{text-align:left;color:#385b75;font-size:.78rem;font-weight:800}
.storage-actions select{box-sizing:border-box;width:100%;min-width:0;padding:9px;border:1px solid #cbdce9;border-radius:9px;background:#fff;color:#294b65;font:inherit;font-size:.83rem}
.storage-actions .button{width:100%;white-space:normal;line-height:1.3;padding:10px 8px;font-size:.8rem}
.box-empty{margin:20px 0;padding:26px 18px;text-align:center;border:1px dashed #b8d5e8;border-radius:15px;background:#f6fbff;color:#58768e}
.box-empty>span{font-size:2.4rem;color:#0b9fbd}
.box-empty h3{margin:8px 0;color:#244b6b}
.box-empty p{margin:0;line-height:1.5}
.box-page-links{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
@media(max-width:420px){.storage-grid{gap:9px}.storage-card{padding:10px 8px}.storage-art{height:78px}.storage-art img{width:76px;height:76px}.storage-actions .button{font-size:.73rem}.box-page-links .button{flex:1}}


/* Ranking global de entrenadores */
.ranking-page>h2{margin-bottom:8px}
.ranking-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:20px 0}
.ranking-category{display:flex;align-items:center;gap:10px;min-width:0;padding:12px;border:1px solid #d3e5f2;border-radius:13px;background:#fff;color:#294d6b;text-decoration:none;font-weight:800;font-size:.86rem;line-height:1.3;box-shadow:0 3px 9px rgba(31,84,120,.04)}
.ranking-category:hover,.ranking-category.active{border-color:#0da8c4;background:#eafaff;color:#087fa5}
.ranking-category-icon{flex:0 0 34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#e7f3fc;font-size:1.15rem}
.ranking-results{overflow:hidden;border:1px solid #d2e4f1;border-radius:16px;background:#fff}
.ranking-results-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid #e2edf5;background:#f4f9fd}
.ranking-results-head h3{margin:0 0 4px;color:#234866;font-size:1.08rem}
.ranking-results-head p{margin:0;color:#6a8295;font-size:.78rem;line-height:1.4}
.ranking-total{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#e2f2fc;color:#176b93;font-size:.7rem;font-weight:900}
.ranking-table{display:flex;flex-direction:column}
.ranking-row{display:flex;align-items:center;gap:10px;min-width:0;padding:12px 14px;border-bottom:1px solid #edf2f6}
.ranking-row:last-child{border-bottom:0}
.ranking-position{flex:0 0 32px;display:grid;place-items:center;min-height:32px;border-radius:10px;background:#f0f5f9;color:#4a667d;font-weight:900;font-size:.9rem}
.ranking-row.top-rank .ranking-position{background:#fff2d2}
.ranking-trainer{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0}
.ranking-trainer strong{color:#234866;font-size:.87rem;overflow-wrap:anywhere}
.ranking-trainer small{color:#8294a3;font-size:.7rem;overflow-wrap:anywhere}
.ranking-value{flex:0 0 auto;max-width:48%;color:#087fa8;font-size:.82rem;text-align:right;overflow-wrap:anywhere}
.ranking-pokemon-img{width:38px;height:38px;object-fit:contain}
.ranking-footnote{margin:14px 0 0;color:#7b8e9d;font-size:.74rem;line-height:1.5}
@media(max-width:420px){.ranking-categories{gap:7px}.ranking-category{padding:9px;gap:7px;font-size:.77rem}.ranking-category-icon{flex-basis:29px;height:29px}.ranking-results-head{padding:12px}.ranking-row{gap:7px;padding:10px 9px}.ranking-position{flex-basis:28px;min-height:28px}.ranking-value{font-size:.75rem;max-width:45%}.ranking-trainer strong{font-size:.8rem}}


/* Indicador de Poké Ball junto al nombre del Pokémon salvaje */
#wildName{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
}
.wild-caught-ball{
  position:relative;
  display:inline-block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  box-sizing:border-box;
  border:2px solid #202b35;
  border-radius:50%;
  overflow:hidden;
  vertical-align:middle;
  box-shadow:0 1px 2px rgba(0,0,0,.14);
}
.wild-caught-ball::before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:45%;
  background:#e94747;
  border-bottom:2px solid #202b35;
}
.wild-caught-ball::after{
  content:"";
  position:absolute;
  width:6px;height:6px;
  left:50%;top:50%;
  transform:translate(-50%,-50%);
  border:2px solid #202b35;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.65);
}
.wild-caught-ball.is-unknown{
  border-color:#111;
  background:#111;
  box-shadow:none;
}
.wild-caught-ball.is-unknown::before{
  background:#111;
  border-bottom-color:#111;
}
.wild-caught-ball.is-unknown::after{
  background:#111;
  border-color:#111;
  box-shadow:0 0 0 1px #111;
}
.wild-name-text{display:inline-block;min-width:0}

/* Kanto League: encabezado desplegable de líderes */
.kanto-league-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 13px;border:0;border-radius:0;background:linear-gradient(110deg,#087fba,#12b8c9);color:#fff;text-align:left;font:inherit;font-weight:800;cursor:pointer;letter-spacing:.02em}
.kanto-league-toggle:focus-visible{outline:3px solid #f4c84a;outline-offset:2px}
.kanto-toggle-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid rgba(255,255,255,.55);border-radius:7px;font-size:20px;line-height:1}
.gym-leader-list[hidden]{display:none!important}
.gym-leaders{overflow:hidden;border-radius:12px 12px 0 0}
.gym-leader-list{max-height:65vh;overflow-y:auto;overscroll-behavior:contain}

/* Acción distinta para Pokémon debilitados: requieren Revivir, no Poción */
.sidebar-revive-button{background:#fff0e9!important;color:#a93420!important;border-color:#f3b5a4!important}
.sidebar-revive-button:disabled{opacity:.5;cursor:not-allowed}


/* Chat online del mundo compartido */
.world-chat{margin:18px 0 24px;background:#fff;border:1px solid #cfe2f5;border-radius:18px;overflow:hidden;box-shadow:0 8px 22px rgba(28,74,112,.07)}
.world-chat-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;background:linear-gradient(110deg,#087fba,#12b8c9);color:#fff}
.world-chat-header h3{margin:0;font-size:1.05rem;color:#fff}
.world-chat-header p{margin:4px 0 0;color:rgba(255,255,255,.88);font-size:.86rem}
.world-chat-live{display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:20px;background:rgba(255,255,255,.16);font-size:.78rem;white-space:nowrap}
.world-chat-live i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#8af0b1}
.world-chat-messages{height:260px;overflow-y:auto;padding:14px 16px;background:#f7fbff;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.chat-empty{margin:auto;text-align:center;color:#6a8197;font-size:.9rem}
.chat-message{max-width:88%;align-self:flex-start;background:#fff;border:1px solid #d8e7f4;border-radius:12px 12px 12px 4px;padding:9px 12px;box-shadow:0 2px 5px rgba(29,74,111,.04);overflow-wrap:anywhere}
.chat-message-meta{display:flex;align-items:center;gap:12px;margin-bottom:4px}
.chat-message-meta strong{color:#145486;font-size:.86rem}
.chat-message-meta time{color:#7a8da0;font-size:.72rem}
.chat-message p{margin:0;color:#29475f;font-size:.92rem;line-height:1.4;white-space:pre-wrap}
.world-chat-form{display:flex;gap:9px;padding:12px 14px;border-top:1px solid #e0edf7;background:#fff}
.world-chat-form input{flex:1;min-width:0;padding:12px 14px;border:1px solid #c7dced;border-radius:11px;background:#fbfdff;color:#193d5a;font:inherit;outline:none}
.world-chat-form input:focus{border-color:#089fc3;box-shadow:0 0 0 3px rgba(8,159,195,.12)}
.world-chat-form button{border:0;border-radius:11px;padding:0 20px;background:linear-gradient(110deg,#087fba,#12b8c9);color:#fff;font:inherit;font-weight:700;cursor:pointer}
.world-chat-form button:disabled{opacity:.55;cursor:wait}
.world-chat-hint{margin:0;padding:0 16px 12px;color:#72879b;font-size:.78rem;background:#fff}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:600px){.world-chat-messages{height:220px}.world-chat-form{gap:7px;padding:10px}.world-chat-form button{padding:0 14px}.world-chat-header{padding:13px}.chat-message{max-width:96%}}

/* Enlace CHAT ONLINE en el menú lateral */
.chat-sidebar-link{display:flex!important;align-items:center;gap:9px;margin:8px 9px 10px;padding:12px 11px;border:1px solid #f1c4c8;border-radius:10px;background:linear-gradient(110deg,#fff8f8,#fff);color:#d7192d!important;font-weight:900;letter-spacing:.08em;text-decoration:none!important;box-shadow:0 3px 10px rgba(190,25,45,.08);transition:background .15s ease,transform .15s ease}
.chat-sidebar-link:hover{background:#fff0f1;transform:translateY(-1px)}
.chat-sidebar-icon{font-size:15px;color:#e11d32}
.chat-sidebar-dot{width:8px;height:8px;margin-left:auto;border-radius:50%;background:#e11d32;box-shadow:0 0 0 3px rgba(225,29,50,.12)}

/* Página independiente de CHAT ONLINE */
.standalone-chat-page{max-width:900px;margin:0 auto;padding:8px 0 28px}
.chat-page-intro{margin:0 0 18px;padding:8px 4px}
.chat-page-intro h2{margin:5px 0;color:#d7192d;letter-spacing:.08em}
.chat-page-intro p{margin:0;color:#5b7690}
.standalone-chat-page .world-chat{margin:0 0 16px}
.standalone-chat-page .world-chat-messages{height:min(52vh,480px);min-height:260px}
@media(max-width:600px){.standalone-chat-page .world-chat-messages{height:42vh;min-height:220px}}

/* Caja Pokémon: ordenamiento y liberación */
.box-sort-form{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin:0 0 16px;padding:12px 14px;background:#edf6ff;border:1px solid #d0e4f7;border-radius:12px}
.box-sort-form label{font-weight:700;color:#194c79}
.box-sort-form select{min-width:220px;max-width:100%;padding:10px 12px;border:1px solid #bfd8ee;border-radius:9px;background:#fff;color:#234761;font:inherit}
.storage-release-form{margin-top:8px}
.storage-release-form .release-button{width:100%;background:#fff0f1!important;border:1px solid #efb7bd!important;color:#c81e32!important;box-shadow:none!important}
.storage-release-form .release-button:hover{background:#ffe1e5!important}

/* Caja Pokémon: el ordenamiento va debajo del resumen, a ancho completo */
.box-page > .box-sort-form{
  display:flex;
  width:100%;
  box-sizing:border-box;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  flex-wrap:wrap;
  margin:12px 0 18px;
  padding:12px 14px;
  background:#edf6ff;
  border:1px solid #d0e4f7;
  border-radius:12px;
}
.box-page > .box-sort-form select{flex:1;min-width:190px;max-width:360px}
.box-page > .storage-grid{width:100%}

/* Caja Pokémon: acciones de navegación compactas debajo de las tarjetas */
.box-page .box-page-links{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:wrap;
  width:100%;
  margin:18px 0 0;
  padding:0;
}
.box-page .box-page-links .button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:0;
  min-height:0;
  height:auto;
  flex:0 0 auto;
  padding:10px 16px;
  line-height:1.25;
  white-space:nowrap;
}

/* Panel administrativo privado */
.admin-panel{max-width:100%;padding:4px 0 18px}
.admin-panel>h2{margin:6px 0 8px;color:#14538a}
.admin-stat{display:flex;align-items:center;gap:12px;margin:16px 0;padding:14px 18px;border:1px solid #cfe3f8;background:#edf6ff;border-radius:14px}
.admin-stat strong{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#08a8c0;color:#fff;font-size:20px}
.admin-stat span{font-weight:700;color:#24517a}
.admin-user-card{margin:14px 0;padding:16px;border:1px solid #cfe2f6;border-radius:14px;background:#f7fbff;box-shadow:0 5px 14px rgba(25,78,122,.06)}
.admin-user-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.admin-user-heading h3{margin:0 0 4px;overflow-wrap:anywhere}
.admin-user-heading small,.admin-hint{color:#607d98;font-size:12px}
.admin-role{border-radius:999px;padding:5px 9px;background:#e2f6ed;color:#16724a;font-size:12px;font-weight:700;white-space:nowrap}
.admin-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid #dbe9f7}
.admin-form label{display:flex;flex-direction:column;gap:5px;flex:1;min-width:115px;font-size:12px;font-weight:700;color:#2a4d70}
.admin-form input,.admin-form select{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #bfd8ef;border-radius:9px;background:white;color:#244967;font:inherit}
.admin-form .button{min-height:40px;padding:10px 13px;white-space:normal}
.admin-security-note{margin-top:18px;padding:12px;background:#fff7df;border-radius:10px;color:#79551b;font-size:13px}
@media(max-width:620px){.admin-form{align-items:stretch}.admin-form label{min-width:100%;}.admin-form .button{width:100%}}

/* Buscador rápido de cuentas del panel administrativo */
.admin-search-box{margin:16px 0;padding:14px 16px;border:1px solid #cfe2f6;border-radius:12px;background:#fff}
.admin-search-box>label{display:block;margin-bottom:7px;color:#244967;font-size:13px;font-weight:700}
.admin-search-row{display:flex;gap:8px;align-items:center}
.admin-search-row input{flex:1;min-width:0;padding:11px 12px;border:1px solid #bfd8ef;border-radius:9px;background:#fff;color:#244967;font:inherit;outline:none}
.admin-search-row input:focus{border-color:#08a8c0;box-shadow:0 0 0 3px rgba(8,168,192,.13)}
.admin-search-box small{display:block;margin-top:7px;color:#607d98;font-size:12px}
.admin-user-card[hidden]{display:none!important}
@media(max-width:480px){.admin-search-row{align-items:stretch;flex-direction:column}.admin-search-row .button{width:100%}}


/* Progresión secuencial de líderes: verde disponible/derrotado, rojo bloqueado */
.gym-leader-item.gym-unlocked{
  background:#e7f9ec;
  border:1px solid #26a653;
  box-shadow:inset 3px 0 0 #26a653;
}
.gym-leader-item.gym-unlocked b,.gym-leader-item.gym-unlocked small{color:#176b35}
.gym-leader-item.gym-locked{
  background:#fff0f0;
  border:1px solid #d94848;
  box-shadow:inset 3px 0 0 #d94848;
  cursor:not-allowed;
  opacity:.88;
}
.gym-leader-item.gym-locked img{filter:grayscale(1);opacity:.6}
.gym-leader-item.gym-locked b,.gym-leader-item.gym-locked small{color:#a12626}
.gym-leader-item.gym-defeated{
  background:#e0f7e6;
  border:1px solid #208b45;
  box-shadow:inset 3px 0 0 #208b45;
}
.gym-leader-item.gym-defeated b,.gym-leader-item.gym-defeated small{color:#145c2b}


/* Acceso destacado: Entrar al mundo */
.sidebar a.adventure-enter-link{display:flex;align-items:center;justify-content:center;min-height:48px;margin:8px 9px;padding:12px 10px;border:1px solid #18a94f;border-radius:10px;background:linear-gradient(135deg,#20d765,#07983d);color:#fff;font-size:15px;font-weight:1000;letter-spacing:.55px;line-height:1.2;text-align:center;text-transform:uppercase;text-shadow:0 1px 1px #075d2b66;box-shadow:0 4px 10px #07983d38;transition:transform .15s ease,filter .15s ease,box-shadow .15s ease}
.sidebar a.adventure-enter-link:hover{background:linear-gradient(135deg,#39f77b,#08a847);color:#fff;filter:brightness(1.04);transform:translateY(-1px);box-shadow:0 6px 14px #07983d4d}
.sidebar a.adventure-enter-link:focus-visible{outline:3px solid #a4ffc1;outline-offset:2px}
@media(max-width:540px){.sidebar a.adventure-enter-link{min-height:50px;font-size:15px;margin:8px 8px;padding:13px 8px}}

/* Icono de Caramelo usando el recurso original WEBP del proyecto */
.sidebar-candy-button .candy-button-icon{width:15px;height:15px;object-fit:contain;vertical-align:middle;display:inline-block;margin-right:2px}


/* Adaptación móvil/tablet: PokeHu RPG */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, canvas, svg { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
a, button, input, select { touch-action: manipulation; }
body { overflow-x: hidden; }
.layout { width: 100%; }
.content, .sidebar, .welcome, .form-wrap, .character-wrap, .game-welcome,
.dex-wrap, .box-page, .admin-panel { min-width: 0; }
table { display: block; max-width: 100%; overflow-x: auto; }

/* Tablet: contenido primero y paneles laterales debajo, sin perder funciones */
@media (max-width: 900px) {
  .layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin: 12px auto;
    padding: 0 12px;
  }
  .content { order: 1; width: 100%; }
  .layout > .sidebar:first-child { order: 2; }
  .layout > .sidebar:last-child { order: 3; }
  .sidebar {
    display: block !important;
    width: 100%;
    max-width: none;
  }
  .sidebar section { min-width: 0; }
  .sidebar section > div { max-width: 100%; }
  .topnav { width: 100%; gap: 10px 14px; }
  .nav-user { overflow-wrap: anywhere; }
  .hero { padding-left: 8px; padding-right: 8px; }
  .dex-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .team-grid, .storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Teléfonos */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .hero { padding: 6px 6px 0; }
  .hero-art { height: 112px; border-radius: 8px; }
  .brand h1 { font-size: clamp(29px, 9vw, 40px); letter-spacing: -1px; }
  .brand p { font-size: 8px; letter-spacing: 1px; margin: 5px 0; }
  .brand-small { font-size: 8px; letter-spacing: 1.5px; }
  .mascot, .mascot.right { font-size: 36px; }
  .topnav {
    padding: 10px;
    gap: 9px 12px;
    font-size: 12px;
    align-items: center;
  }
  .topnav a { overflow-wrap: anywhere; }
  .nav-logout, .nav-admin { padding: 8px 10px; }
  .layout { padding: 0 7px; gap: 10px; }
  .welcome, .form-wrap, .character-wrap, .game-welcome, .dex-wrap {
    padding: 14px;
    border-radius: 12px;
  }
  .welcome h2, .form-wrap h2, .character-wrap h2, .game-welcome h2,
  .dex-wrap h2 { font-size: clamp(22px, 6vw, 29px); }
  .welcome .lead { font-size: 16px; }
  .cta-row, .feature-row { grid-template-columns: 1fr; }
  .feature-row div { flex-direction: row; align-items: center; text-align: left; }
  .feature-row small { margin-left: auto; }
  .gender-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .character-wrap .starter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .starter-choice { min-height: 135px; padding: 10px 4px; }
  .creature { width: 48px; height: 50px; font-size: 36px; }
  .starter-choice b { font-size: 11px; overflow-wrap: anywhere; }
  .type { font-size: 9px; padding: 3px 5px; }
  .selected-info { gap: 8px; padding: 10px; }
  .selected-info .button { width: 100%; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .profile-stats div { padding: 10px; min-width: 0; }
  .profile-stats b { font-size: 18px; }
  .dex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .dex-card { padding: 8px 4px; }
  .dex-image { height: 54px; }
  .dex-image img { width: 52px; height: 52px; }
  .team-grid, .storage-grid { grid-template-columns: 1fr; gap: 9px; }
  .team-card { padding: 11px; gap: 9px; }
  .player-card, .companion-card { gap: 10px; padding: 12px; }
  .player-avatar, .companion-art { width: 58px; height: 58px; flex-basis: 58px; font-size: 34px; }
  .button { min-height: 42px; padding: 11px 13px; }
  .sidebar h3 { padding: 11px 12px; font-size: 14px; }
  .sidebar a, .sidebar p { padding: 10px 12px; font-size: 13px; }
  .box-page > .box-sort-form { padding: 10px; }
  .box-page > .box-sort-form select { min-width: 0; width: 100%; max-width: none; }
  .box-page .box-page-links { gap: 8px; }
  .box-page .box-page-links .button { white-space: normal; flex: 1 1 130px; }
  .admin-user-heading { flex-wrap: wrap; }
  .admin-form { align-items: stretch; }
  .admin-form label { min-width: 100%; }
  .admin-form .button { width: 100%; }
  .standalone-chat-page .world-chat-messages { height: 42vh; min-height: 200px; }
  footer { padding: 16px 8px; }
}

/* Pantallas muy estrechas */
@media (max-width: 380px) {
  .layout { padding: 0 5px; }
  .character-wrap .starter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { gap: 8px; }
  .brand h1 { font-size: 28px; }
  .mascot, .mascot.right { font-size: 30px; }
}


/* Indicador USER ONLINE global en la barra superior */
.user-online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(64, 220, 153, .45);
  border-radius: 999px;
  background: rgba(19, 118, 83, .25);
  color: #d8fff0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}
.user-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35e58c;
  box-shadow: 0 0 9px rgba(53, 229, 140, .8);
}
.user-online-badge strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: #35e58c;
  color: #063a2a;
  font-size: 12px;
  letter-spacing: 0;
}
@media (max-width: 760px) {
  .topnav { flex-wrap: wrap; gap: 10px 12px; }
  .nav-user { margin-left: 0; }
  .user-online-badge { margin-left: auto; order: 5; }
}
@media (max-width: 420px) {
  .user-online-badge { padding: 7px 9px; gap: 6px; font-size: 10px; }
}
