html{
  margin: 0;
  height: 100%;
  background-color: #F6A2D6; /* kolor z dołu gradientu jako podkład */
}

body {
  /* --- rozmiar i layout --- */
  min-height: 100dvh; /* poprawne 100vh dla iOS z Dynamic Island */
  margin: 0;

  /* --- gradient --- */
  background-image: linear-gradient(180deg, #F9C7E6 0%, #F6A2D6 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% calc(100% + env(safe-area-inset-top));
  background-position: center calc(-1 * env(safe-area-inset-top));

  /* --- fallback tła (jeśli gradient się nie wczyta) --- */
  background-color: #F6A2D6;

  /* --- font i układ --- */
  font-family: "Courgette", cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  /* --- bezpieczne obszary --- */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);

  /* --- poprawa zachowania scrolla i wyglądu --- */
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* iOS fallback – zostaw */
@supports (-webkit-touch-callout: none) {
  html { height: -webkit-fill-available; }
  body { min-height: -webkit-fill-available; }
}

/* Dodatkowy gradient na stare iOS (opcjonalne) */
@supports (-webkit-background-clip: text) {
  html {
    background-image: -webkit-linear-gradient(270deg, #F9C7E6, #F6A2D6);
  }
}

/* --- TWOJE ELEMENTY --- */

.kartka{
  width: 70%;
  max-width: 720px;
  height: 600px;
  background-color: #F47CC4;
  color: white;
  font-size: 20px;
  padding: 2rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.przyciski{
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: auto;
}

.kartka {
  position: relative;     /* kontekst dla absolute */
  /* nic z overflow na razie! (bez hidden/clip) */
}

/* startowo oba przyciski w normalnym przepływie */
#przycisk_tak,
#przycisk_nie {
  position: static;
}


.kartka { position: relative; overflow: hidden; }
#przycisk_nie { position: relative; transition: transform .2s ease; }
#przycisk_tak { position: relative; z-index: 2; }


/* Pasek z przyciskami wyśrodkowany na dole kartki */
.btns {
  position: absolute;
  left: 50%;
  bottom: 24px;                /* jak w Twoim projekcie */
  transform: translateX(-50%); /* zawsze środek */
  display: flex;
  gap: 32px;                   /* odstęp między przyciskami */
}

/* Tak zawsze „nad” w razie nakładania */
#przycisk_tak { position: relative; z-index: 2; }

/* Nie będzie „uciekał” translacją (bez wyjmowania z layoutu) */
#przycisk_nie {
  position: relative;
  z-index: 3;
  transition: transform .2s ease;
  will-change: transform;
}
.kartka { overflow: hidden; }  /* utnie wszystko poza kontenerem */


.button_y{
  width: 125px;
  height: 45px;
  background-color: green;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}
.button_y:hover{
  cursor:pointer;
}

.button_n{
  width: 125px;
  height: 45px;
  background-color: #F00528;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}
.button_n:hover{
  cursor: pointer;
}

/* Kontener na GIF – zajmuje wolną przestrzeń między tytułem a przyciskami */
.gif-box{
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;              /* wypełnij środkową przestrzeń kartki */
  min-height: 120px;           /* bezpieczna wysokość na mniejszych ekranach */
}

/* Sam GIF – nie rozciąga kartki, skaluje się w środku */
.gif{
  max-width: 100%;
  max-height: clamp(160px, 40vh, 360px); /* ograniczenia wysokości */
  height: auto;
  object-fit: contain;
  pointer-events: none;        /* żeby ruch "Nie" nie łapał hovera GIFa */
  user-select: none;
}


/* MODAL */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.modal-overlay.znikaj {
  animation: fadeOut 0.3s forwards;
}

.modal-okno {
  background-color: white;
  color: black;
  padding: 2rem;
  border-radius: 15px;
  max-width: 400px;
  position: relative;
  text-align: center;
  animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.modal-okno button.zamknij {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.handwritten{
    font-family: "Courgette", cursive;
    text-align: center;
}
.page {
  width: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}


