/* =====================================================
   都道府県ブロックマップゲーム - japan-prefecture-game.css
   プレフィックス: jpg-  ※テーマとの干渉を防ぐ
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=BIZ+UDGothic:wght@400;700&display=swap');

/* ルートラッパー：高さ固定・スクロールなし */
.jpg-root {
    font-family: 'BIZ UDGothic', sans-serif;
    background: #e8f4fd;
    width: 100%;
    height: 90vh;          /* 電子黒板に合わせて調整可 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1a2a3a;
    --jpg-navy: #1e3a5f;
    --jpg-gold: #d4af37;
}

/* ===== ヘッダー ===== */
.jpg-header {
    background: #1e3a5f;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    border-bottom: 2px solid #d4af37;
    flex-wrap: wrap;
}

.jpg-title {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    color: #d4af37;
    white-space: nowrap;
    margin: 0;
}

.jpg-btn-reset {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 0.9em;
    padding: 6px 14px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.jpg-btn-reset:hover { background: rgba(255,255,255,0.08); }

.jpg-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.jpg-score-badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 4px 14px;
    font-size: 0.85em;
    font-family: 'BIZ UDGothic', sans-serif;
    color: #fff;
}
.jpg-score-badge span {
    font-weight: 700;
    color: #d4af37;
}

/* ===== 全体進捗バー ===== */
.jpg-progress-wrap {
    height: 4px;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.jpg-progress-fill {
    height: 100%;
    background: #d4af37;
    width: 0%;
    transition: width 0.5s ease;
}

/* ===== メインエリア ===== */
.jpg-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ===== サイドバー ===== */
.jpg-sidebar {
    width: 160px;
    background: #1e3a5f;
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 12px 10px;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 1;
}
.jpg-sidebar h3 {
    font-family: 'BIZ UDGothic', sans-serif;
    color: #d4af37;
    font-size: 0.8em;
    margin: 0 0 10px;
    text-align: center;
}
.jpg-region-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 7px 8px;
    margin-bottom: 6px;
    transition: border-color 0.3s;
}
.jpg-region-block.complete { border-color: #d4af37; }
.jpg-region-name {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 0.76em;
    font-weight: 700;
    color: #ddd;
    margin-bottom: 4px;
}
.jpg-region-bar-wrap {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
}
.jpg-region-bar-fill {
    height: 100%;
    background: #d4af37;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s;
}
.jpg-region-count {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 0.68em;
    color: rgba(255,255,255,0.45);
    margin-top: 3px;
    text-align: right;
}

/* ===== 地図エリア ===== */
.jpg-map-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #e8f4fd;
}

.jpg-grid-scaler {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
}

.jpg-japan-grid {
    display: grid;
    gap: 2px;
    position: relative;
    flex-shrink: 0;
}

.jpg-bg-cell {
    background: #c5dff5;
    border: 1px solid #aacce8;
    border-radius: 2px;
}

/* ===== 都道府県ブロック ===== */
.jpg-pref-block {
    position: absolute;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: transparent;        /* 正解前は県名非表示 */
    border: 1px solid #9abcd4;
    text-align: center;
    line-height: 1.2;
    white-space: pre-line;
    background: #b0d0e8;
    transition: background 0.4s, color 0.4s, box-shadow 0.3s;
    user-select: none;
}
.jpg-pref-block.correct {
    color: #fff;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

@keyframes jpgPopIn {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.22); }
    70%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}
.jpg-pref-block.pop { animation: jpgPopIn 0.45s ease forwards; }

/* ===== 中央フローティング入力UI ===== */
.jpg-floating-input {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.jpg-result-msg {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: #d4af37;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
    min-height: 1.6em;
    text-align: center;
    pointer-events: none;
}

.jpg-input-panel {
    pointer-events: all;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(30,58,95,0.4);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.jpg-input-panel input {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 1.15em;
    padding: 8px 14px;
    border: 2px solid rgba(212,175,55,0.6);
    border-radius: 10px;
    background: rgba(255,255,255,0.85);
    color: #1a2a3a;
    outline: none;
    width: 220px;
    transition: all 0.2s;
}
.jpg-input-panel input::placeholder {
    font-family: 'BIZ UDGothic', sans-serif;
    color: rgba(30,58,95,0.45);
}
.jpg-input-panel input:focus {
    background: rgba(255,255,255,0.95);
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.25);
}

.jpg-btn-submit {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 1em;
    font-weight: 700;
    padding: 8px 18px;
    background: #d4af37;
    color: #1e3a5f;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s;
}
.jpg-btn-submit:hover { filter: brightness(1.1); }

/* ===== 完成モーダル ===== */
.jpg-modal {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.jpg-modal.show { display: flex; }
.jpg-modal-box {
    font-family: 'BIZ UDGothic', sans-serif;
    background: #1e3a5f;
    border: 2px solid #d4af37;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}
.jpg-modal-box h2 {
    font-size: 2em;
    font-weight: 700;
    color: #d4af37;
    margin: 0 0 12px;
}
.jpg-modal-box p {
    font-size: 1em;
    color: rgba(255,255,255,0.8);
    margin: 0 0 24px;
}
.jpg-modal-box button {
    font-family: 'BIZ UDGothic', sans-serif;
    font-size: 1em;
    font-weight: 700;
    padding: 12px 28px;
    background: #d4af37;
    color: #1e3a5f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
