body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #0d0d0d;
  color: #d4af37;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 20px;
  background-color: #000;
  border-bottom: 1px solid #222;
  text-align: center;
}

header img {
  height: 70px;
  margin-bottom: 10px;
}

h1 {
  font-family: 'Angelica', cursive;
  font-size: 36px;
  color: #d4af37;
  margin: 0;
}

h2 {
  text-align: center;
  font-size: 24px;
  color: #d4af37;
  margin-top: 30px;
  margin-bottom: 10px;
}

.tagline {
  font-family: 'Pacifico', cursive;
  font-size: 20px;
  color: #bfa25a;
  text-align: center;
  margin-top: 5px;
}

.hero-image img {
  width: 90%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin: 0 auto 30px;
  border-radius: 12px;
  border: 2px solid #d4af37;

}
}


.icon-buttons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
}

.icon-buttons img {
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.2s;
}

.icon-buttons img:hover {
  transform: scale(1.1);
}

.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border: 2px solid #d4af37;
  border-radius: 12px;
  padding: 20px;
  z-index: 1000;
  min-width: 300px;
  color: #d4af37;
}
.display-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.display-area input {
  flex: 1;
  padding: 10px;
  font-size: 18px;
  background: #000;
  color: #d4af37;
  border: 2px solid #d4af37;
  border-radius: 8px;
}

.clear-btn {
  padding: 10px 15px;
  background: #8B0000;
  color: #fff;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 кнопки в ряд */
  gap: 10px;
}

.calc-btn {
  padding: 15px;
  font-size: 18px;
  background-color: #111;
  color: #d4af37;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calc-btn:hover {
  background-color: #222;
}

.popup .close-btn {
  float: right;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #d4af37;
  cursor: pointer;
}
#calcDisplay {
  width: 100%;
  padding: 10px;
  background: #000;
  color: #d4af37;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  margin-bottom: 10px;
}
.todo-container input {
  width: calc(100% - 50px);
  padding: 8px;
  background: #000;
  color: #d4af37;
  border: 1px solid #333;
  border-radius: 8px;
}

.todo-container button {
  background: #111;
  border: 1px solid #d4af37;
  color: #d4af37;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

#taskList {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

#taskList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

#taskList li span.completed {
  text-decoration: line-through;
  color: #777;
}

.card-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;      
  gap: 20px;
  padding: 20px;
  overflow-x: visible;    
}

.card {
  perspective: 1000px;
  flex: 0 0 calc(33.33% - 20px); 
  max-width: 100%;
}

@media (max-width: 900px) {
  .card {
    flex: 0 0 calc(50% - 20px);
  }
}

@media (max-width: 600px) {
  .card {
    flex: 0 0 100%; 
  }
}

.card-front img {
  width: 1000%;
  height: auto;
  object-fit: cover;
  border: 2px solid #d4af37;
}


.card {
  perspective: 1000px;
  flex: 0 0 calc(33.33% - 20px); 
  max-width: 100%;
  height: 300px; 
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .card {
    flex: 0 0 calc(50% - 20px); 
  }
}

@media (max-width: 600px) {
  .card {
    flex: 0 0 100%; 
  }
}

.card-inner {
  position: relative;
  width: 90%;
  height: 90%;
  transform-style: preserve-3d;
  transition: transform 0.8s;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 90%;
  height: 90%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  background-size: contain; /* ✅ добавлено */
  background-repeat: no-repeat; /* ✅ добавлено */
  background-position: center; /* ✅ добавлено */
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ✅ чтобы не искажались */
  border: 2px solid #d4af37;
}

.card-back {
  background-color: #111;
  color: #d4af37;
  transform: rotateY(180deg);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  font-size: 16px;
  border: 2px solid #d4af37;
}


.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: #111;
  border-top: 1px solid #333;
}

.footer-buttons button {
  background: transparent;
  border: none;
  color: #d4af37;
  font-size: 16px;
  cursor: pointer;
}

.footer-content {
  display: none;
  background: #1a1a1a;
  color: #d4af37;
  text-align: center;
  padding: 20px;
  animation: slideUp 0.5s ease-out;
}

.footer-content.active {
  display: block;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
  grid-template-columns: repeat(4, 1fr);
.calc-btn-clear {
  background-color: #8B0000;
  color: #fff;
}

}
