body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    padding: 15px 12px;
    color: #1e293b;
    line-height: 1.6;
}

.card {
    background: #ffffff;
    max-width: 960px;
    margin: 0 auto 16px auto;
    padding: 20px 24px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 広告枠スタイル */
.ad-container { max-width: 960px; margin: 0 auto 16px auto; text-align: center; }
.ad-placeholder {
    background: #e2e8f0;
    border: 1px dashed #94a3b8;
    color: #64748b;
    font-size: 12px;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.top-ad .ad-placeholder { min-height: 50px; }
.bottom-ad .ad-placeholder { min-height: 80px; }
.modal-ad { margin: 15px 0; min-height: 60px; background: #f8fafc; }

.header-top { display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 22px; margin: 0; color: #0f172a; }
.header p { font-size: 14px; color: #64748b; margin: 6px 0 16px 0; }

/* プログレスバー */
.progress-bar-container { background: #f8fafc; border-radius: 10px; padding: 10px 14px; border: 1px solid #e2e8f0; }
.progress-bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: bold; color: #475569; margin-bottom: 6px; }
.progress-bar-track { background: #e2e8f0; height: 10px; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { background: #10b981; height: 100%; transition: width 0.4s ease; }

/* ステージグリッド */
.section-title { font-size: 16px; margin: 0 0 14px 0; color: #334155; }
.stages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stage-btn {
    border: 1px solid #cbd5e1; background: #fff; padding: 12px; border-radius: 10px; text-align: left; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 4px;
}
.stage-btn:hover:not(.locked) { border-color: #3b82f6; background: #eff6ff; }
.stage-btn.active { border-color: #3b82f6; background: #dbeafe; box-shadow: 0 0 0 2px #3b82f6; }
.stage-btn.cleared { border-color: #86efac; background: #f0fdf4; }
.stage-btn.locked { opacity: 0.55; background: #f8fafc; cursor: not-allowed; border-style: dashed; }
.stage-btn-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; color: #64748b; }
.stage-btn-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.stage-stars { color: #f59e0b; font-size: 12px; margin-top: 2px; }

/* 演奏カード */
.stage-info-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 15px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.badge { background: #3b82f6; color: white; font-size: 12px; font-weight: bold; padding: 3px 8px; border-radius: 6px; }
.stage-title { margin: 6px 0 4px 0; font-size: 18px; }
.stage-desc { margin: 0; font-size: 14px; color: #64748b; }
.stage-actions { display: flex; gap: 8px; align-items: center; }

.file-btn { background-color: #64748b; color: white; padding: 10px 14px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 13px; }
.file-btn input[type="file"] { display: none; }

.action-btn { background-color: #10b981; color: white; border: none; padding: 11px 20px; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.action-btn:hover { background-color: #059669; }
.sub-btn { background: #f1f5f9; border: 1px solid #cbd5e1; color: #475569; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }

/* 判定HUD */
.hud-box { background: linear-gradient(135deg, #0f172a, #1e293b); color: white; border-radius: 10px; padding: 14px 20px; margin-bottom: 16px; border: 2px solid #38bdf8; position: relative; }
.hud-timer { position: absolute; top: 10px; right: 15px; font-size: 13px; color: #94a3b8; font-family: monospace; }
.hud-main { display: flex; justify-content: space-around; align-items: center; padding-top: 10px; }
.target-box, .detected-box { text-align: center; }
.hud-label { font-size: 12px; color: #94a3b8; }
.big-note { font-size: 40px; font-weight: 800; margin: 2px 0; }
.target-box .big-note { color: #38bdf8; }
.detected-box .big-note { color: #fbbf24; }
.detected-box.match .big-note { color: #4ade80; }
.sub-info { font-size: 13px; color: #cbd5e1; }
.vs-arrow { font-size: 24px; color: #64748b; }

.notes-queue { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px 0; }
.note-badge { background: #334155; padding: 5px 12px; border-radius: 16px; font-size: 13px; white-space: nowrap; }
.note-badge.current { background: #38bdf8; color: #0f172a; font-weight: bold; box-shadow: 0 0 8px #38bdf8; }
.note-badge.cleared { background: #166534; color: #86efac; text-decoration: line-through; }
.score-wrapper { min-height: 250px; overflow-x: auto; }
.hidden { display: none !important; }

/* 解説カード */
.guide-card { background: #fdfdfd; border-left: 5px solid #3b82f6; }
.guide-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.guide-badge { background: #e0f2fe; color: #0369a1; font-size: 12px; font-weight: bold; padding: 3px 8px; border-radius: 6px; }
.guide-header h3 { margin: 0; font-size: 17px; color: #0f172a; }
.guide-body { font-size: 14px; color: #334155; }
.guide-point-box { background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px 16px; border-radius: 8px; margin-top: 10px; }
.guide-point-title { font-weight: bold; color: #2563eb; margin-bottom: 4px; }

/* 全体ナレッジカード */
.extra-knowledge-card h2 { font-size: 18px; margin-top: 0; color: #0f172a; }
.knowledge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; margin-top: 15px; }
.knowledge-item { background: #f8fafc; padding: 14px 16px; border-radius: 8px; border: 1px solid #e2e8f0; }
.knowledge-item h4 { margin: 0 0 6px 0; color: #1e293b; font-size: 14px; }
.knowledge-item p { margin: 0; font-size: 13px; color: #64748b; line-height: 1.5; }
.divider { border: 0; border-top: 1px solid #e2e8f0; margin: 24px 0; }
.extra-knowledge-card h3 { font-size: 16px; margin: 0 0 10px 0; }
.faq-list { margin: 0; padding-left: 20px; font-size: 13px; color: #475569; }
.faq-list li { margin-bottom: 8px; }

/* フッター */
.footer { text-align: center; padding: 25px 15px 40px 15px; font-size: 13px; color: #64748b; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-link { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }
.footer-link:hover { color: #1d4ed8; }
.footer-sep { color: #cbd5e1; }
.copyright { margin: 0; font-size: 12px; color: #94a3b8; }

/* モーダル共通 */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-content {
    background: white; padding: 28px; border-radius: 18px; text-align: center; max-width: 420px; width: 90%;
    position: relative;
}

/* インフォモーダル専用 */
.info-modal-content {
    max-width: 580px;
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px 30px;
}
.close-x-btn {
    position: absolute; top: 16px; right: 18px; background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer;
}
.info-title { font-size: 20px; margin-top: 0; color: #0f172a; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.info-body { font-size: 14px; color: #334155; line-height: 1.7; }
.info-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.info-table th, .info-table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.info-table th { background: #f8fafc; width: 30%; color: #475569; }

/* お問い合わせフォーム */
.contact-form { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: bold; color: #475569; }
.form-control {
    padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-control:focus { outline: none; border-color: #3b82f6; }
.contact-submit-btn {
    background-color: #2563eb; color: white; border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; margin-top: 6px;
}
.contact-submit-btn:hover { background-color: #1d4ed8; }

.trophy-icon { font-size: 52px; margin-bottom: 4px; }
/* モーダルの星マークのスタイリング */
.modal-stars { 
    font-size: 32px; 
    color: #f59e0b; 
    margin: 6px 0;
    letter-spacing: 4px; 
}

/* ボタンの長押しメニューや文字選択を禁止してスマホの反応を良くする */
#startChallengeBtn {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
