* {
  box-sizing: border-box;
  user-select: none;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Lora', Georgia, serif;
  background-color: #120e18;
  color: #f7ebd2;
}

svg.pixel-art, canvas.pixel-art, img.pixel-art {
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Custom Font Helpers - 100% Native Polish Diacritics Support */
.font-cinzel {
  font-family: 'Cinzel', Georgia, serif;
}
.font-medieval {
  font-family: 'MedievalSharp', 'Cinzel', Georgia, serif;
}
.font-ui, .font-pixel {
  font-family: 'Alegreya Sans', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.015em;
}
.font-lora {
  font-family: 'Lora', Georgia, serif;
}

/* =========================================================================
   Drewniano-pergaminowe panele w stylu 16-bit RPG (Stardew Valley)
   ========================================================================= */
.sdv-wood-panel {
  background: linear-gradient(180deg, #f7ebd0 0%, #ead3a6 55%, #dfb87c 100%);
  color: #240d02;
  border: 4px solid #53280c;
  border-radius: 12px;
  box-shadow:
    inset 0 2px 0 #fff3d8,
    inset 0 0 0 2px #d19754,
    inset 0 0 0 4px #8f5022,
    0 10px 28px rgba(0, 0, 0, 0.7);
  position: relative;
}

.sdv-wood-dark {
  background: linear-gradient(180deg, #6c3716 0%, #4a210a 100%);
  color: #fffbeb;
  border: 3px solid #2d1205;
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 180, 0.35),
    inset 0 0 0 2px #9c5c2a,
    0 5px 14px rgba(0, 0, 0, 0.6);
}

.sdv-parchment-inset {
  background: linear-gradient(180deg, #fcf4de 0%, #f4e2be 100%);
  color: #200d03;
  border: 2px solid #9c5c2a;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(74, 33, 10, 0.2);
}

/* Przyciski RPG z głębią naciśnięcia */
.sdv-btn-gold {
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 50%, #d97706 100%);
  color: #240f02 !important;
  border: 3px solid #6b350c;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 4px 0 #4a2107,
    0 6px 14px rgba(0, 0, 0, 0.5);
  font-family: 'Alegreya Sans', system-ui, sans-serif;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease, box-shadow 0.08s ease;
}
.sdv-btn-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    0 5px 0 #4a2107,
    0 8px 18px rgba(0, 0, 0, 0.6);
}
.sdv-btn-gold:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 #4a2107,
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.sdv-btn-green {
  background: linear-gradient(180deg, #86efac 0%, #22c55e 50%, #15803d 100%);
  color: #052e16 !important;
  border: 3px solid #14532d;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 4px 0 #0f3d20,
    0 6px 14px rgba(0, 0, 0, 0.5);
  font-family: 'Alegreya Sans', system-ui, sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease;
}
.sdv-btn-green:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.sdv-btn-green:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0f3d20;
}

.sdv-btn-wood {
  background: linear-gradient(180deg, #7c4521 0%, #592f14 100%);
  color: #fffbeb !important;
  border: 2px solid #361706;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 #2a0f03,
    0 4px 8px rgba(0, 0, 0, 0.4);
  font-family: 'Alegreya Sans', system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease;
}
.sdv-btn-wood:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.sdv-btn-wood:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2a0f03;
}

/* Karty wyboru A, B, C, D w oknie dialogowym */
.sdv-choice-bar {
  background: linear-gradient(180deg, #fffcf4 0%, #f7e8c6 50%, #edd39c 100%);
  color: #2e1707;
  border: 2px solid #733c14;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    0 3px 0 #4a2107,
    0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.1s ease;
}
.sdv-choice-bar:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fff1ce 50%, #fce1a4 100%);
  border-color: #b45309;
  transform: translateY(-2px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    0 5px 0 #4a2107,
    0 6px 12px rgba(0, 0, 0, 0.35);
}
.sdv-choice-bar:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4a2107;
}

/* Wgłębione paski zasobów (trough/slot) */
.sdv-meter-trough {
  background: #251206;
  border: 1px solid #4a240d;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-3px) scale(0.985, 1.025); }
}
.animate-breathe {
  animation: breathe 2.6s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-24px) scale(0.95, 1.06); }
  70% { transform: translateY(0) scale(1.04, 0.96); }
  100% { transform: translateY(0) scale(1, 1); }
}
.animate-hop {
  animation: hop 0.6s cubic-bezier(0.28, 0.84, 0.42, 1);
  transform-origin: bottom center;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.animate-shake {
  animation: shake 0.42s ease-in-out;
}

@keyframes pulse-cta {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.025); filter: brightness(1.08); }
}
.animate-pulse-cta {
  animation: pulse-cta 1.6s ease-in-out infinite;
}

@keyframes bar-warn {
  0%, 100% { filter: brightness(1); }
  50% { background-color: #dc2626; filter: brightness(1.25); }
}
.bar-warning {
  animation: bar-warn 0.8s infinite;
}

@keyframes float-up {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  20% { opacity: 1; transform: translateY(-8px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-44px) scale(1); }
}
.floating-delta {
  position: absolute;
  font-family: 'Alegreya Sans', system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  animation: float-up 1.5s ease-out forwards;
  z-index: 40;
}

@keyframes map-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}
.canvas-shake {
  animation: map-shake 0.45s ease-in-out;
}

.custom-scroll::-webkit-scrollbar {
  width: 7px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: rgba(107, 59, 26, 0.2);
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #8e5226;
  border-radius: 4px;
  border: 1px solid #53280c;
}
