* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  overflow-y: auto; 
}
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1e2b33 0%, #2a2a2a  100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  color: #2c3e50;
    animation: slideIn 0.6s ease-out;
}
.container {
  background: linear-gradient(145deg, #e4f3ff, #f0f4f8, #e3f2fd);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  height: 100%;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #2c4a2b; /* Zielona tablica */
  color: white;
  box-shadow: inset 0 0 15px #000, 0 0 30px #000;
  border: 12px solid #4e3b23; /* Drewniana rama */
  border-radius: 10px;
  background-image: 
        linear-gradient(transparent 96%, rgba(255,255,255,0.05) 97%, transparent 100%),
        radial-gradient(circle, rgba(255,255,255,0.02) 1%, transparent 1%);
  background-size: 100% 25px, 5px 5px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
h1 {
  color: aliceblue;
  margin-bottom: 25px;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  position: absolute;
  top:-2rem;
  right: 0;
  z-index: 7;
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}
.level-selector {
  margin: 20px 0;
}
.difficulty-tabs {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 10px;
  flex-wrap: wrap;
}
.difficulty-tab {
  background: #FAFAFA;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  color: #212121;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  box-shadow: 0 4px 0;
}
.difficulty-tab:hover {
  background-color: #3bb6ff;
  color: white;
  transform: translateY(-2px);
}
.difficulty-tab.active {
  background: #2196F3;
  color: white;
  transform: scale(1.05);
}
.difficulty-tab .icon-label {
    display: none; pointer-events: none;
}
.difficulty-tab .text-label {
    display: inline; pointer-events: none;
}
/* Player stats display styles */
.player-stats-display {
  margin: 25px 0;
  background-color: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.player-stats-display h3 {
  color: #ffffff;
  margin-bottom: 15px;
  font-size: 1.2em;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}
.mini-stat {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mini-stat-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #f0f0f0;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  margin-bottom: 4px;
}
.mini-stat-label {
  color: #ebfe04;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0px 1px 1px black;
  font-weight: bold;
}
.level-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  margin: 20px 0;
}
.level-btn {
  background: #9ecdf2;
  border: none;
  padding: 12px 0px;
  border-radius: 6px;
  color: #1c2d20;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(52, 152, 219, 0.25);
  position: relative;
  overflow: hidden;
  background-color: #c3f0b4;
}
.level-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}
.level-btn:hover::before {
  left: 100%;
}
.level-btn:hover {
  background: #9bd7ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.35);
}
.level-btn.active {
  background: #27ae60;
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.35);
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  gap: 15px;
  flex-wrap: wrap;
}

.timer-streak-container {
  display: flex;
  gap: 15px;
  align-items: center;
}
.feedback-container {
  flex: 1;
  min-width: 200px;
  text-align: center;
}
.timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;

}
.game-area {
  margin: 20px 0;
  display: none;
}
.main-game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}
.question-answer-section {
  display: grid;
  align-items: center;
  gap: 15px;
  grid-template-columns: 1fr auto;
}
.timer {
  background: #3498db;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: 500;
  box-shadow: 0 3px 12px rgba(52, 152, 219, 0.25);
}
.streak {
  background: #27ae60;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: 500;
  box-shadow: 0 3px 12px rgba(39, 174, 96, 0.25);
}
.progress-bar {
  width: 80%;
  height: 15px;
  background-color: rgba(255, 255, 255, 0.1); /* imitacja wytartej kredy */
   /* jak rysunek kredą */
  border-radius: 12px;
  margin: 20px auto;
  overflow: hidden;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
}
.progress {
  height: 100%;
  background: linear-gradient(90deg, #f6a6c1, #9ecdf2); /* pastelowe kolory kredy */
  border-radius: 12px 0 0 12px;
  transition: width 0.4s ease;
}
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
.question {
  font-size: 2.5em;
  margin: 10px 0;
  color: white;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 1s ease-in-out;
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
.answer-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.answer-input {
  width: 100px;
  font-size: 3em;
  font-family: 'Inter', sans-serif;
  text-align: center;
  background-color: transparent;
  color: yellow;
  border: none;
  border-bottom: 4px dashed rgba(255, 255, 255, 0.6);
  outline: none;
  padding: 5px;
  transition: border-color 0.2s ease;
}
.answer-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.answer-input:focus {
  border-bottom: 4px solid #ffffff;
}

/* Quick answers - ukryte na start */
.quick-answers {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.quick-answers button {
  font-family: 'Inter', sans-serif;
  /*! font-size: 1.5em; */
  /*! padding: 10px; */
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  width: 40px;
  display: flex;
  align-items: center;
  place-content: center;
}
.quick-answers button:hover {
  background-color: #79add2;
}
.quick-btn {
  background: #FAFAFA;
  border: 2px solid #ADDBFF;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #212121;
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}
.feedback:empty:before {
  content: attr(data-text);
  color: lightsteelblue;
}
.feedback {
  padding: 15px 20px;
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1.1em;
  border-left: 5px solid #f0f0f0;
  border-radius: 6px;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
  white-space: pre-line;
  min-height: 54px;
  display: flex;
  align-items: center;
}
.correct {
  background-color: rgba(39, 174, 96, 0.15);
  color: #ffff66;
  border: 1px solid #27ae60;
  animation: celebration 0.5s ease;
}
.incorrect {
  background-color: #8b0000;
  color: #ffffff;
  border: 1px solid #ff4c4c;
  animation: shake 0.5s ease;
}
@keyframes celebration {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin: 20px 0;
}
.stat-card {
  background-color: rgba(255, 255, 255, 0.05); /* delikatna przezroczystość */
  color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  border: 2px dashed rgba(255, 255, 255, 0.3); /* jakby narysowane kredą */
  backdrop-filter: blur(2px); /* subtelny efekt kredy */
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}
.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: #f0f0f0; /* biała kreda */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
}
.stat-card div:last-child {
  color: #01ff58;
  font-size: 0.9em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.achievements {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.achievement {
  background: #27ae60;
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  animation: achievementPop 0.5s ease;
  box-shadow: 0 3px 12px rgba(39, 174, 96, 0.25);
}
@keyframes achievementPop {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* MODAL STYLES FOR FINAL SCORE */
.final-score {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 1000;
  animation: modalFadeIn 0.4s ease-out;
}

.final-score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #2c4a2b, #1e3a1d);
  border: 8px solid #4e3b23;
  border-radius: 15px;
  padding: 30px;
  max-width: 90vw;
  max-height: 90vh;
	min-width:50%;
  overflow-y: auto;
  text-align: center;
  color: #ffffff;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 15px rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.final-score h2 {
  font-size: 2.2em;
  margin-bottom: 10px;
  color: #ffffff;
  text-shadow: 0 0 5px rgba(255,255,255,0.4);
}

.score-grade {
  font-size: 4em;
  margin: 20px 0;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  animation: glow 2s infinite alternate;
  transition: all 0.5s ease;
}

.grade-text {
  font-size: 1.8em;
  margin-bottom: 20px;
  color: gold;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.retry-button,
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  margin: 10px 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #1c2d20;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 0 #9cc594;
  min-width:120px;
}
.back-to-menu {
  font-size: .8em;
  padding: 2px 10px;
  margin: 0
}

.btn-icon, .back-to-menu-inline .btn-icon {
    display: none;
}

/* Kolory przycisków */
.retry-button {
	background-color: #35bd29;
	box-shadow: 0 4px 0 #3e8616;
}
.btn {
  background-color: #ffd93b;
  color: #2c4a2b;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 0 #c9a600;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.back-to-menu-inline,
.back-to-menu {
  background-color: #c3f0b4;
}
.retry-button:hover,
.btn:hover,
.back-to-menu-inline:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.screenshot-modal-content {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    text-align: center;
}

.template-selector {
    margin: 20px 0;
}

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.template-btn {
    padding: 10px 15px;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.2);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-btn:hover {
    background: rgba(52, 152, 219, 0.4);
}

.template-btn.active {
    background: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.screenshot-preview {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

#previewCanvas {
    border: 2px solid #3498db;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.screenshot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary {
    background: #27ae60 !important;
}

.btn-secondary {
    background: #f39c12 !important;
}
/* Celebration animations */
@keyframes celebrationFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1.5) rotate(360deg);
  }
}
@keyframes celebrationPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    color: #27ae60;
    text-shadow: 0 0 20px rgba(39, 174, 96, 0.8);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes flashFade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes glow {
  from {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  }
  to {
    text-shadow: 3px 3px 20px rgba(255, 255, 255, 0.5);
  }
}
.floating-emoji {
  position: absolute;
  font-size: 2em;
  animation: float 3s infinite ease-in-out;
  pointer-events: none;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}
.emoji-1 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.emoji-2 {
  top: 20%;
  right: 10%;
  animation-delay: 1s;
}
.emoji-3 {
  bottom: 20%;
  left: 15%;
  animation-delay: 2s;
}
.emoji-4 {
  bottom: 10%;
  right: 15%;
  animation-delay: 0.5s;
}
.game-header {
  flex-direction: column;
  gap: 10px;
}
.timer-streak-container {
  order: 1;
}
.feedback-container {
  order: 2;
  min-width: 100%;
}
@media (max-width: 768px) {
	  html {
    height: auto;
    min-height: 100%;
  }
  body {
    padding: 0px;
    min-height: 100vh;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; 
  }
  
  .container {
	width: 100%;
	height:100vh;
    padding: 12px;
    margin: 0;
    border: 8px solid #4e3b23; 
    border-radius: 4px;
    min-height: auto; 
    max-height: none;
  }

  h1 {
    font-size: 1em;
    position: static;
  }
  .question {
    font-size: 2em;
  }
  .answer-input {
    width: 100px;
    font-size: 1.5em;
  }
  .level-buttons {
    grid-template-columns: repeat( auto-fill, minmax(100px, 1fr) );
  }
  .feedback {
    padding: 10px;
    font-size: .8em;
  }
  .retry-button,
  .btn,
  .back-to-menu,
  .back-to-menu-inline {
    font-size: .8rem;
    margin: 6px 2px;
    padding: 6px 12px;
    border-radius: 6px;
  }
      .btn-icon, .back-to-menu-inline .btn-icon {
        display: inline;
    }

    .btn-text {
        display: none;
    }


    .btn-icon {
        font-size: 1.6em;
    }
  .quick-answers {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-answers button {
    border-radius: 50%;
  }
  .difficulty-tabs {
    flex-direction: row;
    align-items: center;
  }
  .difficulty-tab {
	padding: 4px 16px;
	border-radius: 10px;
	font-size: 2rem;
}

      .difficulty-tab .icon-label {
        display: inline;
    }
    .difficulty-tab .text-label {
        display: none;
    }
  .game-header {
    flex-direction: column;
  }
  .timer-streak-container {
    flex-direction: column;
    gap: 10px;
  }
  
  /* Mobile modal adjustments */
  .final-score-content {
    max-width: 95vw;
    max-height: 95vh;
	  width:100%;
    padding: 20px;
  }
  
  .final-score h2 {
    font-size: 1.8em;
  }
  
  .score-grade {
    font-size: 3em;
  }
  
  .grade-text {
    font-size: 1.4em;
  }
}

/* === NOWE STYLE DLA ULEPSZEŃ - DODAJ NA KOŃCU styles.css === */

/* Selektor motywów */
.theme-selector {
  margin: 15px 0;
  text-align: center;
}

.theme-selector h3 {
  color: #ffffff;
  font-size: 1em;
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.theme-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.theme-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffd93b;
  box-shadow: 0 0 15px rgba(255, 217, 59, 0.5);
}

/* Menu dodatkowe - rankingi i odznaki */
.menu-extras {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.extra-btn {
  background: #27ae60;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 0 #1e8b4d;
}

.extra-btn:hover {
  background: #2ecc71;
  transform: translateY(-2px);
}

.extra-btn:active {
  transform: translateY(0);
}

/* Timer bomby */
.bomb-timer {
  background: #e74c3c;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  box-shadow: 0 3px 12px rgba(231, 76, 60, 0.4);
  animation: pulse 1s infinite;
}

.bomb-timer.danger {
  animation: shake 0.5s infinite;
  background: #c0392b;
}

/* Zablokowane poziomy */
.level-btn.locked {


  cursor: not-allowed;
  opacity: 0.6;
}

.level-btn.locked:hover {
  background: #95a5a6;
  transform: none;
  box-shadow: none;
}

/* Powiadomienia o odblokowaniu */
.unlock-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  animation: slideInRight 0.5s ease-out;
  max-width: 300px;
  text-align: center;
}

.unlock-notification h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
}

.unlock-notification p {
  margin: 5px 0;
  font-size: 0.9em;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Powiadomienia o odznakach */
.badge-unlock {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  z-index: 1002;
  animation: badgePopIn 0.6s ease-out;
  text-align: center;
  max-width: 350px;
}

.badge-unlock h3 {
  margin-bottom: 15px;
  font-size: 1.5em;
}

.badge-icon {
  font-size: 2em;
  margin: 10px 0;
  animation: bounce 1s infinite;
}

@keyframes badgePopIn {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  80% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Modal rankingów */
.rankings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rankings-content {
  background: linear-gradient(145deg, #2c4a2b, #1e3a1d);
  border: 8px solid #4e3b23;
  border-radius: 15px;
  padding: 30px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  color: white;
  text-align: center;
  width: 100%;
}

.rankings-content h2 {
  margin-bottom: 20px;
  color: #ffd93b;
  text-shadow: 0 0 10px rgba(255, 217, 59, 0.5);
}

.rankings-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  text-align: left;
}

.ranking-item.top-three {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.ranking-item .rank {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
  color: #ffd93b;
}

.ranking-item .score {
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  color: #27ae60;
}

.ranking-item strong {
  color: #ffffff;
}

.ranking-item small {
  color: #bdc3c7;
}

/* Modal wyzwań */
.challenge-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.challenge-content {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.challenge-content h2 {
  margin-bottom: 20px;
  font-size: 1.8em;
}

.challenge-content p {
  margin: 10px 0;
  font-size: 1.1em;
}

.challenge-content button {
  margin: 10px 5px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.challenge-content button:first-of-type {
  background: #27ae60;
  color: white;
}

.challenge-content button:last-of-type {
  background: #e74c3c;
  color: white;
}

/* Style dla odznak */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.badge-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.badge-item.collected {
  background: rgba(39, 174, 96, 0.2);
  border-color: #27ae60;
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.3);
}

.badge-item.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.badge-item .badge-icon {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.badge-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 8px;
  color: #ffffff;
}

.badge-condition {
  font-size: 0.9em;
  color: #bdc3c7;
  margin-bottom: 10px;
}

.badge-status {
  font-size: 0.8em;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
}

.badge-item.collected .badge-status {
  background: rgba(39, 174, 96, 0.3);
  color: #2ecc71;
}

.badge-item.locked .badge-status {
  background: rgba(149, 165, 166, 0.3);
  color: #95a5a6;
}
.container.theme-space {
  background: linear-gradient(135deg, #3e4b86 0%, #764ba2 100%) !important;
  border-color: #5a67d8 !important;
}

.container.theme-ocean {
  background: linear-gradient(135deg, #225384 0%, #0984e3 100%) !important;
  border-color: #2980b9 !important;
}

.container.theme-sunset {
  background: linear-gradient(135deg, #cc4676 0%, #9e6906 100%) !important;
  border-color: #e17055 !important;
}

/* Płynne przejścia */
.container {
  transition: background 0.5s ease, border-color 0.5s ease !important;
}
/* Lepsze układanie przycisków w final score */
.final-actions {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

/* Responsywność dla mobile - DODATKOWE STYLE */
@media (max-width: 768px) {
  .theme-buttons {
    gap: 8px;
  }
  
  .theme-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
  }
  
  .menu-extras {
    flex-direction: row;
    gap: 10px;
  }
  
  .extra-btn {
    padding: 8px 16px;
    font-size: 0.9em;
  }
  
  .unlock-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 0.9em;
  }
  
  .rankings-content,
  .challenge-content {
    padding: 20px;
    margin: 10px;
  }
  
  .ranking-item {
    grid-template-columns: 40px 1fr 60px;
    padding: 10px;
    font-size: 0.9em;
  }
  
  .badges-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .badge-item {
    padding: 15px;
  }
  
  .badge-item .badge-icon {
    font-size: 2em;
  }
  
  .final-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .final-actions .btn,
  .final-actions .retry-button {
    width: 100%;
    max-width: 250px;
  }
}

.feedback.hint {
    background-color: rgba(52, 152, 219, 0.15);
    color: #74b9ff;
    border-left: 5px solid #3498db;
    animation: hintGlow 0.5s ease;
}

@keyframes hintGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}



/* DOMYŚLNE KOLORY (Klasyczna Tablica) */
.level-btn, .difficulty-tab, .extra-btn, .btn, .retry-button {
  transition: all 0.3s ease; /* Płynne przejścia między motywami */
}

/* === MOTYW SPACE (Kosmos) 🚀 === */
.container.theme-space .level-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  border: 2px solid #5a67d8;
  box-shadow: 0 4px 0 #4c51bf;
}

.container.theme-space .level-btn:hover {
  background: linear-gradient(135deg, #5a67d8, #667eea);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(90, 103, 216, 0.4);
}

.container.theme-space .level-btn.active {
  background: linear-gradient(135deg, #4c51bf, #553c9a);
  box-shadow: 0 0 20px rgba(90, 103, 216, 0.6);
}

.container.theme-space .difficulty-tab {
  background: rgba(90, 41, 132, 0.92);
  border: 2px solid rgba(90, 103, 216, 0.5);
  color: #fff;
}

.container.theme-space .difficulty-tab.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: #4c51bf;
  color: #ffffff;
}

.container.theme-space .extra-btn {
  background: linear-gradient(135deg, #667eea, #5a67d8);
  box-shadow: 0 4px 0 #4c51bf;
}

.container.theme-space .btn {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 4px 0 #7c3aed;
}

.container.theme-space .retry-button {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 0 #059669;
}

/* === MOTYW OCEAN (Ocean) 🌊 === */
.container.theme-ocean .level-btn {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: #ffffff;
  border: 2px solid #2980b9;
  box-shadow: 0 4px 0 #1e6091;
}

.container.theme-ocean .level-btn:hover {
  background: linear-gradient(135deg, #0984e3, #2980b9);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(41, 128, 185, 0.4);
}

.container.theme-ocean .level-btn.active {
  background: linear-gradient(135deg, #2980b9, #1e6091);
  box-shadow: 0 0 20px rgba(116, 185, 255, 0.6);
}

.container.theme-ocean .difficulty-tab {
  background: rgba(13, 74, 136, 0.92);
  border: 2px solid rgba(41, 128, 185, 0.5);
  color: #fff;
}

.container.theme-ocean .difficulty-tab.active {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  border-color: #2980b9;
  color: #1e1e1e;
}

.container.theme-ocean .extra-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 0 #1e40af;
}

.container.theme-ocean .btn {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #ffffff;
  box-shadow: 0 4px 0 #0e7490;
}

.container.theme-ocean .retry-button {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 4px 0 #0e7490;
}

/* === MOTYW SUNSET (Zachód Słońca) 🌅 === */
.container.theme-sunset .level-btn {
  background: linear-gradient(135deg, #fd79a8, #fdcb6e);
  color: #2d3748;
  border: 2px solid #e17055;
  box-shadow: 0 4px 0 #d63031;
}

.container.theme-sunset .level-btn:hover {
  background: linear-gradient(135deg, #fdcb6e, #f39c12);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(225, 112, 85, 0.4);
}

.container.theme-sunset .level-btn.active {
  background: linear-gradient(135deg, #e17055, #d63031);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(253, 203, 110, 0.6);
}

.container.theme-sunset .difficulty-tab {
  background: rgba(127, 7, 52, 0.69);
  border: 2px solid rgba(225, 112, 85, 0.5);
  color: #fff;
}

.container.theme-sunset .difficulty-tab.active {
  background: linear-gradient(135deg, #fd79a8, #fdcb6e);
  border-color: #e17055;
  color: #2d3748;
}

.container.theme-sunset .extra-btn {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  box-shadow: 0 4px 0 #e53e3e;
}

.container.theme-sunset .btn {
  background: linear-gradient(135deg, #f6ad55, #ed8936);
  color: #2d3748;
  box-shadow: 0 4px 0 #c05621;
}

.container.theme-sunset .retry-button {
  background: linear-gradient(135deg, #68d391, #38a169);
  box-shadow: 0 4px 0 #2f855a;
}

/* === DODATKOWE ELEMENTY === */

/* Progress bar - dostosowane kolory */
.container.theme-space .progress {
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}

.container.theme-ocean .progress {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.container.theme-sunset .progress {
  background: linear-gradient(90deg, #f093fb, #f6ad55);
}

/* Timer i streak - dostosowane kolory */
.container.theme-space .timer {
  background: linear-gradient(135deg, #667eea, #5a67d8);
}

.container.theme-space .streak {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.container.theme-ocean .timer {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.container.theme-ocean .streak {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.container.theme-sunset .timer {
  background: linear-gradient(135deg, #fd79a8, #e17055);
}

.container.theme-sunset .streak {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* Theme buttons - lepsze wyróżnienie aktywnego */
.container.theme-space .theme-btn.active {
  background: rgba(102, 126, 234, 0.4);
  border-color: #667eea;
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
}

.container.theme-ocean .theme-btn.active {
  background: rgba(116, 185, 255, 0.4);
  border-color: #74b9ff;
  box-shadow: 0 0 15px rgba(116, 185, 255, 0.8);
}

.container.theme-sunset .theme-btn.active {
  background: rgba(253, 121, 168, 0.4);
  border-color: #fd79a8;
  box-shadow: 0 0 15px rgba(253, 121, 168, 0.8);
}

/* Stat cards - dostosowane kolory */
.container.theme-space .stat-card {
  background-color: rgba(102, 126, 234, 0.1);
  border: 2px dashed rgba(102, 126, 234, 0.3);
}

.container.theme-ocean .stat-card {
  background-color: rgba(116, 185, 255, 0.1);
  border: 2px dashed rgba(116, 185, 255, 0.3);
}

.container.theme-sunset .stat-card {
  background-color: rgba(253, 121, 168, 0.1);
  border: 2px dashed rgba(253, 121, 168, 0.3);
}

/* Feedback hints - dostosowane kolory */
.container.theme-space .feedback.hint {
  background-color: rgba(102, 126, 234, 0.15);
  color: #a78bfa;
  border-left: 5px solid #667eea;
}

.container.theme-ocean .feedback.hint {
  background-color: rgba(116, 185, 255, 0.15);
  color: #3b82f6;
  border-left: 5px solid #74b9ff;
}

.container.theme-sunset .feedback.hint {
  background-color: rgba(253, 121, 168, 0.15);
  color: #f093fb;
  border-left: 5px solid #fd79a8;
}

/* Quick answers - dostosowane kolory */
.container.theme-space .quick-btn {
  background: rgba(102, 126, 234, 0.2);
  border: 2px solid #667eea;
  color: #e2e8f0;
}

.container.theme-space .quick-btn:hover {
  background: rgba(102, 126, 234, 0.4);
}

.container.theme-ocean .quick-btn {
  background: rgba(116, 185, 255, 0.2);
  border: 2px solid #74b9ff;
  color: #bfdbfe;
}

.container.theme-ocean .quick-btn:hover {
  background: rgba(116, 185, 255, 0.4);
}

.container.theme-sunset .quick-btn {
  background: rgba(253, 121, 168, 0.2);
  border: 2px solid #fd79a8;
  color: #fed7d7;
}

.container.theme-sunset .quick-btn:hover {
  background: rgba(253, 121, 168, 0.4);
}

/* Specjalny styl dla przycisku Info */
.extra-btn.info-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 2px solid #2980b9;
    transition: all 0.3s ease;
}

.extra-btn.info-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1c5985);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* Style dla modalu info */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.info-modal-content {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: white;
    position: relative;
}

.game-mode-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
}

.game-mode-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-icon {
    font-size: 2em;
}

.mode-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #ecf0f1;
}

.mode-characteristics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.characteristic-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
}

.close-info-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.close-info-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

* {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Naprawa container dla mobile */
.container {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}



/* Naprawa modalów */
.info-modal,
.rankings-modal,
.final-score {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

.info-modal-content,
.rankings-content {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Naprawa dla długiej zawartości */
.game-mode-item {
    touch-action: manipulation;
}

/* Mobile scrolling improvements */
@media (max-width: 768px) {
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .container {
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    
    /* Modal mobile fixes */
    .info-modal-content {
        max-height: 85vh;
        margin: 5vh auto;
        touch-action: pan-y;
    }
    
    /* Przyciski większe na mobile */
    .close-info-btn,
    .extra-btn,
    .btn {
        min-height: 44px;
        touch-action: manipulation;
        width: auto;
    }
}