/* ============================================================
   ぱそトレ！ 5分間タイピングテスト専用「正典」スタイル (v20.7.28.Final)
   ------------------------------------------------------------
   【管理ルール】
   - 略記（shorthand）禁止。
   - 1024px絶対統治 ＆ 768px高 1画面収容ロジック。
   - 企業の採用試験を想定した、静寂と集中のデザイン。
   ============================================================ */

/* --- 1. 全体物理配置 ＆ 背景 --- */
body.test-body {
    background-color: #64758A;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ヘッダー：背景色と一体化（物理高を節約） */
body.test-body header {
    background-color: #64758A;
    width: 100%;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* 1024px中央配置 ＆ ヘッダー厚みの最小化 */
body.test-body .header-inner {
    max-width: 1024px;
    margin-top: 0px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-right: 0px;
    padding-bottom: 10px;
    padding-left: 0px;
}

/* アイコン物理ロック */
body.test-body .nav-icon {
    width: 18px !important;
    height: 18px !important;
}

/* ナビゲーション文字色 */
body.test-body .nav-item {
    color: #2c3e50 !important;
    text-decoration-line: none !important;
}

/* メインラッパー：ヘッダーから指示通り「30px」離す */
.test-main-wrapper {
    max-width: 1000px;
    margin-top: 30px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 15px;
    padding-left: 0px;
}

/* --- 2. 各種カード（白ボックス）共通定義 --- */
.test-info-card,
.test-stat-card,
.test-typing-card,
.test-result-card {
    background-color: #ffffff;
    box-sizing: border-box;
}

/* --- 3. ステータスカード（上段） --- */
.test-stat-card {
    width: 1000px;
    height: 65px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-group {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
}

.stat-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.4rem;
    font-weight: 900;
    color: #1e293b;
}

.stat-unit {
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    margin-left: 2px;
}

/* --- 4. タイピングメインカード（中央） --- */
.test-typing-card {
    width: 1000px;
    padding-top: 25px;
    padding-right: 40px;
    padding-bottom: 25px;
    padding-left: 40px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
    box-shadow: 0px 15px 40px rgba(0, 0, 0, 0.15);
}

.test-typing-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: #14b8a6;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 10px;
    margin-left: 0px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-text-display {
    background-color: #f8fafc;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: #e2e8f0;
    border-right-color: #e2e8f0;
    border-bottom-color: #e2e8f0;
    border-left-color: #e2e8f0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
    padding-top: 15px;
    padding-right: 25px;
    padding-bottom: 15px;
    padding-left: 25px;
    font-size: 1.55rem;
    line-height: 1.5;
    color: #1e293b;
    /* 物理高を85pxに固定し、1行収容を維持 */
    height: 85px;
    word-break: break-all;
    white-space: normal;
    box-sizing: border-box;
    text-align: left;
}

/* 下段：入力エリア（ハイブリッド方式：物理レイヤー） */
.test-input-view {
    background-color: #ffffff;
    position: relative !important;
    border-top-color: #cbd5e1;
    border-right-color: #cbd5e1;
    border-bottom-color: #cbd5e1;
    border-left-color: #cbd5e1;
}

/* サンプル（上段）の進捗：薄グレー */
.char-done {
    color: #cbd5e1 !important;
}

/* 下段入力エリア：確定文字 */
.char-confirmed {
    color: #1e293b;
}

/* 青いキャレット：高さをフォントサイズに同期 */
.char-current-caret {
    display: inline-block;
    width: 2px;
    height: 1.55rem;
    background-color: #2563eb;
    margin-right: -2px;
    vertical-align: middle;
    animation: test-blink 1s step-end infinite;
}

@keyframes test-blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* 本物の入力口：変換中のみ可視化。フォントサイズを 1.55rem に同期 */
.test-hidden-field {
    position: absolute !important;
    top: 0px;
    left: 0px;
    opacity: 0;
    z-index: 10;
    cursor: text;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.55rem;
    line-height: 1.5;
    color: #1e293b;
    background-color: transparent;
    border-top-style: none !important;
    border-right-style: none !important;
    border-bottom-style: none !important;
    border-left-style: none !important;
    outline-style: none !important;
    box-shadow: none !important;
    width: 95%;
    height: 3rem;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
}

/* ダメージエフェクト（ミス時） */
.test-input-view.damage-effect {
    background-color: #fff1f2 !important;
    border-top-color: #fda4af !important;
    border-right-color: #fda4af !important;
    border-bottom-color: #fda4af !important;
    border-left-color: #fda4af !important;
    transition-property: none !important;
}

/* --- 5. 準備・結果カード専用（860px幅：垂直高をさらに再圧縮） --- */
.test-info-card,
.test-result-card {
    width: 860px;
    margin-top: 10px; /* 15pxから圧縮 */
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    padding-top: 20px; /* 25pxから圧縮 */
    padding-right: 60px;
    padding-bottom: 20px; /* 30pxから圧縮 */
    padding-left: 60px;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    border-bottom-left-radius: 25px;
    box-shadow: 0px 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.test-card-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 15px; /* 20pxから圧縮 */
    margin-left: 0px;
}

.test-instruction {
    text-align: left;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 20px; /* 25pxから圧縮 */
    margin-left: 0px;
}

.test-lead-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #475569;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
}

.test-notice-box {
    background-color: #f8fafc;
    border-left-width: 6px;
    border-left-style: solid;
    border-left-color: #3498db;
    padding-top: 15px; /* 20pxから圧縮 */
    padding-right: 30px;
    padding-bottom: 15px; /* 20pxから圧縮 */
    padding-left: 30px;
    margin-top: 15px; /* 20pxから圧縮 */
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: left;
}

.notice-title {
    font-weight: 900;
    margin-bottom: 12px;
}

.test-notice-list {
    list-style-type: none;
    padding-left: 0px;
}

.test-notice-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #475569;
}

.test-notice-list li::before {
    content: "・";
    position: absolute;
    left: 0px;
    font-weight: 900;
}

/* --- 6. 結果画面詳細 (v20.7.28.Optimized) --- */
.res-header {
    font-size: 1.2rem; /* 少し控えめにし、ランクを際立たせる */
    font-weight: 900;
    color: #64748b;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 15px; /* 下の「判定ランク」ラベルとの距離 */
    margin-left: 0px;
}

.res-main-layout {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: flex-start; /* 指示通り「上揃え」に修正 */
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 25px;
    margin-left: 0px;
}

.res-rank-block {
    text-align: left; /* 左揃えにして安定感を出す */
}

.res-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 800;
    display: block;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 5px;
    margin-left: 0px;
}

.res-rank-text {
    font-size: 6.5rem;
    font-weight: 900;
    color: #2563eb;
    line-height: 1;
    margin-top: 15px; /* 判定ランク文字からの距離 */
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    /* 判定不可（複数文字）になっても位置が上下に跳ねないよう、最小高さを固定 */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 110px;
}

.res-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 300px;
    padding-top: 8px; /* さらに微圧縮 */
    padding-right: 0px;
    padding-bottom: 8px;
    padding-left: 0px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #f1f5f9;
}

.res-stat-label {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 800;
}

.res-stat-num {
    font-size: 1.8rem; /* 数値を少し大きくし視認性向上 */
    font-weight: 700;
    color: #1e293b;
}

/* アドバイスエリア：背景を目立たせ、ラベルなしでも重要性を伝える */
.res-advice-box {
    background-color: #f0f9ff; /* 落ち着いた水色で目立たせる */
    border-left-width: 6px;
    border-left-style: solid;
    border-left-color: #3498db;
    padding-top: 20px;
    padding-right: 30px;
    padding-bottom: 20px;
    padding-left: 30px;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 30px;
    margin-left: 0px;
    text-align: left;
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.02);
}

.advice-text {
    font-size: 1.05rem;
    font-weight: 700; /* 文字を少し太く */
    color: #334155;
    line-height: 1.7;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
}

.res-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* summary-btn：白背景・青枠 */
.test-result-card .summary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 48px;
    background-color: #ffffff;
    border-top-width: 2px;
    border-right-width: 2px;
    border-bottom-width: 2px;
    border-left-width: 2px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: #3498db;
    border-right-color: #3498db;
    border-bottom-color: #3498db;
    border-left-color: #3498db;
    color: #3498db;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
    border-bottom-left-radius: 40px;
    text-decoration-line: none;
    font-weight: 800;
    font-size: 0.95rem;
    transition-property: all;
    transition-duration: 0.2s;
}

.test-result-card .summary-btn:hover {
    background-color: #3498db;
    color: #ffffff;
    transform: translateY(-2px);
}

/* --- 7. フッター（圧縮版） --- */
body.test-body footer {
    width: 100%;
    background-color: #ffffff;
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: center;
    margin-top: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 5px;
}

.footer-links a {
    color: #2c3e50;
    text-decoration-line: none;
    font-size: 0.8rem;
}

body.test-body footer p {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
}