/**
 * World QV2 - 国旗当てクイズゲーム
 * メインスタイルシート
 * 
 * 設計方針:
 * - モバイルファースト・レスポンシブデザイン
 * - 多言語フォント対応
 * - アクセシビリティ重視
 * - 視覚的フィードバック重視
 * 
 * 構成:
 * 1. リセット・ベーススタイル
 * 2. レイアウト・コンテナ
 * 3. 画面別スタイル
 * 4. コンポーネント別スタイル
 * 5. アニメーション・エフェクト
 */

/* ========================================
   リセット・ベーススタイル
   ======================================== */

/* 全要素のマージン・パディングをリセット（ブラウザ間の表示統一のため） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* パディング・ボーダーを幅に含める */
}

/* ボディ要素の基本設定（アプリ全体の基調となるスタイル） */
body {
    /* 多言語対応フォントスタック（読みやすさのため） */
    font-family: 'Noto Sans JP', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* グラデーション背景（視覚的魅力のため） */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 最小高さを画面全体に設定（コンテンツが少なくても背景を表示するため） */
    min-height: 100vh;
    
    /* テキスト色と行間設定（読みやすさのため） */
    color: #333;
    line-height: 1.6;
}

/* 英語表示時のフォント調整 */
html[lang="en"] body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   言語切り替えボタン
   ======================================== */

/* 言語切り替えボタンの配置とスタイル */
.language-switch-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    
    /* ボタンスタイル */
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    
    /* テキストスタイル */
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    
    /* インタラクション */
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* ガラスモーフィズム効果 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 言語切り替えボタンのホバー効果 */
.language-switch-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 言語切り替えボタンのアクティブ状態 */
.language-switch-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .language-switch-btn {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ========================================
   レイアウト・コンテナ
   ======================================== */

/* メインコンテナ（全画面共通のレイアウト制御のため） */
.container {
    max-width: 600px;    /* 最大幅制限（大画面での読みやすさのため） */
    margin: 0 auto;      /* 中央配置 */
    padding: 20px;       /* 内側余白（画面端からの距離確保のため） */
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* Back Button */
.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) translateX(-5px);
}

.back-icon {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Game Section */
.game-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.game-btn {
    font-size: 1.2rem;
    padding: 18px 36px;
    margin-bottom: 30px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #333;
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* 開発秘話ボタン用のスタイル */
.tertiary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
}

.tertiary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #555;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.dev-story-container {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px 0;
}

.dev-story-btn {
    max-width: 200px;
    margin: 0;
    display: flex;
}

.dev-story-btn .btn-icon {
    font-size: 0.9rem;
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 20px;
}

.leaderboard-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard-content {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.genre-leaderboard {
    margin-bottom: 20px;
}

.genre-leaderboard:last-child {
    margin-bottom: 0;
}

.genre-title {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

.leaderboard-rank {
    font-weight: 700;
    color: #667eea;
    min-width: 30px;
}

.leaderboard-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.leaderboard-score {
    font-weight: 600;
    color: #e74c3c;
}

/* Genre Selection */
.genre-selection {
    display: grid;
    gap: 20px;
}

.genre-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.genre-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.genre-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.genre-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.genre-info p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Game Screen */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-stats {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.score, .question-number {
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.question-section {
    text-align: center;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

/* 国旗選択肢コンテナ - 10択まで対応 */
.flag-options {
    display: grid;
    /* 10択対応: 最小幅を80pxに縮小、最大5列まで表示 */
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;                    /* 間隔を少し狭めて10択でも見やすく */
    max-width: 700px;             /* 最大幅を拡張して10択に対応 */
    margin: 0 auto;
}

/* 国旗選択肢 - 10択でも適切なサイズを維持 */
.flag-option {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;          /* 角丸を少し小さく */
    padding: 20px;                /* パディングを元に戻す */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;             /* 最小高さを縮小して10択に対応 */
    aspect-ratio: 1;              /* 正方形を維持 */
    
    /* 10択時の可読性向上 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 国旗絵文字のスタイル */
.flag-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

/* 国旗コンテナ - 画像と絵文字の切り替え用 */
.flag-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 国旗画像のスタイル */
.flag-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flag-option:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.flag-option.correct {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    animation: correctPulse 0.6s ease-out;
}

.flag-option.wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    animation: wrongShake 0.6s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 国旗絵文字 - 10択対応でサイズを調整 */
.flag-emoji {
    font-size: 3rem;              /* 4remから3remに縮小（10択対応） */
    line-height: 1;
    display: block;
    
    /* 10択時の視認性向上 */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
}
    word-wrap: break-word;
}

/* Result Screen */
.result-content {
    text-align: center;
}

.final-score {
    margin-bottom: 30px;
}

.final-score h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.genre-display {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* World Map */
.world-map {
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
}

.world-map h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.map-wrapper {
    position: relative;
    width: 100%;
    display: inline-block;
}

.world-map-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: block;
    background-color: #f8f9fa;
    object-fit: contain;
}

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

.country-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: markerPulse 2s infinite;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.country-marker.correct {
    background-color: #27ae60;
}

.country-marker.wrong {
    background-color: #e74c3c;
}

.country-marker.selected {
    background-color: #3498db;
    width: 20px;
    height: 20px;
    border: 4px solid white;
}

.capital-label {
    position: absolute;
    transform: translate(-50%, 0);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    text-align: center;
    z-index: 20;
    min-width: 120px;
}

.capital-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 2px;
}

.country-name {
    font-weight: 500;
    color: #7f8c8d;
    font-size: 0.8rem;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-marker.selected {
    background-color: #3498db;
    width: 14px;
    height: 14px;
    border: 3px solid white;
}

@keyframes markerPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2); 
        opacity: 0.8; 
    }
}

/* High Score Form */
.high-score-form {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    border: 2px solid #27ae60;
}

.high-score-form h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 10px;
}

.high-score-form p {
    color: #333;
    margin-bottom: 15px;
}

.high-score-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(39, 174, 96, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.high-score-form input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-actions .primary-btn,
.result-actions .secondary-btn {
    flex: 1;
    min-width: 150px;
    margin: 0;
}

/* Messages */
.correct-message,
.wrong-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    text-align: center;
    min-width: 200px;
}

.correct-message.show,
.wrong-message.show {
    display: block;
    animation: popIn 0.3s ease-out;
}

.correct-content,
.wrong-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.correct-icon,
.wrong-icon {
    font-size: 3rem;
}

.correct-message p,
.wrong-message p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.correct-message {
    border: 3px solid #27ae60;
}

.wrong-message {
    border: 3px solid #e74c3c;
}

/* Primary Button */
.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.primary-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Comments Section */
.comments-section {
    margin-top: 20px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.2rem;
}

/* Comments List */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

.comment-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-nickname {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

.comment-time {
    font-size: 0.8rem;
    color: #666;
}

.comment-text {
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.no-comments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Form Styles */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.label-icon {
    font-size: 1.1rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    resize: none;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-textarea {
    min-height: 80px;
}

.char-counter {
    position: absolute;
    right: 15px;
    bottom: -25px;
    font-size: 0.85rem;
    color: #666;
}

.submit-btn {
    margin-top: 20px;
    margin-bottom: 0;
}

/* Messages */
.success-message,
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    text-align: center;
    min-width: 300px;
}

.success-message.show,
.error-message.show {
    display: block;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-content,
.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.success-icon,
.error-icon {
    font-size: 3rem;
}

.success-message p,
.error-message p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 25px 20px;
    }
    
    .back-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .primary-btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .dev-story-btn {
        max-width: 180px;
        font-size: 0.8rem;
        padding: 8px 16px;
    }
    
    .dev-story-container {
        margin: 8px 0 15px 0;
    }
    
    /* 10択対応 - タブレット向け調整 */
    .flag-options {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 12px;
        max-width: 100%;
    }
    
    .flag-option {
        padding: 15px;
        min-height: 70px;
        border-radius: 12px;
    }
    
    .flag-emoji {
        font-size: 2.5rem;
    }
    
    .comment-item {
        padding: 15px;
    }
    
    .success-message,
    .error-message {
        margin: 0 20px;
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    /* 10択対応 - スマートフォン向け調整 */
    .flag-options {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
        max-width: 100%;
    }
    
    .flag-option {
        padding: 12px;
        min-height: 60px;
        border-radius: 10px;
        border-width: 2px;
    }
    
    .flag-emoji {
        font-size: 2rem;
    }
    
    .title-icon {
        font-size: 2rem;
    }
    
    .dev-story-btn {
        max-width: 160px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .dev-story-container {
        margin: 5px 0 10px 0;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ========================================
   ゲームルール画面スタイル
   ======================================== */

/* ゲームルール画面のメインコンテンツ */
.rules-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* QRコードセクション */
.qr-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-code {
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 10px;
}

.qr-text {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.game-url {
    font-size: 14px;
    color: #333;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    margin: 0;
}

/* ルールセクション */
.rules-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    text-shadow: none;
}

.section-icon {
    font-size: 28px;
}

/* ルールアイテム */
.rule-item {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border-left: 4px solid rgba(102, 126, 234, 0.8);
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-item h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-item p {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
}

/* ジャンル別ルール */
.genre-rule {
    margin-bottom: 25px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.genre-rule:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.genre-rule:last-child {
    margin-bottom: 0;
}

.genre-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.genre-header .genre-icon {
    font-size: 24px;
}

.genre-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

/* 難易度表示 */
.difficulty {
    font-size: 16px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.difficulty.easy {
    background: rgba(76, 175, 80, 0.3);
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.difficulty.medium {
    background: rgba(255, 152, 0, 0.3);
    color: #ffcc02;
    border: 1px solid rgba(255, 152, 0, 0.5);
}

.difficulty.hard {
    background: rgba(244, 67, 54, 0.3);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.genre-rule p {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 8px;
}

.genre-rule p:last-child {
    margin-bottom: 0;
}

.genre-rule p strong {
    color: #000;
    font-weight: 600;
}

/* ルール画面のアクションボタン */
.rules-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.large-btn {
    font-size: 18px;
    padding: 18px 40px;
    min-width: 250px;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .rules-content {
        padding: 0 15px;
    }
    
    .qr-section,
    .rules-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .section-icon {
        font-size: 24px;
    }
    
    .rule-item {
        padding: 15px;
    }
    
    .rule-item h3 {
        font-size: 16px;
    }
    
    .rule-item p {
        font-size: 14px;
    }
    
    .genre-rule {
        padding: 20px;
    }
    
    .genre-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .genre-header h3 {
        font-size: 18px;
    }
    
    .genre-rule p {
        font-size: 14px;
    }
    
    .large-btn {
        font-size: 16px;
        padding: 15px 30px;
        min-width: 200px;
    }
    
    .qr-code {
        width: 120px;
        height: 120px;
    }
    
    .game-url {
        font-size: 12px;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .difficulty {
        font-size: 14px;
        padding: 3px 8px;
    }
    
    .genre-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .genre-header .genre-icon {
        font-size: 20px;
    }
}
