/* WordPress都道府県ゲーム プラグイン スタイル */

/* ベーススタイル - WordPressテーマの影響を受けないようにリセット */
.prefecture-game-wrapper {
    font-family: 'Arial', sans-serif !important;
    line-height: 1.4 !important;
    color: #333 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: relative !important;
}

.prefecture-game-wrapper * {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* タイトル */
.prefecture-game-wrapper .pg-title {
    color: white !important;
    font-size: 2.5em !important;
    margin-bottom: 30px !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3) !important;
    text-align: center !important;
    font-weight: bold !important;
}

/* メインコンテナ */
.prefecture-game-wrapper .pg-main-container {
    display: flex !important;
    max-width: 1600px !important;
    margin: auto !important;
    gap: 20px !important;
    align-items: flex-start !important;
}

/* ゲームコンテナ */
.prefecture-game-wrapper .pg-game-container {
    flex: 1 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 30px !important;
    border-radius: 20px !important;
    box-shadow: 0px 8px 32px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(10px) !important;
    text-align: center !important;
}

/* サイドバー共通 */
.prefecture-game-wrapper .pg-sidebar,
.prefecture-game-wrapper .pg-left-sidebar {
    width: 300px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 20px !important;
    border-radius: 20px !important;
    box-shadow: 0px 8px 32px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(10px) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.prefecture-game-wrapper .pg-left-sidebar {
    width: 280px !important;
}

/* セットアップセクション */
.prefecture-game-wrapper .pg-setup-section {
    margin-bottom: 30px !important;
}

.prefecture-game-wrapper .pg-group-setup,
.prefecture-game-wrapper .pg-time-limit-section {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 20px 0 !important;
    flex-wrap: wrap !important;
}

/* ラベル */
.prefecture-game-wrapper label {
    font-weight: bold !important;
    color: #333 !important;
    font-size: 1.1em !important;
}

/* 入力フィールドとセレクト */
.prefecture-game-wrapper input,
.prefecture-game-wrapper select {
    font-size: 1.1em !important;
    padding: 12px 15px !important;
    border: 2px solid #667eea !important;
    border-radius: 12px !important;
    background-color: #fff !important;
    transition: all 0.3s ease !important;
    min-width: 150px !important;
    font-family: inherit !important;
}

.prefecture-game-wrapper input:focus,
.prefecture-game-wrapper select:focus {
    outline: none !important;
    border-color: #5a67d8 !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.prefecture-game-wrapper .pg-input {
    flex: 1 !important;
    max-width: 300px !important;
    min-width: 200px !important;
}

/* ボタン */
.prefecture-game-wrapper button {
    font-size: 1.1em !important;
    padding: 12px 25px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-family: inherit !important;
}

.prefecture-game-wrapper button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.prefecture-game-wrapper button:active {
    transform: translateY(0) !important;
}

.prefecture-game-wrapper .pg-reset-button {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* 入力コンテナ */
.prefecture-game-wrapper .pg-input-container {
    display: flex !important;
    justify-content: center !important;
    gap: 15px !important;
    margin: 30px 0 !important;
    flex-wrap: wrap !important;
}

/* タイマー */
.prefecture-game-wrapper .pg-timer {
    font-size: 2em !important;
    font-weight: bold !important;
    color: #dc3545 !important;
    margin: 10px 0 !important;
}

.prefecture-game-wrapper .pg-timer.warning {
    color: #fd7e14 !important;
    animation: pg-pulse 1s infinite !important;
}

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

/* 現在のグループ表示 */
.prefecture-game-wrapper .pg-current-group {
    font-size: 1.5em !important;
    font-weight: bold !important;
    margin: 15px 0 !important;
    padding: 15px !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    color: white !important;
}

/* 結果表示 */
.prefecture-game-wrapper .pg-result {
    font-size: 1.8em !important;
    margin: 20px 0 !important;
    font-weight: bold !important;
    padding: 15px !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
}

.prefecture-game-wrapper .pg-result.correct {
    background: #d4edda !important;
    color: #155724 !important;
    border: 2px solid #c3e6cb !important;
}

.prefecture-game-wrapper .pg-result.incorrect {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 2px solid #f5c6cb !important;
}

.prefecture-game-wrapper .pg-result.duplicate {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 2px solid #ffeaa7 !important;
}

/* チャートコンテナ */
.prefecture-game-wrapper .pg-chart-container {
    margin: 20px 0 !important;
    background: white !important;
    padding: 20px !important;
    border-radius: 15px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

.prefecture-game-wrapper .pg-chart-title {
    font-size: 1.3em !important;
    font-weight: bold !important;
    margin-bottom: 20px !important;
    color: #333 !important;
    text-align: center !important;
}

/* 棒グラフ */
.prefecture-game-wrapper .pg-bar-chart {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 15px !important;
    height: 200px !important;
    padding: 10px 0 !important;
}

.prefecture-game-wrapper .pg-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    min-width: 60px !important;
}

.prefecture-game-wrapper .pg-bar-fill {
    width: 40px !important;
    background: linear-gradient(180deg, #667eea, #764ba2) !important;
    border-radius: 8px 8px 0 0 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    min-height: 20px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    color: white !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
    padding-bottom: 5px !important;
}

.prefecture-game-wrapper .pg-bar-fill.active {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5) !important;
    transform: scale(1.05) !important;
}

.prefecture-game-wrapper .pg-bar-label {
    margin-top: 8px !important;
    font-size: 0.9em !important;
    font-weight: bold !important;
    color: #333 !important;
}

/* サイドバータイトル */
.prefecture-game-wrapper .pg-sidebar-title {
    font-weight: bold !important;
    font-size: 1.3em !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    border-bottom: 2px solid #667eea !important;
    padding-bottom: 10px !important;
}

/* 地方別残数表示 */
.prefecture-game-wrapper .pg-region-item {
    background: #f8f9fa !important;
    margin: 8px 0 !important;
    padding: 12px !important;
    border-radius: 10px !important;
    border-left: 4px solid #667eea !important;
    transition: all 0.3s ease !important;
}

.prefecture-game-wrapper .pg-region-item.completed {
    background: #d4edda !important;
    border-left-color: #28a745 !important;
}

.prefecture-game-wrapper .pg-region-item:hover {
    transform: translateX(3px) !important;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1) !important;
}

.prefecture-game-wrapper .pg-region-name {
    font-weight: bold !important;
    color: #333 !important;
    margin-bottom: 5px !important;
}

.prefecture-game-wrapper .pg-region-count {
    font-size: 0.9em !important;
    color: #666 !important;
}

.prefecture-game-wrapper .pg-region-count.completed {
    color: #28a745 !important;
    font-weight: bold !important;
}

/* 履歴統計 */
.prefecture-game-wrapper .pg-history-stats {
    background: #f8f9fa !important;
    padding: 15px !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
}

/* プログレスバー */
.prefecture-game-wrapper .pg-progress-bar {
    width: 100% !important;
    height: 20px !important;
    background: #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    margin: 10px 0 !important;
}

.prefecture-game-wrapper .pg-progress-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #28a745, #20c997) !important;
    transition: width 0.3s ease !important;
    border-radius: 10px !important;
}

/* 正解リスト */
.prefecture-game-wrapper .pg-correct-list {
    list-style: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.prefecture-game-wrapper .pg-prefecture-item {
    font-size: 1em !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
    transition: all 0.3s ease !important;
    animation: pg-slideIn 0.5s ease !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.prefecture-game-wrapper .pg-prefecture-item .pg-group-badge {
    background: rgba(255,255,255,0.3) !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8em !important;
}

@keyframes pg-slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.prefecture-game-wrapper .pg-prefecture-item:hover {
    transform: translateX(-3px) !important;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2) !important;
}

/* ゲーム終了表示 */
.prefecture-game-wrapper .pg-game-over {
    font-size: 2em !important;
    color: #dc3545 !important;
    font-weight: bold !important;
    margin: 20px 0 !important;
    padding: 20px !important;
    background: #f8d7da !important;
    border: 2px solid #f5c6cb !important;
    border-radius: 15px !important;
}

.prefecture-game-wrapper .pg-winner {
    font-size: 2em !important;
    color: #28a745 !important;
    font-weight: bold !important;
    margin: 20px 0 !important;
    padding: 20px !important;
    background: #d4edda !important;
    border: 2px solid #c3e6cb !important;
    border-radius: 15px !important;
    animation: pg-celebrate 2s ease !important;
}

@keyframes pg-celebrate {
    0%, 100% { transform: scale(1); }
    25%, 75% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
}

/* レスポンシブデザイン */
@media (max-width: 1400px) {
    .prefecture-game-wrapper .pg-main-container {
        flex-direction: column !important;
    }
    
    .prefecture-game-wrapper .pg-left-sidebar,
    .prefecture-game-wrapper .pg-sidebar {
        width: 100% !important;
        max-height: 300px !important;
    }
    
    .prefecture-game-wrapper .pg-left-sidebar {
        order: -1 !important;
    }
}

@media (max-width: 600px) {
    .prefecture-game-wrapper .pg-game-container {
        padding: 20px !important;
        margin: 10px !important;
    }
    
    .prefecture-game-wrapper .pg-title {
        font-size: 2em !important;
    }
    
    .prefecture-game-wrapper .pg-group-setup,
    .prefecture-game-wrapper .pg-time-limit-section,
    .prefecture-game-wrapper .pg-input-container {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .prefecture-game-wrapper input,
    .prefecture-game-wrapper select,
    .prefecture-game-wrapper button {
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .prefecture-game-wrapper .pg-bar-chart {
        height: 150px !important;
        gap: 10px !important;
    }
    
    .prefecture-game-wrapper .pg-bar {
        min-width: 40px !important;
    }
    
    .prefecture-game-wrapper .pg-bar-fill {
        width: 30px !important;
    }
}

/* WordPressテーマとの競合防止 */
.prefecture-game-wrapper a {
    text-decoration: none !important;
}

.prefecture-game-wrapper img {
    max-width: none !important;
    height: auto !important;
}

.prefecture-game-wrapper ul,
.prefecture-game-wrapper ol {
    list-style: none !important;
}