/* ===== ANIMACJA PRZEJŚCIA MIĘDZY STRONAMI ===== */
.page.page-fade-in {
  animation: pageFadeIn 0.18s ease forwards;
}
.page.page-fade-out {
  animation: pageFadeOut 0.12s ease forwards;
  pointer-events: none;
}
@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pageFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== NOWY REKORD ===== */
@keyframes goldFlash {
  0%   { opacity: 0; }
  20%  { opacity: 0.7; }
  100% { opacity: 0; }
}
.overlay.new-record::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(245,200,66,0.5) 0%, transparent 70%);
  animation: goldFlash 1.2s ease forwards;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}
.new-record-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245,200,66,0.8);
  animation: goldPulse 0.8s ease infinite alternate;
  margin-top: 12px;
}
@keyframes goldPulse {
  from { opacity: 0.7; text-shadow: 0 0 10px rgba(245,200,66,0.5); }
  to   { opacity: 1;   text-shadow: 0 0 30px rgba(245,200,66,1); }
}


/* ===== POMOC — ZASADY GRY ===== */
.back-btn {
  position: fixed;
  top: 60px;
  left: 16px;
  z-index: 9999;
  transform: translateZ(0);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(240,244,239,0.9);
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}

/* Przycisk fullscreen */
.fullscreen-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(240,244,239,0.5);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.fullscreen-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
  transform: scale(1.1);
}
.back-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.7);
  color: var(--white);
  transform: scale(1.1) translateZ(0);
}
.back-btn.visible { display: flex; }

.help-btn {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 9999;
  transform: translateZ(0);
  will-change: position;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(231,76,60,0.2);
  border: 1px solid rgba(231,76,60,0.5);
  color: #e74c3c;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0;
  flex-shrink: 0;
  margin-left: auto;
}
.help-btn:hover {
  background: rgba(231,76,60,0.35);
  border-color: #e74c3c;
  transform: scale(1.1);
}
.help-btn.visible { display: flex; }

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.help-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.help-modal {
  background: #1a2e20;
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  position: relative;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}
.help-overlay.visible .help-modal {
  transform: translateY(0);
}
.help-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 16px;
  text-align: center;
}
.help-modal-body {
  font-size: 14px;
  color: rgba(240,244,239,0.85);
  line-height: 1.7;
}
.help-modal-body li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.help-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: none;
  color: rgba(240,244,239,0.5);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.help-modal-close:hover { color: var(--white); }



/* ===== OSIĄGNIĘCIA ===== */
.ach-wrap { width: 100%; margin-top: 24px; }
.ach-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ach-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 4px; color: var(--white); }
.ach-count { font-size: 16px; letter-spacing: 2px; color: rgba(245,200,66,0.7); font-family: 'Bebas Neue', sans-serif; }
.ach-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; width: 100%; }
@keyframes achModalIn { from { opacity:0; transform:scale(0.92); } to { opacity:1; transform:scale(1); } }

/* ===== DAILY RESULT VIEW ===== */
.daily-result-view { display: none; text-align: center; padding: 40px 0; flex: 1; flex-direction: column; justify-content: center; align-items: center; }
.daily-result-icon { font-size: 72px; margin-bottom: 16px; }
.daily-result-title { font-family: 'Bebas Neue', sans-serif; font-size: 42px; letter-spacing: 5px; color: var(--gold); }
.daily-result-score { font-size: 22px; color: rgba(240,244,239,0.7); margin-top: 12px; letter-spacing: 2px; }
.daily-result-buttons { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.daily-result-stats-btn { padding: 16px 24px; font-size: 18px; letter-spacing: 2px; width: 100%; max-width: 320px; white-space: nowrap; }
.btn-secondary { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; color: rgba(240,244,239,0.6); font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 3px; padding: 16px 48px; cursor: pointer; transition: all 0.2s; width: 100%; max-width: 300px; }
.btn-secondary:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
