/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF69B4;
    --primary-light: #FFB3DA;
    --primary-dark: #E91E63;
    --accent: #FFA726;
    --secondary: #9C27B0;
    --background: linear-gradient(135deg, #FFE5F1 0%, #E8F5E8 100%);
    --surface: #FFFFFF;
    --surface-soft: #FFF8FC;
    --error: #FF5722;
    --text-primary: #2D2D2D;
    --text-secondary: #666666;
    --text-hint: #999999;
    --border: #F0F0F0;
    --success: #66BB6A;
    --cute-pink: #FFE4E1;
    --cute-yellow: #FFF9C4;
    --cute-blue: #E3F2FD;
    --cute-green: #E8F5E8;
    
    --font-japanese: 'Noto Sans JP', sans-serif;
    --font-korean: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    
    --radius: 12px;
    --radius-small: 8px;
    --radius-large: 20px;
}

body {
    font-family: var(--font-korean);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--surface);
    box-shadow: var(--shadow-1);
}

/* App Bar */
.app-bar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0 0 24px 24px;
}

.app-bar h1 {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-japanese);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.app-bar h1::after {
    content: '🌸';
    margin-left: 0.5rem;
    font-size: 1.25rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
}

.streak-widget {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-large);
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3); }
}

.streak-widget .material-icons {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Main Content */
main {
    flex: 1;
    padding: 1rem;
    padding-bottom: 5rem;
    overflow-y: auto;
}

.screen {
    animation: slideIn 0.3s ease-out;
}

.screen.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    gap: 1.5rem;
}

.loading p {
    color: var(--primary);
    font-weight: 500;
    position: relative;
}

.loading p::after {
    content: '✨';
    margin-left: 0.5rem;
    animation: twinkle 1.5s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--cute-pink);
    border-top: 4px solid var(--primary);
    border-right: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sentence Card */
.sentence-card {
    background: var(--surface-soft);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(255, 105, 180, 0.15);
    margin-bottom: 1.5rem;
    border: 3px solid var(--cute-pink);
    position: relative;
    overflow: hidden;
}

.sentence-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary));
    border-radius: 22px;
    z-index: -1;
    opacity: 0.1;
}

.sentence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.level-badge {
    background: linear-gradient(135deg, var(--cute-yellow), var(--accent));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-large);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 8px rgba(255, 167, 38, 0.3);
    border: 2px solid white;
}

.sentence-content {
    margin-bottom: 1.5rem;
}

.japanese-text {
    font-family: var(--font-japanese);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 2.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-top: 0.5rem;
}

.romaji-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.korean-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sentence-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-romaji {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-hint);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.toggle-romaji:hover {
    color: var(--primary);
}

/* Buttons */
.action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-small);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.action-button.primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
}

.action-button.secondary {
    background: var(--cute-blue);
    color: var(--secondary);
    border: 2px solid var(--secondary);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2);
}

.action-button.secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(156, 39, 176, 0.4);
}

.action-button.accent {
    background: linear-gradient(135deg, var(--accent), #FFD54F);
    color: white;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(255, 167, 38, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.action-button.accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF8F00, var(--accent));
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 167, 38, 0.6);
}

.action-button.danger {
    background: var(--error);
    color: white;
}

.action-button.danger:hover:not(:disabled) {
    background: #b71c1c;
}

.icon-button {
    background: var(--cute-pink);
    border: 2px solid white;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
    color: var(--primary);
}

.icon-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 105, 180, 0.4);
}

.icon-button .material-icons {
    font-size: 1.5rem;
}

/* Quiz Screen */
.quiz-header, .review-header, .settings-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quiz-question {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    margin-bottom: 1.5rem;
}

.quiz-question p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.quiz-japanese-text {
    font-family: var(--font-japanese);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.quiz-option {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-option:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-1);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(var(--primary), 0.05);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(var(--success), 0.1);
}

.quiz-option.incorrect {
    border-color: var(--error);
    background: rgba(var(--error), 0.1);
}

.quiz-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quiz-option.selected .quiz-option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.quiz-option.selected .quiz-option-radio::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.quiz-result {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-small);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quiz-result.correct {
    border: 2px solid var(--success);
    background: rgba(var(--success), 0.1);
}

.quiz-result.incorrect {
    border: 2px solid var(--error);
    background: rgba(var(--error), 0.1);
}

.quiz-submit {
    width: 100%;
}

/* Review Screen */
.review-tabs {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-small);
    padding: 0.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-1);
}

.tab-button {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: var(--primary);
    color: white;
}

.review-content {
    min-height: 50vh;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    background: var(--cute-green);
    border-radius: 20px;
    margin: 1rem 0;
    border: 2px dashed var(--success);
}

.empty-state .material-icons {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    color: var(--success);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.sentence-list-item {
    background: var(--surface);
    border-radius: var(--radius-small);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.sentence-list-item .japanese {
    font-family: var(--font-japanese);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.sentence-list-item .korean {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sentence-list-item .meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

/* Settings Screen */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-1);
}

.setting-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.setting-item select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-small);
    background: var(--surface);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface-soft);
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(255, 105, 180, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 3px solid var(--cute-pink);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.grammar-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(var(--primary), 0.05);
    border-radius: var(--radius-small);
    border-left: 4px solid var(--primary);
}

.grammar-section h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    background: #ffffff !important;
    border-top: 3px solid #FF69B4 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 10px 10px 10px !important;
    z-index: 9999 !important;
    box-shadow: 0 -3px 20px rgba(255, 105, 180, 0.2) !important;
    border-radius: 0 !important;
    height: 75px !important;
    box-sizing: border-box !important;
}

.nav-button {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 8px 4px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #666 !important;
    font-size: 11px !important;
    flex: 1 !important;
    min-width: 60px !important;
    max-width: none !important;
    border-radius: 8px !important;
    position: relative !important;
    text-align: center !important;
}

.nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 0 0 3px 3px;
    transition: width 0.3s ease;
}

.nav-button.active {
    color: var(--primary);
    background: rgba(255, 105, 180, 0.1);
    transform: translateY(-2px);
}

.nav-button.active::before {
    width: 24px;
}

.nav-button:hover:not(.active) {
    color: var(--secondary);
    background: rgba(156, 39, 176, 0.05);
}

.nav-button .material-icons {
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 480px) {
    #app {
        max-width: 100vw;
    }
    
    .sentence-card {
        margin: 0;
        border-radius: 0;
    }
    
    .japanese-text {
        font-size: 1.25rem;
    }
    
    .sentence-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Ruby Text for Furigana - Using HTML5 ruby elements */
ruby.ruby-text {
    ruby-align: center;
    ruby-position: over;
}

rt.furigana {
    font-size: 0.6em;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1;
}

/* Fallback for browsers that don't support ruby */
@supports not (ruby-align: center) {
    ruby.ruby-text {
        position: relative;
        display: inline-block;
        margin: 0 0.1em;
        vertical-align: baseline;
    }
    
    rt.furigana {
        position: absolute;
        top: -1.4em;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.55em;
        line-height: 1;
        color: var(--text-secondary);
        white-space: nowrap;
        display: block;
        text-align: center;
        min-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Focus States */
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loading States */
.loading-content {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error States */
.success-message {
    background: rgba(var(--success), 0.1);
    color: var(--success);
    padding: 1rem;
    border-radius: var(--radius-small);
    border: 1px solid var(--success);
    margin: 1rem 0;
}

.error-message {
    background: rgba(var(--error), 0.1);
    color: var(--error);
    padding: 1rem;
    border-radius: var(--radius-small);
    border: 1px solid var(--error);
    margin: 1rem 0;
}
.nav-button .material-icons {
    font-size: 20px !important;
    display: block !important;
    margin-bottom: 2px !important;
}

.nav-button.active {
    color: #FF69B4 !important;
}

.nav-button span:last-child {
    font-weight: 500 !important;
}

/* AdSense 광고 컨테이너 스타일링 */
.ad-container-main {
    background: linear-gradient(135deg, rgba(255,105,180,0.1), rgba(255,182,193,0.1));
    border: 1px dashed rgba(255,105,180,0.5);
    border-radius: 12px;
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    min-height: 130px;
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.ad-container-settings {
    background: linear-gradient(135deg, rgba(255,105,180,0.1), rgba(255,182,193,0.1));
    border: 1px dashed rgba(255,105,180,0.5);
    border-radius: 12px;
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    min-height: 280px;
    width: 100%;
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.ad-placeholder-visible {
    color: rgba(255,105,180,0.8);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    line-height: 1.5;
    display: block;
}

/* AdSense 광고가 로드되면 placeholder 숨기기 */
.ad-container-main .adsbygoogle[data-adsbygoogle-status="done"] ~ .ad-placeholder-visible,
.ad-container-settings .adsbygoogle[data-adsbygoogle-status="done"] ~ .ad-placeholder-visible {
    display: none;
}

.adsbygoogle {
    border-radius: 8px;
    overflow: hidden;
}

/* 설정 설명 텍스트 */
.setting-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
    padding-left: 0;
}

/* 고대비 모드 스타일 */
body.high-contrast {
    --primary: #000000;
    --secondary: #ffffff;
    --accent: #ffff00;
    --background: #ffffff;
    --surface: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --border: #000000;
    --shadow: rgba(0, 0, 0, 0.8);
    --error: #ff0000;
    --success: #008000;
    --warning: #ff8c00;
}

body.high-contrast .app-bar {
    background: #000000;
    color: #ffffff;
    border-bottom: 3px solid #000000;
}

body.high-contrast .app-bar h1 {
    color: #ffffff;
    font-weight: 700;
}

body.high-contrast .streak-widget {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-weight: 700;
}

body.high-contrast .sentence-card {
    background: #ffffff;
    border: 3px solid #000000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

body.high-contrast .japanese-text {
    color: #000000;
    font-weight: 600;
    font-size: 1.3em;
}

body.high-contrast .korean-text {
    color: #333333;
    font-weight: 600;
    font-size: 1.1em;
}

body.high-contrast .action-button {
    font-weight: 700;
    border: 2px solid #000000;
    font-size: 1em;
}

body.high-contrast .action-button.primary {
    background: #000000;
    color: #ffffff;
}

body.high-contrast .action-button.primary:hover {
    background: #333333;
}

body.high-contrast .action-button.secondary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

body.high-contrast .action-button.secondary:hover {
    background: #f0f0f0;
}

body.high-contrast .action-button.accent {
    background: #ffff00;
    color: #000000;
    border: 2px solid #000000;
}

body.high-contrast .action-button.accent:hover {
    background: #ffff80;
}

body.high-contrast .action-button.danger {
    background: #ff0000;
    color: #ffffff;
    border: 2px solid #000000;
}

body.high-contrast .action-button.danger:hover {
    background: #cc0000;
}

body.high-contrast .quiz-options .quiz-option {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
    font-weight: 600;
}

body.high-contrast .quiz-options .quiz-option:hover {
    background: #f0f0f0;
}

body.high-contrast .quiz-options .quiz-option.selected {
    background: #ffff00;
    border-color: #000000;
    color: #000000;
}

body.high-contrast .quiz-options .quiz-option.correct {
    background: #008000;
    color: #ffffff;
    border-color: #000000;
}

body.high-contrast .quiz-options .quiz-option.incorrect {
    background: #ff0000;
    color: #ffffff;
    border-color: #000000;
}

body.high-contrast .bottom-nav {
    background: #000000;
    border-top: 3px solid #000000;
}

body.high-contrast .nav-button {
    color: #ffffff;
    font-weight: 600;
}

body.high-contrast .nav-button.active {
    color: #ffff00;
    font-weight: 700;
}

body.high-contrast .settings-content .setting-section {
    background: #ffffff;
    border: 2px solid #000000;
}

body.high-contrast .setting-item {
    border-bottom: 1px solid #cccccc;
}

body.high-contrast .setting-item span {
    color: #000000;
    font-weight: 600;
}

body.high-contrast select {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-weight: 600;
}

body.high-contrast .switch .slider {
    background-color: #cccccc;
    border: 2px solid #000000;
}

body.high-contrast .switch input:checked + .slider {
    background-color: #ffff00;
}

body.high-contrast .switch .slider:before {
    background-color: #000000;
    border: 1px solid #000000;
}

body.high-contrast .level-badge {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-weight: 700;
}

body.high-contrast .toggle-romaji {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-weight: 600;
}

body.high-contrast .toggle-romaji:hover {
    background: #f0f0f0;
}

body.high-contrast .romaji-text {
    color: #666666;
    font-weight: 600;
}

body.high-contrast .ad-container-main,
body.high-contrast .ad-container-settings {
    background: #ffffff;
    border: 3px solid #000000;
}

body.high-contrast .ad-placeholder-visible {
    color: #000000;
    font-weight: 700;
}

body.high-contrast .toast {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-weight: 600;
}

/* 포커스 스타일 강화 */
body.high-contrast button:focus,
body.high-contrast select:focus,
body.high-contrast input:focus {
    outline: 4px solid #ffff00;
    outline-offset: 2px;
}

/* 텍스트 크기 증가 */
body.high-contrast {
    font-size: 18px;
}

body.high-contrast .japanese-text {
    font-size: 1.4em;
}

body.high-contrast .korean-text {
    font-size: 1.2em;
}

body.high-contrast .action-button {
    font-size: 1.1em;
    padding: 14px 20px;
}

body.high-contrast .nav-button {
    font-size: 14px;
}

/* 고대비 모드: 만화/스토리 섹션 */
body.high-contrast .comic-panel {
    background: #ffffff;
    border: 3px solid #000000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

body.high-contrast .comic-text {
    color: #000000;
    font-weight: 600;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #000000;
}

body.high-contrast .comic-character {
    font-weight: 700;
    color: #000000;
}

body.high-contrast .comic-navigation button {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-weight: 700;
}

body.high-contrast .comic-navigation button:hover {
    background: #333333;
}

body.high-contrast .comic-navigation button:disabled {
    background: #cccccc;
    color: #666666;
    border-color: #666666;
}

body.high-contrast .comic-title {
    color: #000000;
    font-weight: 700;
    text-shadow: none;
}

body.high-contrast .comic-progress {
    background: #ffffff;
    border: 2px solid #000000;
}

body.high-contrast .comic-progress-fill {
    background: #000000;
}

/* 고대비 모드: 루비 텍스트 (후리가나) */
body.high-contrast ruby.ruby-text {
    color: #000000;
}

body.high-contrast rt.furigana {
    color: #333333;
    font-weight: 600;
}

/* 고대비 모드: 로딩 화면 */
body.high-contrast .loading {
    background: #ffffff;
    color: #000000;
}

body.high-contrast .loading-spinner {
    border-color: #cccccc;
    border-top-color: #000000;
}

/* 고대비 모드: 문법 모달 */
body.high-contrast .grammar-modal {
    background: rgba(0, 0, 0, 0.8);
}

body.high-contrast .grammar-content {
    background: #ffffff;
    border: 3px solid #000000;
    color: #000000;
}

body.high-contrast .grammar-content h3 {
    color: #000000;
    border-bottom: 2px solid #000000;
}

body.high-contrast .close-grammar {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

body.high-contrast .close-grammar:hover {
    background: #333333;
}

