/* ===========================
   Base & Reset
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue: #2563eb;
    --blue-light: #eff6ff;
    --blue-dark: #1d4ed8;
    --green: #16a34a;
    --green-light: #f0fdf4;
    --red: #dc2626;
    --red-light: #fef2f2;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --text: #1f2937;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    color: var(--text);
    background: var(--gray-50);
    line-height: 1.6;
    font-size: 15px;
}

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

/* ===========================
   Header & Footer
   =========================== */
.site-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-username {
    font-size: 14px;
    color: var(--gray-600);
}
.btn-logout {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    padding: 5px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.btn-logout:hover {
    background: var(--gray-200);
}
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; font-size: 18px; font-weight: 700; color: var(--gray-900);
}
.logo-badge {
    background: var(--blue); color: white;
    padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 800;
}
.site-footer {
    background: var(--gray-100); border-top: 1px solid var(--gray-200);
    padding: 20px 0; text-align: center; color: var(--gray-500); font-size: 13px;
    margin-top: 60px;
}
.main-content { padding: 32px 0; }

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 8px; font-size: 15px; font-weight: 600;
    border: none; cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn-primary {
    background: var(--blue); color: white;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
    background: white; color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); }
.btn-large { padding: 14px 40px; font-size: 17px; border-radius: 10px; }
.btn-small { padding: 5px 14px; font-size: 13px; border-radius: 6px; }
.btn-submit {
    background: var(--green); color: white;
    padding: 16px 48px; font-size: 18px; font-weight: 700; border-radius: 12px;
    box-shadow: 0 4px 14px rgba(22,163,74,.25);
}
.btn-submit:hover { background: #15803d; transform: translateY(-1px); }

/* ===========================
   Index / Hero
   =========================== */
.hero {
    text-align: center; padding: 48px 0 32px;
}
.hero h1 { font-size: 32px; font-weight: 800; color: var(--gray-900); margin-bottom: 12px; }
.hero-subtitle { font-size: 16px; color: var(--gray-500); margin-bottom: 32px; }

.exam-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    max-width: 720px; margin: 0 auto 32px;
}
@media (max-width: 600px) { .exam-info-grid { grid-template-columns: 1fr; } }

.info-card {
    background: white; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); text-align: left; border-top: 4px solid var(--blue);
}
.info-card.reading { border-top-color: var(--green); }
.info-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.section-badge {
    font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    background: var(--blue-light); color: var(--blue);
}
.reading .section-badge { background: var(--green-light); color: var(--green); }
.question-count { font-size: 20px; font-weight: 800; color: var(--gray-700); }
.part-list { list-style: none; padding: 0; }
.part-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px;
}
.part-list li:last-child { border: none; }
.part-list em { color: var(--gray-500); font-style: normal; }
.info-note { font-size: 12px; color: var(--orange); margin-top: 10px; }

.start-form { margin: 24px 0 8px; }
.start-note { font-size: 13px; color: var(--gray-500); }

/* Results History Table */
.results-history { margin-top: 48px; }
.results-history h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.results-table-wrapper { overflow-x: auto; }
.results-table {
    width: 100%; border-collapse: collapse; background: white;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.results-table th {
    background: var(--gray-700); color: white; padding: 12px 16px;
    text-align: left; font-size: 13px; font-weight: 600;
}
.results-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.results-table tr:last-child td { border: none; }
.results-table tr:hover td { background: var(--gray-50); }
.score-cell { text-align: center; }
.score-cell.total { font-size: 16px; }
.score-max { font-size: 12px; color: var(--gray-500); }

/* ===========================
   Exam Sticky Header
   =========================== */
.exam-sticky-header {
    position: sticky; top: 57px; z-index: 90;
    background: var(--gray-900); color: white;
    padding: 10px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.exam-sticky-inner {
    max-width: 960px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.exam-progress-info { font-size: 14px; color: var(--gray-300); }
.exam-timer { display: flex; align-items: center; gap: 8px; }
.timer-label { font-size: 12px; color: var(--gray-400); }
.timer-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-warning { color: #fbbf24 !important; }
.timer-danger { color: #f87171 !important; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* ===========================
   Exam Sections
   =========================== */
.exam-section { margin-bottom: 40px; }
.section-header {
    background: var(--blue); color: white;
    padding: 20px 24px; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0;
}
.section-header.reading-header { background: var(--green); }
.section-header h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.section-header p { font-size: 13px; opacity: .8; }

.part-block { background: white; border: 1px solid var(--gray-200); padding: 24px; margin-bottom: 4px; }
.part-block:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.part-header { margin-bottom: 20px; }
.part-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.part-subtitle { font-size: 14px; font-weight: 400; color: var(--gray-500); margin-left: 8px; }
.part-instruction { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* ===========================
   Question Cards
   =========================== */
.question-card {
    border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    padding: 18px 20px; margin-bottom: 16px;
    transition: border-color .2s;
}
.question-card:hover { border-color: var(--blue); }
.question-card.answered { border-color: var(--blue); background: var(--blue-light); }

.question-number {
    font-size: 12px; font-weight: 700; color: white;
    background: var(--gray-500); display: inline-block;
    padding: 2px 10px; border-radius: 20px; margin-bottom: 12px;
}
.answered .question-number { background: var(--blue); }

.sentence-text {
    font-size: 16px; line-height: 1.7; margin-bottom: 14px;
    color: var(--gray-900); font-weight: 500;
}
.question-text {
    font-size: 15px; margin-bottom: 12px; color: var(--gray-700);
}

/* Script Box */
.script-box {
    background: var(--gray-50); border-left: 3px solid var(--blue);
    padding: 12px 16px; border-radius: 0 8px 8px 0; margin-bottom: 14px;
}
.script-label {
    display: block; font-size: 11px; font-weight: 700; color: var(--blue);
    text-transform: uppercase; margin-bottom: 6px;
}

/* Set Cards (Part 3, 4, 6, 7) */
.set-card {
    border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 24px;
}
.set-card .script-box { margin: 16px 16px 8px; }
.set-card .inline-question { margin: 0 16px 0; border-radius: 0; border: none; border-top: 1px solid var(--gray-100); }
.set-card .inline-question:last-child { margin-bottom: 16px; }

/* Passage Box */
.passage-header {
    background: var(--gray-100); padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
}
.passage-type-badge {
    font-size: 11px; font-weight: 700; color: var(--blue);
    background: var(--blue-light); padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
}
.passage-title { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.double-badge {
    font-size: 11px; font-weight: 600; color: var(--orange);
    background: var(--orange-light); padding: 2px 8px; border-radius: 4px;
}
.passage-box {
    background: white; padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}
.passage-text {
    font-family: inherit; font-size: 14px; line-height: 1.8;
    color: var(--gray-700); white-space: pre-wrap; word-wrap: break-word;
}

/* ===========================
   Options
   =========================== */
.options-grid {
    display: grid; gap: 8px;
}
.options-4 { grid-template-columns: 1fr 1fr; }
.options-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
    .options-4, .options-3 { grid-template-columns: 1fr; }
}

.option-label {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border-radius: 8px;
    border: 1.5px solid var(--gray-200); cursor: pointer;
    transition: all .15s; background: white;
}
.option-label:hover { border-color: var(--blue); background: var(--blue-light); }
.option-label input[type="radio"] { display: none; }
.option-label:has(input:checked) {
    border-color: var(--blue); background: var(--blue-light);
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.option-key {
    min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: var(--gray-200); border-radius: 50%; font-size: 12px; font-weight: 700;
    flex-shrink: 0; margin-top: 1px;
}
.option-label:has(input:checked) .option-key {
    background: var(--blue); color: white;
}
.option-text { font-size: 14px; color: var(--gray-700); line-height: 1.4; }

/* ===========================
   Submit
   =========================== */
.submit-section {
    text-align: center; padding: 40px 0 60px;
}
.submit-warning {
    background: #fff7ed; border: 1.5px solid var(--orange);
    color: var(--orange); border-radius: 8px; padding: 12px 20px;
    margin-bottom: 20px; display: inline-block; font-size: 14px;
}
.submit-note { font-size: 13px; color: var(--gray-500); margin-top: 10px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal-box {
    background: white; border-radius: 14px; padding: 32px;
    max-width: 420px; width: 90%; text-align: center; box-shadow: var(--shadow-md);
}
.modal-box h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.modal-box p { color: var(--gray-500); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ===========================
   Result Page
   =========================== */
.result-page { padding-bottom: 60px; }

.score-summary-card {
    background: white; border-radius: 16px; padding: 36px;
    box-shadow: var(--shadow-md); text-align: center; margin-bottom: 40px;
}
.score-summary-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.result-date { font-size: 13px; color: var(--gray-500); margin-bottom: 28px; }

.total-score-display {
    display: flex; align-items: baseline; justify-content: center;
    gap: 4px; margin-bottom: 28px;
}
.total-score-number { font-size: 72px; font-weight: 900; color: var(--blue); line-height: 1; }
.total-score-label { font-size: 24px; color: var(--gray-400); }

.section-scores {
    display: flex; gap: 20px; justify-content: center; margin-bottom: 28px;
}
@media (max-width: 480px) { .section-scores { flex-direction: column; align-items: center; } }

.section-score-card {
    background: var(--blue-light); border-radius: 12px; padding: 20px 32px;
    text-align: center; min-width: 160px;
}
.section-score-card.reading-score { background: var(--green-light); }
.section-score-label { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.reading-score .section-score-label { color: var(--green); }
.section-score-num { font-size: 48px; font-weight: 900; color: var(--blue); line-height: 1; }
.reading-score .section-score-num { color: var(--green); }
.section-score-max { font-size: 14px; color: var(--gray-400); }
.section-score-detail { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* Part Score Bars */
.part-score-grid { max-width: 600px; margin: 0 auto; text-align: left; }
.part-score-row {
    display: grid; grid-template-columns: 180px 1fr 80px;
    align-items: center; gap: 12px; padding: 6px 0;
}
@media (max-width: 600px) {
    .part-score-row { grid-template-columns: 140px 1fr 60px; }
}
.part-score-name { font-size: 13px; color: var(--gray-600); }
.part-score-bar-wrap { background: var(--gray-200); border-radius: 4px; height: 10px; }
.part-score-bar { background: var(--blue); height: 10px; border-radius: 4px; transition: width .5s; }
.part-score-nums { font-size: 12px; color: var(--gray-500); text-align: right; }

/* Review Section */
.review-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.review-part { margin-bottom: 40px; }
.review-part-title {
    font-size: 16px; font-weight: 700; color: white;
    background: var(--gray-700); padding: 10px 16px; border-radius: 8px; margin-bottom: 12px;
}
.review-set { margin-bottom: 24px; }
.review-script {
    background: var(--gray-50); border-left: 3px solid var(--blue);
    padding: 14px 16px; margin-bottom: 12px; border-radius: 0 8px 8px 0;
    font-size: 14px; white-space: pre-line; line-height: 1.7;
}
.review-card {
    border-radius: 10px; padding: 16px; margin-bottom: 10px;
    border-left: 4px solid var(--gray-300);
}
.review-correct { background: var(--green-light); border-left-color: var(--green); }
.review-wrong { background: var(--red-light); border-left-color: var(--red); }
.review-card-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.review-qnum { font-size: 13px; font-weight: 700; color: var(--gray-600); }
.result-badge {
    font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 12px;
}
.correct-badge { background: var(--green); color: white; }
.wrong-badge { background: var(--red); color: white; }
.review-scene, .review-sentence {
    font-size: 14px; color: var(--gray-700); margin-bottom: 10px; line-height: 1.6;
}
.review-question { font-size: 14px; color: var(--gray-700); margin-bottom: 10px; }

.review-options { display: grid; gap: 6px; margin-bottom: 12px; }
.review-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    background: white; border: 1px solid var(--gray-200);
}
.correct-option {
    background: var(--green-light); border-color: var(--green); font-weight: 600;
}
.wrong-option {
    background: var(--red-light); border-color: var(--red);
}
.your-correct-option {
    background: var(--green-light); border-color: var(--green); font-weight: 600;
}
.option-tag {
    margin-left: auto; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.correct-tag { color: var(--green); }
.wrong-tag { color: var(--red); }
.your-correct-tag { color: var(--green); }

.explanation-box {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--gray-700);
    line-height: 1.6;
}
.explanation-box strong { color: #92400e; }

.result-actions {
    display: flex; gap: 16px; justify-content: center; margin-top: 40px;
    flex-wrap: wrap;
}

/* ===========================
   パート別 10分練習
   =========================== */
.quick-practice-section {
    margin-top: 48px;
    background: white;
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}
.quick-practice-title {
    font-size: 1.25rem; font-weight: 700; color: var(--gray-900);
    margin-bottom: 6px;
}
.quick-practice-desc {
    color: var(--gray-500); font-size: 13px; margin-bottom: 20px;
}
.quick-practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.btn-part-practice {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 14px 10px;
    border: 2px solid transparent; border-radius: var(--radius);
    cursor: pointer; font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    width: 100%;
}
.btn-part-practice:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.btn-part-practice.listening {
    background: var(--blue-light); border-color: #bfdbfe; color: var(--blue-dark);
}
.btn-part-practice.reading {
    background: var(--green-light); border-color: #bbf7d0; color: var(--green);
}
.bpp-part { font-size: 11px; font-weight: 700; opacity: 0.7; }
.bpp-name { font-size: 14px; font-weight: 600; }
.bpp-count { font-size: 12px; opacity: 0.7; }

/* 種別バッジ（過去結果一覧） */
.type-badge {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
}
.full-badge { background: var(--blue-light); color: var(--blue-dark); }
.part-badge { background: var(--green-light); color: var(--green); }

/* パート練習スコア表示 */
.practice-score-display {
    text-align: center; padding: 20px 0 8px;
}
.practice-score-display .total-score-number {
    font-size: 4rem; font-weight: 800; color: var(--blue);
    display: inline-block;
}
.practice-score-display .total-score-label {
    font-size: 1.5rem; color: var(--gray-500);
    display: inline-block; margin-left: 4px;
}
.practice-percentage {
    font-size: 1.1rem; color: var(--gray-700); margin-top: 4px;
}

/* ===== Gamification ===== */

/* ステータスカード */
.status-card {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    row-gap: 12px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
}
.status-item:first-child { padding-left: 0; }
.status-icon { font-size: 20px; }
.status-value { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.status-label { font-size: 13px; color: var(--gray-500); }
.status-level-badge {
    background: var(--blue);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}
.status-divider {
    width: 1px;
    height: 32px;
    background: var(--gray-200);
}
.status-xp-bar-wrap {
    flex: 1;
    min-width: 200px;
    padding-left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.status-xp-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
}
.status-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), #60a5fa);
    border-radius: 99px;
    transition: width 0.6s ease;
}
.status-xp-hint { font-size: 12px; color: var(--gray-500); white-space: nowrap; }

/* スコア推移グラフ */
.score-graph-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 32px;
}
.score-graph-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
}
.score-graph-wrap { position: relative; }

/* バッジ */
.badges-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 32px;
}
.badges-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
}
.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    min-width: 80px;
    cursor: default;
    transition: transform 0.15s;
}
.badge-item.earned {
    background: var(--blue-light);
    border-color: #bfdbfe;
}
.badge-item.earned:hover { transform: scale(1.06); }
.badge-item.locked {
    background: var(--gray-50);
    opacity: 0.45;
    filter: grayscale(1);
}
.badge-icon { font-size: 26px; line-height: 1; }
.badge-name { font-size: 11px; font-weight: 600; color: var(--gray-700); text-align: center; }

/* XP獲得バナー */
.xp-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white;
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.xp-banner-icon { font-size: 20px; }
.xp-banner-text { font-size: 16px; font-weight: 700; }
.xp-banner-sep { opacity: 0.6; }
.new-badge-pill {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 600;
}

/* ヘッダーナビ */
.header-nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    margin-left: 24px;
}
.header-nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.header-nav-link:hover {
    background: var(--gray-100);
    color: var(--blue);
}

/* ランキングページ */
.ranking-page { max-width: 700px; margin: 0 auto; }
.ranking-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 24px;
    text-align: center;
}
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}
.ranking-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s;
}
.ranking-tab:hover { color: var(--blue); }
.ranking-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: var(--blue-light);
}
.ranking-panel { display: none; }
.ranking-panel.active { display: block; }
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.ranking-table thead tr {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}
.ranking-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ranking-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
}
.ranking-table tbody tr:last-child { border-bottom: none; }
.ranking-table tbody tr:hover { background: var(--gray-50); }
.ranking-table tbody tr.ranking-me {
    background: var(--blue-light);
    border-left: 3px solid var(--blue);
}
.ranking-table td { padding: 12px 16px; font-size: 14px; }
.rank-num { font-size: 20px; text-align: center; width: 56px; }
.rank-name {
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}
.rank-you {
    background: var(--blue);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}
.rank-level-badge {
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.rank-value { font-weight: 700; color: var(--gray-900); }
.rank-unit { font-size: 12px; font-weight: 400; color: var(--gray-500); margin-left: 2px; }
.ranking-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 40px 0;
    font-size: 14px;
}
