html { 
    overflow-y: scroll; 
}

body {
    font-family: "Noto Sans JP", system-ui, -apple-system, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.search-input:focus { 
    scroll-margin-top: 120px; 
}

.app-container {
    width: 100%;
    max-width: 500px;
    background-color: #f4f4f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    box-sizing: border-box;
}

.sticky-header {
    position: sticky;
    top: 0;
    background-color: #f4f4f9;
    width: 100%;
    z-index: 100;
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.banner-container { 
    width: 100%; 
    margin-bottom: 10px; 
    cursor: pointer; 
}

.banner-img { 
    width: 100%; 
    height: auto; 
    border-radius: 4px; 
    display: block; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.prefecture-container { 
    width: 100%; 
    margin-bottom: 10px; 
}

.controls-container { 
    width: 100%; 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    gap: 8px; 
}

/* 「?」ボタン */
.info-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    background: #fff;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: all 0.15s;
}

.info-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.info-btn:active {
    background: #edf2f7;
}

.search-toggle-btn, .sort-btn {
    padding: 8px 14px; 
    font-size: 0.85rem; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    background-color: #fff; 
    color: #333; 
    cursor: pointer; 
    transition: all 0.15s;
}

.search-toggle-btn:hover, .sort-btn:hover { 
    border-color: #3b82f6; 
    color: #3b82f6; 
}

.search-toggle-btn.active, .sort-btn.active { 
    background-color: #3b82f6; 
    border-color: #3b82f6; 
    color: #fff; 
}

.search-container { 
    width: 100%; 
    margin-bottom: 20px; 
}

.search-input { 
    width: 100%; 
    padding: 12px 16px; 
    font-size: 1rem; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    outline: none; 
    background-color: #fff; 
}

.search-input:focus { 
    border-color: #3b82f6; 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); 
}

.container { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    width: 100%; 
}

.vote-btn-custom { 
    transition: transform 0.1s ease, background-color 0.1s ease, box-shadow 0.1s ease; 
}

.vote-btn-custom:active { 
    transform: scale(0.95); 
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important; 
}

.vote-btn-custom:disabled { 
    cursor: wait; 
    opacity: 0.75; 
}

.vote-spinner {
    width: 16px; 
    height: 16px; 
    border: 2px solid rgba(255, 255, 255, 0.35); 
    border-top-color: #fff; 
    border-radius: 50%; 
    display: inline-block; 
    animation: vote-spin 0.6s linear infinite;
}

@keyframes vote-spin { 
    to { transform: rotate(360deg); } 
}

.footer {
    margin-top: 20px; 
    text-align: center; 
    color: #888; 
    font-size: 0.85rem;
}

.logo { 
    width: 90%; 
    max-width: 50px; 
    aspect-ratio: 1 / 1; 
    object-fit: contain; 
    display: block; 
    margin: 5px auto; 
}

/* モーダル共通（※フェードイン・アウト対応） */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 1000; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    
/* 初期状態：完全に透明＆非表示（クリック不可） */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    
    /* 背景のぼわーんとした変化（0.3秒） */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show { 
    /* 表示状態：不透明＆表示（操作可能） */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-box { 
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    padding: 28px 24px; 
    max-width: 320px; 
    width: 85%; 
    text-align: center; 
    
    /* 初期状態：少し下から小さめに配置 */
    transform: translateY(15px) scale(0.95);
    /* モーダル本体のふんわりとした動き（0.3秒） */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* モーダルが表示された時の白い箱の動き */
.modal-overlay.show .modal-box {
    /* 元の位置・大きさにふんわり戻る */
    transform: translateY(0) scale(1);
}

.modal-box p { 
    margin: 0 0 18px; 
    font-size: 1.05rem; 
    font-weight: bold; 
    color: #333; 
}

.modal-image { 
    width: 140px; 
    height: 240px; 
    object-fit: cover; 
    border-radius: 10px; 
    margin: 0 auto 14px; 
    display: block; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
}

.modal-box button { 
    padding: 10px 24px; 
    font-size: 0.9rem; 
    border: none; 
    border-radius: 8px; 
    background-color: #3b82f6; 
    color: #fff; 
    cursor: pointer; 
}

.modal-box-preview {
    max-width: 360px;
}

.preview-title {
    margin-bottom: 14px; 
    font-size: 1rem; 
    color: #333;
}

/* 画像プレビューモーダル用ヘッダー・タイトル調整 */
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
}

.preview-title-top {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    text-align: left;
}

/* 規定・注意事項モーダル用スタイル */
.terms-modal-box {
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.terms-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.terms-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1a202c;
    font-weight: bold;
}
.modal-close-x {
    width: auto !important;
    flex-shrink: 0;
    background: transparent !important; /* ←★背景を透明に強制指定 */
    border: none !important;
    color: #4a5568 !important; /* 文字色もはっきりしたグレーに */
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 8px !important;
    box-shadow: none !important;
}

.modal-close-x:hover {
    color: #1a202c !important;
    background: transparent !important;
}

.modal-close-x:active {
    color: #000000 !important;
    background: transparent !important;
}

.terms-modal-content {
    overflow-y: auto;
    font-size: 0.85rem;
    color: #4a5568;
    padding-right: 4px;
    line-height: 1.5;
}

.terms-modal-content h4 {
    margin: 14px 0 4px;
    font-size: 0.9rem;
    color: #1a202c;
    font-weight: bold;
}

.terms-modal-content h4:first-child {
    margin-top: 0;
}

.terms-modal-content p {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: normal;
    color: #4a5568;
}

.terms-modal-content ul {
    margin: 0 0 8px;
    padding-left: 1.2em;
    list-style-type: disc;
}

.terms-modal-content li {
    margin-bottom: 4px;
}

/* 画像プレビューモーダル用のスタイル */
.preview-image-container {
    position: relative;
    display: inline-block;
    margin: 0 auto 14px;
}

.preview-modal-image {
    width: 200px;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.preview-overlay-text {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    width: 90%;
    padding: 4px 8px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    pointer-events: none;
}

/* ボトムアップモーダル用のアニメーション調整 */
#prefModalOverlay {
    backdrop-filter: blur(2px);
}

/* Turnstile専用モーダル */
.turnstile-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

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

.modal-box-turnstile {
    max-width: 300px; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.turnstile-title {
    margin-bottom: 15px; 
    font-size: 0.95rem;
}

.turnstile-cancel-btn {
    margin-top: 15px; 
    background-color: #cbd5e1 !important; 
    color: #333 !important; 
    cursor: pointer;
}

/* ガイドエリア全体のデザイン */
.vote-guide-container {
    margin: 0; /* ラッパー側でmarginを設定するため0に変更 */
    flex: 1;   /* 余った横幅いっぱいに広げる */
    min-width: 0; /* flexアイテム内のテキスト省略(ellipsis)を正常動作させるため */
    box-sizing: border-box;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); */
}

/* 1行で並べるためのFlexコンテナ */
.guide-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

/* 2行をまとめる親要素 */
.guide-text-group {
    display: flex;
    flex-direction: column; /* 縦並びにする */
    /* gap: 0.5px;               1行目と2行目の間のすき間 */
    /* 左側のグラデーションバー装飾（2行分まとめて1本のラインにする場合） */
    padding-left: 10px;
    border-left: 3.5px solid #8b5cf6;
    border-image: linear-gradient(to bottom, #8b5cf6, #ec4899) 1;

    /* --- 背景絵の設定 --- */
    position: relative;
    background-image: url('statics/img/nogizaka46_logo.png'); /* 画像のパスを指定 */
    background-repeat: no-repeat;
    background-position: calc(0% + 12px) center; /* 右側に配置（お好みで center に変更可） */
    background-size: contain;         /* 枠内に収まるサイズ */
    border-radius: 0 8px 8px 0;
    
    /* 背景画像だけを「うっすら」表示させるための背景色＆重ね調整 */
    background-color: rgba(244, 244, 249, 0.85); /* 白背景で画像を約15%ほど透けさせる */
    background-blend-mode: overlay;
}

/* 各行のテキストスタイル */
.guide-main-text {
    font-size: 1.0rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.3;
    display: block; /* ブロック化して確実に改行 */
    color:#4c455c
    
    /* 文字のグラデーション指定 */
    /* background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; */
}
/* アコーディオン部分 */
.guide-accordion {
    flex-shrink: 0;           /* ボタン側が潰れないように設定 */
}

.guide-summary {
    font-size: 0.8rem;
    font-weight: bold;
    color: #66686b;
    background-color: #ffffff;
    border: 1px solid #dadada;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.guide-summary::-webkit-details-marker {
    display: none;
}

.guide-summary:hover {
    background-color: #c7c7c7;
}

/* 開いたときの展開エリア（1行の下に広がるよう配置） */
.guide-detail-content {
    position: absolute;
    top: 100%;
    left: -14px;
    right: -14px;
    margin-top: 10px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
    font-size: 0.8rem;
    color: #475569;
    text-align: left;
}

.guide-detail-title {
    font-weight: bold;
    text-align: center;
    margin: 0 0 6px 0;
    color: #1e293b;
}

.guide-steps {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}

.guide-steps li {
    margin-bottom: 4px;
}

.guide-note {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 8px 0 0 0;
    text-align: center;
}

/* ガイド枠と「?」ボタンを横並びにするラッパー */
.top-guide-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

/* =========================================
   ここから追加：グラフモーダル専用スタイル
========================================= */
.chart-modal-box {
    max-width: 440px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

.chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e293b;
}

/* 推し情報バッジ */
.favorite-info-badge {
    font-size: 0.85rem;
    font-weight: normal;
    color: #7e22ce;
    background-color: #f3e8ff;
    border: 1px solid #d8b4fe;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* 縦スクロール領域 */
.chart-scroll-container {
    overflow-y: auto;
    max-height: 55vh;
    padding-right: 4px;
    flex-grow: 1;
}

/* グラフの高さを固定してバーを太く保つ */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 600px; /* 14人のバーを確保するための高さ */
}

.info-btn {
    position: relative;
}

.info-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(147, 51, 234, 0.6); /* 乃木坂カラーっぽいパープル */
    animation: ripple 2.5s infinite ease-out;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

.info-btn.has-viewed::after {
    display: none;
}