/* Styl gry Podniebny Kotek - Kolorowy, pastelowy i uroczy */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 50%, #fbc2eb 100%);
  font-family: 'Fredoka', 'Quicksand', 'Nunito', system-ui, sans-serif;
  color: #37474f;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameWrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 450px;
  max-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  border-radius: 28px;
  overflow: hidden;
  background-color: #B3E5FC;
}

#gameCanvas {
  display: block;
  border-radius: 28px;
  width: 100%;
  height: 100%;
}

/* Górny pasek HUD */
#hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.hud-item {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 15px;
  color: #455a64;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-right {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.15s, background-color 0.2s;
}

.hud-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
}

.hud-btn:active {
  transform: scale(0.95);
}

/* Przyciski dotykowe na dole */
#touchControls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.touch-btn {
  pointer-events: auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.15s;
}

.touch-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.05);
}

.touch-btn.active, .touch-btn:active {
  transform: scale(0.92);
  background: #FFE082;
  border-color: #FFA726;
}

/* Modale i Nakładki */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(25, 32, 48, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #fff9f0 100%);
  border-radius: 28px;
  padding: 30px 24px;
  width: 88%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  border: 4px solid #ffffff;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(45deg, #FF6F00, #FF4081, #7C4DFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-subtitle {
  font-size: 14px;
  color: #78909c;
  margin-bottom: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: #F1F8E9;
  border-radius: 16px;
  padding: 10px;
  border: 2px solid #DCEDC8;
}

.stat-box.highlight {
  background: #FFF8E1;
  border-color: #FFE082;
}

.stat-label {
  font-size: 12px;
  color: #689F38;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stat-box.highlight .stat-label {
  color: #F57F17;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #33691E;
}

.stat-box.highlight .stat-value {
  color: #E65100;
}

.badge-record {
  display: inline-block;
  background: linear-gradient(90deg, #FFD54F, #FF80AB);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Przyciski główne */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(45deg, #FF5252, #FF4081, #FFA726);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 64, 129, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 64, 129, 0.45);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(255, 64, 129, 0.3);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  margin-top: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #5c6bc0;
  background: #E8EAF6;
  border: 2px solid #C5CAE9;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

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

.guide-box {
  background: #E0F7FA;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
  text-align: left;
  font-size: 13px;
  color: #006064;
  line-height: 1.5;
  border: 2px solid #B2EBF2;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.guide-item:last-child {
  margin-bottom: 0;
}
