/* ================================================
   Angielskie Czasowniki Nieregularne — global CSS
   ================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 10px;
}

.app {
  background: white;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  min-height: 500px;
}

h1 { color: #4c1d95; text-align: center; margin-bottom: 6px; font-size: 1.7em; }
h2 { color: #5b21b6; margin-bottom: 18px; text-align: center; font-size: 1.3em; }
.subtitle { text-align: center; color: #6b7280; margin-bottom: 22px; font-size: 0.9em; }

/* ---- BUTTONS ---- */
.btn {
  display: block; width: 100%; padding: 14px 18px; margin: 9px 0;
  border: none; border-radius: 12px; font-size: 1.05em;
  cursor: pointer; font-weight: 600;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary   { background: linear-gradient(135deg, #667eea, #764ba2); color: white; box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(102,126,234,0.6); }
.btn-success   { background: linear-gradient(135deg, #34d399, #059669); color: white; }
.btn-advanced  { background: linear-gradient(135deg, #fb923c, #ea580c); color: white; box-shadow: 0 4px 15px rgba(234,88,12,0.3); }
.btn-advanced:hover { box-shadow: 0 6px 20px rgba(234,88,12,0.5); }
.btn-danger    { background: linear-gradient(135deg, #f87171, #dc2626); color: white; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }

.back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; background: none; border: none;
  color: #7c3aed; font-size: 0.95em; cursor: pointer;
  margin-bottom: 14px; font-weight: 600;
}
.back-btn:hover { text-decoration: underline; }

/* ---- MENU ---- */
.menu-stats {
  background: #f5f3ff; border-radius: 12px; padding: 14px;
  margin-bottom: 22px; text-align: center; color: #5b21b6;
}
.menu-stats .stat { font-size: 1.5em; font-weight: bold; }

/* ---- KATALOG TESTÓW ---- */
.catalog-section { margin: 20px 0 8px; }
.catalog-heading {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78em; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: #9ca3af; margin-bottom: 10px;
}
.catalog-heading::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}
/* Karty testów — nadpisuj display:block z .btn */
.btn.ctc-btn {
  display: flex !important; align-items: center;
  gap: 12px; text-align: left;
  padding: 13px 16px;
}
.ctc-btn-icon  { font-size: 1.4em; flex-shrink: 0; }
.ctc-btn-text  { flex: 1; }
.ctc-btn-name  { display: block; font-weight: 700; font-size: 1em; }
.ctc-btn-sub   { display: block; font-size: 0.78em; opacity: 0.82; margin-top: 2px; }
.ctc-btn-arrow { flex-shrink: 0; font-size: 1.25em; opacity: 0.65; }

/* ---- PROGRESS BAR ---- */
.prog-container { background: #e5e7eb; border-radius: 10px; height: 9px; margin-bottom: 18px; }
.prog-bar { background: linear-gradient(90deg, #8b5cf6, #6d28d9); height: 100%; border-radius: 10px; transition: width 0.3s; }
.prog-text { text-align: center; color: #6b7280; font-size: 0.88em; margin-bottom: 7px; }

/* ---- FLASHCARD ---- */
.flashcard {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 16px; padding: 36px 20px; text-align: center;
  cursor: pointer; min-height: 185px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin-bottom: 18px; border: 3px solid #8b5cf6;
  transition: all 0.25s; user-select: none;
}
.flashcard:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139,92,246,0.25); }
.fc-label { font-size: 0.78em; color: #7c3aed; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.fc-word  { font-size: 2.1em; font-weight: bold; color: #4c1d95; }
.fc-hint  { font-size: 0.88em; color: #8b5cf6; margin-top: 10px; }
.fc-divider { width: 60%; height: 2px; background: #c4b5fd; margin: 14px auto 10px; display: none; }
.fc-base { font-size: 1.45em; color: #059669; font-weight: bold; display: none; margin-top: 2px; }
.fc-past { font-size: 1.15em; color: #0891b2; display: none; margin-top: 4px; }
.fc-base-label, .fc-past-label { font-size: 0.75em; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; display: none; margin-top: 10px; }

.fiszki-btns { display: flex; gap: 10px; }
.fiszki-btns .btn { flex: 1; }

/* ---- COUNT / MODE SELECTOR ---- */
.section-title { font-weight: bold; color: #374151; margin-bottom: 8px; font-size: 0.88em; }
.count-selector { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.count-btn {
  flex: 1; min-width: 55px; padding: 10px 6px;
  border: 2px solid #d1d5db; border-radius: 8px;
  background: white; cursor: pointer;
  font-size: 0.9em; font-weight: 600; text-align: center;
  transition: all 0.15s;
}
.count-btn.selected { border-color: #8b5cf6; background: #f5f3ff; color: #5b21b6; }

/* ---- TEST ---- */
.test-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.score-badge { background: #f5f3ff; color: #5b21b6; padding: 5px 13px; border-radius: 20px; font-weight: bold; font-size: 0.9em; }

.question-card {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 14px; padding: 26px 18px; text-align: center;
  margin-bottom: 22px; border: 2px solid #f59e0b;
}
.question-card .q-label { font-size: 0.78em; color: #92400e; text-transform: uppercase; letter-spacing: 1px; }
.question-card .q-word  { font-size: 2em; font-weight: bold; color: #78350f; margin-top: 5px; }

.input-group { margin-bottom: 13px; }
.input-group label { display: block; font-weight: 600; color: #374151; margin-bottom: 5px; font-size: 0.92em; }
.input-group input {
  width: 100%; padding: 13px 15px;
  border: 2px solid #d1d5db; border-radius: 10px;
  font-size: 1.05em; outline: none; transition: border-color 0.2s;
}
.input-group input:focus   { border-color: #8b5cf6; }
.input-group input.correct { border-color: #059669; background: #f0fdf4; }
.input-group input.wrong   { border-color: #dc2626; background: #fef2f2; }

.feedback { text-align: center; font-size: 1.05em; font-weight: bold; min-height: 26px; margin-bottom: 10px; }
.feedback.correct { color: #059669; }
.feedback.wrong   { color: #dc2626; }
.correct-answer   { font-size: 0.88em; color: #6b7280; text-align: center; margin-bottom: 12px; min-height: 20px; }

/* ---- WYNIKI ---- */
.result-card   { text-align: center; padding: 12px 0 18px; }
.result-emoji  { font-size: 3.8em; margin-bottom: 10px; }
.result-score  { font-size: 2.6em; font-weight: bold; color: #4c1d95; }
.result-label  { color: #6b7280; margin-bottom: 8px; font-size: 1.05em; }
.result-message { color: #374151; margin-bottom: 20px; font-size: 0.93em; }

.scrollable { max-height: 280px; overflow-y: auto; }
.result-details { background: #f9fafb; border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; }
.result-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #e5e7eb; font-size: 0.88em;
}
.result-item:last-child { border-bottom: none; }
.ri-pl     { color: #374151; flex: 1; }
.ri-en     { color: #6b7280; flex: 1.2; text-align: center; font-style: italic; }
.ri-status { font-size: 1.15em; }

/* ---- HISTORIA ---- */
.history-item {
  background: #f9fafb; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 9px; display: flex; justify-content: space-between;
  align-items: center; border-left: 4px solid #8b5cf6;
}
.history-date { color: #6b7280; font-size: 0.82em; margin-top: 2px; }
.history-score { font-weight: bold; font-size: 1.05em; }
.history-score.good   { color: #059669; }
.history-score.medium { color: #d97706; }
.history-score.bad    { color: #dc2626; }
.empty-history { text-align: center; color: #9ca3af; padding: 40px 20px; font-size: 1.05em; }

/* ---- SPEAK BUTTONS ---- */
.speak-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.speak-btn {
  background: white; border: 2px solid #8b5cf6; border-radius: 22px;
  color: #7c3aed; cursor: pointer; font-size: 0.95em; padding: 7px 16px;
  font-weight: 700; transition: all 0.15s; white-space: nowrap;
}
.speak-btn:hover  { background: #f5f3ff; box-shadow: 0 3px 10px rgba(139,92,246,0.25); }
.speak-btn:active { transform: scale(0.95); }
.speak-btn.speaking { background: #ede9fe; border-color: #6d28d9; }

/* ---- MODE GRID (fiszki setup) ---- */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.mode-card {
  padding: 11px 8px; border: 2px solid #e5e7eb; border-radius: 12px;
  text-align: center; cursor: pointer; transition: all 0.15s;
  font-weight: 600; font-size: 0.85em; line-height: 1.4;
}
.mode-card:hover    { border-color: #8b5cf6; background: #faf5ff; }
.mode-card.selected { border-color: #8b5cf6; background: #f5f3ff; color: #5b21b6; }
.mode-card .mc-icon { font-size: 1.3em; display: block; margin-bottom: 3px; }
.mode-card .mc-sub  { font-weight: 400; color: #6b7280; font-size: 0.88em; display: block; }
.mode-card.selected .mc-sub { color: #7c3aed; }
.mode-card.full { grid-column: 1 / -1; }

/* ---- VERB LIST (wybierz view) ---- */
.verb-list { max-height: 360px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 12px; }
.verb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: background 0.1s;
}
.verb-item:last-child { border-bottom: none; }
.verb-item:hover { background: #f9fafb; }
.verb-item input[type=checkbox] { width: 17px; height: 17px; accent-color: #7c3aed; cursor: pointer; flex-shrink: 0; }
.vi-pl   { font-weight: 600; color: #374151; flex: 1; font-size: 0.92em; }
.vi-en   { color: #6b7280; font-size: 0.82em; flex: 1.3; }
.vi-dots { display: flex; gap: 3px; align-items: center; }
.vi-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.vi-dot.hard { background: #ef4444; }
.vi-dot.easy { background: #22c55e; }
.vi-dot.none { background: #d1d5db; }
.vi-fire { font-size: 0.75em; color: #ef4444; font-weight: bold; }

/* ---- SETS VIEW ---- */
.set-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 12px;
  margin-bottom: 9px; transition: border-color 0.15s;
}
.set-item.active { border-color: #8b5cf6; background: #f5f3ff; }
.set-item input[type=radio] { width: 17px; height: 17px; accent-color: #7c3aed; cursor: pointer; flex-shrink: 0; }
.format-hint {
  background: #f5f3ff; border-radius: 12px; padding: 12px 14px;
  font-size: 0.82em; color: #5b21b6; margin-top: 14px; line-height: 1.7;
}
.format-hint code { background: #ede9fe; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; color: #4c1d95; }

/* ---- LOGIN VIEW ---- */
.login-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 70vh; text-align: center;
}
.login-card {
  background: white; border-radius: 24px; padding: 44px 36px;
  max-width: 380px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.login-logo  { font-size: 3.2em; margin-bottom: 12px; }
.login-title { font-size: 1.55em; font-weight: 700; color: #1f2937; margin-bottom: 6px; }
.login-sub   { color: #6b7280; font-size: 0.92em; margin-bottom: 28px; line-height: 1.5; }
.login-note  { color: #9ca3af; font-size: 0.72em; margin-top: 18px; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  color: #d1d5db; font-size: 0.82em; margin: 16px 0;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }

.local-form { text-align: left; margin-top: 4px; }
.local-form input {
  width: 100%; padding: 10px 12px; border: 2px solid #e5e7eb;
  border-radius: 10px; font-size: 0.92em; margin-bottom: 8px;
  outline: none; transition: border-color 0.15s;
}
.local-form input:focus { border-color: #8b5cf6; }
.local-form .hint { font-size: 0.72em; color: #9ca3af; margin-top: 6px; }

/* ---- SELECTION TABLE (wybierz słówka do testu) ---- */
.sel-table-wrap {
  max-height: 360px; overflow-y: auto;
  border: 1px solid #e5e7eb; border-radius: 12px;
  user-select: none; -webkit-user-select: none;
  cursor: pointer;
}
.sel-table { width: 100%; border-collapse: collapse; font-size: 0.84em; }
.sel-table thead th {
  position: sticky; top: 0;
  background: #f5f3ff; color: #5b21b6; font-weight: 700;
  padding: 8px 6px; text-align: left;
  border-bottom: 2px solid #ddd6fe;
  font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.5px;
}
.sel-row { border-bottom: 1px solid #f3f4f6; }
.sel-row:last-child { border-bottom: none; }
.sel-row:hover { background: #faf5ff; }
.sel-row.sel-selected { background: #ede9fe; }
.sel-row.sel-selected:hover { background: #ddd6fe; }
.sel-table td { padding: 6px 6px; vertical-align: middle; }
.sel-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border: 2px solid #d1d5db; border-radius: 4px;
  font-size: 0.75em; color: white; font-weight: bold; flex-shrink: 0;
}
.sel-row.sel-selected .sel-check { border-color: #7c3aed; background: #7c3aed; }
.sel-en-sm { color: #6b7280; font-style: italic; }

/* ---- USER BAR ---- */
.user-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #f5f3ff; border-radius: 14px;
  margin-bottom: 14px;
}
.user-bar img {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #8b5cf6; flex-shrink: 0; object-fit: cover;
}
.user-bar-name  { font-weight: 600; color: #374151; flex: 1; font-size: 0.9em; text-align: left; }
.user-bar-email { font-size: 0.72em; color: #6b7280; text-align: left; }

/* ---- APP FOOTER ---- */
.app-footer {
  text-align: center; color: #d1d5db; font-size: 0.68em;
  margin-top: 28px; padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

/* ---- VIEWS ---- */
.view        { display: none; }
.view.active { display: block; }

/* ---- INNE TESTY ---- */
.btn-teal {
  background: linear-gradient(135deg, #14b8a6, #0d9488); color: white;
  box-shadow: 0 4px 15px rgba(20,184,166,0.35);
}
.btn-teal:hover { box-shadow: 0 6px 20px rgba(20,184,166,0.55); }

.et-test-card {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border: 2px solid #5eead4; border-radius: 14px;
  padding: 18px 20px; margin-bottom: 12px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.et-test-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,184,166,0.2); }
.et-card-title { font-size: 1.05em; font-weight: 700; color: #0f766e; }
.et-card-desc  { font-size: 0.87em; color: #374151; margin-top: 4px; }
.et-card-meta  { font-size: 0.78em; color: #0d9488; margin-top: 6px; font-weight: 600; }
.et-empty      { text-align:center; color:#94a3b8; padding:28px 0; font-size:0.9em; }

.et-instruction-box {
  background: #f0fdfa; border-left: 4px solid #14b8a6;
  border-radius: 8px; padding: 10px 14px;
  font-size: 0.9em; color: #0f766e; font-weight: 600;
  margin-bottom: 18px;
}
.et-word-pl {
  text-align: center; font-size: 2em; font-weight: 700;
  color: #1e293b; margin-bottom: 20px; padding: 20px;
  background: #f8fafc; border-radius: 12px;
}
.et-sentence {
  font-size: 1.15em; color: #1e293b; text-align: center;
  padding: 18px 14px; background: #f8fafc; border-radius: 12px;
  margin-bottom: 20px; line-height: 1.7;
}
.et-blank {
  display: inline-block; min-width: 60px;
  border-bottom: 3px solid #14b8a6;
  color: #14b8a6; font-weight: 700; margin: 0 4px;
  text-align: center;
}
.et-opts {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 16px;
}
.et-opt {
  padding: 13px 10px; border: 2px solid #e5e7eb;
  border-radius: 12px; background: #fff;
  font-size: 0.97em; cursor: pointer; font-weight: 500;
  transition: all 0.15s; text-align: center;
}
.et-opt:hover:not(:disabled) { border-color: #14b8a6; background: #f0fdfa; }
.et-opt:disabled              { cursor: default; opacity: 0.85; }
.et-opt-correct               { border-color: #059669 !important; background: #d1fae5 !important; color: #065f46 !important; }
.et-opt-wrong                 { border-color: #dc2626 !important; background: #fee2e2 !important; color: #991b1b !important; }

.et-mistakes-title { font-weight: 700; color: #374151; margin-bottom: 10px; font-size: 0.92em; }
.et-mistake-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid #f1f5f9;
  font-size: 0.85em;
}
.et-mistake-row:last-child { border-bottom: none; }
.et-m-q       { flex: 1 1 100%; font-style: italic; color: #64748b; }
.et-m-correct { color: #059669; font-weight: 700; }
.et-m-wrong   { color: #dc2626; }
.et-perfect   { color: #059669; text-align: center; font-weight: 700; padding: 16px; font-size: 1.05em; }

.et-type-wrap  { display: flex; gap: 8px; margin-bottom: 10px; }
.et-type-input {
  flex: 1; padding: 13px 14px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 1em; outline: none; transition: border-color 0.2s;
}
.et-type-input:focus { border-color: #14b8a6; }
.et-type-input:disabled { opacity: 0.85; }
.et-type-btn {
  padding: 13px 18px;
  background: linear-gradient(135deg, #14b8a6, #0d9488); color: white;
  border: none; border-radius: 10px; font-size: 0.95em;
  cursor: pointer; font-weight: 700; white-space: nowrap;
}
.et-type-btn:hover:not(:disabled) { opacity: 0.9; }
.et-type-btn:disabled { opacity: 0.55; cursor: default; }
.et-inp-ok  { border-color: #059669 !important; background: #d1fae5 !important; }
.et-inp-err { border-color: #dc2626 !important; background: #fee2e2 !important; }
.et-type-fb { text-align: center; font-weight: 700; font-size: 0.93em; padding: 9px 12px; border-radius: 8px; margin-top: 4px; min-height: 36px; }
.et-fb-ok   { color: #065f46; background: #d1fae5; }
.et-fb-err  { color: #991b1b; background: #fee2e2; }

/* ---- TYPING TEST (wpisywanie słowa) ---- */
.tt-input-wrap { display: flex; gap: 8px; margin-bottom: 10px; }
.tt-input {
  flex: 1; padding: 13px 14px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 1em; outline: none; transition: border-color 0.2s;
}
.tt-input:focus    { border-color: #14b8a6; }
.tt-input:disabled { opacity: 0.85; }
.tt-inp-ok  { border-color: #059669 !important; background: #d1fae5 !important; }
.tt-inp-err { border-color: #dc2626 !important; background: #fee2e2 !important; }
.tt-btn {
  padding: 13px 18px;
  background: linear-gradient(135deg, #14b8a6, #0d9488); color: white;
  border: none; border-radius: 10px; font-size: 0.95em;
  cursor: pointer; font-weight: 700; white-space: nowrap;
}
.tt-btn:hover:not(:disabled) { opacity: 0.9; }
.tt-btn:disabled { opacity: 0.55; cursor: default; }
.tt-fb {
  text-align: center; font-weight: 700; font-size: 0.93em;
  padding: 9px 12px; border-radius: 8px; min-height: 36px;
}
.tt-fb-ok  { color: #065f46; background: #d1fae5; }
.tt-fb-err { color: #991b1b; background: #fee2e2; }

/* ---- SPEAK BUTTON ---- */
.speak-btn {
  padding: 11px 14px;
  background: linear-gradient(135deg, #06b6d4, #0891b2); color: white;
  border: none; border-radius: 10px; font-size: 0.9em;
  cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: opacity 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.speak-btn:hover { opacity: 0.9; box-shadow: 0 2px 8px rgba(6,182,212,0.3); }
.speak-btn:active { transform: scale(0.98); }
.speak-btn.speaking { opacity: 0.7; }

