/* DigiGram starter portraits — responsive 3-card selection from approved concept. */
.starter-portrait-selection{
  --portrait-cyan:#45e9fd;
  position:relative;isolation:isolate;overflow:hidden;
  padding:16px 13px 20px;
  border:1px solid #455fa2;
  border-radius:22px;
  background:
    radial-gradient(ellipse at 50% 4%,rgba(30,141,237,.23),transparent 55%),
    linear-gradient(160deg,#101e45,#111333 68%,#101639);
}
.starter-portrait-selection::before{
  content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;
  background:repeating-linear-gradient(0deg,transparent 0 27px,rgba(74,174,243,.035) 28px 29px),
             repeating-linear-gradient(90deg,transparent 0 27px,rgba(74,174,243,.035) 28px 29px);
}
.starter-art-heading{text-align:center;margin:0 0 18px}
.starter-art-heading .kicker{color:#64e7ff;font-size:11px;letter-spacing:.22em;font-weight:900}
.starter-art-heading h2{font-weight:1000;letter-spacing:.04em;line-height:1.1;
  color:#f2fbff;font-size:clamp(21px,5vw,32px);margin:7px 0 10px;
  text-shadow:0 0 14px #29b5ff85}
.starter-art-heading p{margin:0 auto;max-width:590px;color:#c5ddf5;
  font-size:13px;line-height:1.5}
.starter-portrait-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(6px,1.7vw,14px);align-items:stretch}
.starter-portrait-card{
  --accent:#59d4ff;--glow:rgba(89,212,255,.43);
  appearance:none;-webkit-appearance:none;
  display:flex;flex-direction:column;justify-content:flex-start;
  width:100%;min-width:0;min-height:0;padding:5px 5px 9px;
  background:linear-gradient(160deg,#1a2b53 0%,#121f42 69%,#16213c);
  border:2px solid var(--accent);border-radius:16px;cursor:pointer;
  color:#fff;box-shadow:inset 0 0 8px var(--glow),0 0 11px var(--glow);
  transition:transform .17s ease,box-shadow .17s ease,border-width .17s ease;
  text-align:center;
}
.starter-portrait--fire{--accent:#ff664f;--glow:#ff533b55;
  background:linear-gradient(165deg,#40203b,#25132a 76%)}
.starter-portrait--ice{--accent:#54ccff;--glow:#20bdff64;
  background:linear-gradient(165deg,#173b6b,#111d41 76%)}
.starter-portrait--light{--accent:#ffdf67;--glow:#ffcb3d5e;
  background:linear-gradient(165deg,#4a3c2b,#241c30 76%)}
.starter-portrait-card.is-selected{
  transform:translateY(-3px);border-color:#fff;
  box-shadow:0 0 0 2px var(--accent),0 0 23px var(--glow),
    inset 0 0 14px var(--glow)
}
.starter-portrait-card:focus-visible{outline:3px solid white;outline-offset:4px}
.starter-portrait-art{
  position:relative;display:block;width:100%;aspect-ratio:145/165;
  border-radius:10px 10px 5px 5px;overflow:hidden;
  background:radial-gradient(circle,#205480,#071c38);
}
.starter-portrait-art img{
  position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:cover;object-position:center;z-index:1;border-radius:inherit
}
.starter-portrait-emoji{position:absolute;inset:0;display:grid;place-items:center;
  font-size:46px;z-index:0}
.starter-selected-tick{position:absolute;right:4px;top:4px;z-index:3;
  width:24px;height:24px;line-height:23px;border-radius:50%;
  color:#092136;background:#a9ffdb;font-size:17px;font-weight:1000;
  opacity:0;transform:scale(.75);transition:opacity .17s ease,transform .17s ease;
  box-shadow:0 0 9px #a5ffe2}
.starter-portrait-card.is-selected .starter-selected-tick{opacity:1;transform:scale(1)}
.starter-portrait-name{font-size:clamp(12px,3.1vw,21px);font-weight:1000;
  line-height:1.25;display:block;width:100%;margin:8px 0 3px;
  text-shadow:0 1px 6px #0a1039}
.starter-portrait-role{display:flex;justify-content:center;align-items:center;
  flex-wrap:wrap;gap:3px 4px;width:100%;color:#f4e9e9;
  font-size:clamp(9px,2.35vw,13px);font-weight:700;line-height:1.28}
.starter-portrait-role>span{font-size:12px;white-space:nowrap}
.starter-choice-summary{padding:13px 14px;margin:16px 0 11px;
  border:1px solid #4ab4db;border-radius:15px;
  background:linear-gradient(130deg,rgba(14,47,90,.9),rgba(22,23,65,.88));
  color:#d7e8ff;line-height:1.5;text-align:center;
  min-height:105px}
.starter-choice-summary strong{color:#e6faff;font-size:15px}
.starter-choice-summary p{font-size:13px;margin:6px 0}
.starter-choice-summary small{color:#a5f4d8;font-size:11px}
.starter-choice-note{color:#a7cee5;text-align:center;
  font-size:12px;line-height:1.45;margin:0 10px 14px}
.starter-portrait-confirm.btn{display:block;width:min(100%,430px);
  margin:0 auto;min-height:55px;padding:13px 12px;font-size:17px;font-weight:1000;
  color:white;letter-spacing:.06em;border:2px solid #c48aff;border-radius:16px;
  background:linear-gradient(110deg,#7525d2,#4f35df,#7237e3);
  box-shadow:0 0 17px #7639e080,inset 0 1px 6px #e6c1ff66}
.starter-portrait-confirm.btn:disabled{opacity:.48;filter:saturate(.6);
  box-shadow:none;cursor:not-allowed}
@media(max-width:360px){
  .starter-portrait-selection{padding:13px 9px 17px}
  .starter-portrait-grid{gap:6px}
  .starter-portrait-card{padding:4px 4px 8px;border-radius:12px}
  .starter-portrait-name{font-size:12px;letter-spacing:-.03em}
  .starter-portrait-role{font-size:9px}
  .starter-art-heading p{font-size:12px}
  .starter-choice-summary{padding:10px}
}
@media(prefers-reduced-motion:reduce){
  .starter-portrait-card,.starter-selected-tick{transition:none}
}
/* One approved image for each base starter everywhere in the Digivice.
   Keep the photo-style WebP rendering sharp instead of pixelating it like
   the original transparent 16-bit sprites. Evolutions are unaffected. */
.digimon-sprite-stage.starter-portrait-reuse{
  --portrait-ring:#68cced;
  overflow:hidden;
  border:2px solid var(--portrait-ring);
  border-radius:13px;
  background:linear-gradient(155deg,#17466b,#101c3d);
  box-shadow:inset 0 0 8px #070e23,0 0 8px #10284680;
}
.digimon-sprite-stage.starter-portrait-reuse--agumon{
  --portrait-ring:#ff745a;
  background:linear-gradient(155deg,#63303f,#24152f);
}
.digimon-sprite-stage.starter-portrait-reuse--gabumon{
  --portrait-ring:#58cfff;
}
.digimon-sprite-stage.starter-portrait-reuse--patamon{
  --portrait-ring:#ffdc73;
  background:linear-gradient(155deg,#654d30,#292035);
}
.digimon-sprite-stage.starter-portrait-reuse::after{content:none}
.digimon-sprite-stage.starter-portrait-reuse>.digimon-sprite{
  width:100%;height:100%;min-width:0;min-height:0;
  object-fit:cover;object-position:center center;
  image-rendering:auto;filter:none;
}
/* Existing layout classes still determine portrait size on the home, battle
   and evolution screens; image files and crop are identical in all locations. */

/* Partner portrait V3 — approved mobile layout: tall portrait left,
   vertically balanced info/currency right, and breathing room above bond. */
.digimon-panel .tamer-summary{
  display:grid;
  grid-template-columns:minmax(0,44%) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) auto;
  grid-template-areas:"portrait info" "portrait balances";
  gap:7px clamp(10px,3vw,18px);
  align-items:center;
  min-height:clamp(180px,44vw,305px);
  margin-bottom:14px;
}
.digimon-panel .tamer-profile{display:contents}
.digimon-panel .partner-sprite-stage{
  grid-area:portrait;
  align-self:stretch;
  width:100%;
  height:100%;
  min-height:clamp(175px,44vw,300px);
  max-height:320px;
  aspect-ratio:auto;
}
.digimon-panel .tamer-profile-copy{
  grid-area:info;align-self:center;
  display:flex;flex-direction:column;align-items:flex-start;
  justify-content:center;gap:4px;
  min-width:0;text-align:left;
}
.digimon-panel .tamer-profile-copy h2{margin:2px 0;line-height:1.27}
.digimon-panel .tamer-profile-copy .bond-name-row{width:100%;max-width:100%}
.digimon-panel .tamer-balances{
  grid-area:balances;
  align-self:end;justify-self:stretch;
  display:flex;flex-direction:row;flex-wrap:wrap;
  justify-content:flex-start;align-items:center;
  width:100%;max-width:100%;gap:5px;
  padding-bottom:4px;
}
.digimon-panel .tamer-balances .balance{
  max-width:100%;min-width:0;white-space:nowrap;
  padding:6px 5px;font-size:clamp(10px,2.75vw,13px);
}
.digimon-panel .partner-sprite-stage.starter-portrait-reuse>.digimon-sprite{
  image-rendering:auto;object-fit:cover;object-position:center center;
}
@media(max-width:370px){
  .digimon-panel .tamer-summary{
    grid-template-columns:minmax(0,42%) minmax(0,1fr);
    column-gap:9px;min-height:165px;
  }
  .digimon-panel .partner-sprite-stage{min-height:165px}
  .digimon-panel .tamer-profile-copy{gap:4px}
  .digimon-panel .tamer-profile-copy h2{
    font-size:calc(clamp(16px,4.7vw,23px) + 1pt);
  }
  .digimon-panel .tamer-balances{gap:6px}
}

/* Approved evolution zoom: identical portrait frame and lineage border as
   starters, with a centered proportional cover crop as reviewed by the owner.
   Applies to partner, battle and evolution tiles without altering any source
   illustration or the three base starter portraits. */
.digimon-sprite-stage.starter-portrait-reuse.hd-evolution-reuse>.digimon-sprite,
.digimon-panel .partner-sprite-stage.starter-portrait-reuse.hd-evolution-reuse>.digimon-sprite{
  object-fit:cover;
  object-position:center center;
}

/* First-entry choice cards only: show all of each newly supplied illustration.
   This does not affect the shared partner/evolution/battle portraits. */
.starter-portrait-selection .starter-portrait-art img {
  object-fit:contain;
  object-position:center center;
}
