/*
-----------------------------------------------------------
Copyright (c) 2026 Ahngunism. All rights reserved.
-----------------------------------------------------------
File           : style.css
Last updated:  : 20260310 103700
Version        : ver 6
-----------------------------------------------------------
*/
:root {
    --primary-color: #6C5CE7;
    --secondary-color: #00CEC9;
    --bg-gradient-start: #1E1E2E;
    --bg-gradient-end: #2D2B55;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0B0;
    --correct-color: #00b894;
    --incorrect-color: #d63031;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    margin: 0;
    font-family: 'Noto Sans KR', 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end)) fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    text-align: center;
}

h1 {
    font-size: 2.2em;
    background: linear-gradient(to right, #a29bfe, #81ecec);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

h2, h3 { color: #fff; margin-top: 0; }

.btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
}
.btn-secondary { background: rgba(255, 255, 255, 0.1); box-shadow: none; color: #fff; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }
.btn-danger { background: linear-gradient(45deg, #d63031, #ff7675); box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4); }
.btn-success { background: linear-gradient(45deg, #00b894, #55efc4); box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4); }

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.mode-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}
.mode-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}
.mode-card h3 { color: var(--secondary-color); margin-bottom: 10px; font-size: 1.4em;}
.mode-card p { color: var(--text-secondary); font-size: 0.9em; margin: 0; line-height: 1.5;}

.settings-group { margin-bottom: 25px; text-align: center; }
.settings-group label.group-label { display: block; text-align: center; margin-bottom: 12px; color: var(--secondary-color); font-weight: bold; font-size: 1.1em; }
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.radio-group input[type="radio"] { display: none; }
.radio-group label {
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin: 0;
    font-weight: 500;
}
.radio-group input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.4);
}

.kana-grid, .kana-yoon-grid { display: grid; gap: 8px; margin-bottom: 15px; }
.kana-grid { grid-template-columns: repeat(5, 1fr); }
.kana-yoon-grid { grid-template-columns: repeat(3, 1fr); }
.kana-cell {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: rgba(255,255,255,0.3);
    transition: all 0.3s;
}
.kana-cell.learned {
    color: #fff;
    background: rgba(108, 92, 231, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.2);
    text-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.kana-cell.empty { visibility: hidden; }

/* Flashcard Styles */
.flashcard-wrapper {
    perspective: 1000px;
    width: 100%;
    max-width: 350px;
    height: 250px;
    margin: 0 auto 30px;
    cursor: pointer;
}
.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
.flashcard-front { font-size: 6em; font-family: 'Noto Sans JP'; font-weight: bold;}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-back .kr { font-size: 4em; font-family: 'Noto Sans KR'; color: var(--secondary-color); margin-bottom: 20px; font-weight:bold;}
.flashcard-back .en { font-size: 1.5em; color: var(--text-secondary); }

/* Typing Game */
.game-area {
    position: relative;
    height: 450px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}
.falling-char {
    position: absolute;
    font-size: 3em;
    font-family: 'Noto Sans JP';
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}
.typing-input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.5em;
    font-family: inherit;
    text-align: center;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    background: rgba(0,0,0,0.3);
    color: white;
    outline: none;
    transition: border-color 0.3s;
}
.typing-input:focus { border-color: var(--secondary-color); box-shadow: 0 0 15px rgba(0, 206, 201, 0.4); }
.stats-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 10px;
}
.combo-text { color: var(--secondary-color); text-shadow: 0 0 5px rgba(0, 206, 201, 0.5); }
.score-text { color: #fff; }

/* Quiz Overrides */
.quiz-input {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.5em;
    font-family: inherit;
    text-align: center;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    background: rgba(0,0,0,0.3);
    color: white;
    outline: none;
    margin-bottom: 20px;
}
.quiz-input:focus { border-color: var(--secondary-color); }
.quiz-display {
    font-size: 7em;
    font-family: 'Noto Sans JP';
    font-weight: bold;
    margin-bottom: 30px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
    transition: opacity 0.3s;
}
.quiz-display.show-answer {
    font-size: 5em;
    font-family: 'Noto Sans KR';
    color: var(--secondary-color);
    text-shadow: none;
}
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s;
}

.ad-wrapper { margin: 20px 0; text-align: center; width: 100%; display: flex; justify-content: center; }
.ad-grid { 
    display: grid;
    grid-template-columns: 320px 320px;
    justify-content: center; 
    gap: 10px; 
    margin: 20px auto; 
}
.ad-item { display: flex; justify-content: center; align-items: center; width: 320px; height: 50px; }

/* Result Layout */
.result-score { font-size: 3em; font-weight: bold; margin-bottom: 10px; color: var(--secondary-color); text-shadow: 0 0 20px rgba(0,206,201,0.3);}
.result-desc { color: var(--text-secondary); margin-bottom: 30px; font-size: 1.1em;}
.result-charts { margin-top: 30px; }
.cell-correct { background: rgba(0, 184, 148, 0.3) !important; border-color: var(--correct-color) !important; color: #fff !important; }
.cell-incorrect { background: rgba(214, 48, 49, 0.3) !important; border-color: var(--incorrect-color) !important; color: #fff !important; }
.result-legend { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; }
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.legend-color { width: 16px; height: 16px; border-radius: 4px; }
