/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* おひさまプロジェクトのベースカラー */
    --base-color: #F9C74F;
    --base-color-light: #FEF3DC;
    --base-color-10: rgba(249, 199, 79, 0.1);
    
    /* ニュートラルカラー */
    --bg-main: #FEF3DC;
    --bg-card: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #BDC3C7;
    --border-light: #ECEFF1;
    
    /* シャドウ */
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.08);
    
    /* 丸角 */
    --radius-small: 12px;
    --radius-medium: 16px;
    --radius-large: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.6;
}

/* 画面管理 */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.page {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.page.active {
    display: block;
    opacity: 1;
}

/* ログイン画面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 32px;
    background: linear-gradient(135deg, #FFF4E6 0%, var(--base-color) 100%);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-large);
    padding: 48px 40px;
    box-shadow: var(--shadow-card);
    max-width: 400px;
    width: 100%;
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.sun-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.sun-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-section h1 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.logo-section h2 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    background: var(--bg-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-secondary);
    background: var(--bg-card);
}

/* ボタン */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--base-color);
}

.btn-primary:hover {
    background: var(--base-color-10);
    border-color: var(--base-color);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
}

/* メインアプリ */
#main-app {
    min-height: 100vh;
    background: var(--bg-main);
}

/* ヘッダー */
.app-header {
    background: var(--base-color);
    padding: 16px 24px;
    box-shadow: var(--shadow-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-small);
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--bg-main);
}

.app-title {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.3);
}

.user-info #user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.user-level {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
}

/* サイドメニュー */
.side-menu {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.menu-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.close-menu {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-menu:hover {
    background: var(--bg-main);
}

.menu-list {
    list-style: none;
    padding: 16px 12px;
}

.menu-list li {
    margin-bottom: 4px;
}

.menu-list li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 400;
    font-size: 15px;
    border-radius: var(--radius-small);
}

.menu-list li a:hover {
    background: var(--base-color-10);
    color: var(--text-primary);
}

.menu-list li a i {
    font-size: 20px;
    width: 20px;
    color: var(--base-color);
}

/* メインコンテンツ */
.main-content {
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ホーム画面 */
.welcome-section {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 40px 32px;
    border-radius: var(--radius-large);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
    border: 2px solid var(--base-color);
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.subtitle {
    font-size: 15px;
    opacity: 0.8;
    font-weight: 400;
}

/* 学習進捗セクション */
.progress-section {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-large);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
    border: 2px solid var(--base-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-header h3 {
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-count {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.progress-percentage {
    font-size: 32px;
    color: var(--base-color);
    font-weight: 700;
}

/* プログレスバー1: シンプルバー */
.progress-bar-container {
    width: 100%;
    height: 40px;
    background: #F0F0F0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #F9C74F 0%, #FFD700 100%);
    border-radius: 50px;
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(249, 199, 79, 0.4);
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.3) 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-text {
    font-size: 16px;
    font-weight: 700;
    color: #2C3E50;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* プログレスバー2: セグメント表示 */
.progress-segments {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.segment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.segment-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.segment-range {
    font-size: 11px;
    color: var(--text-secondary);
}

.segment-bar-container {
    display: flex;
    gap: 4px;
    height: 32px;
    margin-bottom: 20px;
}

.segment-bar {
    flex: 1;
    background: #F0F0F0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.segment-fill {
    height: 100%;
    transition: width 1s ease-out;
    position: relative;
}

.segment-bar.beginner .segment-fill {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.segment-bar.intermediate .segment-fill {
    background: linear-gradient(135deg, #F9C74F 0%, #FFD700 100%);
}

.segment-bar.advanced .segment-fill {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
}

.segment-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0) 50%, 
        rgba(255, 255, 255, 0.3) 100%);
}

/* モチベーションメッセージ */
.motivation-message {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF4E6 100%);
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--base-color);
}

.motivation-message .material-icons {
    font-size: 32px;
    color: var(--base-color);
}

.motivation-message p {
    font-size: 15px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

.motivation-message strong {
    color: var(--base-color);
    font-weight: 700;
}

.previous-learning {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-large);
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
}

.previous-learning h3 {
    font-size: 18px;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.kanji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.kanji-item {
    background: var(--bg-main);
    border-radius: var(--radius-medium);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.kanji-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.kanji-item.learned {
    background: var(--base-color);
    border-color: var(--base-color);
    position: relative;
}

.kanji-item.learned .kanji-character {
    color: white;
}

.kanji-item.learned .kanji-reading {
    color: rgba(255, 255, 255, 0.9);
}

.kanji-item.learned::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--base-color);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kanji-character {
    font-size: 48px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.kanji-reading {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* クイックアクション */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.action-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-large);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.action-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 48px;
    margin-bottom: 16px;
}

.action-card h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.action-card p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

/* 学ぶ・覚える画面 */
.learn-options,
.practice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.learn-card,
.practice-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-large);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
}

.learn-card:hover,
.practice-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.learn-card { 
    background: var(--bg-card); 
    border-color: var(--border-light);
}

.practice-card { 
    background: var(--bg-card); 
    border-color: var(--border-light);
}

.learn-card i,
.practice-card i {
    font-size: 56px;
    margin-bottom: 16px;
}

.learn-card h4,
.practice-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.learn-card p,
.practice-card p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

/* 戻るボタン */
.back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 10px 20px;
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-family: inherit;
}

.back-btn:hover {
    background: var(--bg-main);
}

.back-btn i {
    margin-right: 8px;
}

/* ページタイトル */
.page h2 {
    font-size: 24px;
    margin-bottom: 32px;
    color: var(--text-primary);
    font-weight: 600;
}

/* 動画コンテナ */
.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.video-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    background: var(--base-color-10);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    width: 56px;
    height: 56px;
    background: var(--base-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 24px;
}

.video-info {
    padding: 20px;
}

.video-info h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.video-info p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

/* 動画モーダル */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.close-video {
    position: absolute;
    top: -50px;
    right: 0;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-video:hover {
    background: var(--bg-main);
}

.video-modal video,
.video-modal img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-medium);
}

/* 読み・書き・使い方学習 */
.reading-practice,
.writing-practice,
.usage-examples {
    display: grid;
    gap: 24px;
}

.practice-item {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.practice-kanji {
    font-size: 120px;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-weight: 400;
}

.practice-readings {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.reading-badge {
    background: var(--base-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
}

.reading-badge.kun-reading {
    background: var(--base-color);
    color: var(--text-primary);
}

.practice-examples {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
}

.practice-examples h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.example-item {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-medium);
    margin-bottom: 16px;
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.example-word {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.example-reading {
    font-size: 16px;
    color: var(--base-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.example-meaning {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 12px;
}

.example-sentence {
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.8;
    padding: 16px;
    background: var(--base-color-10);
    border-radius: var(--radius-small);
    border-left: 4px solid var(--base-color);
    margin-top: 12px;
}
    font-weight: 400;
}

/* フラッシュカード */
.flash-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    gap: 24px;
}

.flash-card {
    width: 400px;
    height: 500px;
    background: var(--bg-card);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
    border: 1px solid var(--border-light);
}

.flash-card.flipped {
    transform: rotateY(180deg);
}

.flash-front,
.flash-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: var(--radius-large);
}

.flash-back {
    transform: rotateY(180deg);
    background: var(--base-color-10);
}

.flash-kanji {
    font-size: 140px;
    font-weight: 400;
    color: var(--text-primary);
}

.flash-reading {
    font-size: 32px;
    margin-bottom: 16px;
    font-weight: 500;
}

.flash-meaning {
    font-size: 20px;
    font-weight: 400;
}

.flash-controls {
    display: flex;
    gap: 12px;
}

.flash-controls button {
    padding: 12px 28px;
    border: 2px solid var(--base-color);
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
    font-family: inherit;
}

.flash-controls button:hover {
    background: var(--base-color-10);
}

/* ゲーム */
.game-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.game-piece {
    aspect-ratio: 1;
    background: var(--bg-main);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.game-piece:hover {
    background: var(--base-color-10);
    box-shadow: var(--shadow-hover);
}

.game-piece.selected {
    border-color: var(--base-color);
    background: var(--base-color);
}

.game-piece.correct {
    background: var(--base-color-10);
    color: var(--text-primary);
    border-color: var(--base-color);
}

.game-question {
    text-align: center;
    margin-bottom: 32px;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 20px;
    background: var(--bg-main);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
}

/* マッチングゲーム */
.matching-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.matching-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.matching-card {
    aspect-ratio: 1;
    background: var(--base-color);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.matching-card:hover {
    box-shadow: var(--shadow-hover);
}

.matching-card.flipped {
    background: var(--bg-card);
    border: 2px solid var(--base-color);
}

.matching-card.matched {
    background: var(--base-color-10);
    cursor: default;
    border: 2px solid var(--base-color);
}

/* ミニテスト */
.mini-test-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-light);
}

.test-question {
    margin-bottom: 32px;
}

.test-question h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.test-kanji-display {
    font-size: 80px;
    text-align: center;
    color: var(--text-primary);
    font-weight: 400;
    margin: 24px 0;
}

.test-options {
    display: grid;
    gap: 12px;
}

.test-option {
    padding: 16px 24px;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
}

.test-option:hover {
    background: var(--base-color-10);
    border-color: var(--base-color);
}

.test-option.selected {
    background: var(--base-color);
    border-color: var(--base-color);
}

.test-option.correct {
    background: var(--base-color-10);
    border-color: var(--base-color);
}

.test-option.incorrect {
    background: #FFE0E0;
    border-color: #FF6B6B;
}

/* 検定試験 */
.exam-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.exam-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    position: relative;
}

.exam-card::before {
    content: '';
    display: none;
}
    background-size: contain;
    opacity: 0.3;
}

.exam-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.exam-badge {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.badge-bronze {
    background: var(--primary-orange);
}

.badge-silver {
    background: var(--accent-blue);
}

.badge-gold {
    background: var(--primary-yellow);
}

.exam-card h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.exam-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 400;
    font-size: 14px;
}

.exam-details {
    list-style: none;
    text-align: left;
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-main);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
}

.exam-details li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.btn-exam {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px;
    border: 2px solid var(--base-color);
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-exam:hover:not(:disabled) {
    background: var(--base-color-10);
}

.btn-exam:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 検定試験実施画面 */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.exam-timer {
    background: var(--base-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
}

.exam-timer i {
    margin-right: 8px;
}

.exam-progress {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-medium);
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-main);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--base-color);
    transition: width 0.3s;
    border-radius: 50px;
}

#exam-question-num {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.exam-content {
    background: var(--bg-card);
    padding: 48px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

/* 検定結果 */
.result-container {
    max-width: 600px;
    margin: 0 auto;
}

.result-card {
    background: var(--bg-card);
    padding: 56px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.result-icon {
    font-size: 80px;
    margin-bottom: 24px;
    color: var(--base-color);
}

.result-score {
    font-size: 56px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.result-message {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
}

.result-details {
    display: grid;
    gap: 12px;
    text-align: left;
    background: var(--bg-main);
    padding: 24px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 15px;
    font-weight: 400;
}

.result-detail-item:last-child {
    border-bottom: none;
}

/* 成績画面 */
.results-container {
    display: grid;
    gap: 24px;
}

.result-summary {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.result-summary h3 {
    font-size: 20px;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-main);
    padding: 28px;
    border-radius: var(--radius-medium);
    text-align: center;
    border: 1px solid var(--border-light);
}

.stat-card:nth-child(1) { background: var(--primary-yellow); border-color: var(--primary-orange); }
.stat-card:nth-child(2) { background: var(--accent-blue); border-color: var(--accent-blue); }
.stat-card:nth-child(3) { background: var(--accent-mint); border-color: var(--accent-mint); }
.stat-card:nth-child(4) { background: var(--primary-cream); border-color: var(--primary-yellow); }

.stat-value {
    font-size: 40px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.exam-history {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.exam-history h3 {
    font-size: 20px;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-main);
    border-radius: var(--radius-medium);
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
}

.history-date {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}

.history-level {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

.history-score {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* レベル選択 */
.level-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.level-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: all 0.2s;
    border: 1px solid var(--border-light);
}

.level-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.level-badge {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    background: var(--base-color-10);
    border: 2px solid var(--base-color);
}

.level-card h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.level-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 400;
    font-size: 14px;
}

.btn-select {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px;
    border: 2px solid var(--base-color);
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-select:hover {
    background: var(--base-color-10);
}

/* 漢字一覧 */
.kanji-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .app-title {
        font-size: 16px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .progress-section {
        padding: 20px;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-percentage {
        font-size: 24px;
    }

    .progress-bar-container {
        height: 32px;
    }

    .segment-bar-container {
        height: 24px;
    }

    .segment-label {
        font-size: 11px;
    }

    .segment-range {
        font-size: 10px;
    }

    .motivation-message {
        padding: 12px 16px;
    }

    .motivation-message .material-icons {
        font-size: 24px;
    }

    .motivation-message p {
        font-size: 13px;
    }

    .kanji-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 12px;
    }

    .kanji-character {
        font-size: 40px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .flash-card {
        width: 100%;
        max-width: 350px;
        height: 450px;
    }

    .flash-kanji {
        font-size: 100px;
    }

    .game-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-piece {
        font-size: 48px;
    }

    .matching-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .matching-card {
        font-size: 20px;
    }

    .page h2 {
        font-size: 20px;
    }

    .welcome-section h2 {
        font-size: 24px;
    }

    .practice-kanji {
        font-size: 80px;
    }

    .result-card {
        padding: 32px 24px;
    }
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 32px;
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}