/* Reset a základní nastavení */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Baloo 2', cursive, sans-serif;
  background-color: #6c0bff;
  color: white;
  text-align: center;
  user-select: none;
  font-size: 16px;
}

body.no-scroll {
  overflow: hidden;
}

/* REAL viewport height workaround */
:root {
  --vh: 1vh;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.main-wrapper {
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-container     { flex: 4 }
.restart-container  { flex: 1 }

/* Poměr rozložení */
.game-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

.floating-message { flex: 2; font-size: 1.2rem; }
.main-emoji       { flex: 4; font-size: 12rem; }
.title            { flex: 1; font-size: 3rem; }
.subtitle         { flex: 1; font-size: 1.2rem; }

/* Restart container */
.restart-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  opacity: 0;
  z-index: 500;
  pointer-events: none;
  transition: opacity 0.6s ease;
  padding: 2vh 10vw;
  box-sizing: border-box;
  gap: 10px;
}

.restart-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.content-container {
  text-align: left;
  padding: 6rem 1.5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.content-heading {
  font-size: 2rem;
  font-weight: bold;
  text-align: left;
  margin-bottom: 2rem;
  line-height: 2rem;
}

.content-subheading {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.content-text {
  font-weight: normal;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.content-text a {
  text-decoration: none;
  cursor: pointer;
  font-weight: normal;
  color: white;
}

/*Tlacitko */
.tlacitko {
  display: flex;
  align-items: center;
  background-color: #FFD43B; /* Žluté pozadí */
  color: black;
  padding: 16px 24px;
  font-size: 1.2rem;
  border: none;
  border-radius: 16px;
  box-shadow: 6px 6px 0px #000000; /* Černý stín */
  gap: 14px;
  max-height: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.tlacitko.secondary {
  display: none;
}

.tlacitko:hover {
  transform: translateY(-2px);
}

.emoji-button {
  font-size: 2rem;
  color: #B28DFF; /* Světle fialové srdce */
}

/* Herní plocha */
.game-area {
  display: block;
  position: fixed;
  top:0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 400;
  background: transparent;
  cursor: auto;
  padding: 2vh;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.game-area.active {
  opacity: 1;
  cursor: pointer;
}

/* Emoji uprostřed */
.main-emoji {
  display: flex;
  align-items: center;
  text-shadow: 0 0 10px rgba(0,0,0,0.4);
  z-index: 10;
}

/* Texty */
.title {
  display: flex;
  align-items: flex-end;
  font-weight: 900;
  line-height: 100%;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 100%;
}

/* Plovoucí zprávy nahoře */
.floating-message {
  display: flex;
  max-width: 80%;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
  text-shadow: 0 0 5px rgba(0,0,0,0.4);
}

.floating-message.show {
  opacity: 1;
}

.ko-fi {
  left: 50% !important;
  transform: translateX(-50%);
  right: auto;
  bottom: 2rem;
  padding: 12px;
  position: fixed;
  z-index: 500;
}

/* Footer */
#footer-bar {
  touch-action: manipulation;
  width: 100%;
  max-height: 2rem;
  position: fixed;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.1); /* lehce průhledné světlé pozadí */
  backdrop-filter: blur(6px);
  color: white;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1rem;
  z-index: 1000;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  text-align: center;
}

.footer-left {
  text-align: left;
}


.footer-right {
  text-align: right;
}

.footer-right a,
.footer-center a,
.footer-left a {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

#footer-bar a:hover {
  text-shadow: 0 0 5px rgba(0,0,0,0.4);
}

/* Skrytí výchozí šipky (většina prohlížečů) */
details.no-arrow summary {
  list-style: none;
}

/* Pro WebKit prohlížeče (Chrome, Safari) */
details.no-arrow summary::-webkit-details-marker {
  display: none;
}

.screenshot-mode {
  background-color: #8f3cff;
}

/* Emoji efekt při kliku */
.click-emoji {
  font-size: 4rem;
  position: absolute;
  pointer-events: none;
  transition: transform 0.6s ease-out, opacity 0.6s;
  z-index: 100;
}

/* Emoji výbuch při 100 kliknutích */
.celebration-emoji {
  position: absolute;
  font-size: 2.2rem;
  pointer-events: none;
  transform: translate(0, 0);
  transition: transform 1s ease-out, opacity 1s;
  opacity: 1;
  z-index: 5;
}

@keyframes wiggle {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.1) rotate(-3deg); }
  50%  { transform: scale(1.08) rotate(3deg); }
  80%  { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}

.wiggle {
  animation: wiggle 0.3s ease-out;
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  7%  { transform: scale(1.1); }
  14%  { transform: scale(1); }
  21%  { transform: scale(1.07); }
  28%  { transform: scale(1); }
  100% { transform: scale(1); }
}

.heartbeat {
  animation: heartbeat 4.5s ease-in-out infinite;
}

@keyframes fall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.falling-emoji {
  position: fixed;
  top: -50px;
  font-size: 2.5rem;
  pointer-events: none;
  animation: fall linear forwards;
  z-index: 5;
}

@keyframes floatUp {
  from {
    transform: translateY(0) rotate(var(--rotation));
    opacity: 1;
  }
  to {
    transform: translateY(-100vh) rotate(var(--rotation));
    opacity: 0;
  }
}

.balloon-emoji {
  position: fixed;
  bottom: -60px;
  font-size: var(--size, 4vh); /* 👈 proměnná velikost */
  pointer-events: none;
  animation: floatUp var(--duration, 3s) cubic-bezier(0.25, 0.1, 0.3, 1) forwards;
  z-index: 999;
  left: 0;
  will-change: transform;
  transform: translateX(var(--driftX)) rotate(var(--rotation));
}

/* 📱 Mobilní optimalizace pro iPhone a malé displeje */
@media screen and (max-width: 430px) {

  .main-wrapper {
    display: flex;
    flex-direction: column; /* nebo row */
  }

  .game-container     { flex: 3 }
  .restart-container  { flex: 1 }
  
  .floating-message { flex: 4; font-size: 1rem; }
  .main-emoji       { flex: 6; font-size: 12rem; }
  .title            { flex: 2; font-size: 3rem; }
  .subtitle         { flex: 1; font-size: 1rem; }

  .main-emoji {
    display: flex;
    align-items: center;
    line-height: 100%;
  }

  .restart-container {
    flex-direction: column;
    width: 100%;
  }

  .tlacitko {
    justify-content: center;
    background-color: #FFD43B; /* Žluté pozadí */
    color: black;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 1.2rem;
    box-shadow: 6px 6px 0px #000000; /* Černý stín */
    height: 100%;
    width: 100%;
  }

  .tlacitko.secondary {
    display: flex;
    color: whitesmoke;
    background-color: #935eff;
    padding: 6px 24px;
    font-size: 1rem;
  }

  .tlacitko.hidden {
    display: none;
  }

  #footer-bar {
    display: none;
  }
}

@media screen and (max-height:530px) {
  .main-wrapper {
    display: flex;
    flex-direction: column; /* nebo row */
  }

  .game-container     { flex: 3 }
  .restart-container  { flex: 1 }
  
  .floating-message { flex: 1; font-size: 1rem; }
  .main-emoji       { flex: 4; font-size: 6rem; }
  .title            { flex: 2; font-size: 1.6rem; }
  .subtitle         { flex: 1; font-size: 1rem; }

  .main-emoji {
    display: flex;
    align-items: flex-end;
    line-height: 100%;
  }

  .main-block .tlacitko {
    font-weight: 600;
    font-size: 1rem;
  }

  .main-block .emoji-button {
    font-size: 1rem;
  }

  .ko-fi{
    display: none;
  }

  #footer-bar {
    display: none;
  }
}
