/* v39 — starter selection and server-authoritative skill mastery. Loaded last. */
.starter-dialog.is-open{display:grid;place-items:center;padding:clamp(10px,3vw,34px)}
.starter-experience{width:min(1180px,100%);max-height:min(790px,calc(100dvh - 28px));border:1px solid rgba(113,202,235,.35);border-radius:26px;overflow:hidden;box-shadow:0 32px 90px rgba(0,18,31,.56);background:linear-gradient(160deg,#071f2c,#092b3b)}
.starter-flow-header{min-height:82px;padding:15px 18px 13px 24px}
.starter-flow-content{padding:20px;max-height:calc(100dvh - 132px);overflow:auto;scrollbar-gutter:stable}
.starter-select-v39{display:grid;gap:16px}
.starter-select-v39>header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding:0 3px}
.starter-select-v39>header b{color:var(--starter-text,#eefaff);font-size:15px}
.starter-select-v39>header span{max-width:580px;color:var(--starter-muted,#9ab6c5);font-size:10px;line-height:1.45;text-align:right}
.starter-choice-grid-v39{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.starter-choice-card-v39{position:relative;display:grid;grid-template-rows:190px auto auto 32px;min-width:0;padding:13px;border:1px solid color-mix(in srgb,var(--starter-accent) 60%,#31576a);border-radius:22px;background:radial-gradient(circle at 50% 20%,color-mix(in srgb,var(--starter-accent) 20%,transparent),transparent 47%),linear-gradient(160deg,rgba(255,255,255,.07),rgba(255,255,255,.025));box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 14px 28px rgba(0,10,18,.2);color:#fff;text-align:left;cursor:pointer;overflow:hidden;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.starter-choice-card-v39:hover,.starter-choice-card-v39:focus-visible{transform:translateY(-4px);border-color:var(--starter-accent);box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 20px 38px color-mix(in srgb,var(--starter-accent) 18%,rgba(0,10,18,.46));outline:0}
.starter-card-art-v39{display:grid;place-items:center;min-height:0}
.starter-card-portrait-v39,.starter-card-portrait-v39 img{display:block;width:178px;height:178px;object-fit:contain;user-select:none;-webkit-user-drag:none}
.starter-card-copy-v39{display:grid;gap:3px;min-width:0;padding:3px 4px 11px;text-align:center}
.starter-card-copy-v39 small{color:color-mix(in srgb,var(--starter-accent) 78%,white);font-size:8px;font-weight:900;letter-spacing:.075em;text-transform:uppercase}
.starter-card-copy-v39 b{color:var(--starter-text,#f3fbff);font-size:23px;line-height:1.05}
.starter-card-copy-v39 em{color:var(--starter-muted,#9ab6c5);font-size:9px;font-style:normal;white-space:normal}
.starter-card-skills-v39{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:9px 3px;border-top:1px solid rgba(160,210,230,.12)}
.starter-card-skill-v39{position:relative;display:grid;place-items:center;aspect-ratio:1;border:1px solid rgba(140,197,220,.24);border-radius:12px;background:rgba(1,14,22,.38);overflow:hidden}
.starter-card-skill-v39.is-locked{filter:saturate(.35);opacity:.58}
.starter-card-skill-v39.is-learned{border-color:var(--starter-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--starter-accent) 18%,transparent)}
.starter-card-skill-dot,.starter-card-skill-dot img{width:100%;height:100%;object-fit:cover}
.starter-card-skill-v39 small{position:absolute;right:3px;bottom:3px;padding:2px 4px;border-radius:6px;background:rgba(3,18,27,.84);color:#fff;font-size:6px;font-weight:900}
.starter-card-open-v39{display:flex;align-items:center;justify-content:center;gap:8px;border-radius:10px;background:color-mix(in srgb,var(--starter-accent) 14%,rgba(255,255,255,.03));color:color-mix(in srgb,var(--starter-accent) 76%,white);font-size:9px;font-weight:900;text-transform:uppercase}

.starter-details-v39{display:grid;grid-template-columns:minmax(290px,.82fr) minmax(420px,1.18fr);gap:16px;min-height:500px}
.starter-profile-v39,.starter-details-copy-v39{border:1px solid rgba(128,195,220,.2);border-radius:21px;background:rgba(255,255,255,.035)}
.starter-profile-v39{display:grid;grid-template-rows:250px auto;padding:14px;background:radial-gradient(circle at 50% 27%,color-mix(in srgb,var(--starter-accent) 20%,transparent),transparent 48%),rgba(255,255,255,.03)}
.starter-profile-art-v39{display:grid;place-items:center;min-height:0}
.starter-detail-portrait-v39,.starter-detail-portrait-v39 img{display:block;width:245px;height:245px;object-fit:contain;user-select:none;-webkit-user-drag:none}
.starter-profile-copy-v39{display:grid;gap:5px;align-content:start;text-align:center}
.starter-profile-copy-v39>small{color:color-mix(in srgb,var(--starter-accent) 75%,white);font-size:8px;font-weight:900;letter-spacing:.08em}
.starter-profile-copy-v39 h3{margin:0;color:var(--starter-text,#effaff);font-size:30px}
.starter-profile-copy-v39 p{margin:0;color:var(--starter-muted,#9ab6c5);font-size:10px}
.starter-v39-legacy-label{color:var(--starter-muted,#9ab6c5);font-size:7px;font-weight:800}
.starter-profile-copy-v39 .pokemon-type-badges{justify-content:center}
.starter-profile-copy-v39 .starter-stat-grid{grid-template-columns:repeat(3,1fr);gap:5px;margin-top:8px}
.starter-profile-copy-v39 .starter-stat{padding:7px;border-radius:10px}
.starter-profile-copy-v39 .starter-stat span small{font-size:6px}
.starter-details-copy-v39{display:flex;flex-direction:column;gap:10px;padding:16px;min-width:0}
.starter-details-copy-v39>header small{color:var(--starter-accent);font-size:7px;font-weight:900;letter-spacing:.11em}
.starter-details-copy-v39>header b{display:block;margin-top:3px;color:var(--starter-text,#effaff);font-size:19px}
.starter-details-copy-v39>header p{margin:3px 0 0;color:var(--starter-muted,#9ab6c5);font-size:9px}
.starter-roadmap-v39{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.starter-roadmap-skill{display:grid;grid-template-columns:50px minmax(0,1fr) 28px;align-items:center;gap:8px;min-width:0;padding:7px;border:1px solid rgba(130,191,215,.18);border-radius:13px;background:rgba(1,15,23,.3);color:inherit;text-align:left;cursor:pointer}
.starter-roadmap-skill.is-active{border-color:var(--starter-accent);background:color-mix(in srgb,var(--starter-accent) 9%,rgba(1,15,23,.36))}
.starter-roadmap-skill.is-locked{opacity:.7}
.starter-roadmap-icon,.starter-roadmap-icon img{display:block;width:48px;height:48px;border-radius:10px;object-fit:cover}
.starter-roadmap-skill span{display:grid;gap:2px;min-width:0}
.starter-roadmap-skill small{color:var(--starter-accent);font-size:6px;font-weight:900;letter-spacing:.05em}
.starter-roadmap-skill b{overflow:hidden;color:var(--starter-text,#effaff);font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.starter-roadmap-skill em{overflow:hidden;color:var(--starter-muted,#9ab6c5);font-size:7px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}
.starter-roadmap-skill>strong{display:grid;place-items:center;width:26px;height:26px;border-radius:9px;background:rgba(255,255,255,.08);color:var(--starter-accent);font-size:9px}
.starter-detail-inline-v39 .starter-skill-detail{grid-template-columns:76px 1fr;padding:9px;min-height:98px}
.starter-detail-inline-v39 .starter-skill-detail-icon,.starter-detail-inline-v39 .starter-skill-detail-atlas,.starter-detail-inline-v39 .starter-skill-detail-atlas img{width:72px;height:72px}
.starter-detail-inline-v39 .starter-skill-detail-copy p{margin:3px 0 6px;font-size:8px}
.starter-detail-inline-v39 .starter-skill-metrics i{min-height:34px;padding:5px}

.starter-confirm-v39,.starter-partner-v39{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(360px,1.15fr);gap:20px;align-items:center;max-width:860px;min-height:450px;margin:auto;padding:25px;border:1px solid color-mix(in srgb,var(--starter-accent) 45%,#31566a);border-radius:24px;background:radial-gradient(circle at 23% 40%,color-mix(in srgb,var(--starter-accent) 18%,transparent),transparent 34%),rgba(255,255,255,.03)}
.starter-confirm-art-v39,.starter-partner-art-v39{position:relative;display:grid;place-items:center}
.starter-confirm-portrait-v39,.starter-confirm-portrait-v39 img,.starter-partner-portrait-v39,.starter-partner-portrait-v39 img{display:block;width:280px;height:280px;object-fit:contain;user-select:none;-webkit-user-drag:none}
.starter-confirm-copy-v39,.starter-partner-copy-v39{display:grid;gap:8px}
.starter-confirm-copy-v39>small,.starter-partner-copy-v39>small{color:var(--starter-accent);font-size:8px;font-weight:900;letter-spacing:.1em}
.starter-confirm-copy-v39 h3,.starter-partner-copy-v39 h3{margin:0;color:var(--starter-text,#effaff);font-size:32px;line-height:1.05}
.starter-confirm-copy-v39>p,.starter-partner-copy-v39>p{margin:0;color:var(--starter-muted,#9ab6c5);font-size:11px;line-height:1.5}
.starter-confirm-first-skill,.starter-learned-v39{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:10px;margin-top:7px;padding:9px;border:1px solid color-mix(in srgb,var(--starter-accent) 36%,#395c6e);border-radius:15px;background:color-mix(in srgb,var(--starter-accent) 9%,rgba(2,17,25,.55))}
.starter-confirm-skill-icon,.starter-confirm-skill-icon img,.starter-learned-icon-v39,.starter-learned-icon-v39 img{display:block;width:62px;height:62px;border-radius:12px;object-fit:cover}
.starter-confirm-first-skill span,.starter-learned-v39 span{display:grid;gap:2px}
.starter-confirm-first-skill small,.starter-learned-v39 small{color:var(--starter-accent);font-size:7px;font-weight:900}
.starter-confirm-first-skill b,.starter-learned-v39 b{color:var(--starter-text,#effaff);font-size:13px}
.starter-confirm-first-skill strong{padding:6px 8px;border-radius:9px;background:#39a558;color:#fff;font-size:7px}
.starter-partner-art-v39>span{position:absolute;right:20px;bottom:32px;display:grid;place-items:center;width:50px;height:50px;border-radius:50%;background:#43b95b;color:#fff;font-size:24px;box-shadow:0 0 0 7px rgba(67,185,91,.16)}
.starter-learned-v39{grid-template-columns:64px minmax(0,1fr)}
.starter-learned-v39 em{color:var(--starter-muted,#9ab6c5);font-size:8px;font-style:normal}

.pokemon-mastery-section{padding:0!important;overflow:hidden}
.pokemon-mastery-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;background:linear-gradient(135deg,#eff9ff,#f8fcff);border-bottom:1px solid #dceaf2}
.pokemon-mastery-head span small{display:block;color:#0787cf;font-size:8px;font-weight:900;letter-spacing:.08em}
.pokemon-mastery-head span b{display:block;margin-top:2px;color:#173e5c;font-size:15px}
.pokemon-mastery-head span p{margin:3px 0 0;color:#6b8496;font-size:9px}
.pokemon-mastery-head>strong{display:grid;grid-template-columns:auto auto;align-items:end;gap:0 5px;min-width:70px;padding:8px 10px;border-radius:13px;background:#078dd0;color:#fff;font-size:23px;text-align:center}
.pokemon-mastery-head>strong small{grid-column:1/-1;font-size:6px;letter-spacing:.08em}.pokemon-mastery-head>strong em{padding-bottom:3px;font-size:7px;font-style:normal;opacity:.8}
.pokemon-mastery-next{padding:7px 15px;background:#f8fbfd;color:#638095;font-size:8px;font-weight:800}
.pokemon-mastery-grid{display:grid;gap:8px;padding:12px}
.pokemon-mastery-card{display:grid;grid-template-columns:62px minmax(0,1fr) 76px;align-items:center;gap:10px;padding:9px;border:1px solid #dbe8ef;border-left:3px solid var(--skill-type,#4ba5d9);border-radius:14px;background:#fff}
.pokemon-mastery-card.is-locked{background:#f6f9fb}
.pokemon-mastery-icon{position:relative;width:60px;height:60px}.pokemon-mastery-art,.pokemon-mastery-art img{display:block;width:60px;height:60px;border-radius:12px;object-fit:cover}.pokemon-mastery-icon>span{position:absolute;left:3px;top:3px;padding:2px 4px;border-radius:5px;background:rgba(6,25,36,.82);color:#fff;font-size:6px;font-weight:900}
.pokemon-mastery-copy{display:grid;gap:2px;min-width:0}.pokemon-mastery-copy>small{color:#6d8799;font-size:7px;font-weight:900;letter-spacing:.05em}.pokemon-mastery-copy>b{color:#173e5c;font-size:12px}.pokemon-mastery-copy>p{overflow:hidden;margin:0;color:#668095;font-size:8px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.pokemon-mastery-copy>em{color:#7c92a2;font-size:7px;font-style:normal}
.pokemon-mastery-ranks{display:flex;gap:4px;margin:3px 0}.pokemon-mastery-ranks i{width:18px;height:5px;border-radius:999px;background:#dce7ed}.pokemon-mastery-ranks i.is-filled{background:var(--skill-type,#3fa9dd);box-shadow:0 0 6px color-mix(in srgb,var(--skill-type,#3fa9dd) 45%,transparent)}
.pokemon-mastery-card>button{min-height:34px;border:0;border-radius:10px;background:#078dd0;color:#fff;font-size:8px;font-weight:900;cursor:pointer}.pokemon-mastery-card>button:disabled{background:#e4ebef;color:#8296a4;cursor:not-allowed}

html[data-game-theme="light"] .starter-experience{background:linear-gradient(160deg,#fbfdff,#eef8fc)}
html[data-game-theme="light"] .starter-choice-card-v39,html[data-game-theme="light"] .starter-profile-v39,html[data-game-theme="light"] .starter-details-copy-v39,html[data-game-theme="light"] .starter-confirm-v39,html[data-game-theme="light"] .starter-partner-v39{background:radial-gradient(circle at 50% 20%,color-mix(in srgb,var(--starter-accent) 12%,transparent),transparent 48%),#fff;box-shadow:0 14px 34px rgba(36,89,115,.1)}
html[data-game-theme="light"] .starter-card-skill-v39,html[data-game-theme="light"] .starter-roadmap-skill{background:#f5fafc}

@media(max-width:760px){
  .starter-dialog.is-open{place-items:center;padding:7px}
  .starter-experience{max-height:calc(100dvh - 14px);border-radius:20px}
  .starter-flow-header{min-height:62px;padding:9px 10px 8px 13px}
  .starter-flow-content{max-height:calc(100dvh - 78px);padding:10px}
  .starter-select-v39{gap:9px}.starter-select-v39>header{display:grid;gap:2px}.starter-select-v39>header b{font-size:12px}.starter-select-v39>header span{font-size:8px;text-align:left}
  .starter-choice-grid-v39{grid-template-columns:1fr;gap:8px}
  .starter-choice-card-v39{grid-template-columns:94px minmax(0,1fr) 116px;grid-template-rows:auto 30px;min-height:130px;padding:8px;border-radius:16px}
  .starter-card-art-v39{grid-row:1/3}.starter-card-portrait-v39,.starter-card-portrait-v39 img{width:92px;height:108px}
  .starter-card-copy-v39{align-content:center;padding:2px 6px;text-align:left}.starter-card-copy-v39 small{font-size:6px}.starter-card-copy-v39 b{font-size:18px}.starter-card-copy-v39 em{font-size:7px}
  .starter-card-skills-v39{align-self:center;padding:0;border:0}.starter-card-skill-v39{border-radius:9px}.starter-card-skill-v39 small{font-size:5px}
  .starter-card-open-v39{grid-column:2/4;font-size:7px}
  .starter-details-v39{grid-template-columns:1fr;gap:9px;min-height:0}
  .starter-profile-v39{grid-template-columns:112px minmax(0,1fr);grid-template-rows:auto;padding:8px}.starter-detail-portrait-v39,.starter-detail-portrait-v39 img{width:110px;height:150px}.starter-profile-copy-v39{text-align:left}.starter-profile-copy-v39 h3{font-size:22px}.starter-profile-copy-v39 .pokemon-type-badges{justify-content:flex-start}.starter-profile-copy-v39 .starter-stat-grid{grid-template-columns:repeat(3,1fr)}
  .starter-details-copy-v39{padding:9px}.starter-details-copy-v39>header b{font-size:15px}.starter-roadmap-v39{grid-template-columns:1fr 1fr}.starter-roadmap-skill{grid-template-columns:42px minmax(0,1fr) 23px;padding:5px}.starter-roadmap-icon,.starter-roadmap-icon img{width:40px;height:40px}.starter-roadmap-skill em{display:none}.starter-detail-inline-v39{display:none}
  .starter-details-copy-v39 .starter-flow-actions{position:sticky;bottom:-9px;margin:0 -9px -9px;padding:8px 9px calc(8px + env(safe-area-inset-bottom));background:linear-gradient(180deg,rgba(4,24,34,0),rgba(4,24,34,.97) 30%)}
  .starter-confirm-v39,.starter-partner-v39{grid-template-columns:130px minmax(0,1fr);gap:10px;min-height:340px;padding:12px}.starter-confirm-portrait-v39,.starter-confirm-portrait-v39 img,.starter-partner-portrait-v39,.starter-partner-portrait-v39 img{width:135px;height:190px}.starter-confirm-copy-v39 h3,.starter-partner-copy-v39 h3{font-size:22px}.starter-confirm-copy-v39>p,.starter-partner-copy-v39>p{font-size:9px}.starter-confirm-first-skill,.starter-learned-v39{grid-template-columns:48px minmax(0,1fr);padding:6px}.starter-confirm-skill-icon,.starter-confirm-skill-icon img,.starter-learned-icon-v39,.starter-learned-icon-v39 img{width:46px;height:46px}.starter-confirm-first-skill strong{display:none}.starter-partner-art-v39>span{right:0;bottom:22px;width:38px;height:38px;font-size:18px}
  .pokemon-mastery-card{grid-template-columns:52px minmax(0,1fr);padding:7px}.pokemon-mastery-icon,.pokemon-mastery-art,.pokemon-mastery-art img{width:50px;height:50px}.pokemon-mastery-card>button{grid-column:1/-1}.pokemon-mastery-copy>p{white-space:normal}.pokemon-mastery-head span p{display:none}
}

@media(max-width:430px){
  .starter-choice-card-v39{grid-template-columns:82px minmax(0,1fr);grid-template-rows:auto auto auto}.starter-card-art-v39{grid-row:1/4}.starter-card-portrait-v39,.starter-card-portrait-v39 img{width:80px;height:112px}.starter-card-skills-v39{grid-column:2}.starter-card-open-v39{grid-column:2}
  .starter-roadmap-v39{grid-template-columns:1fr}.starter-profile-v39{grid-template-columns:94px minmax(0,1fr)}.starter-detail-portrait-v39,.starter-detail-portrait-v39 img{width:92px;height:132px}.starter-profile-copy-v39 .starter-stat-grid{display:none}
  .starter-confirm-v39,.starter-partner-v39{grid-template-columns:1fr;text-align:center}.starter-confirm-art-v39,.starter-partner-art-v39{height:130px}.starter-confirm-portrait-v39,.starter-confirm-portrait-v39 img,.starter-partner-portrait-v39,.starter-partner-portrait-v39 img{width:150px;height:150px}.starter-confirm-copy-v39,.starter-partner-copy-v39{text-align:left}
}
