/* ===================================
   横画面推奨メッセージ
   =================================== */
.rotate-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif;
}

.rotate-content {
    padding: 40px 20px;
    max-width: 300px;
}

.rotate-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: rotate-pulse 2s infinite;
}

.rotate-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffd700;
    font-family: 'Cinzel', serif;
}

.rotate-content p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 30px;
    color: #d8b7ff;
}

.rotate-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 2rem;
}

.phone-icon {
    animation: phone-tilt 3s ease-in-out infinite;
}

.arrow-icon {
    color: #ffd700;
    animation: arrow-bounce 1.5s ease-in-out infinite;
}

.phone-rotated {
    animation: phone-rotate 3s ease-in-out infinite;
}

/* スマートフォン縦画面時のみ表示 - 横画面推奨 */
@media (max-width: 1024px) and (orientation: portrait) {
    .rotate-message {
        display: flex;
    }
    
    /* ゲームコンテナをぼかす */
    .game-container {
        filter: blur(3px);
        pointer-events: none;
    }
}

/* ===================================
   スマホ特化統一デザインシステム
   =================================== */

:root {
    /* 画面サイズベース統一変数（横画面前提） */
    --screen-width: 100vw;
    --screen-height: 100vh;
    --screen-height-safe: 100dvh; /* ブラウザUI除外 */
    
    /* 統一サイズ規格（横画面基準の％ベース） */
    --logo-size: 50vh;           /* ロゴ幅：画面高さの50%（より大きく表示） */
    --nft-card-size: min(28vh, 30vw); /* NFTカード：タイトル除去分も含めて最大化 */
    --nft-display-size: 10vh;    /* パレード中NFT表示：画面高さの10% */
    --button-height: 8vh;        /* ボタン高さ：画面高さの8% */
    --spacing-unit: 2vh;         /* 基本間隔：画面高さの2% */
    --padding-base: 3vw;         /* 基本パディング：画面幅の3% */
    
    /* 文字サイズ統一規格（横画面基準） */
    --title-size: 4vh;           /* タイトル文字サイズ（横画面基準） */
    --subtitle-size: 2.5vh;      /* サブタイトル文字サイズ */
    --body-size: 2vh;            /* 本文文字サイズ */
    --small-size: 1.8vh;         /* 小文字サイズ */
    
    /* カラー統一 */
    --primary-color: #6a0dad;
    --secondary-color: #4b0082;
    --accent-color: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: #d8b7ff;
    --bg-primary: linear-gradient(135deg, #1a1a3a 0%, #0a0a0a 100%);
}

/* 全体の基本設定 */
.game-container {
    width: var(--screen-width);
    height: var(--screen-height-safe);
    border: none;
    border-radius: 0;
}

/* ===================================
   リセットと基本設定
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden; /* モバイルでのスクロールバー除去 */
    position: relative;
    width: 100vw;
    height: 100vh; /* min-heightからheightに変更でより一貫した表示 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* ハロウィンの背景グラデーション */
    background: radial-gradient(ellipse at center, #1a0033 0%, #0a0a0a 100%);
    
    /* モバイルでのビューポート安定化 */
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: none;
    user-select: none;
}

/* ===================================
   ゲームコンテナ（固定サイズ）
   =================================== */
.game-container {
    position: relative;
    width: 70vw; /* 全デバイスで画面幅の70% */
    height: 70vh; /* 全デバイスで画面高の70% */
    margin: 2vh auto; /* 上下に余裕を持たせる */
    transform-origin: center center;
    
    /* レンダリング最適化 */
    will-change: width, height;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    
    /* スムーズなサイズ変更 */
    transition: width 0.3s ease, height 0.3s ease;
    
    /* 最小・最大サイズの制限 */
    min-width: 320px;
    min-height: 200px;
    max-width: 1368px; /* 元のサイズを上限とする */
    max-height: 547px;
}

/* 画面サイズに応じてスケール調整（幅・高さ両方考慮） */

/* PC用の個別設定を削除 - 全デバイス統一設定を使用 */"

/* スマートフォン横画面（推奨） - 画面横幅の90%を直接的に使用 */
@media (max-width: 1000px) and (orientation: landscape) {
    .game-container {
        width: 90vw !important; /* 画面横幅の90%を直接指定 */
        height: calc(90vw / 2.5) !important; /* 2.5:1の比率を維持 */
        transform: none; /* スケーリングを無効化 */
        margin: 2px auto;
        max-width: 1368px; /* 元のサイズを上限とする */
        max-height: 547px;
    }
}

/* スマートフォン縦画面（制限的対応） - 横画面推奨メッセージが表示されるため最小限のサイズ */
@media (max-width: 480px) and (orientation: portrait) and (min-height: 700px) {
    .game-container {
        transform: scale(0.28);
        margin: 5px auto;
    }
}

@media (max-width: 400px) and (orientation: portrait) and (min-height: 700px) {
    .game-container {
        transform: scale(0.26);
        margin: 2px auto;
    }
}

/* 縦画面で高さが不足している場合 */
@media (orientation: portrait) and (max-height: 700px) {
    .game-container {
        transform: scale(0.24);
        margin: 2px auto;
    }
}

@media (orientation: portrait) and (max-height: 600px) {
    .game-container {
        transform: scale(0.22);
        margin: 1px auto;
    }
}

/* 高さ制限時の調整 - 横幅90%を維持しつつ高さ制限対応 */
@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        width: 90vw !important; /* 横幅90%を維持 */
        height: min(calc(90vw / 2.5), 85vh) !important; /* 高さを画面の85%以下に制限 */
        transform: none !important;
        margin: 0px auto;
        max-width: 1368px;
    }
}

@media (max-height: 400px) and (orientation: landscape) {
    .game-container {
        width: 90vw !important; /* 横幅90%を維持 */
        height: min(calc(90vw / 2.5), 80vh) !important; /* さらに高さを制限 */
        transform: none !important;
        margin: 0px auto;
        max-width: 1368px;
    }
}

/* ゲームビューポート */
.game-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    border: 3px solid #4a0080;
    border-radius: 15px;
    box-shadow: 
        0 0 50px rgba(138, 43, 226, 0.5),
        inset 0 0 30px rgba(138, 43, 226, 0.2);
}

/* モバイルでのボーダーとシャドウ調整 */
@media (max-width: 1000px) and (orientation: landscape) {
    .game-viewport {
        border-width: 2px; /* ボーダーを細くしてコンテンツエリアを最大化 */
        border-radius: 10px;
        box-shadow: 
            0 0 30px rgba(138, 43, 226, 0.4),
            inset 0 0 20px rgba(138, 43, 226, 0.15);
    }
}

/* ===================================
   ハロウィンの装飾枠
   =================================== */
.halloween-frame {
    position: absolute;
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    pointer-events: none;
    z-index: 100;
}

/* コーナー装飾 */
.frame-corner {
    position: absolute;
    font-size: 60px;
    animation: float 3s ease-in-out infinite;
}

.frame-corner-tl {
    top: -10px;
    left: -10px;
    animation-delay: 0s;
}

.frame-corner-tr {
    top: -10px;
    right: -10px;
    animation-delay: 0.5s;
}

.frame-corner-bl {
    bottom: -10px;
    left: -10px;
    animation-delay: 1s;
}

.frame-corner-br {
    bottom: -10px;
    right: -10px;
    animation-delay: 1.5s;
}

/* 蜘蛛の巣 */
.spider-web {
    position: absolute;
    font-size: 80px;
    opacity: 0.6;
    pointer-events: none;
}

.spider-web-tl {
    top: -20px;
    left: -20px;
    transform: rotate(-45deg);
}

.spider-web-tr {
    top: -20px;
    right: -20px;
    transform: rotate(45deg) scaleX(-1);
}

/* コウモリ */
.bat {
    position: absolute;
    font-size: 30px;
    opacity: 0.7;
    pointer-events: none;
    animation: fly 10s ease-in-out infinite;
}

.bat-1 {
    top: 20%;
    left: -60px;
    animation-delay: 0s;
}

.bat-2 {
    top: 50%;
    right: -60px;
    animation-delay: 3s;
    animation-direction: reverse;
}

.bat-3 {
    top: 70%;
    left: -60px;
    animation-delay: 6s;
}

/* お化け */
.ghost {
    position: absolute;
    font-size: 40px;
    opacity: 0.5;
    pointer-events: none;
    animation: haunt 8s ease-in-out infinite;
}

.ghost-1 {
    bottom: 20%;
    left: -60px;
    animation-delay: 0s;
}

.ghost-2 {
    top: 30%;
    right: -60px;
    animation-delay: 4s;
}

/* 枠の各辺 */
.frame-side {
    position: absolute;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(138, 43, 226, 0.3) 50%, 
        transparent 100%);
}

.frame-side-top,
.frame-side-bottom {
    width: calc(100% - 80px);
    height: 2px;
    left: 40px;
}

.frame-side-top {
    top: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        #ff6b35 25%,
        #ffd700 50%,
        #ff6b35 75%,
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

.frame-side-bottom {
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        #6a0dad 25%,
        #4b0082 50%,
        #6a0dad 75%,
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite reverse;
}

.frame-side-left,
.frame-side-right {
    width: 2px;
    height: calc(100% - 80px);
    top: 40px;
}

.frame-side-left {
    left: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        #ff6b35 50%,
        transparent 100%);
}

.frame-side-right {
    right: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        #6a0dad 50%,
        transparent 100%);
}

/* ===================================
   画面管理
   =================================== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease-in-out;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===================================
   ウォレット入力セクション
   =================================== */
/* ウォレット入力セクションは下部で統一設定されます */

/* ウォレットラベルは下部で統一設定されます */

/* ウォレット入力は下部で統一設定されます */

.wallet-input:focus {
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    background: rgba(138, 43, 226, 0.15);
}

.wallet-input::placeholder {
    color: rgba(216, 183, 255, 0.6);
}

.wallet-help {
    font-size: clamp(0.6rem, 1.4vw, 0.7rem);
    color: rgba(216, 183, 255, 0.8);
    margin-top: clamp(4px, 1vw, 6px);
    font-style: italic;
}

/* AYAME応援チェックボックスセクション */
.ayame-support-section {
    margin-top: clamp(12px, 2vh, 20px);
    padding: clamp(8px, 1.5vh, 12px);
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

/* カスタムチェックボックス */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(0.7rem, 1.6vw, 0.9rem);
    color: var(--text-primary);
    line-height: 1.4;
    user-select: none;
    position: relative;
}

.checkbox-container .ayame-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    position: relative;
    width: clamp(16px, 2.5vh, 20px);
    height: clamp(16px, 2.5vh, 20px);
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 4px;
    margin-right: clamp(8px, 1.5vh, 12px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 8px;
    border: solid var(--accent-color);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.checkbox-container:hover .checkmark {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.checkbox-container .ayame-checkbox:checked ~ .checkmark {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(138, 43, 226, 0.2));
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.checkbox-container .ayame-checkbox:checked ~ .checkmark::after {
    display: block;
}

.checkbox-label {
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.checkbox-container .ayame-checkbox:checked ~ .checkbox-label {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* ===================================
   NFT表示画面（スマホ特化統一版）
   =================================== */

#nftDisplay {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nft-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important; /* NFT表示時は中央配置 */
    width: 100% !important;
    height: 100% !important;
    padding: 1vh 1vw !important; /* パディング最小化でスペース最大活用 */
    box-sizing: border-box !important;
}

.nft-header {
    flex: 0 0 auto !important;
    text-align: center !important;
    margin-bottom: min(2vh, 16px) !important;
    padding: 0 2vw !important;
}

/* ローディング時はヘッダーを表示、NFT表示時は非表示 */
.nft-loading .nft-header {
    display: block !important; /* ローディング時は表示 */
}

/* NFTヘッダー表示制御 - より具体的なセレクタで制御 */
.nft-cards-container.show ~ .nft-loading .nft-header {
    display: none !important; /* NFTカード表示時のみ非表示 */
}

.nft-title {
    font-size: max(18px, min(3.5vh, 4.5vw)) !important; /* ローディング画面で目立つサイズ */
    font-family: 'Cinzel', serif !important;
    margin: 0 !important;
    white-space: nowrap !important; /* 改行防止 */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 1.5em !important; /* 最小高さ確保 */
    background: linear-gradient(45deg, var(--accent-color), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.nft-cards-container {
    display: none; /* 初期状態では非表示 */
    
    /* 枠内埋め尽くしアプローチ - 最大限活用 */
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important; /* パディング完全削除 */
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 20;
    overflow: hidden !important;
    
    /* CSS Gridレイアウト - 枠内埋め尽くし1段6枚 */
    grid-template-columns: repeat(6, 1fr) !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important; /* 隙間完全除去 */
    grid-gap: 0 !important; /* 古いブラウザ対応も含めて隙間除去 */
    column-gap: 0 !important;
    row-gap: 0 !important;
    justify-items: stretch !important; /* カードをセル内で引き延ばし */
    align-items: stretch !important; /* 縦方向も引き延ばし */
    grid-auto-flow: row !important; /* 行優先で配置 */
}

/* NFTカード表示時 */
.nft-cards-container.show {
    display: grid !important; /* CSS Gridレイアウトに戻す */
    visibility: visible !important;
    opacity: 1 !important;
}

.nft-card {
    /* 枠内埋め尽ましアプローチ - 隙間完全除去最優先 */
    width: 100% !important; /* グリッドセル内で強制100% */
    height: 75% !important; /* 高さを75%に調整して画質改善とゆとり確保 */
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: 75% !important; /* 最大高さも75%に制限 */
    
    /* 完全シンプル設計 - 隙間問題解決のため */
    background: linear-gradient(145deg, rgba(138, 43, 226, 0.15), rgba(75, 0, 130, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.3) !important; /* ゴールド系の枠を追加 */
    border-radius: 8px !important; /* 軽やかな角丸 */
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2), 0 0 20px rgba(138, 43, 226, 0.1) !important; /* 光るエフェクト */
    padding: 8px !important; /* 適度なパディング */
    margin: auto !important; /* 中央配置 */
    outline: none !important;
    
    /* レイアウト - 縦並び（画像＋テキスト） */
    display: flex !important;
    flex-direction: column !important; /* 縦並びに戻す */
    align-items: center !important;
    justify-content: space-between !important;
    
    /* Grid配置 - 中央配置 */
    justify-self: center !important; /* 中央配置 */
    align-self: center !important; /* 中央配置 */
    
    /* 位置指定 */
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    
    /* 確実収容のための追加制御 */
    flex-shrink: 0 !important;
    flex-grow: 0 !important; /* 成長を制限 */
    
    /* アニメーション効果を追加 */
    opacity: 0 !important; /* 初期状態は非表示 */
    transform: translateY(30px) scale(0.8) !important; /* 下から上に、小さくスタート */
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important; /* バウンシーなアニメーション */
    
    /* ホバーエフェクト */
    cursor: pointer;
}

/* カード表示アニメーション */
.nft-card.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important; /* 元の位置とサイズに */
}

/* ホバーエフェクト */
.nft-card:hover {
    transform: translateY(-5px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4), 0 0 30px rgba(138, 43, 226, 0.2) !important;
    border-color: rgba(255, 215, 0, 0.6) !important;
}

/* スペシャルエフェクト：カード表示時のキラキラ */
.nft-card.show::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent, rgba(255, 215, 0, 0.4), transparent,
        rgba(138, 43, 226, 0.4), transparent, rgba(255, 215, 0, 0.4), transparent);
    background-size: 300% 300%;
    border-radius: 10px;
    animation: sparkle 2s ease-in-out;
    pointer-events: none;
    z-index: -1;
}

@keyframes sparkle {
    0%, 100% { 
        background-position: 0% 0%; 
        opacity: 0;
    }
    50% { 
        background-position: 100% 100%; 
        opacity: 1;
    }
}

/* パーティクルエフェクト用のコンテナ */
.nft-card .particle-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 8px;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8), transparent);
    border-radius: 50%;
    animation: float-up 2s ease-out forwards;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0);
    }
}

/* インタラクション効果も隙間防止のため削除 */

.nft-card-image {
    /* 画像部分の改善 */
    width: 100%;
    flex: 1; /* 残り空間を最大活用 */
    display: flex;
    align-items: center; /* 中央寄せに変更 */
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 画像読み込み時のシマーエフェクト */
.nft-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.nft-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* contain に変更して画像全体を表示 */
    object-position: center center; /* 中央寄せに変更 */
    border-radius: 4px;
    /* 画質向上のための設定 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    image-rendering: auto;
    /* スムージングを有効化 */
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nft-card-info {
    /* カード幅連動大型テキスト用 - テキスト部分 */
    width: 100%;
    flex-shrink: 0; /* テキスト部分の高さを固定 */
    display: flex;
    flex-direction: row; 
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    gap: 3px; /* 固定ギャップで全デバイス統一 */
    padding: 4px 0; /* 固定パディングで全デバイス統一 */
}

.nft-id {
    /* 統一固定サイズ - 全デバイス同一表示 */
    font-size: 14px; /* 固定サイズで全デバイス統一 */
    font-weight: bold;
    color: var(--accent-color);
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 0;
}

.nft-instrument {
    /* 統一固定サイズ - 楽器名 */
    font-size: 12px; /* 固定サイズで全デバイス統一 */
    color: var(--text-secondary);
    text-transform: capitalize;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* セパレーター - カード幅連動大型テキスト */
.nft-separator {
    font-size: 12px; /* 固定サイズで全デバイス統一 */
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.1;
    flex-shrink: 0;
}
}

/* レスポンシブメディアクエリ削除 - 全デバイス統一表示 */

/* NFT関連メディアクエリ完全削除 - 全デバイス統一表示 */

/* レスポンシブNFTレイアウト - CSS Grid 3×2 固定配置 */

/* レスポンシブデザイン削除 - 全サイズ統一埋め尽くし */

/* アニメーション完全削除 - 隙間なし保証 - 追加強化 */
.nft-card {
    opacity: 1 !important; /* 初期状態で完全表示 */
    transform: none !important; /* 一切のトランスフォームを無効化 */
    visibility: visible !important; /* 可視性強制 */
}

/* 完全隙間なし保証のためのグローバル設定追加 */
.nft-cards-container .nft-card {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

.nft-cards-container *, .nft-card * {
    box-sizing: border-box !important;
}

/* 千鳥配置CSS完全削除 - 隙間なし1段横並び専用 */

/* ローディング表示（％ベース統一版） - 初期表示 */
.nft-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 2vh 2vw !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 15 !important;
    background: var(--bg-primary) !important; /* 背景色で他を隠す */
}

.loading-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
}

/* ローディング時のタイトル表示確保 */
.nft-loading .nft-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-bottom: 3vh !important;
    width: 100% !important;
}

.nft-loading .nft-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--accent-color) !important;
    text-align: center !important;
    font-size: max(18px, min(3.5vh, 4.5vw)) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* ローディングスピナー調整（重複削除） */

.loading-spinner {
    width: calc(var(--spacing-unit) * 3);
    height: calc(var(--spacing-unit) * 3);
    border: 3px solid rgba(138, 43, 226, 0.3);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: var(--body-size);
    color: var(--text-secondary);
    text-align: center;
}

.parade-start-button {
    background: linear-gradient(135deg, #ff6b35, #ffd700);
    border: none;
    padding: 15px 35px;
    font-size: 1.1rem;
    color: #2a1a4a;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    font-family: 'Cinzel', serif;
    font-weight: bold;
    margin-top: 20px;
}

.parade-start-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.nft-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* NFT未所有時のメッセージ */
.no-nft-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
    background: rgba(138, 43, 226, 0.1);
    border: 2px dashed rgba(138, 43, 226, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out;
}

.no-nft-icon {
    font-size: 4rem;
    opacity: 0.7;
}

.no-nft-text {
    font-size: 1.2rem;
    color: #d8b7ff;
    font-family: 'Cinzel', serif;
}

.no-nft-subtitle {
    font-size: 0.9rem;
    color: rgba(216, 183, 255, 0.8);
    font-style: italic;
}

/* ===================================
   オープニング画面（スマホ特化統一版）
   =================================== */

#opening {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.opening-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: calc(var(--spacing-unit) * 2) var(--padding-base);
    box-sizing: border-box;
}

.logo-section {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.main-logo {
    width: var(--logo-size);
    height: auto;
    margin-bottom: var(--spacing-unit);
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.4));
}

.subtitle {
    font-size: var(--subtitle-size);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.6);
    font-family: 'Noto Sans JP', sans-serif;
}

.input-section {
    flex: 0 0 auto;
    width: 100%;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
}

.wallet-section {
    width: 100%;
}

.wallet-label {
    display: block;
    font-size: var(--body-size);
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    font-family: 'Cinzel', serif;
}

.wallet-input {
    width: 100%;
    padding: calc(var(--spacing-unit) * 0.75) var(--padding-base);
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: var(--body-size);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', sans-serif;
}

.wallet-input:focus {
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 16px rgba(138, 43, 226, 0.3);
    background: rgba(138, 43, 226, 0.15);
}

.wallet-input::placeholder {
    color: rgba(216, 183, 255, 0.6);
}

.wallet-help {
    font-size: var(--small-size);
    color: rgba(216, 183, 255, 0.8);
    margin-top: calc(var(--spacing-unit) * 0.5);
    text-align: center;
    font-style: italic;
    line-height: 1.3;
}

.start-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 0 var(--padding-base);
    height: var(--button-height);
    font-size: var(--body-size);
    color: var(--text-primary);
    border-radius: calc(var(--button-height) / 2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 0.5);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.4);
    font-family: 'Cinzel', serif;
    width: 100%;
    font-weight: 500;
    /* Safari対応 */
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.start-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 12px rgba(138, 43, 226, 0.6);
}

.button-text {
    font-size: var(--body-size);
}

.button-icon {
    font-size: calc(var(--body-size) * 1.2);
}

/* ===================================
   ハロウィン装飾要素（軽量版）
   =================================== */

/* 浮遊するハロウィン要素 */
.opening-content::before,
.opening-content::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.opening-content::before {
    background-image: 
        radial-gradient(2px 2px at 10vw 20vh, rgba(255, 215, 0, 0.8), transparent),
        radial-gradient(2px 2px at 80vw 30vh, rgba(255, 140, 0, 0.8), transparent),
        radial-gradient(1px 1px at 20vw 60vh, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 90vw 70vh, rgba(255, 255, 255, 0.4), transparent);
    animation: sparkle 3s ease-in-out infinite alternate;
}

.opening-content::after {
    background-image: 
        radial-gradient(1px 1px at 30vw 15vh, rgba(138, 43, 226, 0.6), transparent),
        radial-gradient(2px 2px at 70vw 80vh, rgba(255, 69, 0, 0.7), transparent),
        radial-gradient(1px 1px at 15vw 75vh, rgba(255, 215, 0, 0.5), transparent);
    animation: sparkle 3s ease-in-out infinite alternate-reverse;
}

/* ハロウィンっぽいフォント装飾 */
.subtitle {
    font-size: var(--subtitle-size);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    text-shadow: 
        0 0 8px rgba(138, 43, 226, 0.6),
        0 0 16px rgba(255, 140, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.main-logo {
    width: var(--logo-size);
    height: auto;
    margin-bottom: var(--spacing-unit);
    filter: 
        drop-shadow(0 0 20px rgba(138, 43, 226, 0.4))
        drop-shadow(0 0 40px rgba(255, 140, 0, 0.3))
        drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.6));
    transition: filter 0.3s ease;
}

.main-logo:hover {
    filter: 
        drop-shadow(0 0 30px rgba(138, 43, 226, 0.6))
        drop-shadow(0 0 60px rgba(255, 140, 0, 0.5))
        drop-shadow(4px 4px 12px rgba(0, 0, 0, 0.8));
}

.start-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), #8B0000);
    border: none;
    padding: 0 var(--padding-base);
    height: var(--button-height);
    font-size: var(--body-size);
    color: var(--text-primary);
    border-radius: calc(var(--button-height) / 2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 0.5);
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 16px rgba(138, 43, 226, 0.4),
        0 0 20px rgba(255, 140, 0, 0.2);
    font-family: 'Cinzel', serif;
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    /* Safari対応 */
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(138, 43, 226, 0.6),
        0 0 30px rgba(255, 140, 0, 0.4);
}

.start-button:active {
    transform: translateY(0px);
    box-shadow: 
        0 2px 12px rgba(138, 43, 226, 0.6),
        0 0 15px rgba(255, 140, 0, 0.3);
}

/* アニメーション */
@keyframes sparkle {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.1); }
}

/* 背景パーティクル */
.opening-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.opening-bg-particles::before,
.opening-bg-particles::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        100px 100px white,
        200px 150px white,
        300px 50px white,
        400px 200px white,
        500px 120px white,
        600px 180px white,
        700px 90px white,
        800px 160px white;
    animation: twinkle 3s infinite;
}

/* ===================================
   パレード画面
   =================================== */
#parade {
    background: #000;  /* 真っ黒な背景 */
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    /* PC・Safari対応の確実な表示 */
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    z-index: 1;
}

/* 背景スクローラー */
.parade-background {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.background-scroller {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 416px;  /* 固定ビューポートに合わせた高さ */
    width: 200%;    /* 幅を200%にしてスクロール効果を改善 */
    min-width: 2912px;  /* 最小幅を保証 */
    
    /* 背景設定（JavaScriptでも上書き） */
    background-image: url('../images/backgrounds/back2.jpg');
    background-repeat: repeat-x;  /* 水平方向にリピート */
    background-size: 2912px 416px;  /* スケールされたサイズ */
    background-position: left bottom;
    
    /* フォールバック背景色 */
    background-color: #1e1b4b;
    
    transform-origin: left bottom;
    will-change: transform;
    
    /* アニメーションはJavaScriptで制御 */
}

/* パレードステージ */
.parade-stage {
    position: absolute;
    bottom: 20px;  /* もっと下に配置 */
    left: 0;
    width: 100%;
    z-index: 10;
}

.characters-container {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    padding: 0 50px;
    height: 150px;
    gap: 10px;  /* キャラクター間に少し隙間 */
}

.character {
    width: 80px;
    height: 150px;
    position: relative;
    animation: bounce 2s ease-in-out infinite;
    transition: all 0.5s ease;
    /* 画像の背景色を透過 */
    background: transparent;
}

/* キャラクターのシルエット表示 */
.character-img {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* 影絵画像 - Canvas */
.character-canvas {
    width: 100%;
    height: 100%;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
}

/* シルエット画像 */
.character-silhouette {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: brightness(0);  /* 黒いシルエット */
    transition: filter 0.3s ease;
}

/* アクティブ時の紫色グロー効果 */
.character.active .character-silhouette {
    filter: brightness(0) drop-shadow(0 0 25px rgba(147, 51, 234, 0.9)) drop-shadow(0 0 15px rgba(59, 130, 246, 0.7)) drop-shadow(0 0 35px rgba(217, 70, 239, 0.5));
    -webkit-filter: brightness(0) drop-shadow(0 0 25px rgba(147, 51, 234, 0.9)) drop-shadow(0 0 15px rgba(59, 130, 246, 0.7)) drop-shadow(0 0 35px rgba(217, 70, 239, 0.5));
}

.character.active {
    animation: bounce 0.5s ease-in-out infinite;
    transform: scale(1.1);
}

/* 空のキャラクター（ベーシックモード） */
.character-empty {
    opacity: 0 !important;
    pointer-events: none;
}

.character-empty .character-img {
    display: none;
}

/* UI オーバーレイ */
.parade-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* 画面サイズベースの動的NFT表示システム */
.playing-characters {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 20 !important;
    
    /* コンテナとしてのみ機能、レイアウトは子要素で制御 */
    display: block !important;
}

/* 左上NFT表示 - 画面サイズベース動的配置 */
.playing-left {
    position: absolute !important;
    top: min(2vh, 16px) !important; /* 上端からの余白 */
    left: min(2vw, 16px) !important; /* 左端からの余白 */
    
    /* 画面サイズに応じた動的サイズ計算 */
    width: max(80px, min(15vw, 180px)) !important; /* 最小80px、最大60pxで画面幅の15% */
    height: auto !important;
    
    /* スタイル設定 */
    background: rgba(0, 0, 0, 0.85) !important;
    border: 2px solid rgba(138, 43, 226, 0.6) !important;
    border-radius: 12px !important;
    padding: min(1.5vh, 12px) !important;
    text-align: center !important;
    
    /* 表示制御 */
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
    
    /* オーバーフロー防止 */
    max-width: calc(50vw - 32px) !important; /* 画面の半分以下に制限 */
    box-sizing: border-box !important;
}

/* 右上NFT表示 - 画面サイズベース動的配置 */
.playing-right {
    position: absolute !important;
    top: min(2vh, 16px) !important; /* 上端からの余白 */
    right: min(2vw, 16px) !important; /* 右端からの余白 */
    
    /* 画面サイズに応じた動的サイズ計算 */
    width: max(80px, min(15vw, 180px)) !important; /* 最小80px、最太180pxで画面幅の15% */
    height: auto !important;
    
    /* スタイル設定 */
    background: rgba(0, 0, 0, 0.85) !important;
    border: 2px solid rgba(138, 43, 226, 0.6) !important;
    border-radius: 12px !important;
    padding: min(1.5vh, 12px) !important;
    text-align: center !important;
    
    /* 表示制御 */
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
    
    /* オーバーフロー防止 */
    max-width: calc(50vw - 32px) !important; /* 画面の半分以下に制限 */
    box-sizing: border-box !important;
}

/* アクティブ状態表示強化 */
.playing-left.active,
.playing-right.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    
    /* アクティブ時の強化エフェクト */
    border-color: rgba(138, 43, 226, 0.8) !important;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(138, 43, 226, 0.4) !important;
}

/* ラベルテキスト - 画面サイズベース動的サイズ */
/* パレード中のラベル表示調整 */
.playing-label {
    font-size: max(8px, min(1.6vh, 12px)) !important; /* コンパクトなサイズ */
    color: var(--text-secondary) !important;
    margin-bottom: max(3px, min(0.6vh, 6px)) !important; /* 縮小したマージン */
    font-family: 'Cinzel', serif !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
}

/* 新規: NFT情報表示エリア */
.playing-nft-info {
    margin-top: max(4px, min(0.8vh, 8px)) !important;
    font-size: max(8px, min(1.4vh, 11px)) !important;
    color: var(--text-primary) !important;
    text-align: center !important;
    line-height: 1.2 !important;
    font-family: 'Noto Sans JP', sans-serif !important;
    font-weight: 500 !important;
    
    /* テキストの視認性向上 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    
    /* 改行防止とオーバーフロー対応 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* NFT ID表示（ゴールド色） */
.nft-id-display {
    color: var(--accent-color) !important; /* ゴールド */
    font-weight: bold !important;
}

/* セパレーター */
.nft-separator {
    color: var(--text-secondary) !important;
    margin: 0 1px !important;
}

/* 楽器名表示（シルバー系） */
.nft-instrument-display {
    color: var(--text-secondary) !important;
    font-style: italic !important;
    text-transform: capitalize !important;
}

/* NFTキャラクター画像 - パレード中正方形固定サイズ */
.playing-character {
    /* 確実な正方形実装 */
    width: 80px !important; /* 固定幅で確実な正方形 */
    height: 80px !important; /* 固定高さで確実な正方形 */
    
    /* 動的サイズ調整版（画面サイズ対応） */
    width: max(60px, min(12vw, 100px)) !important;
    height: max(60px, min(12vw, 100px)) !important;
    
    /* Aspect ratioサポートブラウザ向け */
    aspect-ratio: 1 / 1 !important;
    
    /* スタイル設定 */
    margin: 0 auto !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center top !important; /* 顔部分を優先表示 */
    border-radius: 8px !important; /* 正方形に合う角丸 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(138, 43, 226, 0.4) !important;
    position: relative !important;
    overflow: hidden !important;
    
    /* 確実な正方形表示のための設定 */
    display: block !important;
    box-sizing: border-box !important;
    
    /* 正方形コンテナの確実な実装 */
    flex-shrink: 0 !important; /* 縮小防止 */
}

/* NFT画像のグロー効果 */
.playing-character::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2) 0%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* プログレスバー */
.progress-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 8px; /* モバイルでのタッチ性向上のため基本サイズを増加 */
    background: rgba(255, 255, 255, 0.3); /* 少し濃くして見やすく */
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer; /* クリック可能であることを示す */
    transition: height 0.2s ease;
    z-index: 20; /* エフェクトレイヤーより上に表示 */
    
    /* モバイルでのタッチ領域を拡大 */
    padding: 2px 0;
    margin-bottom: -2px;
}

.progress-bar:hover {
    height: 10px; /* ホバー時に少し太くなる */
}

/* モバイルデバイスではホバー効果を無効化し、タッチ時の視覚効果を追加 */
@media (hover: none) and (pointer: coarse) {
    .progress-bar:hover {
        height: 8px;
    }
    
    .progress-bar:active {
        height: 10px;
        background: rgba(255, 255, 255, 0.4);
    }
}

/* 全デバイス統一 - 70% × 70%に最適化されたUI調整 */
/* 横画面特化レイアウト（全デバイス統一） */
.opening-content {
    display: flex !important;
    flex-direction: row !important; /* 強制的に横並び */
    align-items: center;
    justify-content: space-between;
    padding: 5vh 5vw;
    min-height: 90vh;
    gap: 4vw;
    /* 縦積みを絶対に防ぐ */
    flex-wrap: nowrap !important;
}

/* ロゴセクション（左側） - 横画面特化 */
.logo-section {
    flex: 0 0 45% !important; /* 強制的に45%固定 */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.logo-main,
.main-logo {
    width: 100%;
    max-width: 50vw; /* 35vw → 50vw に拡大 */
    height: auto;
    margin-bottom: 0; /* サブタイトル削除により余白削除 */
    filter: drop-shadow(0 0 30px rgba(138, 43, 226, 0.5));
}

/* サブタイトルは削除済み */

/* 入力セクション（右側） - 横画面特化 */
.input-section {
    flex: 0 0 45% !important; /* 強制的に45%固定 */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3vh !important;
}

.wallet-input-section,
.wallet-section {
    margin: 0;
    text-align: center;
    width: 100%;
}

.wallet-label {
    display: block !important;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem) !important;
    color: #d8b7ff !important;
    margin-bottom: 1vh !important;
    font-family: 'Cinzel', serif !important;
}

.wallet-input {
    width: 100%;
    max-width: 100%;
    padding: 1.5vh 2vw;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 25px;
    color: white;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.wallet-help {
    font-size: clamp(0.7rem, 1.3vw, 0.8rem);
    color: #b19cd9;
    margin-top: 1vh;
    line-height: 1.3;
}

.start-button, .replay-button {
    background: linear-gradient(135deg, #6a0dad, #4b0082);
    border: none;
    padding: 1.5vh 4vw;
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 1vw;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.4);
    font-family: 'Cinzel', serif;
    min-width: 180px;
    justify-content: center;
    /* Safari対応 */
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* 横画面特化デザイン - 縦積みレイアウト廃止 */
/* すべての画面サイズで左右レイアウトを維持 */

/* ===================================
   スマートフォン専用オープニング画面
   =================================== */

.mobile-opening-content {
    display: flex;
    flex-direction: row; /* 横画面特化：左右レイアウト */
    align-items: center;
    justify-content: space-between; /* 左右に配置 */
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic Viewport Height */
    padding: 5vh 5vw; /* 上下・左右の余白 */
    gap: 4vw; /* 左右の間隔 */
    text-align: center;
    background: linear-gradient(135deg, #1a1a3a 0%, #0a0a0a 100%);
    box-sizing: border-box;
}

.mobile-logo-section {
    flex: 0 0 45%; /* 左側45%を固定 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-logo {
    width: 100%;
    max-width: 50vw; /* 35vw → 50vw に拡大 */
    height: auto;
    margin-bottom: 0; /* サブタイトル削除により余白削除 */
    filter: drop-shadow(0 0 30px rgba(138, 43, 226, 0.5));
}

/* モバイル版サブタイトルも削除済み */

.mobile-input-section {
    flex: 0 0 45%; /* 右側45%を固定 */
    width: 100%;
    max-width: none; /* 幅制限を解除 */
    display: flex;
    flex-direction: column;
    align-items: center; /* 中央配置 */
    gap: 3vh; /* レスポンシブギャップ */
}

.mobile-wallet-section {
    width: 100%;
}

.mobile-wallet-label {
    display: block;
    font-size: 14px;
    color: #d8b7ff;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
}

.mobile-wallet-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', sans-serif;
}

.mobile-wallet-input:focus {
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 16px rgba(138, 43, 226, 0.3);
    background: rgba(138, 43, 226, 0.15);
}

.mobile-wallet-input::placeholder {
    color: rgba(216, 183, 255, 0.6);
}

.mobile-wallet-help {
    font-size: 12px;
    color: rgba(216, 183, 255, 0.8);
    margin-top: 6px;
    font-style: italic;
    line-height: 1.3;
}

.mobile-start-button {
    background: linear-gradient(135deg, #6a0dad, #4b0082);
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.4);
    font-family: 'Cinzel', serif;
    min-height: 48px; /* タッチ操作に適したサイズ */
    width: 100%;
    font-weight: 500;
    /* Safari対応 */
    -webkit-appearance: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.mobile-start-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 12px rgba(138, 43, 226, 0.6);
}

.mobile-button-text {
    font-size: 16px;
}

.mobile-button-icon {
    font-size: 18px;
}

/* ===================================
   スマートフォン専用NFT表示画面
   =================================== */

.mobile-nft-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a3a 0%, #0a0a0a 100%);
}

.mobile-nft-header {
    text-align: center;
    margin-bottom: 24px;
}

.mobile-nft-title {
    font-size: clamp(18px, 5vw, 24px);
    color: #ffd700;
    margin: 0;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.mobile-nft-cards-container {
    display: flex;
    flex-direction: row; /* 横並び強制 */
    flex-wrap: nowrap; /* 縦積み禁止 */
    justify-content: space-evenly; /* 均等配置 */
    align-items: center;
    gap: min(1vw, 6px); /* ギャップを縮小 */
    width: 100%;
    max-width: 100%; /* 幅制限解除 */
    margin-bottom: 20px;
    padding: 0 1vw; /* 左右余白を縮小 */
}

.mobile-nft-card {
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 6px;
    padding: min(0.5vh, 4px);
    text-align: center;
    transition: all 0.3s ease;
    width: min(10vh, 13vw); /* さらに縮小 */
    height: calc(min(10vh, 13vw) * 1.3); /* 縦長比率調整 */
    min-width: 60px;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 1; /* 必要に応じて縮小 */
    flex-basis: calc((100% - 5 * min(1vw, 6px)) / 6); /* 6等分 */
}

.mobile-nft-card:hover {
    border-color: rgba(138, 43, 226, 0.6);
    box-shadow: 0 2px 12px rgba(138, 43, 226, 0.3);
}

.mobile-nft-image {
    width: 100%;
    height: auto;
    max-height: 60%;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 4px;
}

.mobile-nft-info {
    color: white;
    font-size: clamp(9px, 2.5vw, 11px);
    line-height: 1.2;
}

.mobile-nft-id {
    font-weight: bold;
    color: #ffd700;
    font-size: clamp(10px, 2.8vw, 12px);
}

.mobile-nft-instrument {
    color: #d8b7ff;
    font-size: clamp(8px, 2.2vw, 10px);
    margin-top: 2px;
}

/* モバイルローディング表示 */
.mobile-nft-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    min-height: 200px;
}

.mobile-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(138, 43, 226, 0.3);
    border-top: 3px solid #8a2be2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.mobile-loading-text {
    font-size: 14px;
    color: #d8b7ff;
    text-align: center;
}

/* 縦向き画面での調整 */
@media (max-width: 480px) and (orientation: portrait) {
    .mobile-nft-cards-container {
        max-width: 300px;
        gap: 8px;
    }
    
    .mobile-nft-card {
        padding: 6px;
    }
}

/* 横向き画面での調整 */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nft-content {
        padding: 12px;
    }
    
    .mobile-nft-header {
        margin-bottom: 12px;
    }
    
    .mobile-nft-cards-container {
        gap: 8px;
        max-width: 480px;
    }
}

/* ===================================
   スマートフォン専用パレード画面調整
   =================================== */

/* メディアクエリ削除 - 画面サイズベースの動的調整で統一対応 */
/* 上記の動的サイズ設定により、全てのデバイスで適切なサイズと配置を実現 */

/* 極小画面での追加最適化（画面サイズベース動的調整） */

/* 極小画面（幅400px未満）での追加調整 */
@media (max-width: 400px) {
    .playing-left, .playing-right {
        width: max(70px, 12vw) !important; /* より小さな最小サイズ */
        padding: 6px !important;
        top: 8px !important; /* より少ない余白 */
    }
    
    .playing-left {
        left: 8px !important; /* より少ない余白 */
    }
    
    .playing-right {
        right: 8px !important; /* より少ない余白 */
    }
    
    .playing-character {
        min-width: 50px !important;
        min-height: 70px !important; /* 50px * 1.4 */
    }
    
    .playing-label {
        font-size: 8px !important;
        margin-bottom: 3px !important;
    }
}

/* 横幅が狭い画面での重複防止 */
@media (max-width: 600px) {
    .playing-left, .playing-right {
        max-width: calc(45vw - 16px) !important; /* より厳格な幅制限で重複防止 */
    }
}

/* 非常に小さな画面での調整 */
@media (max-width: 600px) or (max-height: 400px) {
    .opening-content {
        padding: 2vh 3vw;
        gap: 2vh;
    }
    
    .logo-main {
        max-width: 60vw;
        margin-bottom: 1vh;
    }
    
    .opening-subtitle {
        font-size: 0.75rem;
        margin-bottom: 1vh;
    }
    
    .start-button {
        padding: 1vh 3vw;
        font-size: 0.8rem;
        min-width: 140px;
    }
}

/* スマホ版での小さい画面調整 */
@media (max-width: 600px) {
    .mobile-opening-content {
        padding: 20px 16px 16px 16px;
        justify-content: space-evenly; /* より均等に配置 */
    }
    
    .mobile-logo {
        width: min(240px, 65vw);
    }
    
    .mobile-start-button {
        padding: 12px 24px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* 非常に高さが低い画面での調整 */
@media (max-height: 600px) {
    .mobile-opening-content {
        padding: 16px 20px 12px 20px;
        justify-content: space-around;
    }
    
    .mobile-logo {
        width: min(200px, 50vw);
        margin-bottom: 8px;
    }
    
    .mobile-input-section {
        gap: 16px;
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a0dad, #ff6b35);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* エフェクトレイヤー */
.effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 215, 0, 1) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatUp 3s ease-out forwards;
}

/* ===================================
   エンディング画面
   =================================== */
#ending {
    background: radial-gradient(ellipse at center, #2a1a4a 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ending-content {
    text-align: center;
    z-index: 10;
}

.ending-title {
    font-size: 3rem;
    font-family: 'Cinzel', serif;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s ease-in-out infinite;
}

.ending-message {
    font-size: 1.2rem;
    color: #d8b7ff;
    margin-bottom: 40px;
}

.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.firework-explosion {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: explode 1.5s ease-out forwards;
}

/* ===================================
   アニメーション定義
   =================================== */

/* 背景スクロールアニメーション */
@keyframes scrollBackground {
    0% {
        background-position: 0px 0px;
    }
    100% {
        background-position: -2912px 0px;
    }
}

/* カードアピアアニメーション削除済み */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(138, 43, 226, 0.7);
    }
    to {
        text-shadow: 0 0 20px rgba(138, 43, 226, 1), 0 0 30px rgba(138, 43, 226, 0.5);
    }
}

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

/* プレイヤー中の表示を透明度で調整 */
.playing-character {
    width: 150px;  /* 150px固定 */
    height: 150px; /* 正方形 */
    margin: 0 auto;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 15px;
    border: 3px solid rgba(147, 51, 234, 0.8);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.6), inset 0 0 10px rgba(147, 51, 234, 0.3);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px) rotate(-2deg);
    }
    75% {
        transform: translateY(-5px) rotate(2deg);
    }
}

@keyframes floatUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100px);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes explode {
    from {
        opacity: 1;
        transform: translate(0, 0);
    }
    to {
        opacity: 0;
        transform: translate(var(--x), var(--y));
    }
}

@keyframes fly {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(100px) translateY(-20px);
    }
    50% {
        transform: translateX(150px) translateY(20px);
    }
    75% {
        transform: translateX(80px) translateY(-10px);
    }
}

@keyframes haunt {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
        opacity: 0.7;
    }
}

/* ===================================
   クライマックス演出アニメーション
   =================================== */

/* グロー パルス効果 */
@keyframes glow-pulse {
    0% {
        filter: brightness(1) drop-shadow(0 0 20px #9333ea);
    }
    100% {
        filter: brightness(1.8) drop-shadow(0 0 40px #ffd700) drop-shadow(0 0 60px #ff8c00);
    }
}

/* 背景パルス効果 */
@keyframes background-pulse {
    0% {
        filter: brightness(1) contrast(1);
    }
    100% {
        filter: brightness(1.3) contrast(1.2) saturate(1.5);
    }
}

/* クライマックス パーティクル爆発 */
@keyframes climax-explosion {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) scale(0.3);
    }
}

/* 画面フラッシュ効果 */
@keyframes flash-pulse {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    20% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
    }
}

/* ===================================
   横画面推奨アニメーション
   =================================== */
@keyframes rotate-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(15deg);
        opacity: 0.8;
    }
}

@keyframes phone-tilt {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes arrow-bounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

@keyframes phone-rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(90deg);
    }
}

/* ===================================
   レスポンシブデザイン
   =================================== */

/* 全デバイス統一設定 - 70% × 70% */
/* 個別のデバイス設定は不要、基本設定で統一 */"

/* 統一設定により個別の高さ制限調整は不要 */

/* 固定サイズなのでモバイル対応はコンテナ全体のスケールで制御 */