* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #ffffff;
}

.center-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================================
   Puzzle Grid Container
   ========================================= */
.puzzle-grid {
    position: absolute;
    top: -10vw;
    left: -10vw;
    width: 120vw;
    height: calc(100% + 20vw);
    display: grid;
    /* 1列を10vwに固定し、敷き詰める */
    grid-template-columns: repeat(auto-fill, 10vw);
    grid-auto-rows: 10vw;
    z-index: 20; /* ロゴより手前に変更 */
}

/* =========================================
   Center Logo
   ========================================= */
.center-logo-wrapper {
    width: 80vw;
    height: 80vh;
    z-index: 1; /* パズルより奥に変更 */
    position: relative;
    /* パズルの上に浮き出るように影をつける */
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.15));
    
    /* アニメーション用：初期は非表示 */
    opacity: 0;
    /* opacityはease-in-out、transformはlinearで設定 */
    transition: opacity 1s ease-in-out, transform 0.6s linear;
}

.center-logo-wrapper.is-visible {
    opacity: 1;
}

/* ロゴの左半分移動・縮小用 */
.center-logo-wrapper.move-left {
    /* 左に25vw（左半分の中心）移動しつつ、はみ出ないように50%に縮小 */
    transform: translateX(-25vw) scale(0.5);
}

/* 詳細表示時（端へ退避） */
.center-logo-wrapper.move-left.is-detail {
    transform: translateX(-45vw) scale(0.3);
    opacity: 0.8;
}

.center-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: bottom left; /* 左下を軸に回転 */
}

/* スラム（地面叩き）アニメーション用クラス */
.center-logo-image.slam {
    animation: slam-ground 0.6s ease-out forwards;
}

@keyframes slam-ground {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(-10deg); animation-timing-function: ease-in; } /* 右側を持ち上げる */
    50% { transform: rotate(0deg); animation-timing-function: ease-out; } /* 叩きつける */
    65% { transform: rotate(-2deg); animation-timing-function: ease-in; } /* わずかにバウンド */
    80% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* =========================================
   Puzzle Piece Component
   ========================================= */
.puzzle-piece {
    --piece-size: 10vw;      /* ピース本体のサイズ (画面幅の10%) */
    --tab-size: 2vw;         /* 凸凹の円の半径 (画面幅の2%) */
    --piece-color: #3dbb73;  /* 初期カラー（HTML側で上書き可能） */
    --piece-opacity: 0.5;    /* 背景の浮遊ピースと共通の不透明度 */

    position: relative; /* グリッドに従うためrelativeに変更 */
    width: var(--piece-size);
    height: var(--piece-size);
    
    /* パズルの境界線を強調するための薄い影 */
    filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.25));
    
    /* アニメーション用：初期状態は透明かつ少し縮小 */
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

/* ピースが表示された際の状態 */
.puzzle-piece.is-visible {
    opacity: var(--piece-opacity);
    transform: scale(1);
}

/* ピース本体（凹部分のくり抜き） */
.piece-body {
    width: 100%;
    height: 100%;
    background-color: var(--piece-color);
    border-radius: 8px; /* 少し角を丸めて柔らかく */

    /* 左と上の穴（凹）をマスクでくり抜く */
    -webkit-mask-image: 
        radial-gradient(circle at 0% 50%, transparent var(--tab-size), black calc(var(--tab-size) + 0.5px)),
        radial-gradient(circle at 50% 0%, transparent var(--tab-size), black calc(var(--tab-size) + 0.5px));
    -webkit-mask-composite: source-in;
    mask-image: 
        radial-gradient(circle at 0% 50%, transparent var(--tab-size), black calc(var(--tab-size) + 0.5px)),
        radial-gradient(circle at 50% 0%, transparent var(--tab-size), black calc(var(--tab-size) + 0.5px));
    mask-composite: intersect;
}

/* 右の凸 */
.puzzle-piece::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(var(--tab-size) * -1);
    transform: translateY(-50%);
    width: calc(var(--tab-size) * 2);
    height: calc(var(--tab-size) * 2);
    background-color: var(--piece-color);
    border-radius: 50%;
}

/* 下の凸 */
.puzzle-piece::before {
    content: "";
    position: absolute;
    bottom: calc(var(--tab-size) * -1);
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--tab-size) * 2);
    height: calc(var(--tab-size) * 2);
    background-color: var(--piece-color);
    border-radius: 50%;
}

/* =========================================
   Navigation Menu
   ========================================= */
.main-nav {
    position: absolute;
    right: 0;
    top: 0;
    width: 50vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 8vw; /* ロゴとの間隔をとる */
    z-index: 10;
    pointer-events: none; /* 初期状態は背後の要素にクリックを透過 */
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), padding 0.8s ease, align-items 0.8s ease;
}

.main-nav.is-detail {
    transform: translateX(40vw); /* 画面右端へ寄せる */
    opacity: 0.9;
}

.nav-item {
    font-size: 3rem;
    font-weight: 300;
    color: #888;
    text-decoration: none;
    margin: 1.5vh 0;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, color 0.3s ease, margin 0.8s ease, font-size 0.8s ease;
    position: relative;
    pointer-events: auto;
}

.main-nav.is-detail .nav-item {
    margin: 1.2vh 0;
    transform: translateX(0); /* 初期位置のリセット */
    font-size: 1.6rem; /* 詳細表示時は少し小さくして端に寄せる */
    color: #aaa;
}

.main-nav.is-active {
    pointer-events: auto; /* 表示されたらクリック可能にする */
}

.nav-item {
    text-decoration: none;
    color: #333;
    font-size: 2.5vw;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin: 2vh 0;
    position: relative;
    padding-bottom: 0.5vh;
    
    /* アニメーション用：初期は透明かつ少し下にある */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, color 0.3s ease;
}

.nav-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 下線の基本スタイル */
.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 4px;
    background-color: #3dbb73;
    transition: width 0.3s ease-out;
}

/* PC等のホバー対応デバイスのみに適用 */
@media (hover: hover) {
    .nav-item.is-visible:hover {
        color: #3dbb73;
        transform: translateX(15px);
    }

    .nav-item.is-visible:hover::after {
        width: 100%;
    }

    .modal-close:hover {
        color: #3dbb73;
        transform: rotate(90deg);
    }
}

/* =========================================
   Floating Particles
   ========================================= */
.floating-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0; /* ロゴ(1)やメニュー(10)より奥、背景のすぐ手前 */
    pointer-events: none; /* クリック不可 */
}

/* .puzzle-piece に追加して使うクラス */
.floating-piece {
    --piece-size: 5vw; /* 通常(10vw)の半分 */
    --tab-size: 1vw;   /* 通常(2vw)の半分 */
    position: absolute; /* .puzzle-pieceのrelativeを上書き */
    bottom: -10vw; /* 画面下枠外からスタート */
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.15)); /* 少し影を弱める */
    
    /* アニメーション設定（JavaScriptから var(--duration), var(--delay) を注入して適用） */
    animation: float-up var(--duration) linear var(--delay) infinite;
    opacity: 0; /* 初期状態は非表示（キーフレーム内で制御） */
}

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(var(--start-rot, 0deg));
        opacity: 0;
        /* 最初は勢いよく噴き出す（ease-outのような曲線） */
        animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1);
    }
    5% {
        opacity: var(--piece-opacity); /* 半透明で表示 */
    }
    15% {
        /* 噴き出しフェーズ終了：ランダムな高さまで勢いよく到達し、以降は一定速度（linear） */
        transform: translateY(var(--burst-height, -30vh)) rotate(var(--mid-rot, 45deg));
        animation-timing-function: linear;
    }
    90% {
        opacity: var(--piece-opacity);
    }
    100% {
        transform: translateY(-120vh) rotate(var(--end-rot, 90deg));
        opacity: 0;
    }
}

/* =========================================
   Content Modal
   ========================================= */
.content-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75vw; /* PCでは広めに確保 */
    height: 75vh;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.content-modal.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-body {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 6vh 4vw;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 101;
}

.modal-content-area {
    overflow-y: auto;
    padding-right: 10px;
}

/* カスタムスクロールバー */
.modal-content-area::-webkit-scrollbar {
    width: 6px;
}
.modal-content-area::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content-area::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.modal-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 3vh;
    position: relative;
    padding-bottom: 1vh;
}

.modal-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: #3dbb73;
    border-radius: 2px;
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap; /* 改行を反映 */
}

/* モーダル内画像 */
.modal-image-container {
    width: 100%;
    margin-bottom: 2vh;
    display: flex;
    justify-content: flex-start;
}

.modal-image {
    max-width: 300px !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    object-fit: cover;
}

/* =========================================
   Fixed Contact Button (Puzzle Style)
   ========================================= */
.contact-fixed-btn {
    position: fixed;
    right: 180px; /* LINEボタンの幅120px + 右余白40px + 隙間20px */
    bottom: 40px;
    width: 120px;
    height: 120px;
    z-index: 150;
    cursor: pointer;
    text-decoration: none;
    
    /* アニメーション用：初期は非表示 */
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.contact-fixed-btn.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
}

/* モーダル表示時は干渉を防ぐため非表示化 */
.contact-fixed-btn.is-detail {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
}

.contact-btn-label {
    position: absolute;
    bottom: 112px;
    left: calc(50% + 6px);
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
    font-size: 20px;
    font-weight: 900;
    color: #3a8bed; /* Blue */
    letter-spacing: 0.05em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}

.contact-fixed-btn.is-visible .contact-btn-label {
    opacity: 1;
}

.contact-puzzle-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(58, 139, 237, 0.3)); /* ブルーの光彩 */
    transition: filter 0.3s ease;
}

.contact-fixed-btn .puzzle-shape {
    fill: #3a8bed; /* Blue */
    transition: fill 0.3s ease;
}

/* ホバー時の挙動（反時計回りに傾く） */
@media (hover: hover) {
    .contact-fixed-btn:hover {
        transform: scale(1.1) rotate(-5deg) translateZ(0); /* 反時計回りの回転 */
    }
    
    .contact-fixed-btn:hover .puzzle-shape {
        fill: #2974d6; /* 濃いブルー */
    }
    
    .contact-fixed-btn:hover .contact-puzzle-svg {
        filter: drop-shadow(0 15px 30px rgba(58, 139, 237, 0.4));
    }
}

/* =========================================
   Fixed LINE Button (Puzzle Style)
   ========================================= */
.line-fixed-btn {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 120px; /* 80px * 1.5 */
    height: 120px; /* 80px * 1.5 */
    z-index: 150;
    cursor: pointer;
    text-decoration: none;
    
    /* アニメーション用：初期は非表示 */
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 描画の安定化 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.line-fixed-btn.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
}

.line-btn-label {
    position: absolute;
    bottom: 112px; /* アイコンに食い込ませて空白を90%以上削減 */
    left: calc(50% + 6px); /* パズルの凸凹を考慮して右へ微調整 */
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
    font-size: 20px; /* 12pxから20pxへ拡大 */
    font-weight: 900; /* より太く強調 */
    color: #3dbb73;
    letter-spacing: 0.05em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    text-shadow: 0 0 15px rgba(255,255,255,0.8); /* 背景と分離しやすくするための光彩 */
}

.line-fixed-btn.is-visible .line-btn-label {
    opacity: 1;
}

.line-puzzle-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(61, 187, 115, 0.3));
    transition: filter 0.3s ease;
}

.puzzle-shape {
    fill: #3dbb73;
    transition: fill 0.3s ease;
}

.line-logo-path {
    fill: white;
}

/* ホバー時の挙動 */
@media (hover: hover) {
    .line-fixed-btn:hover {
        transform: scale(1.1) rotate(5deg) translateZ(0);
    }
    
    .line-fixed-btn:hover .puzzle-shape {
        fill: #34a865;
    }
    
    .line-fixed-btn:hover .line-puzzle-svg {
        filter: drop-shadow(0 15px 30px rgba(61, 187, 115, 0.4));
    }
}

/* =========================================
   Staff Exclusive Links Style
   ========================================= */
.staff-links-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-top: 20px;
}

.staff-link-card {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* ホバー時の美しいアニメーション */
@media (hover: hover) {
    .staff-link-card:hover {
        background: rgba(255, 255, 255, 0.85);
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
        border-color: var(--card-color);
    }
    
    .staff-link-card:hover .card-icon-wrapper {
        transform: scale(1.08) rotate(5deg);
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
    }
    
    .staff-link-card:hover .card-arrow {
        transform: translateX(4px);
        color: var(--card-color);
    }
}

/* パズルピース型アイコンのラッパー */
.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-color);
    margin-right: 20px;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card-puzzle-svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

/* テキスト情報領域 */
.card-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-right: 15px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.card-desc {
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.4;
}

/* 右端の矢印インジケーター */
.card-arrow {
    font-size: 1.2rem;
    color: #bdc3c7;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.35s ease;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

