body {
    font-family: sans-serif;
    background: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    height: auto !important;
    overflow: visible !important;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


#result {
    overflow: visible !important; /* 隠れている部分を強制的に出す */
    height: auto !important;     /* 高さを固定せず中身に合わせる */
    background-color: white;     /* 背景が透明だと真っ白に見えることがある */
}

textarea {
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

button {
    padding: 10px 25px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

button:hover {
    background: #34495e;
}

.hidden {
    display: none !important;
}

/* 報酬・保存エリア全体の調整 */
/* 保存エリア：リワード用からシンプルに書き換え */
.save-area {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

#save-image-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

/* フッターデザイン */
.site-footer {
    margin-top: 60px;
    padding: 40px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-links a {
    margin: 0 15px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ポリシーモーダル */
#policy-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
}
.modal-content {
    background: white; padding: 30px; border-radius: 10px; max-width: 500px;
}

/* 「JPGダウンロード」ボタン */
#pdf-download-btn {
    background-color: #27ae60; /* 成功・保存をイメージする緑系 */
    color: white;
}

#pdf-download-btn:hover {
    background-color: #219150;
    transform: translateY(-2px);
}

/* ボタン同士が重ならないようにマージンを追加 */
.reward-area button + button {
    margin-top: 15px;
}

/* 広告モーダルの背景 */
#video-ad-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* 広告の中身 */
.ad-content {
    width: 90%;
    max-width: 400px;
    background: #222;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
}

.ad-video-placeholder {
    width: 100%;
    height: 200px;
    background: #444;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

/* プログレスバー */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #555;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

#ad-progress-bar {
    width: 0%;
    height: 100%;
    background: #f1c40f;
    transition: width 1s linear; /* 1秒ごとにスムーズに伸びる */
}

/* バナー全体のコンテナ */
.ad-banner-top, .ad-banner-bottom {
    width: 100%;
    margin: 20px auto;
    text-align: center;
}

/* 728x90サイズの枠（レスポンシブ対応） */
.ad-placeholder-728x90 {
    display: inline-block;
    max-width: 100%; /* 画面からはみ出さないように */
    background: #fdfdfd;
    border: 1px solid #eee;
    overflow: hidden;
}

.ad-placeholder-728x90 img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* モバイル用の調整：画面が狭いときはバナーを少し小さく見せる */
@media (max-width: 768px) {
    .ad-banner-top {
        margin: 10px 0;
    }
    .ad-label {
        transform: scale(0.8);
    }
}

/* 共通の広告ラベル */
.ad-label {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

/* ローディング中の広告（四角形 300x250想定） */
.ad-space-loading {
    margin-top: 30px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
}

/* 結果の間の広告（横長 728x90想定） */
.ad-space-inline {
    margin: 30px 0;
    padding: 10px 0;
    text-align: center;
}

.ad-placeholder, .ad-placeholder-horizontal {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 1px dashed #ccc;
    min-height: 100px;
}

.result-header {
    text-align: center; /* 中央寄せにするとインパクトが出ます */
    margin-top: -10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #ddd;
}

.result-header h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* メインの大きな星専用のスタイル */
#main-star-rating {
    font-size: 2rem; /* サイズを大きく */
    letter-spacing: 8px;
    filter: drop-shadow(0 0 2px rgba(241, 196, 15, 0.5)); /* ほんのり光らせる */
}

/* ついでに、平均スコアの数字も強調 */
#avg-score {
    color: #e67e22;
    font-size: 2.0rem;
}

/* チャートのサイズ固定 */
.chart-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

/* 読者カードと編集者エリアの間の区切り */
.editor-feedback-area {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px dashed #ddd;
}

/* 編集部総括のボックスを少しプロっぽく */
.editor-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    border-left: 10px solid #2c3e50;
    margin-top: 20px;
}

.editor-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* 良い点・悪い点の横並び */
.editor-points {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.point-box {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
}

.good {
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.bad {
    background-color: #fff3e0;
    border: 1px solid #ffe0b2;
}

.point-box h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.point-box ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.point-box li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* スマホ対応：縦並びに切り替え */
@media (max-width: 600px) {
    .editor-points {
        flex-direction: column;
    }
}

/* 読者リスト全体 */
#reader-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* 読者カード（横長） */
.card {
    display: flex;
    gap: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* アイコン（仮：丸いグレーの円） */
.reader-icon {
    width: 50px;
    height: 50px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* 右側のコンテンツ */
.reader-content {
    flex-grow: 1;
}

/* 名前・属性・スコアの1行目 */
.reader-header {
    margin-bottom: 5px;
}

.reader-name { font-weight: bold; font-size: 1.1rem; margin-right: 10px; }
.reader-meta { font-size: 0.85rem; color: #777; } /* 性別・age用 */

/* 星と数字の2行目 */
.reader-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.reader-score { font-size: 0.9rem; color: #444; font-weight: bold; }

/* コメントの3行目 */
.reader-comment {
    margin: 0;
    font-size: 1.0rem;
    color: #333;
    line-height: 1.5;
}

.card h4 {
    margin: 0;
    color: #e67e22;
}

/* 星の土台（共通） */
.star-rating {
    position: relative;
    display: inline-block;
    font-size: 1.2rem;
    color: #ddd; /* 塗られていない星の色（グレー） */
    letter-spacing: 2px;
    cursor: default;
}

/* 塗りつぶされた星（黄色） */
.star-rating::before {
    content: "★★★★★";
    position: absolute;
    top: 0;
    left: 0;
    width: var(--rating-width); /* ここがJSで動的に変わる（重要） */
    color: #f1c40f; /* 塗りつぶしの色（ゴールド） */
    overflow: hidden;
    white-space: nowrap;
}

/* 読者カード内の星の位置調整 */
.reader-stars-container {
    margin-left: 10px;
    vertical-align: middle;
}

.editor-section {
    margin-top: 30px;
    padding: 20px;
    background: #eee;
    border-radius: 5px;
}

#loading {
    text-align: center;
    font-weight: bold;
    color: #3498db;
}
