body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: rgb(255, 245, 160); /* Pastelowy żółty */
    transition: background-color 1s ease-in-out; /* Płynna zmiana koloru */
    padding: 20px;
}

main {
    margin-top: 20px;
}

#game-container {
    margin-bottom: 20px;
}

.mode-switch {
    text-align: right;
    margin-bottom: 10px;
}

.mode-btn {
    margin: 5px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #4CAF50;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease-in-out;
}

.mode-btn:hover {
    background-color: #e68900;
}

.mode-btn.active {
    background-color: #ff9800;
    font-weight: bold;
}

.title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    display: block;
    width: 100%;
}

.nav-btn {
    margin: 5px;
    padding: 12px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
    transition: background-color 0.3s ease-in-out;
}

.nav-btn:hover {
    background-color: #e68900;
}

.nav-btn.active {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
}

#game-container button {
    padding: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#game-container button:hover {
    background-color: #45a049;
}

#question-container {
    text-align: center;
    margin-bottom: 20px;
}

#buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#score-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#score-container p {
    font-size: 22px;
    font-weight: bold;
    padding: 15px;
    background-color: #ffd700;
    border-radius: 10px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

#score {
    color: #4CAF50;
}

#highscore {
    color: #FF4500;
}

#question {
    font-size: 26px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background-color: #ffeeba;
    color: #333;
    border: 4px solid #ff9800;
    border-radius: 10px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
    display: inline-block;
    margin: 20px auto;
}

.input-field {
    width: 20px; /* Mniejsza szerokość pola input */
    text-align: center;
    font-size: inherit; /* Dziedziczenie rozmiaru czcionki z rodzica */
	font-family: inherit; /* Dziedziczenie kroju czcionki */
    padding: 5px;
    border: 2px solid #333;
    border-radius: 5px;
	text-align: center; /* Wyśrodkowanie tekstu */
	width: 1.5em; /* Dopasowanie szerokości do znaków */
}

.answer-block {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.answer-btn {
    padding: 3px 6px;
    font-size: inherit; /* Dziedziczenie rozmiaru czcionki z rodzica */
	font-family: inherit; /* Dziedziczenie kroju czcionki */
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.answer-btn:hover {
    background-color: #45a049;
}

.selected-btn {
    background-color: #ff9800 !important;
    font-weight: bold;
}

.mode-pc {
    display: inline-block;
}

.mode-tablet {
    display: none;
}

.feedback {
	display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
    min-height: 40px;
    padding: 10px;
    border-radius: 10px;
    display: inline-block;
    width: 100%;
}

.correct {
    color: #ffffff;
    background-color: #4CAF50; /* Zielony dla poprawnych odpowiedzi */
    border: 2px solid #388E3C;
	padding: 8px;
}

.incorrect {
    color: #ffffff;
    background-color: #F44336; /* Czerwony dla błędnych odpowiedzi */
    border: 2px solid #D32F2F;
	padding: 8px;
}

.check-btn, .next-btn {
    font-size: 22px; /* Większa czcionka dla lepszej czytelności */
    font-weight: bold;
    padding: 12px 20px; /* Większe przyciski dla wygody */
    border-radius: 8px; /* Zaokrąglone rogi */
    border: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.check-btn {
    background-color: #4CAF50; /* Zielony dla sprawdzania odpowiedzi */
    color: white;
}

.check-btn:hover {
    background-color: #388E3C; /* Lekko ciemniejszy zielony po najechaniu */
}

.next-btn {
    background-color: #2196F3; /* Niebieski dla „Następnego” */
    color: white;
}

.next-btn:hover {
    background-color: #1976D2; /* Ciemniejszy niebieski po najechaniu */
}

.motivation {
	display: block; /* Upewnia się, że pojawia się na osobnej linii */
    margin-top: 10px; /* Dodaje odstęp między feedback a motywacją */
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    padding: 12px;
    border-radius: 8px;
    display: inline-block;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    clear: both; /* Zapobiega przeskakiwaniu */
    position: relative; /* Zapewnia stabilne położenie */
}

.motivation.correct {
    color: #ffffff;
    background-color: #4CAF50; /* Zielony dla pozytywnych motywacji */
    border: 2px solid #388E3C;
}

.motivation.encouragement {
    color: #ffffff;
    background-color: #FF9800; /* Pomarańczowy dla zachęty */
    border: 2px solid #F57C00;
}

.motivation.master {
    color: #ffffff;
    background-color: #2196F3; /* Niebieski dla mistrzowskiego poziomu */
    border: 2px solid #1976D2;
}

/* Interakcje */
#backButton {
    color: white;
    display: inline-block;
    position: sticky;
    top: 20px;
    left: 0;
    text-align: left;
    z-index: 1000;
}

#backButton:hover {
    background-color: #e68900;
}

#backButton:focus,
#backButton:active {
    background-color: #ff9800;
    font-weight: bold;
    outline: none;
}

#backButtonContainer {
	position: sticky;
    top: 15px; /* odległość od górnej krawędzi podczas scrollowania */
    text-align: left;
	z-index: 1000; /* nad innymi elementami */
}

.primary-btn {
  padding: 12px 20px;
  font-size: 18px;
  font-family: inherit;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
  line-height: 1.2;
  box-sizing: border-box;
}


#timerContainer {
    display: inline-block;
    position: relative;
    margin-left: 10px;
}

#timerToggle {
	touch-action: manipulation;
}

#timerToggle:hover {
    background-color: #e68900;
}

#timerToggle:active,
#timerToggle:focus {
    background-color: #ff9800;
    font-weight: bold;
    outline: none;
}

#timerPanel {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background-color: #ffeeba;
  border: 3px solid #ff9800;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
  flex-direction: column;
  gap: 10px;
  z-index: 1001;
}

#timerPanel.visible {
  display: flex;
}

#timerPanel label {
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#timerPanel input {
    width: 60px;
    padding: 5px;
    font-size: 16px;
    text-align: center;
    border: 2px solid #333;
    border-radius: 5px;
}

#timerPanel input.timer-time {
  width: 120px !important;
}

#timerPanel button {
  padding: 12px 20px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.3s ease-in-out;
}

#timerPanel button:first-of-type {
  background-color: #4CAF50; /* Zielony Start */
  color: white;
}

#timerPanel button:first-of-type:hover {
  background-color: #388E3C;
}

#timerPanel button:last-of-type {
  background-color: #F44336; /* Czerwony Stop */
  color: white;
}

#timerPanel button:last-of-type:hover {
  background-color: #D32F2F;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.overlay-content {
  background-color: #fff8dc;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
  position: relative;
  width: 90%;
  max-width: 400px;
  text-align: center;
  font-size: 20px;
}

.overlay-content h2 {
  margin-bottom: 20px;
  font-size: 26px;
  color: #ff9800;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #333;
}

.hidden {
  display: none;
}

@keyframes overlayFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.overlay-content {
  ...
  animation: overlayFadeIn 0.4s ease-in-out;
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 20px;
}

.label {
  font-weight: bold;
}

.value {
  background-color: #ffecb3;
  padding: 6px 12px;
  border-radius: 6px;
  min-width: 50px;
  display: inline-block;
}

#infoIcon {
  position: fixed;
  bottom: 1em;
  left: 1em;
  font-size: 1.6em;
  background: none;
  border: none;
  color: #7c5cff;
  cursor: pointer;
  z-index: 1500;
  transition: color 0.3s ease;
}
#infoIcon:hover {
  color: #5c47c6;
}

#infoOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 252, 240, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2em;
  z-index: 2000;
}
#infoOverlay.active {
  display: flex;
}

.infoContent {
  max-width: 600px;
  background: #fffefb;
  border: 2px solid var(--bg-panel-border, #f6e7b4);
  border-radius: 18px;
  padding: 2em;
  color: var(--text-main, #3b324d);
  font-size: 1.1em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  text-align: left;
  cursor: default;
}
.infoContent h3 {
  margin-top: 0;
  margin-bottom: 0.6em;
  font-size: 1.5em;
  color: var(--text-label, #ab4cab);
}
.tapHint {
  margin-top: 1em;
  font-style: italic;
  font-size: 0.95em;
  color: #888;
  text-align: center;
}
