/* ============================
   Fonts
============================ */
@font-face {
  font-family: "Corporate-Logo-Medium-ver3"; 
  src: url("fonts/Corporate-Logo-Medium-ver3.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
    font-family: "Kaisotai-Next-UP-B";
    src: url("fonts/Kaisotai-Next-UP-B.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================
   全体のページスタイル
============================ */
body {
    background: radial-gradient(circle at top, #182034, #090d16);
    color: black;
    font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    background-image: url('images/pagebackground.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.top-line {
    height: 1px;          
    background-color: black;
}


/* ============================
   ヘッダー
============================ */
.site-header {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

@media screen and (min-width: 600px) {
  .site-header {
    max-height: 300px;
  }
}

.header-bg {
  position: absolute;
  inset: 0;
  background-image: url("images/header1.png");
  background-size: cover;
  background-position: center 14%; 
  z-index: 1;
}

.header-title {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  display: block;
}



/* ============================
   レイアウト配置
============================ */
#watermarkLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    z-index: 99; 
}

#watermarkLayer img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    opacity: 1; 
}

.viewer-area {
    position: relative;

    width: 417px;
    height: 556px;
    max-width: 100%; 
    aspect-ratio: 417 / 556;

    margin: 0 auto; 
    margin-bottom: 15px
    transform: scale(0.8);    
    transform-origin: top center; 

    background-image: url('images/viewerbackground.png');
    background-size: cover;       
    background-position: center; 
    background-repeat: no-repeat;
}

.viewer-area .layer,
.viewer-area .layer img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    position: absolute;
    top: 0;
    left: 0;
}

.viewer-zoom-enter {
  transform: scale(4);
  opacity: 0;
}

.viewer-zoom-enter-active {
  transform: scale(1);
  opacity: 1;
  transition: transform 0.45s cubic-bezier(.25,1.4,.45,1),
              opacity   0.45s ease-out;
}

.layout {
    position: relative;
    width: 100%;
    max-width: 1300px;
    height: auto;
    margin: 0 auto; 
}



/* ============================
   viewer
============================ */
.layer {
    position: absolute;
    width: 417px;
    height: 556px;
    top: 0;
    left: 0;
}

.layer img {
    width: 417px;
    height: 556px;
    object-fit: contain;
    pointer-events: none;
}

#weapon1Layer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 12;
}

#weapon2Layer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 11;
}

#eyesLayer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10; 
}

#leftHalf img {
    position: absolute;
    left: 0;
    clip-path: inset(0 50% 0 0); 
    z-index: 5;
}

#rightHalf img {
    position: absolute;
    left: 0;
    clip-path: inset(0 0 0 50%); 
    z-index: 5;
}

#capeLayer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

#wingsLayer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; 
}

#mufflerLayer img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}


/* ============================
   左上のフォーム名表示
============================ */
.formNameWrapper {
    position: absolute; 
    top: 10px;        
    left: 0px;            
    text-align: left;   
    z-index: 99;
}

.formNameStatic {
    font-size: 8.5px;
    line-height: 1.2;
    color: black;
    padding: 2px; 
    font-family: 'Noto Sans JP', sans-serif;
    font-style: oblique;
    font-weight: 900;
}

.formNameDynamic {
    font-size: 11px;
    line-height: 1.2;
    color: white;
    background: black;
    padding: 2px 4px; 
    font-family: 'Noto Sans JP', sans-serif;
    font-style: oblique;
    font-weight: 900;
}


/* ============================
    武器ボタンとXボタン 
============================ */
.button-row {
  display: flex;
  justify-content: center; 
  align-items: center !important;     
  gap: 15px; 
  flex-wrap: wrap;          
  margin: 10px 0;
}

#toggleWeaponsWrapper {
  text-align: initial;
  margin: 0;
}

.button-row.center-share-only {
  justify-content: center; 
}

#shareBtn,
#toggleWeaponsBtn {
  display: flex;          
  flex-direction: column; 
  justify-content: center; 
  align-items: center;  
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

#shareBtn img,
#toggleWeaponsBtn img {
  width: 170px;
  height: auto;
}

#shareBtn .btn-text {
  position: static;      
  margin-top: -20px;    
  margin-left: 20px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-style: oblique;
  text-align: center;
  letter-spacing: 1px;
}

#toggleWeaponsBtn .btn-text {
  position: static;      
  margin-top: -20px;    
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-style: oblique;
  text-align: center;
  letter-spacing: 1px;
}

#toggleWeaponsBtn:hover,
#shareBtn:hover {
    transform: scale(1.1);
}

#toggleWeaponsBtn:active,
#shareBtn:active {
    transform: scale(0.95);
}



/* ============================
    左右選択ボタンと入れ替えボタン 共通の動き
============================ */
.selector-btn, #swapButton {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
    cursor: pointer;
    position: relative;
    z-index: 1; 
}

#swapButton:hover {
    transform: scale(1.1);
}

.selector-btn:hover .selector-btn-img  {
  animation: pulse-button 1.5s infinite ease-in-out;
}

.swapButton:active {
    transform: scale(0.95);
}
.selector-btn:active .selector-btn-img {
    transform: scale(0.95);
}

.selector-btn-img, .swap-icon, .selector-btn-label {
    transition: none;
}


/* ============================
    左右選択ボタン
============================ */
.form-selector-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; 
    margin-bottom: 10px; 
}

.selector-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 150px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px; 
}

.selector-btn-img {
    display: block;
    width:  100%;
    height: auto;
    object-fit: contain;
    filter: brightness(0.9); 
    pointer-events: none; 
    transition: transform 0.2s ease;
    animation: none;
}

.memory-description {
    position: absolute; 
    left: 50%; 
    width: 100%;    
    transform: translateX(-48%);

    top: 90%;  /* 下にずらす */
    font-size: clamp(10px, 2vw, 12px);

    line-height: 1.8;
    text-align: left;
    font-style: oblique; 
    font-weight: 700; 

    color: #7E7976;
    font-family: "Noto Sans JP", sans-serif;
    text-shadow: 2px 2px 5px white; 
    text-decoration: underline;
}

@keyframes pulse-button {
    0%   { transform: scale(1.0); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1.0); }
}

.selector-btn-label {
    position: absolute; 
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    color: white;
    text-shadow: 30px 0px 30px black, 30px 0px 30px black;
    font-size: 18px;
    font-weight: 700;
    font-style: oblique;
    text-align: center;
    pointer-events: none; 
    white-space: nowrap;     
    text-overflow: ellipsis;  
    max-width: 80%;          
}

.frame-left {
    background-image: url("images/frame-left.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.frame-right {
    background-image: url("images/frame-right.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* ============================
    入れ替えボタン
============================ */
.swap-button {
    width: 40px;            
    height: 40px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.swap-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.swap-button:active .swap-icon {
    transform: translateY(1px) scale(0.95);
    filter: brightness(0.8);
}


/* ============================
   モーダル
============================ */
.modal {
    position: fixed;
    inset: 0; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; 
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.2);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 7px;
    border: 1px solid white;
    transform: scale(0.5);
    opacity: 0;
    overflow-y: auto;   /* ← これを追加 */
    transition: transform 0.4s,
                opacity 0.4s cubic-bezier(.4,0,.6,1);
}
.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 24px;
    color: white;
}


/* ============================
   モーダル内グリッド
============================ */
.modal-grid {
    margin-top: 10px;
}

.modal-section-title {
    grid-column: 1 / -1;
    text-align: center;
    color: white;
    font-family: "Kaisotai-Next-UP-B", sans-serif;
    font-weight: 700;
    font-size: 15px;
    margin: 6px 0 4px;
    letter-spacing: 0.05em;
}

/* ============================
   上段：既存枠
============================ */
.modal-main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(9, auto);
    gap: 6px;
    grid-auto-flow: column;
}

/* ============================
   区切り線
============================ */
.modal-divider {
    margin: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.3);
}

/* ============================
   下段：追加枠
============================ */
.modal-extra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.modal-extra-grid .button-wrapper:nth-child(10) {
    grid-column: 1;
}

#memoryModal.closing {
    opacity: 0;
    filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ============================
   モーダル内のボタン
============================ */
.modal-grid .button-wrapper {
    width: 100px;    
    height: 50px;
}

.modal-grid .button-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
}

.button-wrapper img {
    transition: filter 0.1s ease;
}

.modal-grid .button-label {
    font-size: 10px;     
    max-width: 70px;    
    padding: 0 2px;    
}

.button-wrapper.selected {
    filter: brightness(0.5);  
    border-radius: 7px;
}

.button-wrapper.hovered {
    filter: brightness(0.5); 
    transition: filter 0.1s ease; 
}

.modal-divider {
    margin: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.modal-extra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.button-wrapper.locked {
    opacity: 0.4;
    pointer-events: none;
}



/* ============================
   ボタンラッパー
============================ */
.button-wrapper {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 50px;
    cursor: pointer;
    overflow: hidden;
    background-color: transparent; 
    border-radius: 8px; 
    transition: filter 0.2s;
}

.button-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;     
    object-position: center; 
    z-index: 1; 
    display: block;      
    background-color: transparent;
    transition: none;     
    filter: brightness(50%);
}

.button-label {
    position: absolute;
    top: 52%;
    left: 52%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 700;
    font-style: oblique;
    font-size: 10px;
    white-space: nowrap;
    max-width: 70px;    
    padding: 0 4px;   
    line-height: 1.2; 
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    transition: 0.2s;
    z-index: 10;
}

.button-wrapper.selected img,
.button-wrapper.hovered img {
    filter: brightness(50%);
}

.button-wrapper.selected .button-label,
.button-wrapper.hovered .button-label {
    opacity: 1;
}


/* ============================
    変身エフェクト
============================ */
#henshinEffect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);  
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    width: 120%;
    max-width: 600px;
    transition: transform 0.6s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
}

#henshinEffect.show {
    transform: translate(-50%, -50%) scale(1.25); 
    opacity: 1;
}



/* ============================
    文章
============================ */
.form-name {
    font-family: "Noto Sans JP", sans-serif; 
    font-weight: 1000; 
    font-style: oblique; 
    text-align: center;
    font-size: 24px;
    color: black; 
    margin-bottom: 10px;
}

.center-text {
    font-family: "Noto Sans JP", sans-serif; 
    font-weight: 1000; 
    color: black;
    text-align: left;
    max-width: 1000px;
}

.intro-text {
    animation: blinkText 1.7s ease-in-out infinite;
    font-family: "Noto Sans JP", sans-serif; 
    font-weight: 700; 
    color: black;
    font-size: 15px;
    text-align: left;
    max-width: 1000px;
    font-style: oblique;
}

@keyframes blinkText {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.info-panel {
    width: 80vw;
    max-width: 375px;
    margin: 0 auto;
    margin-top: 20px;
    background: url("images/info-panel.png") center/cover no-repeat;
    padding: 20px 25px;
}

.info-panel p {
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 1000;
    font-style: oblique;
    font-size: 11px;
    text-align: left;
    color: white;
    line-height: 3.0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
}

.info-panel .info-center {
    margin-top: 0px;   
    margin-bottom: 0px;
    text-align: center;
    font-size: 13px;
}

.info-smaller {
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 1000;
    font-style: oblique;
    font-size: 9.5px;
    text-align: left;
    color: white;
    line-height: 2.0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
}

.info-panel a {
    color: #ffffff;  
    text-decoration: underline;
    font-weight: 700;
}

.info-panel a:hover {
    color: #ffffff;  
    text-decoration: none;
}

.info-panel .divider {
    display: block;
    height: 1px;
    background: white;
    opacity: 0.5;
    margin: 6px 0;
}

.inline-icon {
    width: 18px; 
    height: auto;
    vertical-align: middle;
    margin: 0 4px; 
}



/* ============================
    フッター
============================ */
.site-footer {
  position: relative;
  width: 100vw;
  height: 70px;
  margin: 0;                
  margin-top: 50px;
  padding-top: 50px;
  padding-bottom: 85px;
  bottom: 0;
  left: 0;

  background-image: url("images/header1.png");
  background-size: cover;
  background-position: center 80%; 
  background-repeat: no-repeat;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.footer-credits {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;  
  gap: 4px 0px;                   
  width: fit-content;   
  margin: 0 auto;   
}

.footer-credits .label {
  text-align: right;
  font-family: "Corporate-Logo-Medium-ver3", sans-serif;
  font-weight: normal;
  font-size: 11px;
  color: #FFFFFF;
  line-height: 25px;
  margin-left: 20px;
}

.footer-credits .value {
  text-align: left;
  font-family: "Corporate-Logo-Medium-ver3", sans-serif;
  font-weight: normal;
  font-size: 11px;
  color: #FFFFFF;
  line-height: 25px;
}

.site-footer a:link {
  color: #FFFFFF; 
}
.site-footer a:visited {
  color: #FFFFFF; 
}
.site-footer a:hover {
  color: #adff2f; 
}
.site-footer a:active {
  color: #adff2f; 
}

.footer-copy {
  text-align: center;
  z-index: 2;
  color: #FFFFFF;
  font-family: "Corporate-Logo-Medium-ver3", sans-serif;
  font-weight: normal;
  font-size: 11px;
}



/* ============================
   スマホ用: 画面幅600px以下の時
============================ */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 600px) {

.page-title img {
  max-width: 100vw; 
  }

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  z-index: 10;
}

#prev-btn { left: 8px; }
#next-btn { right: 8px; } 

.viewer-area {
    width: 100%;
    height: 100%;
}

.form-selector-bar {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 90vw;
    max-width: 400px;
    margin: 0 auto 10px auto;
    gap: 10px;
}

.selector-btn {
    width: 60%; 
    min-width: 60px;
    height: auto;
}
.selector-btn-img {
    width: 100%;
    height: auto;
}

.nav-button {
    width: 32px;
    height: 32px;
}

.description {
    margin-top: 16px;
    padding: 0 12px;
    position: relative;
    z-index: 1;
}
}