* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #000000;
    min-height: 100vh;
    display: block;
    padding: 20px;
}

/* Profile selector screen */
.profile-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.profile-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #333;
}

.profile-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin-bottom: 40px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 24px 32px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    background: #fff;
    transition: all 0.15s;
    min-width: 120px;
    position: relative;
}

.profile-card:hover {
    border-color: #000;
    background: #f9f9f9;
    transform: scale(1.03);
}

.profile-avatar {
    font-size: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.profile-add-btn {
    background: none;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.profile-add-btn:hover {
    border-color: #666;
    color: #333;
}

.container {
    width: 100%;
    max-width: 100%;
    position: relative;
    padding: 20px;
}

.list-footer {
    font-size: 13px;
    color: #2196f3;
    text-align: left;
    padding: 4px 0;
    margin-top: 4px;
}

.score-display {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.profile-circle {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s;
}

.profile-circle:hover {
    border-color: #999;
}

.car-circle {
    display: flex;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s;
    color: #666;
}
.car-circle:hover {
    border-color: #999;
}

.profile-circle-avatar {
    font-size: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-ring {
    transition: stroke-dasharray 0.4s ease;
}

.donut-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}

.gear-menu-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.menu-btn:hover {
    opacity: 1;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.menu-icon span {
    display: block;
    height: 3px;
    background: #000;
    border-radius: 2px;
}

.gear-dropdown {
    display: none;
    position: absolute;
    top: 36px;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-width: 180px;
}

.gear-dropdown.show {
    display: block;
}

.gear-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    color: #333;
}

.gear-option svg {
    flex-shrink: 0;
}

.gear-option:hover {
    background: #f5f5f5;
}

.gear-option-danger {
    color: #e53935;
}

/* Reports overlay */
.reports-overlay {
    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: 10000;
}

.reports-panel {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.reports-header h2 {
    margin: 0;
    font-size: 20px;
}

.reports-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 6px;
}

.reports-close:hover {
    background: #f0f0f0;
    color: #333;
}

.reports-list {
    overflow-y: auto;
    padding: 12px 16px;
    flex: 1;
}

.reports-loading {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

.report-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.report-date {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.report-score {
    font-weight: 700;
    font-size: 18px;
    padding: 2px 10px;
    border-radius: 8px;
}

.report-score-good {
    background: #e8f5e9;
    color: #2e7d32;
}

.report-score-ok {
    background: #fff8e1;
    color: #f57f17;
}

.report-score-low {
    background: #ffebee;
    color: #c62828;
}

.report-summary {
    font-size: 14px;
    color: #666;
}

.report-details {
    margin-top: 8px;
}

.report-details summary {
    font-size: 13px;
    font-weight: 600;
    color: #e53935;
    cursor: pointer;
    padding: 4px 0;
}

.report-words {
    padding: 6px 0 0 8px;
}

.report-word-item {
    font-size: 13px;
    padding: 3px 0;
    color: #555;
}

.report-word-correct {
    font-weight: 600;
    color: #2e7d32;
}

.report-word-typed {
    color: #999;
    font-style: italic;
}

.score-label {
    margin-right: 8px;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    display: inline-block;
}

.main-content {
    margin-top: 5vh;
    text-align: center;
}

.hear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    font-size: 36px;
    background: none;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.hear-btn:hover {
    border-color: #000;
    background: #f5f5f5;
}

.hear-btn:active {
    transform: scale(0.96);
    background: #eee;
}

.hear-btn.hear-pulse {
    animation: hearPulse 0.8s ease-in-out 3;
}

@keyframes hearPulse {
    0%, 100% { transform: scale(1); border-color: #e0e0e0; }
    50% { transform: scale(1.15); border-color: #2196f3; }
}

h1 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 50px;
    color: #000000;
}

.word-section {
    margin-bottom: 30px;
}

.speak-btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    display: none;
}

.speak-btn:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.speak-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.word-count {
    font-size: 18px;
    color: #666666;
    margin-top: 12px;
    letter-spacing: 0.3px;
}

.input-section {
    margin-bottom: 0;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10vh;
    width: 100%;
    padding: 0;
}

.results-display {
    margin-top: 10px;
    width: 100%;
    margin-left: 0;
    margin-right: auto;
    max-width: 100%;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 24px;
}

.result-word {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-number {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-hint {
    font-size: 14px;
    color: #888888;
    font-style: italic;
}

.result-typed {
    font-size: 20px;
    color: #666666;
    font-style: italic;
}

.result-checkmark {
    font-size: 28px;
    color: #4caf50;
    min-width: 40px;
}

.result-x {
    font-size: 28px;
    color: #dc3545;
    min-width: 40px;
}

#spellingInput {
    width: 80%;
    max-width: 100%;
    padding: 10px 0;
    font-size: 96px;
    letter-spacing: 10px;
    border: none;
    border-bottom: none;
    border-radius: 0;
    background-color: transparent;
    color: #000000;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#spellingInput:disabled {
    background-color: transparent;
    color: #666666;
    cursor: not-allowed;
}

#spellingInput:focus {
    border-bottom-color: #000000;
    box-shadow: none;
}

#spellingInput::placeholder {
    color: #cccccc;
}

#spellingInput.mic-active {
    border-bottom: 3px solid #4caf50;
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { border-bottom-color: #4caf50; }
    50% { border-bottom-color: #81c784; }
}

#spellingInput.correct {
    background-color: transparent;
    border-bottom-color: #4caf50;
}

#spellingInput.incorrect {
    background-color: transparent;
    border-bottom-color: #dc3545;
}

.submit-btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    display: none;
}

.submit-btn:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.feedback {
    min-height: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    display: none;
}

.feedback.correct {
    color: #000000;
    animation: slideIn 0.3s ease;
}

.feedback.correct::before {
    content: "✓ ";
    font-weight: 700;
}

.feedback.incorrect {
    color: #000000;
}

.feedback.incorrect::before {
    content: "✗ ";
    font-weight: 700;
}

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

.final-score {
    margin: 40px 0;
}

.score-text {
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
    color: #000000;
}

.incorrect-section {
    margin: 40px 0;
    text-align: left;
    background-color: #f5f5f5;
    padding: 24px;
    border-radius: 4px;
}

.incorrect-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #000000;
    text-align: center;
}

.incorrect-words {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.incorrect-word {
    background-color: #ffffff;
    border: 1.5px solid #000000;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
}

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

.snake-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    animation: snakeFadeIn 0.3s ease;
}

.snake-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.snake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.snake-body {
    font-size: 48px;
    display: flex;
    animation: snakeSlither 0.6s ease-in-out infinite alternate;
}

.snake-segment {
    display: inline-block;
    animation: snakeWave 0.5s ease-in-out infinite alternate;
}

.snake-speech {
    background: #4caf50;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    animation: snakeBounce 0.5s ease-in-out infinite alternate;
}

.snake-quiz {
    background: #fff;
    color: #333;
    padding: 16px 20px;
    border-radius: 14px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    animation: snakeFadeIn 0.5s ease 0.3s both;
}

.quiz-question {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.3;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    font-size: 17px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.quiz-option:hover:not(:disabled) {
    border-color: #90caf9;
    background: #e3f2fd;
}

.quiz-option:active:not(:disabled) {
    transform: scale(0.97);
}

.quiz-option.quiz-correct {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
}

.quiz-option.quiz-wrong {
    border-color: #e53935;
    background: #ffebee;
    color: #c62828;
}

.quiz-option:disabled {
    cursor: default;
    opacity: 0.7;
}

.quiz-option.quiz-correct:disabled,
.quiz-option.quiz-wrong:disabled {
    opacity: 1;
}

.quiz-feedback {
    display: none;
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.4;
    color: #555;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.quiz-right {
    color: #2e7d32;
    font-weight: 700;
}

.quiz-not-right {
    color: #e53935;
    font-weight: 700;
}

@keyframes snakeFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes snakeSlither {
    from { transform: translateX(-8px); }
    to { transform: translateX(8px); }
}

@keyframes snakeWave {
    from { transform: translateY(-4px); }
    to { transform: translateY(4px); }
}

@keyframes snakeBounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-6px) scale(1.05); }
}

.next-btn,
.restart-btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
    letter-spacing: 0.3px;
}

.next-btn:hover,
.restart-btn:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.next-btn:active,
.restart-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .score-display {
        position: static;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-bottom: 10px;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .donut-wrapper {
        width: 56px;
        height: 56px;
    }

    .donut-label {
        font-size: 14px;
    }

    .profile-circle {
        width: 56px;
        height: 56px;
    }

    .car-circle {
        display: flex;
        width: 56px;
        height: 56px;
    }

    .profile-circle-avatar {
        font-size: 24px;
    }

    .gear-menu-wrapper {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .gear-dropdown {
        right: 0;
    }

    .menu-btn {
        padding: 6px;
    }

    .menu-icon {
        width: 20px;
        gap: 4px;
    }

    .main-content {
        margin-top: 0;
    }

    .hear-btn {
        display: flex;
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .input-section {
        margin-top: 2vh;
        margin-bottom: 10px;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
    }

    #spellingInput {
        flex: 1;
        min-width: 0;
        font-size: 40px;
        letter-spacing: 5px;
        padding: 6px 0;
        text-align: left;
    }

    .results-display {
        width: 100%;
        margin-top: 15px;
        padding-top: 10px;
    }

    .result-item {
        font-size: 16px;
        padding: 3px 0;
    }

    .result-number {
        width: 28px;
        font-size: 14px;
    }

    .result-typed {
        font-size: 14px;
    }

    .result-hint {
        font-size: 11px;
    }

    .result-checkmark,
    .result-x {
        font-size: 20px;
        min-width: 28px;
    }

    .snake-body {
        font-size: 28px;
    }

    .snake-speech {
        font-size: 20px;
        padding: 8px 18px;
        border-radius: 12px;
    }

    .snake-quiz {
        padding: 12px 14px;
        max-width: 320px;
    }

    .quiz-question {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .quiz-option {
        padding: 10px 12px;
        font-size: 15px;
    }

    .quiz-feedback {
        font-size: 13px;
    }

    .score-number {
        font-size: 36px;
    }

    .incorrect-section {
        padding: 14px;
    }

    .submit-btn {
        width: 100%;
    }

    .flashcard-word {
        font-size: 56px;
        letter-spacing: 4px;
    }

    .flashcard-sentence {
        font-size: 16px;
    }

    .flashcard {
        padding: 24px 18px;
    }
}

/* Touch devices in landscape */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 8px;
    }

    .score-display {
        position: static;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-bottom: 6px;
        gap: 6px;
    }

    .donut-wrapper {
        width: 44px;
        height: 44px;
    }

    .donut-label {
        font-size: 12px;
    }

    .profile-circle {
        width: 44px;
        height: 44px;
    }

    .car-circle {
        display: flex;
        width: 44px;
        height: 44px;
    }
    .car-circle svg {
        width: 20px;
        height: 20px;
    }

    .profile-circle-avatar {
        font-size: 20px;
    }

    .gear-menu-wrapper {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .container {
        padding: 4px 10px;
    }

    .main-content {
        margin-top: 0;
    }

    .hear-btn {
        display: flex;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .input-section {
        margin-top: 1vh;
        margin-bottom: 6px;
    }

    #spellingInput {
        font-size: 36px;
        letter-spacing: 4px;
        padding: 4px 0;
    }

    .results-display {
        margin-top: 8px;
        padding-top: 6px;
    }

    .result-item {
        font-size: 16px;
        padding: 2px 0;
    }

    .flashcard-word {
        font-size: 48px;
    }

    .flashcard {
        padding: 16px 14px;
    }

    .flashcard-sentence {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .wordlists-overlay,
    .wordlist-edit-overlay,
    .reports-overlay {
        align-items: flex-start;
        padding: 8px;
    }

    .wordlists-panel,
    .reports-panel {
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }

    .wordlist-edit-panel {
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }
}

/* Show hear button on all touch-capable devices */
@media (hover: none) and (pointer: coarse) {
    .hear-btn {
        display: flex;
    }
}

.wrong-words-dropdown {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.wrong-words-dropdown summary {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #e53935;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wrong-words-dropdown summary::before {
    content: '▶';
    font-size: 12px;
    transition: transform 0.2s;
}

.wrong-words-dropdown[open] summary::before {
    transform: rotate(90deg);
}

.wrong-words-dropdown summary::-webkit-details-marker {
    display: none;
}

.wrong-words-dropdown .result-item {
    border-top: 1px solid #f0f0f0;
}

/* Flashcard Practice Mode */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    max-width: 500px;
    margin: 0 auto;
}

.flashcard-empty {
    text-align: center;
    color: #999;
    font-size: 18px;
    padding: 60px 20px;
    line-height: 1.8;
}

.flashcard {
    width: 100%;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 32px 28px;
    text-align: center;
    position: relative;
}

.flashcard-word {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: 6px;
    margin-bottom: 12px;
    color: #000;
    line-height: 1.2;
}

.flashcard-word .letter {
    display: inline-block;
    transition: color 0.3s, transform 0.3s;
}

.flashcard-word .letter.highlight {
    color: #bbb;
    transform: scale(1.15);
}

.flashcard-speaker {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #333;
}

.flashcard-speaker:hover {
    border-color: #000;
    background: #f5f5f5;
}

.flashcard-sentence {
    font-size: 18px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 16px;
}

.flashcard-sentence .word-highlight {
    color: #e53935;
    font-weight: 600;
}

.flashcard-mistake {
    font-size: 15px;
    color: #888;
    margin-bottom: 10px;
    font-style: italic;
}

.flashcard-tip {
    font-size: 15px;
    color: #2e7d32;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.flashcard-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.flashcard-arrow {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #333;
}

.flashcard-arrow:hover {
    border-color: #000;
    background: #f5f5f5;
}

.flashcard-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.flashcard-counter {
    font-size: 15px;
    color: #888;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.flashcard-play {
    background: none;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #333;
}

.flashcard-play:hover {
    border-color: #000;
    background: #f5f5f5;
}

.flashcard-family {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 14px 18px;
    width: 100%;
    text-align: center;
}

.flashcard-family-label {
    font-size: 13px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.flashcard-family-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.flashcard-family-word {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* Word Lists Modal */
.wordlists-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordlists-panel {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.wordlists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.wordlists-header h2 {
    margin: 0;
    font-size: 20px;
}

.wordlists-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 6px;
}

.wordlists-close:hover {
    background: #f0f0f0;
    color: #333;
}

.wordlists-list {
    overflow-y: auto;
    padding: 12px 16px;
    flex: 1;
}

.wordlists-add-btn {
    background: none;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    margin: 0 16px 16px 16px;
    font-family: inherit;
    transition: all 0.15s;
}

.wordlists-add-btn:hover {
    border-color: #666;
    color: #333;
}

.wordlist-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wordlist-info {
    flex: 1;
    min-width: 0;
}

.wordlist-name {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.wordlist-count {
    font-size: 13px;
    color: #888;
}

.wordlist-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.wordlist-actions button {
    background: none;
    border: 1.5px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    color: #333;
}

.wordlist-actions button:hover {
    border-color: #000;
    background: #f5f5f5;
}

.wordlist-actions button.danger:hover {
    border-color: #dc3545;
    color: #dc3545;
}

/* Word List Edit Modal */
.wordlist-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wordlist-edit-panel {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.wordlist-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.wordlist-edit-header h2 {
    margin: 0;
    font-size: 20px;
}

.wordlist-edit-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 6px;
}

.wordlist-edit-close:hover {
    background: #f0f0f0;
    color: #333;
}

.wordlist-edit-form {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.wordlist-edit-form input[type="text"] {
    width: 100%;
    padding: 10px 0;
    font-size: 18px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    outline: none;
    font-family: inherit;
    color: #000;
    background: transparent;
    transition: border-color 0.2s;
}

.wordlist-edit-form input[type="text"]:focus {
    border-bottom-color: #000;
}

.wordlist-edit-form input[type="text"]::placeholder {
    color: #ccc;
}

.wordlist-words-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 10px 0;
}

.wordlist-words-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    min-height: 20px;
}

.wordlist-word-chip {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px 8px 6px 12px;
    font-size: 15px;
    font-weight: 500;
    color: #000;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wordlist-word-chip .chip-text {
    flex: 1;
}

.wordlist-word-chip .chip-edit-input {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    width: 60px;
    outline: none;
    color: #000;
    font-family: inherit;
    padding: 0;
}

.wordlist-word-chip button {
    background: none;
    border: none;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.wordlist-word-chip button:hover {
    color: #dc3545;
}

.wordlist-add-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.wordlist-add-row input {
    flex: 1;
}

.wordlist-add-row button {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 36px;
    font-size: 18px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.wordlist-add-row button:hover {
    background: #333;
}

.wordlist-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
}

.wordlist-edit-actions button,
.profile-edit-actions button {
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}

.btn-cancel {
    background: none;
    border: 1.5px solid #e0e0e0;
    color: #666;
}

.btn-cancel:hover {
    border-color: #000;
    color: #000;
}

.btn-save {
    background: #000;
    border: 1.5px solid #000;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-save:hover {
    background: #333;
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.btn-save:active,
.btn-cancel:active {
    transform: translateY(0);
}

/* Profile delete */
.profile-delete-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    margin-top: 20px;
    font-family: inherit;
    transition: color 0.15s;
}

.profile-delete-btn:hover {
    color: #dc3545;
}

/* ── Car Mode ── */
.car-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #111;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.car-screen {
    width: 100%;
    max-width: 600px;
    padding: 24px;
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
    gap: 16px;
    user-select: none;
    -webkit-user-select: none;
}
.car-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}
.car-progress {
    font-size: 16px;
    color: #888;
    font-weight: 600;
}
.car-stop {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.car-stop:hover { color: #fff; }
.car-word {
    font-size: 18px;
    color: #666;
    min-height: 24px;
    letter-spacing: 0.5px;
}
.car-letters {
    display: none;
}
.car-letters.correct { color: #4caf50; }
.car-letters.wrong { color: #f44336; }
.car-mic {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}
.car-mic-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 3px solid #444;
    transition: border-color 0.3s;
}
.car-mic-ring.listening {
    border-color: #4caf50;
    animation: carPulse 1.5s ease-in-out infinite;
}
@keyframes carPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}
.car-status {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #fff;
    min-height: 60px;
    word-break: break-all;
    line-height: 1.2;
    padding: 0 10px;
}
.car-status.correct { color: #4caf50; }
.car-status.wrong { color: #f44336; }
.car-skip-intro {
    position: absolute;
    bottom: 28px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 15px;
    cursor: pointer;
    z-index: 10;
    font-family: inherit;
}
.car-skip-intro:active {
    background: rgba(255,255,255,0.3);
}
.car-score {
    font-size: 14px;
    color: #888;
    min-height: 20px;
    margin-top: 8px;
}

/* Car Mode command buttons */
.car-commands {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding-bottom: 18px;
}
.car-cmd {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #444;
    background: transparent;
    color: #aaa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    gap: 0;
    position: relative;
}
.car-cmd-label {
    position: absolute;
    bottom: -16px;
    font-size: 9px;
    color: #666;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
}
.car-cmd:active {
    transform: scale(0.92);
}
.car-cmd:hover {
    border-color: #888;
    color: #fff;
}
.car-cmd-check {
    width: 52px;
    height: 52px;
    border-color: #4caf50;
    color: #4caf50;
}
.car-cmd-check:hover {
    border-color: #66bb6a;
    color: #66bb6a;
    background: rgba(76, 175, 80, 0.1);
}

/* Car mode desktop sizing */
@media (min-width: 768px) {
    .car-screen {
        gap: 24px;
    }
    .car-progress {
        font-size: 20px;
    }
    .car-stop {
        font-size: 36px;
    }
    .car-mic {
        width: 120px;
        height: 120px;
        margin: 16px 0;
    }
    .car-mic svg {
        width: 56px;
        height: 56px;
    }
    .car-mic-ring {
        border-width: 4px;
    }
    .car-status {
        font-size: 72px;
        min-height: 90px;
        letter-spacing: 10px;
    }
    .car-word {
        font-size: 24px;
        min-height: 32px;
    }
    .car-commands {
        gap: 24px;
        margin-top: 20px;
        padding-bottom: 24px;
    }
    .car-cmd {
        width: 60px;
        height: 60px;
        border-width: 2.5px;
    }
    .car-cmd svg {
        width: 26px;
        height: 26px;
    }
    .car-cmd-check {
        width: 72px;
        height: 72px;
    }
    .car-cmd-check svg {
        width: 30px;
        height: 30px;
    }
    .car-cmd-label {
        font-size: 11px;
        bottom: -20px;
    }
    .car-score {
        font-size: 18px;
    }
}

/* Profile Edit Modal */
.profile-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-edit-panel {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.profile-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.profile-edit-header h2 {
    margin: 0;
    font-size: 20px;
}

.profile-edit-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 6px;
}

.profile-edit-close:hover {
    background: #f0f0f0;
    color: #333;
}

.profile-edit-form {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.profile-edit-form input[type="text"] {
    width: 100%;
    padding: 10px 0;
    font-size: 18px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    outline: none;
    font-family: inherit;
    color: #000;
    background: transparent;
    transition: border-color 0.2s;
}

.profile-edit-form input[type="text"]:focus {
    border-bottom-color: #000;
}

.avatar-picker-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 10px 0;
}

.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar-option {
    width: 48px;
    height: 48px;
    font-size: 0;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 8px;
}

.avatar-option:hover {
    border-color: #999;
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: #2196f3;
    background: #e3f2fd;
}

.profile-edit-actions {
    display: flex;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.profile-card-edit {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.profile-card-edit:hover {
    color: #333;
}
