/* 発音チェック (study/pronunciation/) の画面固有スタイル。共通部品は study_app.css */

/* hidden 属性を display 指定 (.sa-btn の inline-flex など) より優先する */
#pr-app [hidden], .pr-sheet [hidden] { display: none !important; }

/* ---------- 見出し ---------- */
.pr-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.pr-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: #2e8b7a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pr-hero-icon .material-symbols-outlined { font-size: 42px; }
.pr-beta { vertical-align: middle; margin-left: 4px; position: relative; top: -2px; }
.pr-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* ---------- セクションへのリンク ---------- */
.pr-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 8px; }
.pr-jump { display: flex; gap: 8px; }
.pr-jump-link {
    font-weight: 800;
    font-size: 14px;
    color: var(--sa-green);
    padding: 6px 14px;
    border: 2px solid var(--sa-line);
    border-radius: 999px;
}
.pr-jump-link:hover { background: var(--sa-soft); color: var(--sa-green-dark); }

/* ---------- 苦手な音 ---------- */
.pr-weak { margin-top: 16px; }
.pr-weak-title { display: flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 10px; }
.pr-weak-title .material-symbols-outlined { color: var(--sa-orange); }
.pr-weak-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-weak-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid var(--sa-line);
    border-radius: 999px;
    background: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}
.pr-weak-chip:hover { background: var(--sa-soft); }
.pr-weak-score { font-size: 12px; color: #fff; background: var(--sa-orange); border-radius: 999px; padding: 1px 7px; }

/* ---------- カード ---------- */
.pr-group-lead { color: var(--sa-muted); font-size: 14px; margin: -6px 0 12px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.pr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px 12px;
    border: 2px solid var(--sa-line);
    border-bottom-width: 4px;
    border-radius: var(--sa-radius);
    background: #fff;
    color: var(--sa-text);
    cursor: pointer;
    font-family: inherit;
}
.pr-card:hover { background: var(--sa-soft); }
.pr-card:active { transform: translateY(2px); border-bottom-width: 2px; }
.pr-card-label { font-size: 30px; font-weight: 900; line-height: 1.2; color: var(--sa-green); }
.pr-card.is-consonant .pr-card-label { color: var(--sa-blue-dark); font-size: 24px; }
.pr-card.is-tone .pr-card-label { color: var(--sa-purple); font-size: 24px; }
.pr-card-word { font-size: 13px; font-weight: 700; text-align: center; }
.pr-card-meaning { color: var(--sa-muted); font-weight: 400; }
.pr-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 30px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}
.pr-card-dialect { font-size: 11px; color: var(--sa-orange-dark); font-weight: 700; }

/* 点数の色 (カード・結果で共通) */
.pr-card-badge.is-great, .pr-score.is-great { background: var(--sa-green); }
.pr-card-badge.is-good, .pr-score.is-good { background: var(--sa-blue); }
.pr-card-badge.is-fair, .pr-score.is-fair { background: var(--sa-orange); }
.pr-card-badge.is-poor, .pr-score.is-poor { background: var(--sa-red); }

.pr-note { color: var(--sa-muted); font-size: 12px; margin-top: 28px; }

/* ---------- 練習パネル ---------- */
/* 開いている間は後ろをスクロールさせない。スクロールバーの幅を残して、背景が横にずれないようにする */
html.pr-sheet-open { overflow: hidden; scrollbar-gutter: stable; }
.pr-sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.pr-sheet[hidden] { display: none; }
.pr-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.pr-sheet-panel {
    position: relative;
    width: min(480px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 24px 20px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}
.pr-sheet-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sa-muted);
    cursor: pointer;
}
.pr-sheet-close:hover { background: var(--sa-soft); }
.pr-sheet-head { text-align: center; }
.pr-sheet-label { font-size: 44px; font-weight: 900; color: var(--sa-green); line-height: 1.2; }
.pr-sheet-word { font-size: 22px; font-weight: 800; margin-top: 4px; }
.pr-sheet-meaning { font-size: 14px; font-weight: 400; color: var(--sa-muted); margin-left: 8px; }
.pr-sheet-region {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--sa-ok-bg);
    color: var(--sa-green-dark);
    font-size: 12px;
    font-weight: 800;
}
.pr-sheet-tip { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--sa-soft); font-size: 14px; }
.pr-sheet-tip p { margin: 0; }
.pr-sheet-tip p + p { margin-top: 6px; color: var(--sa-orange-dark); font-weight: 700; }
.pr-sheet-region.is-dialect { background: #fbf2e3; color: #8a6424; }
.pr-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pr-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--sa-line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}
.pr-area.is-selected { border-color: var(--sa-green); background: var(--sa-ok-bg); }
.pr-area-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; cursor: pointer; }
.pr-area-title input { accent-color: var(--sa-green); margin: 0; }
.pr-area-city { font-size: 11px; font-weight: 400; color: var(--sa-muted); }
.pr-area-note { margin: 0; font-size: 13px; flex: 1; }
.pr-area .sa-btn { width: 100%; gap: 4px; }
.pr-sheet-actions { display: grid; gap: 10px; margin-top: 16px; }
.pr-sheet-actions .sa-btn { width: 100%; gap: 6px; }
.pr-sheet-actions .sa-btn.is-recording { background: var(--sa-red); animation: pr-pulse 1.2s ease-in-out infinite; }
@keyframes pr-pulse { 50% { opacity: .75; } }
.pr-status { min-height: 20px; margin-top: 12px; font-size: 14px; text-align: center; color: var(--sa-muted); }
.pr-status.is-error { color: var(--sa-red-dark); }
.pr-status.is-rec { color: var(--sa-red-dark); font-weight: 700; }
.pr-status.is-info { color: var(--sa-orange-dark); }

.pr-result { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 14px; border: 2px solid var(--sa-line); border-radius: 16px; }
.pr-result[hidden] { display: none; }
.pr-score {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    padding-top: 22px;
    color: #fff;
}
.pr-score-num { font-size: 32px; font-weight: 900; line-height: 1; }
.pr-score-unit { font-size: 13px; font-weight: 700; margin-left: 2px; }
.pr-result-body { min-width: 0; }
.pr-result-grade { font-size: 17px; font-weight: 900; }
.pr-result-heard { font-size: 13px; color: var(--sa-muted); margin-top: 2px; }
.pr-result-advice { font-size: 14px; margin-top: 6px; }

.pr-remaining { margin-top: 12px; font-size: 12px; color: var(--sa-muted); text-align: center; }
.pr-premium-pr {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fbf2e3;
    color: #8a6424;
    font-size: 14px;
    font-weight: 700;
}
.pr-premium-pr:hover { color: #8a6424; filter: brightness(.98); }
.pr-premium-pr-link { margin-left: auto; white-space: nowrap; text-decoration: underline; }
.pr-guest { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #e8f5fa; font-size: 14px; text-align: center; }
.pr-guest p { margin: 0 0 10px; }
.pr-guest-actions { display: flex; justify-content: center; gap: 8px; }

@media (max-width: 700px) {
    .pr-hero { gap: 14px; }
    .pr-hero-icon { width: 56px; height: 56px; border-radius: 16px; }
    .pr-hero-icon .material-symbols-outlined { font-size: 32px; }
    .pr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .pr-card { padding: 14px 4px 10px; }
    .pr-card-label { font-size: 26px; }
    .pr-card.is-consonant .pr-card-label, .pr-card.is-tone .pr-card-label { font-size: 19px; }
    .pr-card-word { font-size: 12px; }
    .pr-sheet { align-items: flex-end; }
    .pr-sheet-panel { width: 100%; max-height: 92%; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
