@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&family=Poppins:wght@400;600&display=swap');
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* === ANIMACJA ZMIANY ETAPU === */
.stage-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  animation: fadeOutOverlay 2.5s ease forwards;
  pointer-events: none;
}

.stage-transition-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  animation: pulseIcon 1.2s ease-in-out infinite;
}

.stage-transition-name {
  font-size: 32px;
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  text-shadow: 0 0 10px #0ff;
  animation: popIn 0.6s ease-out;
}

#mine-name[contenteditable="true"] {
  border-bottom: 1px dashed #999;
  cursor: text;
  outline: none;
  transition: border-color 0.2s;
}

#mine-name:focus {
  border-color: #00ccff;
}

#badges {
  display: inline-flex;
  gap: 6px;
}

.badge-title {
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 4px;
  color: #333;
}


.badge-icon {
  font-size: 20px;
  cursor: default;
  transition: transform 0.2s;
}

.badge-icon:hover {
  transform: scale(1.3);
}

/* === BADGES === */
#global-badge-popup {
  position: fixed;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 12px;
  max-width: 180px;
  z-index: 12001;
  display: none;
  pointer-events: auto;
  text-align: center;
}


#badges, .badge-display {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-left: 10px;
  vertical-align: middle;
}

.badge-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.badge-icon {
  font-size: 22px;
  cursor: default;
  opacity: 0.3;
  transition: transform 0.2s, opacity 0.2s;
}

.badge-icon.earned {
  opacity: 1;
}

.badge-icon:hover {
  transform: scale(1.3);
}

.badge-popup {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 12px;
  max-width: 180px;
  text-align: center;
  z-index: 9999;
  pointer-events: auto;
}

.badge-popup.show {
  display: block;
}

.boost-timer {
  font-weight: bold;
  font-size: 18px;
  margin-top: 10px;
  text-align: center;
  color: #000;
}

.hidden {
  display: none;
}
.quiz-panel {
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-question {
  font-weight: 600;
  font-size: 1.2rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-dropzone {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #99ccff;
  border-radius: 10px;
  background: #f0f8ff;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.quiz-dropzone:hover {
  border-color: #3399ff;
  background-color: #e6f3ff;
}

.quiz-dropzone::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px dashed #99ccff;
  border-radius: 8px;
  opacity: 0.2;
  pointer-events: none;
}

.quiz-result {
  font-weight: bold;
  text-align: center;
  font-size: 1rem;
}

.quiz-result.success {
  color: #2e7d32; /* zielony */
}

.quiz-result.error {
  color: #c62828; /* czerwony */
}

.quiz-placeholder {
  background: #eef3f9;
  color: #666;
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 16px;
  font-style: italic;
  text-align: center;
  margin-top: 12px;
  font-size: 0.95rem;
}

.quiz-text {
  font-weight: 500;
  color: #222; /* czarny tekst */
  font-size: 0.95rem;
}

.quiz-slot {
  width: 48px;
  height: 48px;
  background: white;
  border: 2px dashed #ccc;
  border-radius: 6px;
}
/* === ANALIZA WYDOBYCIA === */
#analysis-panel {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%; /* było 90% */
  max-width: 1200px; /* było 1000px */
  height: auto;
  max-height: 85vh;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.95);
  border: 2px solid #444;
  border-radius: 12px;
  padding: 20px;
  z-index: 12000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.analysis-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.analysis-box {
  flex: 1 1 280px;
  min-width: 260px;
}

#analysis-panel.show {
  animation: fadeInPanel 0.3s ease-out;
}
@keyframes fadeInPanel {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#analysis-panel.hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}
.analysis-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #444;
  z-index: 12000;
  transition: color 0.2s ease;
}
.analysis-close-btn:hover {
  color: #c00;
}

.btn-wide {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #CD853F;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
}

.upgrade-summary-box {
  padding: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  margin-top: 10px;
  font-size: 14px;
  color: #111;
  max-height: 180px;
  overflow-y: auto;
}

.help-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 320px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 16px;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  max-height: 80vh;
  overflow-y: auto;
  max-height: 400px;
}
.help-popup h3 {
  margin-top: 0;
}
.help-popup button {
  margin-top: 10px;
  float: right;
}


@keyframes fadeOutOverlay {
  0% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; display: none; }
}

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

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === GŁÓWNY UKŁAD === */
.info-block {
  border: 1px solid #666;
  border-radius: 6px;
  padding: 4px 10px;
  margin-right: 10px;
  background: #333;
  display: inline-flex;
  align-items: center;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #000;
  color: #222;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, #aefb82, #ffe97f);
  color: white;
  padding: 10px 20px;
  font-family: 'Orbitron', sans-serif;
  border-bottom: 2px solid #444;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.top-left .label {
  margin: 0 6px 0 12px;
  color: #aaa;
  font-size: 14px;
}

.top-left span {
  font-size: 16px;
  font-weight: bold;
}

.top-right {
  display: flex;
  gap: 10px;
}

.tool-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}

.owned-tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}


.top-btn {
  background: #222;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.top-btn:hover {
  background: #333;
}

.language-dropdown {
  position: relative;
  display: inline-block;
}

#lang-btn {
  background: #222;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 120px;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.lang-menu div {
  padding: 8px 12px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: black;
}

.lang-menu div:hover {
  background-color: #eee;
}

.hidden {
  display: none;
}


/* Domyślnie (desktop) */
#background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  z-index: -1;
  background-attachment: fixed; /* zostaje fixed dla desktopu */
  transition: background-image 0.8s ease-in-out;
}

/* Tylko mobile: override */
@media (max-width: 560px) {
  #background {
    background-attachment: scroll !important; /* wyłącz fixed */
    height: 100dvh; /* stabilna wysokość */
  }
}

.container {
  display: flex;
  flex-wrap: nowrap;
  position: relative;
  justify-content: space-between;
  align-items: stretch;
  height: calc(100vh - 100px);
  box-sizing: border-box;
  overflow: hidden;
  gap: 20px;
  width: 100%;
  overflow-x: hidden;
  padding: 30px 20px 20px 20px; /* kolejność: top, right, bottom, left */
}

.left-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 35%;        /* NOWOŚĆ */
  padding: 20px; 
}

.main-panel,
.right-panel {
  height: auto;
  max-height: 600px;
}

.main-panel {
  background-color: rgba(255, 255, 255, 0.90);
  padding: 20px;
  border-radius: 16px;
  width: 31%;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.right-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px;
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.90);
  text-align: center;
  height: 100%;
  overflow: hidden;
}

.ads-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  padding: 20px;
  flex: 0 0 300px;
}


.ad-slot {
  width: 300px;
  height: 250px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  color: #333;
  padding: 10px;
}


.info-box {
  background-color: rgba(255, 255, 255, 0.6);
  border: 2px solid #888;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #222;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15), inset 0 0 10px #000;
  min-height: 240px;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.message-buttons {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  align-self: center;
}
.message-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  max-height: 100%;
}

.random-message {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 16px;
  font-family: 'Orbitron', sans-serif;
  height: 100%;
  padding: 20px;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  text-align: center;
  width: 100%;
}


.info-box::before {
  content: "ℹ️";
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 20px;
  opacity: 0.7;
}

.info-content {
  margin-left: 24px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  justify-content: center;
}

.character-img {
  height: 180px;
  max-width: 150px;
  image-rendering: pixelated;
}

.info-text {
  font-size: 16px;
  line-height: 1.4;
}


.message-character {
  width: 140px;
  object-fit: contain;
  max-height: 160px;
  display: block;
  height: auto;
  image-rendering: pixelated;
  border-radius: 10px;
  border: 1px solid #333;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.message-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  color: #111;
  text-shadow: none;
  line-height: 1.5;
  max-width: 450px;
  max-height: 180px; /* <- wysokość widocznego tekstu */
  overflow-y: auto;
  padding-right: 8px;
}


#info-content {
  max-width: 600px;
  text-align: center;
  z-index: 1000;
  padding: 10px;
  transition: opacity 0.3s ease;
  opacity: 1;
  will-change: opacity;
  margin: 0 auto;
  overflow: visible;
}
.centered-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}


#info-content.fade-out {
  opacity: 0;
}

#info-content.fade-in {
  opacity: 1;
}

.tool-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Narzędzia się zawiną na małych ekranach */
  gap: 20px;
  padding: 10px;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.tool-item:hover {
  transform: scale(1.05);
}

.tool-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
  margin-bottom: 4px;
}

.tool-item button {
  padding: 6px 10px;
  font-size: 0.5em;
  cursor: pointer;
}

.stats-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .stats-row {
    flex-direction: column;
    align-items: center;
  }
}


.stats p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.2;
}

.stats-above-rock {
  margin-bottom: 10px;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #222;
  text-shadow: 1px 1px 1px #ccc;
}

.stats-above-rock p {
  margin: 4px 0;
}
.counter-box {
  background-color: #fff;
  border: 2px solid #666;
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px; /* zamiast min-width */
  text-align: center;
  box-shadow: inset 0 0 10px #000;
  font-family: 'Orbitron', monospace;
  margin-bottom: 20px;
}
.counter-box .label {
  font-size: 14px;
  color: #111;
  margin-bottom: 4px;
}

.counter-box .value {
  font-size: 32px;
  color: #0b3d0b; /* zielony LED */
  text-shadow: 0 0 4px #00ccff;
  font-weight: bold;
}
.blue-counter .value {
  color: #003366; /* ciemny niebieski */
  text-shadow: 0 0 4px #00ccff;
}
.red-counter .value {
  color: #800000; /* bordowy */
  text-shadow: 0 0 4px #00ccff;
}

#power-box .label {
  font-size: 13px;
  text-align: center;
}
#power-box .subvalue {
  font-size: 20px;
  font-family: 'Orbitron', monospace;
  font-weight: bold;
  color: #800000;
  text-shadow: 0 0 4px #00ccff;
}



#current-rock-name {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 35px;
  margin: 8px;
  text-shadow: 1px 1px 2px #aaa;
}
.rock-header {
  background-color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 45px;
  backdrop-filter: blur(4px);
  line-height: 1;
  display: inline-block; /* dostosowuje szerokość do zawartości */
  border: 2px solid #666;
  box-shadow: inset 0 0 10px #000;
}

.rock-container {
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  border: 2px solid #666;
  box-shadow: inset 0 0 10px #000;
  backdrop-filter: blur(4px);
  display: inline-block;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 10;
}

#clickable-object {
  width: 160px;
  height: 160px;
  cursor: pointer;
  user-select: none;
  cursor: url('images/pickaxe_cursor.png') 0 0, pointer;
}



.left-panel img {
  width: 256px;
  height: 256px;
  cursor: url('images/pickaxe_cursor.png') 0 0, pointer;
  transition: box-shadow 0.3s ease;
  border-radius: 12px;
}

[class*="rock-highlight-"] {
  box-shadow: 0 0 25px 5px rgba(255, 255, 255, 0.4);
}

#clickable-object.rock-highlight-sand      { box-shadow: 0 0 25px 5px rgba(255, 220, 100, 0.7); }
#clickable-object.rock-highlight-gravel    { box-shadow: 0 0 25px 5px rgba(120, 100, 80, 0.7); }
#clickable-object.rock-highlight-stone     { box-shadow: 0 0 25px 5px rgba(100, 100, 100, 0.6); }
#clickable-object.rock-highlight-obsidian  { box-shadow: 0 0 25px 5px rgba(50, 0, 90, 0.7); }
#clickable-object.rock-highlight-gold      { box-shadow: 0 0 25px 5px rgba(255, 215, 0, 0.8); }
#clickable-object.rock-highlight-diamond   { box-shadow: 0 0 25px 5px rgba(0, 200, 255, 0.7); }
#clickable-object.rock-highlight-kryptonit { box-shadow: 0 0 25px 5px rgba(0, 255, 100, 0.7); }
#clickable-object.rock-highlight-uran      { box-shadow: 0 0 25px 5px rgba(100, 255, 100, 0.8); }
#clickable-object.rock-highlight-ice       { box-shadow: 0 0 25px 5px rgba(150, 220, 255, 0.8); }
#clickable-object.rock-highlight-magma     { box-shadow: 0 0 25px 5px rgba(255, 80, 20, 0.8); }

/* === STYL DLA WAGONIKA === */
#train-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
  z-index: 11000 !important;
}

.track {
  position: relative;
  width: 100vw;
  height: 70px;
  background: linear-gradient(to bottom, #aefb82, #ffe97f);
  /*border-top: 4px solid #fff2a8;*/
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15), inset 0 0 10px #000;
}

.wagon {
  position: absolute;
  left: 20px;
  bottom: 4px;
  width: 100px;
  height: 60px;
  background: url('images/other/wagonik.webp') center/contain no-repeat;
  background-size: cover;
  transition: transform 1s linear;
}

.wagon.animate {
  transform: translateX(150vw);
}

.fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  background-color: #999;
  opacity: 0.8;
  transition: height 0.3s;
  border-radius: 0 0 8px 8px;
}

/* === FRAGMENTY I PULS === */
.pulse-once {
  animation: pulse-click 0.3s ease-in-out;
}

@keyframes pulse-click {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.fragment {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 100, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(255, 255, 100, 0.8);
  animation: fragment-fly 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes fragment-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.3);
    opacity: 0;
  }
}

/* === STYL DLA ULEPSZEŃ === */
.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f4f4f4;
  border-radius: 10px;
  padding: 10px 14px;
  color: #222;
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s;
  width: 100%;
  max-width: 280px;
}

.shop-row:hover {
  transform: scale(1.02);
}

.shop-row .icon {
  font-size: 20px;
  margin-right: 12px;
}

.shop-row .info {
  flex-grow: 1;
  text-align: left;
}

.shop-row .title {
  font-weight: bold;
  font-size: 13px;
  line-height: 1.2;
}

.shop-row .desc {
  font-size: 11px;
  color: #555;
  line-height: 1.2;
}

.shop-row .price {
  text-align: right;
  font-size: 12px;
  font-weight: bold;
}

.shop-row .price button {
  margin-top: 6px;
  font-size: 12px;
  padding: 4px 8px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.shop-list {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-right: 5px;
  opacity: 1;
}

.shop-list.visible {
  overflow-y: auto;
}


.shop-list::-webkit-scrollbar {
  width: 6px;
}

.shop-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}
.upgrade-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
}


.accordion .section {
  background-color: #fff;
  color: #000;
  cursor: pointer;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  transition: background-color 0.3s ease;
  border: 2px solid #666;
  box-shadow: inset 0 0 10px #000;
  backdrop-filter: blur(4px);
  text-align: center;
}

.accordion .section:hover {
  background-color: #666;
}

.accordion .content {
  display: none;
  padding: 10px;
  background-color: #f3f3f3;
  border-radius: 8px;
  margin-bottom: 10px;
}

.accordion .section.active + .content {
  display: block;
}

.accordion button {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  background-color: #dcefff;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.accordion button:hover {
  background-color: #c2e5ff;
}

.accordion button.locked {
  background-color: #eee;
  color: #aaa;
  border: 1px dashed #ccc;
  cursor: not-allowed;
}


@media (max-width: 1000px) {
  .container {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    height: auto;
  }

  .left-panel,
  .main-panel,
  .right-panel {
    width: 90%;
    max-width: 600px;
  }

  .ads-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 10px;
  }

  .ad-slot {
    width: 45%;
    max-width: 300px;
    height: 180px;
  }
}

#hourglass-section img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

#hourglass-points {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: #222;
  min-width: 60px;
  text-align: center;
}

#cash-hourglass {
  padding: 6px 12px;
  background-color: #fff3cd;
  border: 1px solid #f0c420;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

#cash-hourglass:hover {
  background-color: #fce59b;
}
.hourglass-box {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 2px solid #a57c48;
  background-color: #f5deb3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hourglass-box.visible {
  display: flex;
}


.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 10px;
}

.analysis-box {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-family: 'Poppins', sans-serif;
}

.analysis-box h4 {
  margin-top: 0;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  font-family: 'Orbitron', sans-serif;
}
#rock-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
}

#rock-history img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #444;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.rock-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 12001;
}

.rock-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  max-width: 500px;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.rock-modal-close {
  margin-top: 15px;
  padding: 6px 12px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.rock-stage-label {
  font-weight: bold;
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 4px;
  color: #444;
}


#show-report-btn {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #CD853F;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
}

.report-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 12001;
}

.report-panel {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 340px;
  text-align: center;
  font-family: Poppins, sans-serif;
  box-shadow: 0 0 10px #0004;
}

.report-panel ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  text-align: left;
  font-size: 14px;
}

.report-panel button {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background-color: #ddd;
}

.report-panel button:hover {
  background-color: #ccc;
}

/*BOSS*/
#boss-fight-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#boss-image {
  max-width: 80%;
  max-height: 80%;
  position: relative;
}

.boss-target {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 0, 0, 0.6);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 10px red;
  z-index: 10;
  animation: pulseTarget 1s infinite;
  z-index: 10000;
}

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

#boss-hp-bar {
  width: 60%;
  height: 20px;
  background: #222;
  border: 2px solid #555;
  border-radius: 10px;
  margin-top: 20px;
  position: relative;
}

#boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, red, darkred);
  border-radius: 10px;
  transition: width 0.3s ease;
}

@keyframes screen-shake {
  0%   { transform: translate(0px, 0px); }
  20%  { transform: translate(-5px, 5px); }
  40%  { transform: translate(5px, -5px); }
  60%  { transform: translate(-5px, -5px); }
  80%  { transform: translate(5px, 5px); }
  100% { transform: translate(0px, 0px); }
}

.shake {
  animation: screen-shake 0.3s ease;
}
#boss-dialog {
  position: absolute;
  left: 5%;
  top: 20%;
  width: 30%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 15px;
  border-radius: 10px;
  font-size: 1.1em;
  z-index: 9999;
  box-shadow: 0 0 10px #000;
  animation: fadeInDialog 0.6s ease-in-out;
}

@keyframes fadeInDialog {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.floating-points {
  position: fixed;
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  animation: floatUp 1s ease-out;
  pointer-events: none;
  z-index: 100000;
  text-shadow: 1px 1px 2px #000;
}

@keyframes floatUp {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}


.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #222;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  z-index: 11001;
}

.cookie-banner button {
  margin-left: 10px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ====== Widoczność desktop vs mobile ====== */
.desktop-only { display: inline-flex; }
.mobile-only  { display: none !important; }  /* na desktopie zawsze ukryte */

/* ====== Hamburger (bez wymuszania display tutaj) ====== */
.hamburger {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 2px 6px;
  font-family: 'Poppins', sans-serif;
  flex: 0 0 auto;
}
.menu-label {
  font-size: 10px;
  line-height: 1;
  margin-bottom: 2px;
  color: #222;
}
.menu-icon {
  font-size: 16px;
  line-height: 1;
}

/* ====== Menu mobilne (szuflada) ====== */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  background: rgba(255, 255, 255, .97);
  border-bottom: 2px solid #444;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  z-index: 11000;
}
.mobile-menu.hidden { display: none; }
.mobile-menu-inner { padding: 12px 16px; font-family: 'Poppins', sans-serif; }
.mobile-close { background: transparent; border: 0; font-size: 20px; float: right; cursor: pointer; }
.mobile-row { margin: 12px 0; display: flex; align-items: center; gap: 12px; }
.mobile-menu-title {
  font-size: 18px;
  font-weight: 600;
  margin: 10px 0 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid #ccc;
  color: #222;
  font-family: 'Poppins', sans-serif;
}

/* ========= MOBILE TYLKO ========= */
@media (max-width: 560px){

  /* Widoczność */
  .desktop-only { display: none !important; }
  .mobile-only  { display: flex !important; }

  /* Top bar */
  .top-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 4px 8px;
    gap: 8px;
  }
  .top-left { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; min-width:0; }
  .top-left .info-block { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:6px 10px; }
  .top-left .info-block .label { font-size:11px; line-height:1.1; margin:0 0 2px 0; white-space:nowrap; }
  #mine-name, #player-rank { font-size:13px; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:clip; }

  .hamburger{ display:flex; flex-direction:column; align-items:center; gap:2px; padding:2px 6px; }
  .menu-label{ font-size:9px; line-height:1; }
  .menu-icon { font-size:16px; line-height:1; }

  /* Liczniki (3 kolumny, mieszczą się) */
  .stats-above-rock .stats-row{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap;
    align-items:stretch;
    justify-content:space-between;
    gap:6px;                /* ciaśniej niż 8px */
    width:100%;
    margin:0 !important;
    padding:0 6px;
    box-sizing:border-box;
  }
  .stats-above-rock .stats-row .counter-box{
    flex:1 1 0;
    min-width:0;
    width:auto !important;
    max-width:none !important;
    margin:0 !important;
    padding:6px 8px;        /* było 8–10 → ciaśniej */
    box-sizing:border-box;
  }
  .stats-above-rock .stats-row .label{ font-size:12px; }
  .stats-above-rock .stats-row .value,
  .stats-above-rock .stats-row .subvalue{ font-size:18px; }
  #power-box .label { font-size:12px; line-height:1.1; }

  /* Nazwa kamienia */
  #current-rock-name { font-size:18px !important; line-height:1.1 !important; text-align:center; }
  .rock-header h2 { padding:6px 12px !important; }
  .rock-header h2::before { transform:scale(0.8); margin-right:6px; }

  /* Pasek info (ticker single) */
  :root { --topbar-h: 56px; }

  /* Zerujemy desktopowe „dzioby”: ikonę i lewy margines pod ikonę */
  .info-box::before { display: none !important; }
  .info-content { margin-left: 0 !important; }

  /* Sam #info-box – wyrównanie w pionie + spójne paddingi */
  #info-box{
    display: flex; align-items: center;
    overflow: hidden;
    min-height: 0 !important;
    height: 30px !important;
    padding: 2px 8px !important;   /* zamiast 0 */
    box-sizing: border-box;
  }

  /* Wewnętrzny wrapper – niech bierze całą szerokość i nie przelewa */
  #info-content{
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    display: flex;                 /* dzięki temu też centrowanie w pionie */
    align-items: center;
  }

  /* Jeżdżący napis – jedna linia, bez „podbijania” wysokości */
  .scroller-single{
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
    line-height: 1;                /* <-- to „podnosi” tekst optycznie na środek */
    font-size: clamp(11px, 2.8vw, 14px);
  }

  /* Na wszelki wypadek: wytnij obrazki/SVG w pasku */
  .info-bar-mobile img,
  .info-bar-mobile .message-character,
  .info-bar-mobile .message-row img,
  .info-bar-mobile #info-content img,
  .info-bar-mobile #info-content svg{
    display: none !important; width: 0 !important; height: 0 !important;
  }

}
/* Preferencje systemowe (pauza animacji) – wariant łączony */
@media (max-width:560px) and (prefers-reduced-motion: reduce){
  .scroller-single { animation: none !important; }
}
/* Ultra-małe ekrany */
@media (max-width: 380px){
  .top-bar { padding:3px 6px; gap:4px; }
  .top-left { gap:4px; }
  .top-left .info-block .label { font-size:10px; }
  #mine-name, #player-rank { font-size:12px; }
  .stats-above-rock .stats-row .value,
  .stats-above-rock .stats-row .subvalue { font-size:16px; }
  .info-bar-mobile{ height:28px; max-height:28px; padding:2px 6px; top: calc(var(--topbar-h,56px) + 2px); }
  .scroller-single{ font-size: clamp(10px, 2.8vw, 13px); }
}
/* === MOBILE: pasek przyklejony na górze + kontrola odstępu === */
@media (max-width:560px){
  /* stały pasek pod topbarem */
  .info-bar-mobile{
    position: static;
    margin-top: 8px;
    margin-bottom: 0px;
    top: calc(var(--topbar-h,56px) + 2px);
    left: 8px; right: 8px;
    height: 30px; max-height: 30px;
    padding: 2px 8px;
    display: flex; align-items: center;
    background: #fff;
    border: 2px solid #cfcfcf;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    overflow: hidden;
    z-index: 10000;
  }

  /* odstęp dla całej zawartości poniżej paska */
  body .container{
    margin-top: calc(var(--topbar-h,56px) 2px) !important;
    padding-top: 6px !important;
  }

  /* liczniki tuż pod paskiem */
  .stats-above-rock{
    margin-top: -20px !important; /* ustaw na -2px jeśli chcesz jeszcze ciaśniej */
  }
}
@media (max-width:560px){
  /* chowamy prawą kolumnę i reklamy w widoku mobilnym */
  .right-panel,
  .ads-panel {
    display: none !important;
  }

  /* sklep w szufladzie przewijalny */
  #mobile-menu .shop-list {
    max-height: 55vh;
    overflow-y: auto;
  }
}
@media (max-width:560px){
  /* chowamy prawą kolumnę i reklamy w widoku mobilnym */
  .right-panel,
  .ads-panel { display: none !important; }

  /* ========== Składana sekcja w szufladzie ========== */
  .mobile-section { margin-top: 8px; }

  .mobile-section-toggle{
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    background: transparent; border: 0; padding: 12px 6px;
    font: inherit; font-weight: 600; letter-spacing: .2px;
    cursor: pointer;
  }
  .mobile-section-toggle .chev{
    margin-left: auto;
    transition: transform .2s ease;
  }
  .mobile-section-toggle[aria-expanded="true"] .chev{
    transform: rotate(90deg);
  }

  .mobile-section-panel{
    border-top: 1px solid rgba(255,255,255,.15);
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
  }
  .mobile-section-panel.open{
    /* max wysokość listy w szufladzie */
    max-height: 55vh;
  }

  /* delikatne ujednolicenie wyglądu listy w menu */
  #mobile-menu .shop-list{
    padding: 8px 4px;
    overflow-y: auto;
  max-height: 65vh;                /* żeby lista nie wyjechała poza ekran */
  -webkit-overflow-scrolling: touch; /* płynny scroll na iOS */
  overscroll-behavior: contain;      /* nie ciągnie tła jak dojedziesz do końca */
  }
}
@media (max-width:560px){
  header.top-bar { position: relative; z-index: 12050; }
  .hamburger { position: relative; z-index: 12060; pointer-events: auto; }
}
/* ===== Mobile menu – estetyka, pozycja, animacja ===== */
@media (max-width:560px){

  :root{ --topbar-h: 56px; } /* masz już – zostaw; tylko upewniamy */

  /* Szuflada pojawia się POD topbarem */
  .mobile-menu{
    position: fixed;
    top: var(--topbar-h,56px);
    left: 0; right: 0;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid #ddd;
    box-shadow: 0 12px 24px rgba(0,0,0,.18);
    z-index: 12040;           /* topbar/hamburger masz ~12060 */
    backdrop-filter: blur(4px);
    animation: mobileMenuSlide .18s ease-out both;
    border-radius: 0 0 14px 14px;
  }
  @keyframes mobileMenuSlide {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
  }
  .mobile-menu.hidden{ display:none; }

  .mobile-menu-inner{
    padding: 10px 14px 12px;
    font-family: 'Poppins', sans-serif;
  }

  /* Wiersze w menu */
  .mobile-row{
    display:flex; align-items:center; gap:10px;
    padding: 6px 2px;
  }
  .mobile-row + .mobile-row{ margin-top: 4px; }

  /* „Chipowe” przyciski */
  .mobile-row .top-btn,
  #info-btn--mobile,
  #analysis-btn--mobile,
  #lang-btn--mobile,
  #mute-btn--mobile{
    display:inline-flex; align-items:center; gap:8px;
    border: 0;
    background: #111;
    color:#fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor:pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Sekcja tytułu (Sklep) */
  .mobile-section-toggle{
    width:100%;
    display:flex; align-items:center; gap:10px;
    background: transparent; border:0;
    padding: 10px 2px; font-weight:700; cursor:pointer;
  }
  .mobile-section-panel{
    border-top:1px solid #eee;
    overflow:hidden; max-height:0; transition:max-height .25s ease;
  }
  .mobile-section-panel.open{ max-height:55vh; }
  #mobile-menu .shop-list{ padding:8px 2px; overflow-y:auto; }

@media (max-width:560px){
  /* ten sam #lang-menu--mobile, ale jako pełny panel po nadaniu .as-panel */
  #lang-menu--mobile.as-panel{
    position: fixed;
    top: var(--topbar-h,56px);
    left: 0; right: 0; bottom: 0;
    display: block !important;
    background: #fff;
    z-index: 13000;
    overflow-y: auto;
    padding: 20px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #lang-menu--mobile.as-panel > div{
    padding: 12px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    cursor: pointer;
  }
  #lang-menu--mobile.as-panel > div:last-child{ border-bottom: 0; }
  #lang-menu--mobile.as-panel > div:hover{ background: #f6f6f6; }

  body.lang-open{ overflow:hidden; }
}
/* 🔽 Zmniejszamy tylko na mobile */
@media (max-width: 560px) {
  .tool-line {
    max-width: 95%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
  }

  .tool-grid .tool {
    width: 80px;
    padding: 4px;
    font-size: 0.8rem;
  }

  .tool-grid .tool img {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 560px) {
  #train-area {
    display: none !important;
  }
}
@media (max-width: 560px) {
  /* pasek zakładek u góry panelu analizy */
  #analysis-panel .tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px 10px 0;
  }
/* === ANALIZA: zakładki (MOBILE) === */
@media (max-width: 560px) {
  /* Pasek zakładek – „glass” + 2 kolumny */
  #analysis-panel .analysis-tabs{
    position: sticky;
    top: 8px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(8px) saturate(120%);
    border-bottom: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
  }

  /* Guziki zakładek */
  #analysis-panel .analysis-tab-btn{
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 10px 12px;
    font: 600 14px/1.1 "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.8));
    box-shadow: 0 1px 2px rgba(0,0,0,.06), inset 0 2px 0 rgba(255,255,255,.35);
    transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #analysis-panel .analysis-tab-btn:hover{
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.88));
  }
  #analysis-panel .analysis-tab-btn:active{ transform: translateY(1px); }

  /* Aktywna zakładka – delikatny akcent */
  #analysis-panel .analysis-tab-btn.active{
    border-color: rgba(74,144,226,.45);
    box-shadow: 0 4px 10px rgba(0,0,0,.12), inset 0 2px 0 rgba(255,255,255,.55);
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(245,247,255,.95));
  }

  /* Treść zakładek */
  #analysis-panel .analysis-tabs-content{
    padding: 8px 12px 16px;
  }
  #analysis-panel .analysis-tabs-content .analysis-box{
    margin: 0; /* bo przenieśliśmy kafel do kontenera zakładek */
  }

  /* Na bardzo wąskich ekranach 1 kolumna */
  @media (max-width: 380px){
    #analysis-panel .analysis-tabs{ grid-template-columns: 1fr; }
  }
}
.drag-ghost {
  opacity: .95;
  transform: scale(.95);
  border-radius: 12px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.25));
}
/* MOBILE: panel analizy jako kolumna – zakładki na górze, treść przewijalna */
@media (max-width: 560px) {
  #analysis-panel{
    display: flex;
    flex-direction: column;
    /* panel nie przewija całej strony; przewija się sama treść poniżej zakładek */
    overflow: hidden;
    max-height: calc(100vh - 90px); /* trochę zapasu pod top-barem */
    padding: 10px 10px 14px;
  }

  /* Pasek zakładek (nie przewija się) */
  #analysis-panel .analysis-tabs{
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;

    background: rgba(255,255,255,.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 5; /* nad treścią */
  }

  /* Treść zakładek – to się przewija */
  #analysis-panel .analysis-tabs-content{
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 2px 80px; /* większy dół, żeby ostatnie kafelki nie „wpadały” pod krawędź */
  }

  /* kosmetyka przycisku zamknięcia, by nie kolidował z zakładkami */
  #analysis-panel .analysis-close-btn{ z-index: 6; }

  /* tytuły wewnątrz sekcji są zbędne, bo są już na przyciskach */
  #analysis-panel .analysis-tab > h1:first-child,
  #analysis-panel .analysis-tab > h2:first-child,
  #analysis-panel .analysis-tab > h3:first-child,
  #analysis-panel .analysis-tab > h4:first-child{ display:none; }

  /* żeby skok do dropzone nie chował jej pod zakładkami */
  #analysis-panel .quiz-dropzone{ scroll-margin-top: 12px; }
}
/* iOS: nie podświetlaj, nie zaznaczaj, nie zoomuj po double-tap */
#rock-wrapper,
#clickable-object {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
          user-select: none;
  touch-action: manipulation; /* iOS 13+ blokuje double-tap-to-zoom */
}
@media (max-width: 560px) {
  /* w pasku mobilnym traktuj <br> jak spację, żeby ticker był jednoliniowy */
  #info-box.info-bar-mobile br { display: none; }
  /* śmiało – pogrubienie zostawiamy */
  #info-box.info-bar-mobile strong { font-weight: 600; }
}
/* === Boss: tekst nad bossem (mobile) === */
@media (max-width: 900px) {
  #boss-fight-overlay {
    /* układ kolumnowy już jest; dociągamy na górę ekranu */
    justify-content: flex-start;
    padding-top: calc(env(safe-area-inset-top) + 12px);
    gap: 10px;
  }

  #boss-dialog {
    position: static !important;   /* zamiast absolute */
    left: auto !important;
    top: auto !important;
    width: 92vw;                    /* szerzej, czytelnie */
    max-width: 680px;
    margin: 0 auto 8px;             /* na środku, ponad bossem */
    order: -1;                      /* pokaż NAD obrazkiem bossa */
    border-radius: 14px;
    padding: 12px 14px;
    line-height: 1.35;
  }

  #boss-image {
    max-width: 85vw;                /* żeby zmieścił się pod tekstem */
    height: auto;
  }

  #boss-hp-bar {
    width: 92vw;
    max-width: 680px;
    margin-top: 6px;
  }
}
@media (max-width: 900px) {
  #boss-fight-overlay { overscroll-behavior: contain; }
  .boss-target { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}



/* domyślnie ukryte poza mobile */
.ad-mobile-slot { display: none; }

/* --- MOBILNE REKLAMY: pasek + placeholder sterowany klasą .pending --- */
@media (max-width: 900px) {
  .ad-mobile-slot {
    display: block;
    width: min(92vw, 680px);
    margin: 4px auto;
  }

  /* placeholder dopóki reklama się nie załaduje */
  .ad-mobile-slot.pending {
    position: relative;
    height: 52px; /* pasek ~320×50 */
    border: 1px dashed rgba(255,255,255,0.35);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
  }
  .ad-mobile-slot.pending::before {
    content: "Reklama — placeholder";
    position: absolute; inset: 0; display: grid; place-items: center;
    font: 600 12px/1.2 Poppins, system-ui, sans-serif;
    color: rgba(255,255,255,0.65);
  }
  .ad-mobile-slot.pending::after {
    content: "≈ 320×50";
    position: absolute; right: 8px; bottom: 6px; font-size: 10px;
    color: rgba(255,255,255,0.55);
  }

  body.boss-active .ad-mobile-slot { visibility: hidden; }
  #boss-fight-overlay { z-index: 9999; }
}
/* --- DEV placeholdery: różne wysokości i podpisy --- */
@media (max-width: 900px) {
  /* wysokości */
  .ad-mobile-slot--top.pending    { height: 52px; }   /* ~320×50 */
  .ad-mobile-slot--bottom.pending { height: 102px; }  /* ~320×100 */

  /* podpis rozmiaru per slot (nadpisuje ogólne "≈ 320×50") */
  .ad-mobile-slot--top.pending::after    { content: "≈ 320×50"; }
  .ad-mobile-slot--bottom.pending::after { content: "≈ 320×100"; }
}
@media (max-width: 560px) {
  #clickable-object.level-enter {
    animation: rock-pop .45s ease-out;
  }

  @keyframes rock-pop {
    0%   { transform: scale(0.85); filter: blur(2px) brightness(0.85); opacity: 0; }
    60%  { transform: scale(1.05); filter: blur(0) brightness(1);    opacity: 1; }
    100% { transform: scale(1); }
  }
}
/* Kompaktowy tryb wiadomości na mobile */
@media (max-width: 560px) {
  .message-text.compact,
  .message-row.compact .message-text {
    font-size: 10px;
    line-height: 1.3;
    max-height: 140px;
    padding-right: 6px;
  }

  /* schowaj obrazek w wiadomościach na mobile */
  .message-row .message-character {
    display: none;
  }

  /* trochę ciaśniejsze layouty */
  .message-row.compact {
    gap: 12px;
  }
}
@media (max-width: 560px) {
  /* Info-box: pionowe centrowanie zawartości */
  #info-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px; /* delikatny bufor wysokości */
  }

  /* Kontener na treść komunikatu jako flex */
  #info-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;   /* poziome centrowanie */
    text-align: center;        /* wyrównanie tekstu */
  }

  /* Dodatkowe porządki dla pojedynczego tekstu */
  .message-text.solo,
  .message-text.solo.compact {
    margin: 0;
    max-width: 90%;
  }

  /* Ukrywanie obrazków w wiadomości na mobile (gdyby się gdzieś pojawiły) */
  .message-row .message-character { display: none !important; }
}
