/* Optional fan-art skin. No layout or user-input changes when disabled. */
.pokemon-skin-toggle{
  flex:none;position:relative;z-index:8;border:1.5px solid #e5be68;
  border-radius:999px;padding:8px 14px;background:#fff6d8;color:#72502a;
  font:800 12px/1.3 "Noto Sans KR",system-ui,sans-serif;
  letter-spacing:-.015em;box-shadow:0 4px 12px #2f2b2619;
  white-space:nowrap;cursor:pointer;touch-action:manipulation
}
.pokemon-skin-toggle:hover{filter:brightness(1.06);transform:translateY(-1px)}
.pokemon-skin-toggle[aria-pressed=true]{
  color:#254b44;background:linear-gradient(120deg,#d9faea,#fff5ca);
  border-color:#88c8b0
}
.pokemon-skin-toggle:focus-visible{outline:3px solid #eab564;outline-offset:3px}
html.pokemon-mode .pokemon-partner-strip{
  --accent:var(--pokemon-accent,#85b9a3);
  --tint:var(--pokemon-tint,#eff9f2);
  display:flex;align-items:center;gap:17px;
  position:relative;overflow:hidden;min-height:105px;max-width:1120px;
  margin:17px auto 19px;padding:10px 27px;
  background:linear-gradient(100deg,var(--tint),#fffdf7 73%);
  border:1px solid color-mix(in srgb,var(--accent),white 48%);
  border-radius:17px;box-shadow:0 10px 28px #23232310;
  font-family:"Noto Sans KR",system-ui,sans-serif;
  isolation:isolate
}
html.pokemon-mode .pokemon-partner-strip:after{
  content:"";position:absolute;right:-38px;top:-85px;width:200px;height:200px;
  border:20px solid color-mix(in srgb,var(--accent),transparent 83%);
  border-radius:50%;pointer-events:none;z-index:-1
}
.pokemon-partner-portraits{display:flex;align-items:center;justify-content:center;
  gap:0;min-width:178px;width:178px;height:85px}
.pokemon-partner-portraits img{width:95px;height:95px;object-fit:contain;
  filter:drop-shadow(0 5px 4px #263f3b26);
  animation:pokemon-bob 4s ease-in-out infinite}
.pokemon-partner-portraits img+img{margin-left:-25px;width:80px;height:80px;
  animation-delay:-1.7s}
.pokemon-partner-copy{display:flex;flex-direction:column;gap:5px;min-width:0}
.pokemon-partner-copy>span{font:800 10px/1.3 system-ui,sans-serif;
  letter-spacing:.11em;color:#859086}
.pokemon-partner-copy strong{color:#314846;font-size:clamp(18px,2.2vw,27px);
  letter-spacing:-.055em;line-height:1.2}
.pokemon-partner-copy small{font-size:12px;color:#677c71}
.pokemon-fan-mark{margin-left:auto;padding:5px 10px;white-space:nowrap;
  color:#748278;background:#ffffff9e;border:1px solid #ffffff;
  border-radius:99px;font-size:10px;font-weight:700}
html.pokemon-mode .game-card{
  border-color:color-mix(in srgb,var(--pokemon-accent,#77a79c),transparent 38%);
  box-shadow:0 8px 29px #22222218,0 0 0 1px #ffffff13
}
html.pokemon-mode .game-card-art{
  isolation:isolate;background:linear-gradient(125deg,var(--pokemon-tint,#f1faef),
    color-mix(in srgb,var(--pokemon-accent,#8ac5a6),white 72%))!important
}
html.pokemon-mode .game-card.pokemon-image-ready .game-card-art:before,
html.pokemon-mode .game-card.pokemon-image-ready .game-card-art:after{
  opacity:0!important
}
html.pokemon-mode .game-card.pokemon-image-ready .game-card-art > :not(.pokemon-card-crew):not(.game-live-preview){
  opacity:.07!important;pointer-events:none
}
.pokemon-card-crew{position:absolute;inset:0;display:grid;align-items:center;
  justify-content:center;grid-template-columns:1fr 1fr;gap:0;padding:1px 21%;
  z-index:2;pointer-events:none}
.pokemon-card-palette{position:absolute;left:20%;top:8%;width:60%;height:84%;
  background:radial-gradient(ellipse,#ffffffa8,transparent 75%);z-index:-1}
.pokemon-card-crew .pokemon-skin-image{height:112px;width:124px;max-width:none;
  min-width:0;object-fit:contain;filter:drop-shadow(0 8px 5px #2a484530);
  animation:pokemon-bob 3.6s ease-in-out infinite;
  transform:translateX(11px)}
.pokemon-card-crew .pokemon-skin-image:nth-of-type(2){
  height:101px;width:109px;animation-delay:-1.35s;transform:translateX(-10px)}
.pokemon-card-caption{position:absolute;left:50%;bottom:3px;transform:translateX(-50%);
  max-width:92%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#294a45;background:#ffffffd6;padding:4px 13px;border:1px solid #ffffffab;
  border-radius:99px;box-shadow:0 3px 10px #284f3b17;
  font:800 11px/1.2 "Noto Sans KR",system-ui,sans-serif}
html.pokemon-mode .game-card .game-card-top{
  border-color:color-mix(in srgb,var(--pokemon-accent,#8cbaa5),white 35%)
}
html.pokemon-mode .game-card.pokemon-image-ready:hover .pokemon-card-crew img{
  animation-duration:1.8s
}
html.pokemon-mode .game-live-preview{z-index:4}
@keyframes pokemon-bob{
  0%,100%{translate:0 0}50%{translate:0 -5px}
}
@media(max-width:720px){
 .pokemon-skin-toggle{padding:6px 9px;font-size:10px}
 html.pokemon-mode .pokemon-partner-strip{gap:8px;min-height:82px;
   padding:7px 10px;border-radius:10px;margin:11px auto 13px}
 .pokemon-partner-portraits{min-width:104px;width:104px;height:70px}
 .pokemon-partner-portraits img{width:68px;height:72px}
 .pokemon-partner-portraits img+img{width:55px;height:59px;margin-left:-21px}
 .pokemon-partner-copy>span{font-size:8px}
 .pokemon-partner-copy strong{font-size:16px}
 .pokemon-partner-copy small{font-size:10px}
 .pokemon-fan-mark{display:none}
 .pokemon-card-crew .pokemon-skin-image{height:105px}
}
@media(max-width:480px){
 /* Keep toggles off the game field and essential score controls. */
 header .pokemon-skin-toggle{font-size:9px;padding:5px 7px;max-width:89px;
   white-space:normal;text-align:center}
 .pokemon-partner-portraits{min-width:85px;width:85px}
 .pokemon-partner-portraits img{width:58px}
 .pokemon-partner-portraits img+img{width:48px;margin-left:-18px}
 .pokemon-partner-copy strong{font-size:15px}
 .pokemon-partner-copy small{font-size:9px}
}
@media(prefers-reduced-motion:reduce){
 .pokemon-card-crew .pokemon-skin-image,.pokemon-partner-portraits img{
   animation:none!important}
 .pokemon-skin-toggle:hover{transform:none}
}


/* POKÉMON ARCADE v2 — familiar gameworlds, cel-accurate PMD animations.
   Every creature remains an image, not a recreated or filtered drawing. */
html.pokemon-mode body{
  background-image:radial-gradient(circle at 6% 8%,#c6f5eb20,transparent 27%),
    radial-gradient(circle at 95% 28%,#f6d9b52a,transparent 30%)
}
html.pokemon-mode .pokemon-skin-toggle{background:linear-gradient(125deg,#dcf8e9,#fff2b9);color:#225e4f}
html.pokemon-mode .pokemon-skin-toggle:after{content:"";display:inline-block;
  width:10px;height:10px;border-radius:50%;background:linear-gradient(#ee787c 46%,#fff 47%);
  border:1.5px solid #38505b;margin-left:7px;vertical-align:-1px}
.pokemon-motion-badge{width:90px;height:88px;position:relative;display:inline-block;
  overflow:visible;flex:none;isolation:isolate}
.pokemon-motion-badge:after{content:"";position:absolute;left:16%;right:16%;
  bottom:9px;height:8px;background:#29493b18;filter:blur(3px);border-radius:50%;z-index:-1}
.pokemon-motion-cel{
  position:absolute;left:50%;bottom:13px;display:block;
  background-repeat:no-repeat;
  image-rendering:pixelated;image-rendering:crisp-edges;
  transform:translateX(-50%) scale(1.65);
  transform-origin:50% 100%;
  filter:drop-shadow(0 2px 0 #273a4222)
}
.pokemon-strip-motion{min-width:90px;width:90px;height:83px;position:relative}
.pokemon-strip-motion .pokemon-motion-cel{transform:translateX(-50%) scale(1.7)}
.pokemon-partner-portraits .pokemon-strip-motion+img{width:92px;height:88px;margin-left:-13px}
.pokemon-card-crew .pokemon-card-motion{
  position:absolute;right:3px;top:7px;width:63px;height:82px;z-index:4;
  filter:drop-shadow(0 3px 3px #36584c36);opacity:.98
}
.pokemon-card-crew .pokemon-card-motion .pokemon-motion-cel{
  transform:translateX(-50%) scale(1.32);bottom:11px
}
.pokemon-card-crew .pokemon-skin-image{height:119px;width:116px}
.pokemon-card-crew .pokemon-skin-image:nth-of-type(2){height:106px;width:107px}
html.pokemon-mode .pokemon-feature-host{position:relative;isolation:isolate}
html.pokemon-mode .pokemon-feature-host>:not(.pokemon-home-feature){
  opacity:.17!important;filter:saturate(.65);pointer-events:none
}
.pokemon-home-feature{
  position:absolute;inset:0;z-index:5;pointer-events:none;
  overflow:hidden;display:flex;justify-content:center;align-items:center;
  isolation:isolate
}
.pokemon-home-glow{
  position:absolute;inset:9% 13% 14%;
  background:radial-gradient(ellipse,#fffefa 4%,#fff5d3a9 38%,transparent 76%);
  border:1px solid #ffffff28;border-radius:50%;z-index:-1
}
.pokemon-home-primary,.pokemon-home-secondary{
  position:relative;height:78%;width:49%;max-width:260px;object-fit:contain;
  filter:drop-shadow(0 13px 9px #213d4129);
  animation:pokemon-bob 3.2s ease-in-out infinite;
}
.pokemon-home-primary{transform:translate(10%,-5%) rotate(-4deg)}
.pokemon-home-secondary{height:66%;width:43%;transform:translate(-11%,7%) rotate(6deg);
  animation-delay:-1.55s}
.pokemon-home-legend{
  position:absolute;bottom:7%;left:50%;transform:translateX(-50%);
  max-width:94%;white-space:nowrap;text-align:center;overflow:hidden;text-overflow:ellipsis;
  border-radius:999px;background:#ffffffd9;color:#31564d;
  border:1px solid #fff;padding:7px 14px;
  font:900 13px/1.3 "Noto Sans KR",sans-serif;
  box-shadow:0 8px 20px #334c3d20
}
/* The actual puzzle/game interface gets partner actors, not just an opening card. */
html.pokemon-mode .pokemon-game-ribbon{
  display:flex;align-items:center;gap:11px;min-height:82px;max-width:850px;
  margin:0 auto 13px;padding:5px 14px 5px 8px;
  border-radius:15px;border:1px solid color-mix(in srgb,var(--pokemon-accent),white 49%);
  background:linear-gradient(108deg,var(--pokemon-tint),#ffffffdf);
  box-shadow:0 5px 15px #243c3610;
  font-family:"Noto Sans KR",system-ui,sans-serif;pointer-events:none
}
.pokemon-game-ribbon-art{width:153px;height:73px;display:flex;
  align-items:center;justify-content:flex-start;flex:none}
.pokemon-game-ribbon-art .pokemon-motion-badge{height:72px}
.pokemon-game-ribbon-art .pokemon-motion-cel{transform:translateX(-50%) scale(1.36);bottom:5px}
.pokemon-game-ribbon-art>img{height:69px;width:73px;object-fit:contain;margin-left:-8px}
.pokemon-game-ribbon-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.pokemon-game-ribbon-copy>span{font:900 10px system-ui,sans-serif;letter-spacing:.12em;color:#6a9e93}
.pokemon-game-ribbon-copy strong{font-size:16px;color:#38554e}
.pokemon-game-ribbon-copy small{font-size:11px;color:#83958b}
html.pokemon-mode #gameScreen .pokemon-game-ribbon,
html.pokemon-mode #arenaScreen .pokemon-game-ribbon{max-width:100%}
/* The board stays fully readable and has distinct creature-specific accent. */
html.pokemon-mode body[data-pokemon-game] .topbar{
  border-bottom-color:color-mix(in srgb,var(--pokemon-accent),transparent 45%)
}
html.pokemon-mode body[data-pokemon-game] #numberGrid,
html.pokemon-mode body[data-pokemon-game] #arrowBoard,
html.pokemon-mode body[data-pokemon-game] #numberBoard,
html.pokemon-mode body[data-pokemon-game] #orbitBoard,
html.pokemon-mode body[data-pokemon-game] #factorBoard,
html.pokemon-mode body[data-pokemon-game] #foldBoard{
  border-radius:16px;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--pokemon-accent),transparent 56%),
    0 10px 29px #112f2b1a
}
html.pokemon-mode body[data-pokemon-game] .stage-counter,
html.pokemon-mode body[data-pokemon-game] .stage-count{
  color:var(--pokemon-accent)
}
html.pokemon-mode .game-card .play-link{
  background:linear-gradient(120deg,var(--pokemon-tint,#dbf5e9),
    color-mix(in srgb,var(--pokemon-accent,#8ca),white 73%));
  color:#2b574e
}
.pokemon-credit-line{display:inline-flex;gap:4px;align-items:center;
  max-width:100%;flex-wrap:wrap;opacity:.72;font-size:9px}
.pokemon-credit-line a{text-decoration:underline;text-underline-offset:2px}
@media(max-width:720px){
  .pokemon-card-crew .pokemon-card-motion{right:0;top:4px}
  .pokemon-card-crew .pokemon-card-motion .pokemon-motion-cel{
    transform:translateX(-50%) scale(1.1)
  }
  .pokemon-home-primary{height:70%}.pokemon-home-secondary{height:60%}
  .pokemon-home-legend{font-size:10px;padding:5px 9px}
  html.pokemon-mode .pokemon-game-ribbon{min-height:64px;padding:4px 9px;gap:6px;margin-bottom:10px}
  .pokemon-game-ribbon-art{width:102px;height:60px}
  .pokemon-game-ribbon-art .pokemon-motion-badge{width:53px;height:56px}
  .pokemon-game-ribbon-art .pokemon-motion-cel{transform:translateX(-50%) scale(1.05);bottom:0}
  .pokemon-game-ribbon-art>img{width:48px;height:53px;margin-left:0}
  .pokemon-game-ribbon-copy strong{font-size:13px}
  .pokemon-game-ribbon-copy small{font-size:9px}
  .pokemon-game-ribbon-copy>span{font-size:8px}
}
@media(prefers-reduced-motion:reduce){
  .pokemon-home-primary,.pokemon-home-secondary{animation:none!important}
}
