.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.app-logo-icon {
  background: rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.app-logo-text {
  font-size: 18px;
  font-weight: 700;
}

.app-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.app-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

/* ===== HomePage ===== */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 8px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 16px;
}

.config-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.config-card h2 {
  margin-bottom: 20px;
  color: var(--text);
}

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

.config-card-header h2 {
  margin-bottom: 0;
}

.settings-icon-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
  line-height: 1;
}

.settings-icon-btn:hover {
  background: var(--bg);
}

.config-section {
  margin-bottom: 24px;
}

.config-section h3 {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tryb */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: all 0.2s;
}

.mode-btn:hover {
  border-color: var(--primary-light);
}

.mode-btn.active {
  border-color: var(--primary);
  background: #eef2ff;
}

.mode-icon {
  font-size: 28px;
}

.mode-name {
  font-weight: 700;
  font-size: 16px;
}

.mode-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Zakres - interaktywna tabliczka mnożenia */
.range-configurator {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.range-instruction {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.multiplication-grid {
  display: grid;
  grid-template-columns: 40px repeat(10, 1fr);
  gap: 4px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.grid-corner {
  /* pusty róg siatki */
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  height: 32px;
}

.grid-row {
  display: contents;
}

.grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
  padding: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.grid-cell:hover {
  border-color: var(--primary-light);
  background: #eef2ff;
}

.grid-cell.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #fff;
}

.grid-cell.start,
.grid-cell.end {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}

.range-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #eef2ff;
  border-radius: 8px;
  padding: 10px 16px;
}

.range-summary-label {
  font-size: 14px;
  color: var(--text-muted);
}

.range-summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.range-summary-detail {
  font-size: 13px;
  color: var(--text-muted);
}

/* Liczba pytań / czas */
.number-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.num-btn {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

.num-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.start-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  transition: background 0.2s;
}

.start-btn:hover {
  background: var(--primary-dark);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Podgląd maskotki na stronie głównej */
.home-pet {
  display: flex;
  justify-content: center;
  background: #eef2ff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

/* Przyciski na stronie ustawień */
.settings-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.settings-actions .start-btn {
  flex: 1;
}

/* ===== GamePage ===== */
.game-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Przycisk "Dalej" po błędnej odpowiedzi */
.next-btn {
  align-self: center;
  padding: 14px 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.next-btn:hover {
  background: var(--primary-dark);
}

/* Licznik czasu w trybie sprawdzianu */
.exam-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef2ff;
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 8px 16px;
  min-width: 120px;
  justify-content: center;
}

.exam-timer-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.exam-timer-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.game-progress {
  flex: 1;
}

.game-progress span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Timer */
.timer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.timer-bar {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--green);
  border-radius: 5px;
  transition: width 1s linear;
}

.timer.low .timer-fill {
  background: var(--red);
}

.timer-value {
  font-weight: 700;
  font-size: 16px;
  min-width: 32px;
  text-align: right;
}

.timer.low .timer-value {
  color: var(--red);
}

/* QuestionCard */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 28px;
  text-align: center;
  transition: border 0.2s;
  border: 3px solid transparent;
}

.question-card.correct {
  border-color: var(--green);
}

.question-card.wrong {
  border-color: var(--red);
}

.question-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.question-number {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
}

.question-op {
  font-size: 40px;
  color: var(--primary);
  font-weight: 700;
}

.question-answer {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary);
}

.answer-input-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.answer-input {
  flex: 1;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border 0.2s;
}

.answer-input:focus {
  border-color: var(--primary);
}

.submit-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Feedback */
.feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  max-width: 360px;
  margin: 0 auto;
}

.feedback.correct {
  background: var(--green-light);
  color: var(--green);
}

.feedback.wrong {
  background: var(--red-light);
  color: var(--red);
}

.feedback-icon {
  font-size: 28px;
}

/* ===== ResultsPage ===== */
.results-page {
  display: flex;
  justify-content: center;
}

.results-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.results-card h2 {
  margin-bottom: 24px;
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 6px solid;
}

.score-circle.green {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}

.score-circle.yellow {
  border-color: var(--yellow);
  color: var(--yellow);
  background: var(--yellow-light);
}

.score-circle.red {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.score-value {
  font-size: 40px;
  font-weight: 800;
}

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

.grade {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.grade.green {
  color: var(--green);
}

.grade.yellow {
  color: var(--yellow);
}

.grade.red {
  color: var(--red);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.result-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.result-value {
  font-size: 18px;
  font-weight: 700;
}

.result-value.correct {
  color: var(--green);
}

.result-value.wrong {
  color: var(--red);
}

.save-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-bottom: 20px;
}

.save-section h3 {
  margin-bottom: 12px;
}

.save-row {
  display: flex;
  gap: 10px;
}

.nick-input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

.nick-input:focus {
  border-color: var(--primary);
}

.save-btn,
.stats-btn {
  padding: 12px 20px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.save-btn:disabled,
.stats-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-text {
  color: var(--red);
  margin-top: 10px;
  font-size: 14px;
}

.saved-confirmation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green-light);
  color: var(--green);
  padding: 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 20px;
}

.saved-icon {
  font-size: 24px;
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.secondary-btn {
  padding: 12px 20px;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: #eef2ff;
}

/* ===== RankingPage ===== */
.ranking-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ranking-header h2 {
  font-size: 24px;
}

.ranking-mode-toggle {
  display: flex;
  gap: 8px;
}

.rank-mode-btn {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
}

.rank-mode-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.ranking-table {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ranking-row {
  display: grid;
  grid-template-columns: 50px 1fr 80px 90px 80px 1fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.ranking-row:last-child {
  border-bottom: none;
}

.ranking-row.header {
  background: var(--bg);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 12px;
}

.rank-col {
  font-weight: 700;
}

.nick-col {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-col {
  font-weight: 700;
  color: var(--primary);
}

.loading-text,
.empty-text {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.stats-section h3 {
  margin-bottom: 16px;
}

.stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stat-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Maskotka (Pet) ===== */
.pet {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pet-large .pet-emoji {
  font-size: 80px;
  line-height: 1;
}

.pet-small .pet-emoji {
  font-size: 40px;
  line-height: 1;
}

.pet-happy .pet-emoji {
  animation: pet-bounce 0.6s ease;
}

.pet-sad .pet-emoji {
  animation: pet-sad 0.6s ease;
}

@keyframes pet-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-14px); }
  70% { transform: translateY(-6px); }
}

@keyframes pet-sad {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(6px) scale(0.95); }
}

.pet-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pet-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.pet-level {
  font-size: 14px;
  color: var(--text-muted);
}

.pet-progress {
  margin-top: 4px;
  width: 100%;
  max-width: 220px;
}

.pet-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.pet-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}

.pet-progress-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Maskotka na ekranie gry */
.game-pet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.pet-evolved-banner {
  background: var(--yellow-light);
  color: var(--yellow);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  animation: pet-bounce 0.8s ease;
}

/* ===== PetPage ===== */
.pet-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.pet-header h2 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}

.pet-subtitle {
  color: var(--text-muted);
}

.pet-login {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.pet-login-row {
  display: flex;
  gap: 10px;
}

.pet-display {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  justify-content: center;
}

.pet-config {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.pet-config h3 {
  margin-bottom: 12px;
  color: var(--text);
}

.pet-name-row {
  margin-bottom: 20px;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.species-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: all 0.2s;
}

.species-card:hover {
  border-color: var(--primary-light);
}

.species-card.active {
  border-color: var(--primary);
  background: #eef2ff;
}

.species-emoji {
  font-size: 40px;
}

.species-name {
  font-weight: 700;
}

.species-evolution {
  display: flex;
  gap: 4px;
}

.species-evo-emoji {
  font-size: 14px;
}

.pet-evolution-preview {
  margin-bottom: 20px;
}

.evolution-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.evolution-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  opacity: 0.4;
}

.evolution-step.reached {
  opacity: 1;
  background: #eef2ff;
  border: 2px solid var(--primary);
}

.evolution-emoji {
  font-size: 32px;
}

.evolution-level {
  font-size: 12px;
  color: var(--text-muted);
}

.save-pet-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
}

.save-pet-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.success-text {
  color: var(--green);
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
}

/* ===== Panel rodzica ===== */
.parent-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.parent-header h2 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}

.parent-subtitle {
  color: var(--text-muted);
}

.logout-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--bg);
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.parent-auth-card,
.parent-children,
.child-stats {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.parent-auth-card h3,
.parent-children h3,
.child-stats h3 {
  margin-bottom: 16px;
}

.parent-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parent-form .secondary-btn {
  width: 100%;
}

.children-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.child-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  transition: all 0.2s;
  text-align: left;
}

.child-card:hover {
  border-color: var(--primary-light);
}

.child-card.active {
  border-color: var(--primary);
  background: #eef2ff;
}

.child-name {
  font-weight: 700;
}

.child-nick {
  color: var(--text-muted);
  font-size: 14px;
}

.add-child-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.add-child-form h4 {
  margin-bottom: 12px;
}

.stats-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pet-progress-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #eef2ff;
  border-radius: 10px;
  padding: 16px;
}

.pet-progress-emoji {
  font-size: 48px;
}

.pet-progress-name {
  font-weight: 700;
  font-size: 18px;
}

.pet-progress-level {
  color: var(--text-muted);
}

.child-settings {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clear-progress-btn {
  padding: 12px;
  background: var(--red-light);
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-progress-btn:hover {
  background: var(--red);
  color: #fff;
}

.clear-progress-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-row label {
  font-size: 14px;
  color: var(--text);
}

.settings-row select {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  min-width: 70px;
}

.stats-section-block {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
}

.stats-section-block h4 {
  margin-bottom: 12px;
}

.daily-time-list,
.difficult-pairs,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-time-row,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
}

.daily-time-value {
  font-weight: 700;
  color: var(--primary);
}

.difficult-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--red-light);
  border-radius: 8px;
  font-size: 14px;
}

.difficult-pair-value {
  font-weight: 800;
  font-size: 16px;
  color: var(--red);
}

.difficult-pair-count {
  color: var(--red);
  font-weight: 600;
}

.history-mode {
  font-size: 13px;
  color: var(--text-muted);
}

.history-score {
  font-weight: 700;
  color: var(--primary);
}

.history-correct {
  font-weight: 600;
}

.history-time {
  color: var(--text-muted);
  font-size: 13px;
}

.history-incomplete {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  background: var(--yellow-light);
  padding: 2px 8px;
  border-radius: 6px;
}

.study-results-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.study-results-header,
.study-results-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.study-results-header {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.study-results-row {
  background: #fff;
}

.study-correct {
  font-weight: 700;
  color: var(--green);
}

.study-wrong {
  font-weight: 700;
  color: var(--red);
}

/* ===== Responsywność ===== */
@media (max-width: 640px) {
  .app-header-inner {
    padding: 12px 16px;
  }

  .app-logo-text {
    font-size: 16px;
  }

  .app-main {
    padding: 16px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .mode-selector {
    grid-template-columns: 1fr;
  }

  .config-card {
    padding: 20px;
  }

  .multiplication-grid {
    grid-template-columns: 28px repeat(10, 1fr);
    gap: 2px;
  }

  .grid-header {
    font-size: 12px;
    height: 26px;
  }

  .grid-cell {
    font-size: 11px;
    border-radius: 4px;
  }

  .question-number,
  .question-answer {
    font-size: 42px;
  }

  .question-op {
    font-size: 30px;
  }

  .results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ranking-row {
    grid-template-columns: 36px 1fr 70px 70px;
    font-size: 13px;
  }

  .time-col,
  .range-col {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .save-row,
  .stats-row,
  .pet-login-row {
    flex-direction: column;
  }

  .species-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .pet-large .pet-emoji {
    font-size: 60px;
  }

  .results-actions,
  .settings-actions {
    flex-direction: column;
  }

  .settings-actions .start-btn {
    width: 100%;
  }
}

/* === Difficulty Heatmap (Faza 2 - Silnik nauki) === */
.heatmap-container {
  margin: 12px 0;
}

.difficulty-heatmap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.heatmap-grid {
  display: grid;
  gap: 2px;
}

.heatmap-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  border-radius: 4px;
  cursor: default;
  user-select: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

.legend-bar {
  width: 120px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #78c878, #f5c542, #ef6f6f);
}

.heatmap-empty {
  padding: 16px;
  text-align: center;
  color: #888;
  background: #f7f7f9;
  border-radius: 8px;
}

/* Pytania z promptem (dzielenie / mieszane) */
.question-prompt {
  font-size: 34px;
  font-weight: 700;
  color: #333;
}

/* === Osiągnięcia / grywalizacja (Faza 3) === */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, #fff8e1, #ffe082);
  border-color: #ffb300;
}

.achievement-card.locked {
  opacity: 0.55;
}

.achievement-emoji {
  font-size: 30px;
}

.achievement-name {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}

.achievement-desc {
  font-size: 11px;
  color: #777;
}

.trend-chart {
  margin-top: 10px;
}

/* Karmienie maskotki */
.pet-feed-row {
  margin: 10px 0;
}

.feed-pet-btn {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.feed-pet-btn:hover {
  background: #43a047;
}

.feed-pet-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Przełącznik języka */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.25);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Porównanie dzieci (Faza 4) */
.compare-btn {
  background: #7e57c2;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin: 8px 0;
}

.compare-btn:hover {
  background: #6d4ab8;
}

.compare-table {
  margin-top: 10px;
  overflow-x: auto;
}

.compare-header,
.compare-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
  font-size: 13px;
}

.compare-header {
  font-weight: 700;
  background: #f0f0f4;
  border-radius: 8px;
  color: #555;
}

.compare-row {
  border-bottom: 1px solid #eee;
}

.compare-name {
  font-weight: 600;
  color: #333;
}

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

.compare-wrong {
  color: #c62828;
}

.compare-best {
  color: #ff8f00;
  font-weight: 700;
}

/* ===== Faza 6 - Optymalizacja mobile-first ===== */

/* Obsługa bezpiecznych obszarów (notch iPhone) */
.app-header {
  padding-top: var(--safe-area-top);
}

.app-footer {
  padding-bottom: calc(12px + var(--safe-area-bottom));
}

/* Cele dotykowe - minimalny rozmiar 44px dla elementów interaktywnych */
.nav-link,
.mode-btn,
.num-btn,
.species-card,
.heatmap-cell {
  min-height: 44px;
}

/* Małe telefony (< 400px) */
@media (max-width: 400px) {
  .app-header-inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .app-logo-text {
    display: none;
  }

  .app-nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .app-main {
    padding: 12px;
  }

  .config-card {
    padding: 14px;
  }

  .multiplication-grid {
    grid-template-columns: 24px repeat(10, 1fr);
    gap: 1px;
  }

  .grid-cell {
    font-size: 10px;
    border-radius: 3px;
  }

  .question-number,
  .question-answer {
    font-size: 36px;
  }

  .question-op {
    font-size: 26px;
  }

  .question-card {
    padding: 24px 14px;
  }

  .answer-input-row {
    max-width: 100%;
  }
}

/* Tablety i małe ekrany (768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .app-nav {
    gap: 4px;
  }

  .nav-link {
    padding: 7px 10px;
    font-size: 14px;
  }

  .multiplication-grid {
    grid-template-columns: 26px repeat(10, 1fr);
  }
}

/* Pojedyncza kolumna dla siatki mnożenia na wąskich ekranach */
@media (max-width: 480px) {
  .multiplication-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Dolna nawigacja mobilna (BottomNav) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgb(0 0 0 / 0.08);
  z-index: 200;
  padding-bottom: var(--safe-area-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  min-height: 44px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.bottom-nav-icon {
  font-size: 20px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }

  .app-nav {
    display: none;
  }

  .app-main {
    padding-bottom: calc(72px + var(--safe-area-bottom));
  }

  .app-footer {
    padding-bottom: calc(72px + var(--safe-area-bottom));
  }
}

/* Klawiatura numeryczna (QuestionCard) - mobile-first */
.numpad {
  margin-top: 16px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.numpad-btn {
  padding: 14px 0;
  font-size: 22px;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 48px;
  color: var(--text);
}

.numpad-btn:active {
  background: var(--primary-light);
  color: #fff;
}

.numpad-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.numpad-action,
.numpad-submit {
  flex: 1;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  min-height: 48px;
}

.numpad-action {
  background: #e2e8f0;
  color: var(--text);
}

.numpad-submit {
  background: var(--primary);
  color: #fff;
}

.numpad-submit:disabled {
  opacity: 0.5;
}

/* Ukryj klawiaturę numeryczną na desktopie (pokaż tylko input) */
@media (min-width: 769px) {
  .numpad {
    display: none;
  }
}

/* Panel rodzica - tabela porównawcza na mobile */
@media (max-width: 640px) {
  .compare-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compare-header,
  .compare-row {
    grid-template-columns: 110px 50px 60px 50px 60px 60px;
    min-width: 420px;
    font-size: 12px;
  }

  .daily-time-list,
  .difficult-pairs {
    max-height: none;
  }

  /* Statystyki - karty pełnej szerokości */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .settings-row label {
    flex-basis: 100%;
  }
}

/* Małe telefony - heatmapa i tabela wyników */
@media (max-width: 480px) {
  .heatmap-grid {
    overflow-x: auto;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .stats-overview {
    grid-template-columns: 1fr 1fr;
  }

  .pet-display {
    transform: none;
  }
}

/* ============================================================
   FAZA 7 - NOWOCZESNY REDESIGN UI
   Gradientowe szare tło + glassmorphism + nowe akcenty
   ============================================================ */

/* Nagłówek - gradient + glass */
.app-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-logo-icon {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-link {
  border-radius: 999px;
  padding: 9px 16px;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

/* Hero */
.hero h1 {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 34px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 16px;
}

/* Karty - glassmorphism */
.config-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 20px;
}

/* Sekcje */
.config-section h3 {
  letter-spacing: 0.8px;
}

/* Tryby gry - nowoczesne karty */
.mode-btn {
  border-radius: 16px;
  background: var(--card-bg-solid);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.mode-btn.active {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-color: var(--primary);
  box-shadow: 0 6px 18px -4px rgb(99 102 241 / 0.35);
}

.mode-icon {
  font-size: 30px;
}

/* Siatka mnożenia - odświeżona */
.grid-cell {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg-solid);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.grid-cell.selected {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px -2px rgb(99 102 241 / 0.4);
}

/* Przyciski główne - gradient */
.start-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 14px;
  box-shadow: 0 8px 20px -6px rgb(99 102 241 / 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -8px rgb(99 102 241 / 0.6);
}

.save-pet-btn,
.save-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 14px;
  border: none;
  box-shadow: 0 8px 20px -6px rgb(99 102 241 / 0.45);
}

.stats-btn {
  background: var(--card-bg-solid);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
}

.secondary-btn {
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card-bg-solid);
  color: var(--text);
}

.next-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 20px -6px rgb(16 185 129 / 0.45);
}

.feed-pet-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 14px;
  box-shadow: 0 8px 20px -6px rgb(16 185 129 / 0.4);
}

.clear-progress-btn {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgb(239 68 68 / 0.25);
  border-radius: 12px;
}

.compare-btn {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border-radius: 12px;
  border: none;
  box-shadow: 0 6px 16px -4px rgb(168 85 247 / 0.4);
}

/* Pola wejściowe */
.nick-input,
.answer-input {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg-solid);
  box-shadow: inset 0 1px 3px rgb(15 23 42 / 0.05);
}

.nick-input:focus,
.answer-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.18);
}

/* Karta pytania */
.question-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.question-number {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Pasek postępu */
.progress-fill {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 999px;
}

.progress-bar {
  background: var(--border);
  border-radius: 999px;
}

/* Dolna nawigacja - glass */
.bottom-nav {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px -8px rgb(15 23 42 / 0.12);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-1px) scale(1.15);
  transition: transform 0.15s ease;
}

/* Statystyki i odznaki */
.stat-item {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  box-shadow: 0 6px 18px -6px rgb(245 158 11 / 0.4);
}

/* Stopka */
.app-footer {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border);
}

/* Odświeżone wiersze wyników/rankingu */
.ranking-row,
.history-row {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   FAZA 7b - ANIMOWANE IKONY
   ============================================================ */

/* Ikony SVG lucide */
.nav-svg-icon,
.logo-svg-icon,
.mode-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
  vertical-align: middle;
}

.logo-svg-icon {
  width: 22px;
  height: 22px;
  animation: logo-spin 14s linear infinite;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ikony trybów - delikatny "bounce" przy hover */
.mode-btn .mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mode-btn:hover .mode-icon {
  transform: translateY(-2px) scale(1.08);
  background: var(--primary-light);
  color: #fff;
}

.mode-btn.active .mode-icon {
  background: var(--primary);
  color: #fff;
  animation: icon-pop 0.35s ease;
}

@keyframes icon-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Dolna nawigacja - animowane ikony */
.bottom-nav-item .nav-svg-icon {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item:active .nav-svg-icon {
  transform: scale(0.85);
}

.bottom-nav-item.active .nav-svg-icon {
  color: var(--primary);
  animation: nav-bounce 0.5s ease;
}

@keyframes nav-bounce {
  0% { transform: scale(0.7); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Maskotka - pulsowanie */
.pet-emoji {
  display: inline-block;
  animation: pet-float 3s ease-in-out infinite;
}

.pet-happy .pet-emoji {
  animation: pet-happy 1.2s ease-in-out infinite;
}

.pet-sad .pet-emoji {
  animation: pet-sad 1.5s ease-in-out infinite;
}

@keyframes pet-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pet-happy {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15) rotate(-6deg); }
  60% { transform: scale(1.1) rotate(6deg); }
}

@keyframes pet-sad {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Emoji w wynikach i osiągnięciach */
.achievement-emoji {
  display: inline-block;
  transition: transform 0.2s ease;
}

.achievement-card.unlocked:hover .achievement-emoji {
  transform: scale(1.25) rotate(-8deg);
}

.species-emoji,
.evolution-emoji {
  display: inline-block;
  transition: transform 0.2s ease;
}

.species-card:hover .species-emoji {
  transform: scale(1.2);
  animation: pet-happy 0.8s ease;
}

/* Ikony w linkach górnej nawigacji - układ w linii */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link .nav-svg-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}
:root {
  /* Akcenty */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-soft: #e0e7ff;
  --green: #10b981;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --yellow: #f59e0b;
  --yellow-light: #fef3c7;

  /* Tło: nowoczesny gradient szarości */
  --bg: #eef1f6;
  --bg-gradient: linear-gradient(160deg, #f4f6fb 0%, #e7ebf2 45%, #dfe4ee 100%);
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-bg-solid: #ffffff;
  --glass-blur: blur(14px);
  --text: #1f2937;
  --text-muted: #64748b;
  --border: rgba(100, 116, 139, 0.18);
  --border-strong: rgba(100, 116, 139, 0.28);
  --shadow-sm: 0 2px 6px -1px rgb(15 23 42 / 0.08);
  --shadow: 0 8px 24px -6px rgb(15 23 42 / 0.12), 0 2px 6px -2px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 20px 45px -12px rgb(15 23 42 / 0.22);
  --radius: 16px;
  --radius-sm: 10px;

  /* Obszar bezpieczny (notch iPhone / zaokrąglenia ekranu) */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

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

html,
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select {
  font-family: inherit;
}

/* Ukrycie strzałek w input type=number */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Płynne przewijanie */
html {
  scroll-behavior: smooth;
}
