/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.7;
    font-weight: 400;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 広告コンテナ */
.ad-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-header {
    margin-bottom: 30px;
}

.ad-footer {
    margin-top: 30px;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 728px;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #6c757d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.ad-content {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 広告が読み込まれた時のスタイル */
.ad-placeholder:has(.adsbygoogle) {
    border: 1px solid rgba(0, 123, 255, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.ad-placeholder:has(.adsbygoogle) .ad-label {
    background: #007bff;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
}

header h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

header h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: #6c757d;
    letter-spacing: 0.05em;
}

/* メインコンテンツ */
main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 40px;
}

/* セクション */
.input-section, .result-section, .info-section {
    margin-bottom: 40px;
}

.input-section h3, .result-section h3, .info-section h3 {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: #2c3e50;
    position: relative;
    padding-left: 16px;
}

.input-section h3:before, .result-section h3:before, .info-section h3:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 2px;
}

/* フォーム */
#analyzeForm {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.optional {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: normal;
}

.input-group input {
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #2c3e50;
    font-weight: 400;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.input-group input:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.input-group input::placeholder {
    color: #adb5bd;
    font-weight: 300;
}

/* セレクトボックス */
.input-group select {
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #2c3e50;
    font-weight: 400;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 48px;
}

.input-group select:focus {
    outline: none;
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.input-group select:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* ボタン */
.analyze-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 18px 48px;
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.analyze-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 123, 255, 0.3);
}

.analyze-btn:hover:before {
    left: 100%;
}

.analyze-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

/* 結果セクション */
.result-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(0, 123, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04);
    backdrop-filter: blur(10px);
}

.setting-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.setting-number, .confidence {
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0, 123, 255, 0.08);
    transition: all 0.3s ease;
}

.setting-number:hover, .confidence:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.setting-number .label, .confidence .label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.setting-number .value, .confidence .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.setting-number .value {
    color: #dc3545;
    font-weight: 600;
}

/* 新しい信頼度表示 */
.confidence-level {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.confidence-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.confidence-percentage {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
}

/* 信頼度レベル別の色分け */
.confidence-高 {
    color: #28a745;
}

.confidence-中 {
    color: #ffc107;
}

.confidence-低 {
    color: #dc3545;
}

/* 詳細結果 */
.detailed-results {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0, 123, 255, 0.08);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background: rgba(0, 123, 255, 0.02);
    border-radius: 8px;
    padding: 16px 12px;
    margin: 0 -12px;
}

.setting-name {
    font-weight: 500;
    color: #2c3e50;
}

.probability-bar {
    flex: 1;
    margin: 0 20px;
    height: 10px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.probability-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.probability-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.probability-text {
    font-weight: 500;
    color: #2c3e50;
    min-width: 60px;
    text-align: right;
}

/* 推奨アクションセクション */
.recommendation-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 123, 255, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 123, 255, 0.1);
}

.recommendation-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.recommendation-title:before {
    content: "💡";
    margin-right: 8px;
    font-size: 1.2rem;
}

.recommendation-text {
    font-size: 1rem;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 12px;
    font-weight: 500;
}

.game-count-info {
    font-size: 0.9rem;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* 情報セクション */
.info-section ul {
    list-style: none;
    padding-left: 0;
    background: rgba(0, 123, 255, 0.02);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(0, 123, 255, 0.08);
}

.info-section li {
    padding: 12px 0;
    padding-left: 32px;
    position: relative;
    color: #2c3e50;
    font-weight: 400;
    line-height: 1.6;
}

.info-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
    top: 12px;
}

/* ゲーム数別の目安セクション */
.game-count-tips {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(40, 167, 69, 0.1);
}

.game-count-tips h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.game-count-tips h4:before {
    content: "📊";
    margin-right: 8px;
    font-size: 1.2rem;
}

.game-count-tips ul {
    background: transparent;
    border: none;
    padding: 0;
}

.game-count-tips li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #495057;
    font-weight: 400;
    line-height: 1.5;
}

.game-count-tips li:before {
    content: "🎯";
    position: absolute;
    left: 0;
    top: 8px;
    font-size: 1rem;
}


/* フッター */
footer {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 123, 255, 0.08);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    /* 広告のレスポンシブ対応 */
    .ad-placeholder {
        min-height: 60px;
        padding: 15px;
        max-width: 100%;
    }
    
    .ad-label {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.2rem;
    }
    
    main {
        padding: 25px;
        border-radius: 15px;
    }
    
    .setting-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .probability-bar {
        margin: 0;
        width: 100%;
    }
    
    .analyze-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* 広告のモバイル対応 */
    .ad-placeholder {
        min-height: 50px;
        padding: 10px;
    }
    
    .ad-label {
        font-size: 0.5rem;
        padding: 1px 4px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
    
    .input-group input {
        padding: 12px;
        font-size: 1rem;
    }
    
    .setting-number .value, .confidence .value {
        font-size: 1.5rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeIn 0.5s ease;
}

/* ローディング状態 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .analyze-btn {
    background: #95a5a6;
    cursor: not-allowed;
}
