:root{
  --key-color:#529b54;
  --key-color-rgb:82,155,84;
  --point-color:#a9cda6;
  --txt-color:#0a0909;
  --line:#92c97e;
  --bg:#f8f8f8;
  --card:#ffffff;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  color:var(--txt-color);
  background:#f8f8f8;
  line-height:1.65;
  padding-bottom:74px;
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  background:linear-gradient(rgba(255,255,255,.78),rgba(255,255,255,.78)),url("../../assets/bg/main-bg.jpg");
  background-size:cover;
  background-position:center top;
  z-index:-1;
}
.wikiNav{
  background:#fff;
  border-bottom:2px solid #e5e5e5;
  position:sticky;
  top:0;
  z-index:50;
}
.wikiNavIn{
  max-width:1200px;
  margin:auto;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
}
.wikiNavLinks{display:flex;gap:8px;overflow:auto}
.wikiNav a{
  white-space:nowrap;
  color:#b75e37;
  text-decoration:none;
  font-weight:700;
  padding:7px 10px;
  border-radius:6px;
}
.wikiNav a.current,.wikiNav a:hover{background:#fbfdf9;color:#529b54}
.wikiNavSearch{margin-left:auto;display:flex;gap:6px;min-width:min(340px,42vw)}
.wikiNavSearch input{
  width:100%;
  border:1px solid #d8d8d8;
  border-radius:6px;
  padding:8px 10px;
}
.wikiNavSearch button{
  border:0;
  border-radius:6px;
  background:var(--key-color);
  color:#fff;
  font-weight:700;
  padding:8px 12px;
}
.articleWrap{
  width:min(100%,1200px);
  margin:18px auto 40px;
  padding:0 12px;
}
.articleCard{
  background:#fff;
  border:1px solid #e8e8e8;
  border-radius:10px;
  box-shadow:0 4px 16px rgba(0,0,0,.06);
  padding:clamp(14px,3vw,26px);
}
.articleHeader__title{
  margin:0 0 18px;
  font-size:clamp(25px,4.8vw,36px);
  line-height:1.25;
  font-weight:800;
}
.articleBody p{margin:0 0 14px}
.articleBody strong{font-weight:800}
.cff-form{width:100%;margin-top:16px}
.calc-block{
  border:1.5px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:14px;
  margin:16px 0;
}
.articleBody h2,.calc-block h2{
  margin:0 0 12px;
  padding:.6em;
  background-color:var(--key-color);
  border-radius:8px;
  color:#fff;
  font-size:clamp(19px,3.6vw,25px);
  line-height:1.35;
}
.fields{margin:0 0 12px;padding:0}
.fields label{
  display:block;
  font-weight:700;
  margin:0 0 4px;
}
.dfield{padding:0!important;margin:0!important}
.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px!important;
}
select,input[type="number"],input[type="text"]{
  width:100%;
  border:1px solid #cfcfcf;
  border-radius:6px;
  background:#fff;
  min-height:36px;
  padding:6px 8px;
  font-size:16px;
}
.cff-spinner-components-container{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:0!important;
}
.cff-spinner-components-container button{
  flex:0 0 36px!important;
  width:36px!important;
  height:36px!important;
  line-height:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #bdbdbd;
  background:#f4f4f4;
  color:#333;
  font-size:18px;
  font-weight:700;
  cursor:pointer;
  padding:0!important;
  margin:0!important;
}
.cff-spinner-components-container input[type="number"]{
  width:70px!important;
  min-width:70px!important;
  max-width:88px!important;
  height:36px!important;
  text-align:center!important;
  padding:0!important;
  border-left:0;
  border-right:0;
  border-radius:0;
  flex-shrink:0!important;
}
.notice{
  background:#fffdfb;
  border:1px solid #f7ac50;
  border-radius:8px;
  padding:10px;
  font-weight:700;
  color:#683900;
}
.target-buttons{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:10px!important;
}
.target-btn{
  background:#fff;
  border:1.5px solid var(--line);
  border-radius:10px;
  padding:10px;
  display:flex;
  align-items:center;
  gap:10px!important;
  text-align:left;
  cursor:pointer;
  color:#111;
}
.target-btn.selected{
  background:#fbfdf9;
  border-color:var(--key-color);
  box-shadow:0 0 0 3px rgba(var(--key-color-rgb),.18);
}
.target-btn img{
  width:64px;
  height:64px;
  object-fit:contain;
}
.target-btn b{font-size:16px}
.mode-switch{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px!important;
}
.mode-btn{
  border:1.5px solid var(--line);
  background:#fff;
  color:#333;
  min-height:44px;
  border-radius:8px;
  font-weight:800;
  cursor:pointer;
}
.mode-btn.selected{
  background:var(--key-color);
  color:#fff;
}
.hidden{display:none!important}
.multi-slots{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:12px!important;
}
.slot-card{
  border:1.5px solid var(--line);
  border-radius:10px;
  background:#fff;
  padding:12px;
  margin:12px 0;
}
.slot-title{
  position:relative;
  padding:0 0 .6em .8em;
  border-bottom:1px solid #eee;
  margin:0 0 12px;
  font-size:20px;
}
.slot-title:before{
  content:"";
  position:absolute;
  top:0;
  bottom:.6em;
  left:0;
  width:4px;
  background:var(--key-color);
  border-radius:4px;
}
.choice-type{
  display:flex;
  flex-wrap:wrap;
  gap:6px!important;
}
.choice-type label{
  display:inline-flex;
  align-items:center;
  gap:3px!important;
  border:1px solid #ddd;
  border-radius:8px;
  padding:6px 8px;
  margin:0;
  background:#fbfdf9;
  font-weight:800;
}
.choice-area{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px!important;
}
.image-choice-row{
  display:flex;
  flex-wrap:wrap;
  gap:5px!important;
}
.image-choice{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px!important;
  min-height:34px;
  border:1.5px solid #ddd;
  background:#fff;
  color:#222;
  border-radius:7px;
  padding:3px 5px;
  cursor:pointer;
  box-shadow:none;
}
.image-choice img{
  height:24px;
  width:auto;
  max-width:42px;
  object-fit:contain;
}
.image-choice span{
  font-size:11px;
  font-weight:700;
  line-height:1;
}
.image-choice.genki span{font-size:14px;padding:4px 8px}
.image-choice.selected{
  border-color:var(--key-color);
  background:#fbfdf9;
  box-shadow:0 0 0 2px rgba(var(--key-color-rgb),.14);
}
.image-choice:disabled{
  opacity:.72;
  cursor:not-allowed;
}
.locked-area{opacity:.92}
.fixed-info{
  border:1px solid #ddd;
  border-left:5px solid var(--key-color);
  border-radius:8px;
  padding:8px;
  margin:8px 0 12px;
  background:#fbfdf9;
  font-weight:700;
}
.slot-note{
  margin:8px 0 0;
  font-size:12px;
  color:#64625f;
  line-height:1.55;
}
.permanent-special-field{
  border:1px solid #ddd;
  border-radius:8px;
  background:#fffdfb;
  padding:8px;
  margin:8px 0;
}
.species-fields{
  display:grid;
  grid-template-columns:1fr;
  gap:10px!important;
}
.species-field{
  border:1px solid #ddd;
  border-radius:8px;
  padding:8px;
}
.species-field label{
  display:flex;
  align-items:center;
  gap:4px!important;
}
.species-field img{
  width:24px;
  height:24px;
  object-fit:contain;
}
.effect-targets{
  margin-top:10px;
  border:1px solid #ddd;
  border-radius:8px;
  padding:8px;
  background:#fbfdf9;
  display:flex;
  flex-wrap:wrap;
  gap:6px!important;
  align-items:center;
}
.effect-target-title{
  width:100%;
  font-weight:800;
  color:var(--key-color);
  margin-bottom:2px;
}
.effect-targets label{
  display:inline-flex;
  align-items:center;
  gap:3px!important;
  margin:0 8px 0 0;
  font-weight:700;
  white-space:nowrap;
}
.effect-targets input[type="checkbox"]{margin:0}
.memo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:12px!important;
}
.memo-box{
  border:1px solid #ddd;
  border-left:5px solid var(--key-color);
  border-radius:8px;
  padding:10px;
  background:#fbfdf9;
}
.memo-box p{margin:4px 0 0}
.fieldname250_1.cff-button-field{
  display:block!important;
  width:100%!important;
  margin:14px 0!important;
}
#calcBtn,#fixedCalcBtn{
  display:block!important;
  width:100%!important;
  min-height:45px!important;
  border:0;
  border-radius:6px!important;
  background:var(--key-color);
  color:#fff;
  font-weight:800!important;
  font-size:18px;
  cursor:pointer!important;
}
.result-block{background:#fbfdf9}
.result-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:12px!important;
}
.result-field label{
  text-align:center;
  font-weight:800;
}
input.codepeoplecalculatedfield{
  text-align:center!important;
  padding-left:0!important;
  padding-right:0!important;
  box-sizing:border-box!important;
  font-size:clamp(18px,3.5vw,28px);
  font-weight:800;
  color:var(--key-color);
  min-height:48px;
  background:#fff;
}
.small-result{font-size:clamp(13px,2.5vw,18px)!important}
.calc-log{
  white-space:pre-wrap;
  background:#fff;
  border:1px solid #ddd;
  border-radius:8px;
  padding:10px;
  font-size:13px;
  max-height:260px;
  overflow:auto;
  margin:8px 0 0;
}
.fixed-calc{
  position:fixed;
  left:8px;
  right:8px;
  bottom:8px;
  background:rgba(255,255,255,.96);
  border:1px solid #ddd;
  border-radius:10px;
  padding:8px;
  box-shadow:0 6px 18px rgba(0,0,0,.15);
  z-index:80;
}
@media(max-width:720px){
  .wikiNavIn{flex-wrap:wrap}
  .wikiNavSearch{min-width:100%;margin-left:0}
  .articleWrap{margin-top:12px;padding:0 8px}
  .articleCard{padding:12px}
  .calc-block{padding:10px;margin:12px 0}
  .target-buttons,.form-grid,.memo-grid,.result-grid,.mode-switch,.choice-area,.multi-slots{grid-template-columns:1fr}
  .target-btn img{width:52px;height:52px}
}


/* v205: HPアップ / 攻撃アップ 分岐 */
.hp-atk-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.species-pair{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  margin:10px 0;
  background:#fffdfb;
}
.species-title{
  display:flex;
  align-items:center;
  gap:6px!important;
  font-weight:900;
  color:var(--key-color);
  margin-bottom:8px;
}
.species-title img{
  height:26px;
  width:auto;
  object-fit:contain;
}
@media(max-width:720px){
  .hp-atk-grid{grid-template-columns:1fr}
}

.species-pair .species-field{max-width:none}

/* v209: smartphone UI overflow / sticky overlap fix */
html,body{
  max-width:100%;
  overflow-x:hidden;
}
.articleWrap,.articleCard,.calc-block,.fields,.dfield,
.form-grid,.memo-grid,.result-grid,.choice-area,.multi-slots,
.species-fields,.species-pair,.effect-targets{
  min-width:0;
}
.cff-spinner-components-container{
  width:100%!important;
  min-width:86px!important;
}
@media(max-width:720px){
  body{
    padding-bottom:0;
    overflow-x:hidden;
  }
  .wikiNav{
    position:static;
    top:auto;
    z-index:1;
  }
  .wikiNavIn{
    display:block;
    padding:8px 10px;
  }
  .wikiNavLinks{
    width:100%;
    display:flex;
    gap:6px!important;
    overflow-x:auto;
    padding-bottom:6px;
    -webkit-overflow-scrolling:touch;
  }
  .wikiNav a{
    font-size:13px;
    padding:6px 8px;
  }
  .wikiNavSearch{
    width:100%;
    min-width:86px!important;
    margin:6px 0 0!important;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px!important;
  }
  .wikiNavSearch input{
    min-width:0;
    height:42px;
    font-size:16px;
  }
  .wikiNavSearch button{
    min-width:58px;
    height:42px;
    padding:0 12px;
  }
  .articleWrap{
    width:100%;
    margin:12px auto 24px;
    padding:0 10px;
  }
  .articleCard{
    width:100%;
    padding:10px;
    border-radius:12px;
  }
  .articleHeader__title{
    font-size:24px;
  }
  .articleBody h2,.calc-block h2{
    font-size:20px;
    padding:.55em .65em;
  }
  .calc-block{
    width:100%;
    padding:10px;
    margin:14px 0;
    overflow:hidden;
  }
  .notice{
    font-size:14px;
    line-height:1.6;
    padding:9px;
  }
  .target-buttons,.form-grid,.memo-grid,.result-grid,.mode-switch,.choice-area,.multi-slots,.species-fields{
    grid-template-columns:1fr!important;
  }
  .hp-atk-grid{
    grid-template-columns:1fr!important;
  }
  .cff-spinner-components-container{
    width:fit-content!important;
    max-width:100%!important;
    justify-content:flex-start!important;
  }
  .cff-spinner-components-container button{
    flex:0 0 40px!important;
    width:40px!important;
    height:40px!important;
  }
  .cff-spinner-components-container input[type="number"]{
    flex:0 0 86px!important;
    width:86px!important;
    min-width:86px!important;
    max-width:86px!important;
    height:40px!important;
  }
  .effect-targets{
    display:block;
  }
  .effect-targets label{
    display:inline-flex;
    margin:4px 10px 4px 0;
  }
  .fixed-calc{
    position:static;
    left:auto;
    right:auto;
    bottom:auto;
    margin:12px 10px 18px;
    padding:0;
    border:0;
    border-radius:0;
    box-shadow:none;
    background:transparent;
  }
  #fixedCalcBtn{
    min-height:46px!important;
    border-radius:8px!important;
  }
}
/* v210: mobile compact status number boxes only */
@media(max-width:720px){
  .hp-atk-grid .fields,
  #watch .fields,
  #center .fields,
  #otherStatus .fields,
  #speciesEffectFields .fields{
    max-width:210px;
  }
}

/* v212: keep calculate button fixed on smartphone */
@media(max-width:720px){
  body{
    padding-bottom:82px!important;
  }
  .fixed-calc{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    bottom:8px!important;
    margin:0!important;
    padding:8px!important;
    border:1px solid #ddd!important;
    border-radius:10px!important;
    box-shadow:0 6px 18px rgba(0,0,0,.15)!important;
    background:rgba(255,255,255,.96)!important;
    z-index:80!important;
  }
  #fixedCalcBtn{
    min-height:46px!important;
    border-radius:8px!important;
  }
}

/* v213 SEO helper / internal links */
.seo-helper-block p{
  margin:0 0 10px;
}
.seo-keyword-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:8px!important;
  margin:10px 0;
}
.seo-keyword-grid a{
  display:block;
  text-decoration:none;
  color:#2f7b32;
  background:#fbfdf9;
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 10px;
  font-weight:800;
}
.seo-keyword-grid a:hover{
  background:#eef8ed;
}
.seo-faq{
  border:1px solid #ddd;
  border-radius:8px;
  padding:8px 10px;
  background:#fff;
}
.seo-faq summary{
  font-weight:900;
  cursor:pointer;
  color:var(--key-color);
}

/* v214: self/help + assist point controls */
.assistModeChoices .image-choice,
.assistPointChoices .image-choice{
  min-width:78px;
}
#assistPointField .slot-note{
  margin:6px 0 0;
}
@media(max-width:720px){
  .assistModeChoices,.assistPointChoices{
    gap:6px!important;
  }
  .assistModeChoices .image-choice,
  .assistPointChoices .image-choice{
    flex:0 0 auto;
    min-width:72px;
  }
}
