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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav-bar {
    background: #2c3e50;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ecf0f1;
}

.nav-bar h1 { font-size: 1.25rem; }

.nav-links { display: flex; gap: 1rem; }
.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}
.nav-links a:hover, .nav-links a.active {
    background: #34495e;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin: 0.3rem;
}
.btn-primary { background: #2980b9; color: #fff; }
.btn-primary:hover { background: #3498db; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #2ecc71; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-secondary { background: #95a5a6; color: #fff; }
.btn-secondary:hover { background: #7f8c8d; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }

.auth-card {
    max-width: 400px;
    margin: 3rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}
.auth-card h1 { margin-bottom: 1.5rem; color: #2c3e50; }
.auth-card input { margin-bottom: 1rem; text-align: center; }
.error-msg { color: #e74c3c; margin-bottom: 1rem; }
.auth-card p { margin-bottom: 0.5rem; }
.auth-link { margin-top: 1rem; }
.auth-link a { color: #2980b9; text-decoration: none; }

/* Settings */
.settings-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.settings-section h2 { margin-bottom: 1rem; font-size: 1.1rem; color: #2c3e50; }

.verb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.4rem;
    max-height: 400px;
    overflow-y: auto;
}
.verb-check {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.4rem;
    background: #f8f9fa;
    border-radius: 4px;
}
.verb-check input { margin-right: 0.4rem; }

/* Play */
.card-area {
    max-width: 600px;
    margin: 2rem auto;
}
.progress-bar {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.flashcard {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.flashcard .prompt {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}
.flashcard .verb-name {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-bottom: 0.5rem;
}
.flashcard .tense-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-style: italic;
}
.hint-section { text-align: center; margin-bottom: 1rem; }
.hint-toggle {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}
.hint-text {
    background: #fef9e7;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #8e6f1e;
}
.answer-area { text-align: center; }
.answer-area input[type="text"] {
    display: block;
    width: 80%;
    max-width: 400px;
    margin: 0 auto 1rem;
    padding: 0.8rem 1rem;
    font-size: 1.2rem;
    border: 2px solid #3498db;
    border-radius: 8px;
    text-align: center;
    outline: none;
}
.answer-area input[type="text"]:focus { border-color: #2980b9; }
.accent-bar { display: flex; justify-content: center; gap: 0.3rem; margin: 0 auto 0.8rem; width: fit-content; }
.accent-btn {
    padding: 0.35rem 0.6rem;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.accent-btn:hover { background: #eaf2f8; border-color: #2980b9; }

.result {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}
.result.correct { background: #d5f4e6; color: #27ae60; }
.result.incorrect { background: #fde2e2; color: #e74c3c; }
.result.accent-flag {
    background: #fef9e7;
    color: #8e6f1e;
    font-weight: normal;
    font-size: 0.9rem;
}
.correct-answer { font-size: 1.1rem; margin-top: 0.5rem; color: #2c3e50; }

/* Verbs reference */
.muted { color: #7f8c8d; }
.verbs-toolbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.verb-search {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    min-width: 220px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}
.verb-search:focus { outline: 2px solid #2980b9; border-color: #2980b9; }
.verbs-sort { display: flex; align-items: center; gap: 1rem; }
.verbs-sort-label { font-weight: 600; color: #2c3e50; }
.verbs-sort label { cursor: pointer; display: flex; align-items: center; gap: 0.3rem; }
.verbs-list { display: flex; flex-direction: column; gap: 0.4rem; }
.verb-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}
.verb-header {
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
}
.verb-header:hover { background: #f8f9fa; }
.verb-item.open { border-color: #2980b9; }
.verb-item.open .verb-header { background: #eaf2f8; }
.verb-it { font-weight: 600; color: #2c3e50; }
.verb-en { color: #7f8c8d; font-size: 0.9rem; }
.verb-caret {
    margin-left: auto;
    color: #95a5a6;
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}
.verb-item.open .verb-caret { transform: rotate(90deg); }
.verb-detail { display: none; padding: 0.5rem 1rem 1rem; }
.verb-detail.open { display: block; }
.verb-meta {
    margin: 0 0 0.55rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e3e7ea;
}
.verb-meta-row { font-size: 0.9rem; line-height: 1.45; }
.verb-meta-row .meta-label { color: #7f8c8d; margin-right: 0.35rem; }
.verb-meta-row .meta-val { font-weight: 600; color: #2c3e50; }
.verb-meta-row .meta-val.meta-type-regular { color: #1e8449; }
.verb-meta-row .meta-val.meta-type-irregular { color: #b9770e; }
.verb-item.search-hit {
    outline: 2px solid #f39c12;
    outline-offset: -2px;
}
.verb-item.search-hit .verb-header { background: #fef5e7; }
.conj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.conj-table th, .conj-table td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #eee;
}
.conj-table thead th { color: #7f8c8d; font-size: 0.8rem; }
.tense-row td {
    background: #f4f6f7;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.person-col { color: #7f8c8d; white-space: nowrap; width: 130px; }
.it-form { font-weight: 600; color: #2c3e50; }
.en-form { color: #555; }
.alt-form { font-weight: normal; color: #8e6f1e; font-size: 0.85rem; }

/* Results */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stat-card .value { font-size: 2rem; color: #2980b9; font-weight: bold; }
.stat-card .label { color: #7f8c8d; margin-top: 0.4rem; font-size: 0.9rem; }
.stat-card .score {
    font-size: 1.2rem;
    color: #27ae60;
    margin-top: 0.3rem;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.stats-table th, .stats-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}
.stats-table th { color: #7f8c8d; font-size: 0.85rem; font-weight: 600; }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.flex-center { display: flex; justify-content: center; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.w-full { width: 100%; }
.controls { margin-bottom: 1.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .flashcard { padding: 1.5rem 1rem; min-height: 140px; }
    .flashcard .prompt { font-size: 1.2rem; }
    .answer-area input[type="text"] { width: 95%; font-size: 1rem; }
    .verb-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .nav-bar { padding: 0.5rem 1rem; }
    .nav-bar h1 { font-size: 1rem; }
}
