/* ============================================================
   お気楽領主 キャラクター人気投票 — 仮デザイン（プレースホルダー）
   デザインカンプ確定後に差し替える前提。コンポーネント単位で分割。
   モバイルファースト / CSS変数 / BEM
   ============================================================ */

/* ===== デザイントークン ===== */
:root {
  --color-bg: #b7e08e;          /* ラフの緑背景（仮） */
  --color-panel: #c9ea9f;
  --color-text: #1a1a1a;
  --color-head: #111;           /* 黒帯見出し */
  --color-head-text: #ffd54a;   /* 金色文字 */
  --color-accent: #E50065;
  --color-x: #000;
  --color-white: #fff;
  --radius: 8px;
  --gap: 16px;
  --maxw: 980px;
  --font: 'PT Serif Custom', 'PT Serif', 'M PLUS 1 Code', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

* { box-sizing: border-box; }

html{width: 100%;}

ul{
  margin: 0;
  padding: 0;
}

.sp{
  display: none;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  line-height: 1.7;
  font-size: clamp(0.875rem, 0.596rem + 0.596vw, 1.125rem);
}
body::before {
  content: "";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100vh;
  background: url(/img/bg_pc.jpg) top center / cover no-repeat;
}

img { max-width: 100%; height: auto; display: block; }

/* ===== 画面（Screen）切替 ===== */
.screen { display: none; margin: 0 auto;}
.inner{
  max-width: var(--maxw);
  margin: 0 auto;
  margin-top: -7vw;
  position: relative;
  z-index: 3;
  width: 90%;
}
.screen.is-active { display: block; }

/* ===== トップ（告知） ===== */
.topvisual {
  overflow: hidden;
  margin-top: -52px;
}
.topvisual-inner{
  padding-top: 2em;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}
.topvisual__hero{
  position: relative;
  width: 100%;
}
.fv-visual{
  width: 100%;
  margin: 0;
  mask-image: linear-gradient(to top, transparent 0%, #000 10%);
}
.fv1,
.fv2,
.fv3,
.fv4{
  position: absolute;
  z-index: 2;
  margin: 0;
  opacity: 0; /* アニメーション前は非表示にしておく */
}
.fv1{
  width: 20%;
  top: 20%;
  left: -7%;
}
.fv2{
  top: 41%;
  width: 20%;
  right: -3%;
}
.fv3,
.fv4{
  width: 26%;
  filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.8));
}
.fv3{
  right: -3%;
  top: 9%;
  /* 修正：元の transform: rotate(51deg); を削除 */
}
.fv4{
  top: 52%;
  left: -1%;
}
.topvisual__hero,
.topvisual__logo,
.topvisual__title {
  opacity: 0;
  will-change: transform, opacity;
}
.topvisual img{
  width: 100%;
  height: auto;
}

/* =========================================
   アニメーション適用 ( .is-animated 付与時 )
========================================= */
.topvisual.is-animated .topvisual__hero {
  animation: fadeInHero 0.2s cubic-bezier(0.25, 1, 0.5, 1) 0s both;
}
.topvisual.is-animated .topvisual__logo {
  position: absolute;
  z-index: 2;
  top: 0%;
  left: -8%;
  width: 75%;
  animation: fadeInLogo 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.5s both;
}
.topvisual.is-animated .topvisual__title {
  position: absolute;
  z-index: 3;
  width: 90%;
  left: 50%;
  top: 54%;
  animation: fadeInTitle 0.8s cubic-bezier(0.25, 1, 0.5, 1) 1s both;
}

/* fv1, fv2：流れ星アニメーション */
.topvisual.is-animated .fv1 {
  animation: shootingStar 0.2s ease-out 0.8s both;
}
.topvisual.is-animated .fv2 {
  animation: shootingStar 0.2s ease-out 0.8s both;
}

/* fv3, fv4：ポワンと表示 ＋ ふわふわアニメーション */
.topvisual.is-animated .fv3 {
  animation: popInFv4 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s both,
             floatingFv4 3s ease-in-out 2.2s infinite;
}
.topvisual.is-animated .fv4 {
  animation: popInFv4 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s both,
             floatingFv4 3.5s ease-in-out 2.4s infinite; /* タイミングを少しずらす */
}

/* =========================================
   Keyframes (アニメーション定義)
========================================= */
@keyframes fadeInHero {
  0% { opacity: 0; transform: scale(0.85); }
  40% { opacity: 0.6; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeInLogo {
  0% { opacity: 0; transform: translateY(-40px) rotate(-6deg); }
  30% { opacity: 0.3; }
  100% { opacity: 1; transform: translateY(0) rotate(-6deg); }
}

/* 修正：中央から拡大する表示方法 */
@keyframes fadeInTitle {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  60% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* 追加：星（fv1, fv2）の流れ星アニメーション */
@keyframes shootingStar {
  0% { opacity: 0; transform: translate(40px, -40px) scale(0.5); }
  70% { opacity: 1; transform: translate(-5px, 5px) scale(1.1); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

/* popInFv3, floatingFv3 は削除 */

/* fv3とfv4で共通化 (rotateなし) */
@keyframes popInFv4 {
  0% { opacity: 0; transform: scale(0); }
  80% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes floatingFv4 {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* ===== 情報ボックス ===== */
.infobox_wrap{
  display: flex;
  flex-direction: column;
  gap: 4em;
  margin: 0 auto;
  padding: 0;
  max-width: 768px;
}
.infobox {
  background-image: 
    url('/img/info-bg.png'), 
    linear-gradient(to right, #DB5AA0 0%, #0AA9EA 50%, #A5CF5E 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, border-box;
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  border: 4px solid transparent;
  border-radius: var(--radius);
  padding: 4em 4em 3em 4em;
  margin: 0 auto;
  text-align: center;
  position: relative;
  list-style: none;
  width: 100%;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.infobox.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.infobox__head {
  width: 53%;
  margin: 0 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -30px;
}
.infobox__head img {
  width: 100%;
  height: auto;
}
/* 開催期間 */
.infobox figure.info-day{
  width: 72%;
  margin: 0 auto 0.5em;
}
.infobox p {
  margin: 0;
  font-size: 1em;
  color: var(--color-text);
}
/* 賞品 */
.info-book{
  display: flex;
  align-items: center;
  gap: 2em;
}
.book-card_text{
  width: 65%;
  margin: 0;
}
.book-card{
  width: calc(35% - 2em);
  margin: 0;
  box-shadow: 4px 4px 8px 0px rgba(0, 0, 0, 0.12);
}
/* 応募方法 */
.infobox:nth-of-type(3) p{
  font-size: 1.2em;
  font-weight: bold;
}
.strong_text{
  font-size: 1.4em;
  color: var(--color-accent);
}
/* 共通 */
.infobox figure.info-deco {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6%;
  margin: 0;
}
.infobox figure.info-deco1{
  left: -4%;
}
.infobox figure.info-deco2{
  transform: translateY(-50%) scaleX(-1);
  right: -4%;
}

.accent { color: var(--color-accent); }

/* ===== ボタン ===== */
.btnrow { display: flex; justify-content: center; flex-wrap: wrap; margin: 1em auto; max-width:300px;}
.btnrow--col { flex-direction: column; align-items: stretch; }

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.6em 0;
  font-size: 16px;
  font-family: inherit;
  transition: filter .15s ease, opacity .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* infoボタン */
.btn_wrap{
  display: flex;
  gap: 1.2em;
  margin-top: 1.5em;
}
.btn--primary,
.btn--sub {
  font-size: 1.4em;
  font-family: var(--font);
  font-weight: bold;
  border: 2.5px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image: 
    linear-gradient(var(--color-white), var(--color-white)), 
    linear-gradient(
      to right, 
      #DB5AA0 0%, 
      #0AA9EA 50%, 
      #A5CF5E 100%
    );
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.12);
}
.btn--primary{
  font-size: 1em;
  display: block;
  max-width: 300px;
  margin: 0 auto;
  width: 100%;
}
.btn--sub{
  width: calc((100% - 1.2em) / 2);
}
.btn--primary span,
.btn--sub span {
  background: linear-gradient(
    to right, 
    #DB5AA0 0%, 
    #0AA9EA 50%, 
    #A5CF5E 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.btn--back{
  display: inline-block;
  color: var(--color-accent);
  margin: 0 auto;
  padding: 0 1em 0.5em;
  border-bottom: 1px solid var(--color-accent);
  background: none;
  border-radius: 0;
  margin-top: 1em;
}
.btn--x { background: var(--color-x); color: var(--color-white); font-weight: 700; }
.btn--link { background: transparent; color: #1a1a1a; text-decoration: underline; padding: 8px; }

/* ===== キャラクター一覧 ===== */
.chara-wrap{
  position: relative;
  margin-top: 8em;
}
.chara-wrap-deco{
  position: absolute;
  width: 40%;
}
.chara-wrap-deco1{
  top: -2.5%;
  right: -3%;
  transform: rotate(45deg);
}
.chara-wrap-deco2{
  bottom: 0%;
  right: -11%;
  width: 25%;
  transform: scaleX(-1);
}
.section-title {
  width: 56%;
  margin: 0;
  margin-left: -0.5em;
}
.chara-wrap p{
  text-align: left;
}
.section-lead {
  color: var(--color-accent);
  font-size: 1.4em;
  font-weight: bold;
  margin: 0.5em 0 0;
}
.note {
  font-size: 0.8em;
  font-weight: 400;
  margin: 0;
}


.voted-banner {
  background: #fff4e5; border: 1px solid var(--color-accent);
  color: var(--color-accent); border-radius: var(--radius);
  padding: 10px; margin: 0 0 16px; font-weight: 700;
}

/* 一覧の取得に失敗したときの案内 */
.loaderror {
  background: var(--color-white); border: 2px solid var(--color-accent);
  color: var(--color-accent); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; font-weight: 700;
}

.character-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 3em 1.1em;
  margin-top: 2em;
  flex-wrap: wrap;
}
.character-card {
  width: calc((100% - 3.3em) / 4);
  cursor: pointer;
  box-shadow: 0 0 6px 0 rgba(128, 128, 128, 0.8);
  text-align: center;
  border: 4px solid transparent; 
  border-image: linear-gradient(to right, #DB5AA0 0%, #0AA9EA 50%, #A5CF5E 100%) 1;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  flex-direction: column;
  background: var(--color-white);
}

.character-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: cardAppear 0.4s ease backwards;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.character-card.is-visible:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 0 6px 5px rgba(255, 255, 255, 1);
}

@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.character-card__img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}
.character-card.is-visible:hover .character-card__img{
  position: relative;
  opacity: 0.7;
  z-index: 1;
}
.chara-wrap p.character-card__name {
  margin: 0;
  font-family: var(--font);
  font-size: 0.8em;
  padding: 0.6em;
  color: var(--color-white);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  background: var(--color-accent);
  flex-grow: 1;
  display: flex;
  align-items: center;
}
.chara-deco{
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
  margin: 0;
  width: 25%;
  top: -64px;
  z-index: 2;
}

/* ===== 不可視Turnstile（ウィジェットを一切表示しない） ===== */
#turnstile-widget { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ===== モーダル共通 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100;
      overscroll-behavior: none !important;
}
.modal__panel .confirm_wrap{
  max-width: 300px;
  margin: 0 auto;
}
.modal[hidden] { display: none; }
/* モーダル表示中は背面をスクロールさせない */
body.is-modal-open { overflow: hidden; }
.modal__panel {
  position: relative;
  padding: 2em 0 2.5em 0; max-width: 480px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  animation: modal-in .18s ease;
  background-image: url('/img/bg-v.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% auto;
  max-width: 768px;
  text-align: center;
}
@keyframes modal-in {
  from { transform: translateY(12px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal__panel h2{
  width: 50%;
  margin: 1em auto 1em;
}
.modal__close {
  position: absolute; top: 8px; right: 10px;
  width: 36px; height: 36px; border: none; background: transparent;
  font-size: 26px; line-height: 1; color: #666; cursor: pointer;
}
.modal__close:hover { color: #000; }
.modal__title { margin: 0 0 12px; font-size: 18px; }
.notice-list { padding-left: 1.2em; margin: 0 0 16px; font-size: 14px; }
.notice-list li { margin-bottom: 8px; }

/* ページ直接表記の注意事項 */
.notice-onpage { max-width: 560px; }
.notice-onpage .notice-list { text-align: left; margin: 8px 0 0; }

/* ===== 投票確認モーダル ===== */
.confirm_wrap{
  border: 4px solid transparent;
  border-image: linear-gradient(to right, #DB5AA0 0%, #0AA9EA 50%, #A5CF5E 100%) 1;
}
.confirm__img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}
.confirm__name {
  background: var(--color-accent);
  color: var(--color-white);
  font-size: 1em;
  padding: 0.6em;
  margin: 0;
  text-align: center;
}
.msg { color: var(--color-accent); min-height: 1.5em; margin-top: 8px; }

/* ===== 投票完了モーダル ===== */
.thanks__title { font-size: 30px; margin: 4px 0 8px; }
.thanks__lead{
  font-size: 1.2em;
  margin: 0 0 1em;
  color: var(--color-accent);
}
.btn--x { display: block; max-width: 340px; margin: 0 auto 16px; padding: 16px; }
.follow-note { font-size: 13px; color: #333; margin: 8px 0 16px; }

/* ===== フッター ===== */
.banners {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 980px;
  margin: 0 auto;
  gap: 1.2em;
  align-items: center;
  margin: 6em auto 3em;
}
.banner {
  width: calc((100% - 1.2em) / 2);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.banner img{
  transition: transform 0.3s ease;
}
.banner:hover img{
  transform: scale(1.06);
}
.footer-links {
  display: flex;
  gap: 1.2em;
  align-items: center;
  margin: 0 auto;
  width: 80%;
  max-width: 500px;
  margin-bottom: 5em;
}
.footer-links a{
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  font-weight: bold;
  font-size: 0.8em;
}
.footer-links a img{
  transition: transform .12s ease, box-shadow .12s ease;
}
.footer-links a:hover img{
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,.22);
}
.copyright {
  font-size: 0.6em;
  color: var(--color-white);
  margin: 0;
  background: #E1A600;
  padding: 0.6em;
  text-align: center;
  font-family: var(--font);
  font-weight: 400;
}
.site-footer-deco_wrap{
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  margin: -230px auto 8em;
}
.site-footer-deco{
  height: 10em;
  width: auto;
  transform: scaleX(-1);
}
.site-footer-deco img{
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
.site-footer-deco3{
  display: none;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (min-width: 768px) {
  .banners { flex-direction: row; justify-content: center; }
}

@media (max-width: 1024px) {
  .chara-wrap-deco1 {
    top: -1.5%;
  }
  .chara-wrap-deco2{
    display: none;
  }
  .site-footer-deco3{
    display: block;
  }
  .character-card {
    width: calc((100% - 2.2em) / 3);
  }
  .chara-deco {
    top: -8vw;
  }
  .site-footer-deco_wrap{
    margin: 0 auto;
  }
}
@media (max-width: 768px) {
  .sp{
    display: block;
  }
  body {
    font-size: clamp(0.875rem, 0.756rem + 0.508vw, 1rem);
  }
  body::before {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100vh;
    background: url(/img/bg_sp.jpg) top center / cover no-repeat;
  }
  .topvisual{
    margin-top: -20px;
  }
  .character-card {
    width: calc((100% - 1.1em) / 2);
  }
  .chara-deco{
    top: -12vw;
  }
  .infobox_wrap{
    gap: 9vw;
  }
  .infobox{
    padding: 3em 1.2em 2em 1.2em;
  }
  .info-book{
    width: 100%;
    margin: 0 auto;
    max-width: 516px;
    gap: 0.2em;
    flex-direction: column;
  }
  .book-card_text{
    width: 100%;
  }
  .book-card{
    width: 40%;
  }
  .strong_text {
    font-size: 1.3em;
  }
  .btn_wrap{
    width: 90%;
    margin: 1.5em auto 0;
    flex-direction: column;
  }
  .btn--sub{
    width: 100%;
    font-size: 1.2em;
  }
  .infobox__head{
    width: 80%;
    top: -10%;
    max-width: 420px;
  }
  .infobox:nth-of-type(2) .infobox__head{
    top: -4%;
  }
  .infobox:nth-of-type(3) .infobox__head{
    top: -5%;
  }
  .infobox figure.info-day {
    width: 85%;
    max-width: 420px;
  }
  .infobox figure.info-deco{
    width: 8%;
  }
  .section-title{
    width: 70%;
    min-width: 300px;
  }
  .banner{
    width: 100%;
    max-width: 420px;
  }
  .chara-wrap-deco1{
    top: -60px;
    right: -16%;
  }
  .chara-wrap-deco2{
    display: none;
  }
  .modal__panel{
    background-image: url(/img/sp.jpg);
  }
  .modal__panel h2{
    width: 100%;
    max-width: 400px;
  }
  .site-footer-deco{
    width: 24%;
    margin: 0;
  }
}
@media (max-width: 500px) {
  .chara-wrap-deco1 {
    top: -2%;
    right: -32%;
    z-index: -1;
    width: 60%;
  }
}