/* Modernizované Květinové mandaly */

:root {
  --primary-color: #d6a5be;
  --secondary-color: #e7eddc;
  --text-dark: #4a4a4a;
  --text-light: #777;
  --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --card-shadow: 0 10px 20px rgba(0,0,0,0.1);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Quicksand', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-gradient);
  color: var(--text-dark);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
}

h1 {
  font-family: var(--font-heading);
  font-size: 2.5em;
  color: #333;
  margin: 0;
}

h2 {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.2em;
  color: var(--text-light);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.intro-text {
  max-width: 700px;
  margin: 20px auto 0;
  line-height: 1.6;
}

.instructions {
  color: #888;
  margin-top: 15px;
  font-style: italic;
}

/* Controls */
.controls {
  text-align: center;
  margin-bottom: 30px;
  height: 60px; /* Placeholder height to prevent layout jump */
}

.btn-shuffle {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1em;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-body);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(214, 165, 190, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-shuffle:hover {
  background-color: #c58ca5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(214, 165, 190, 0.6);
}

/* Desk (Balíček karet) */
#desk-container {
  min-height: 120px;
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
  perspective: 1000px;
}

#desk {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100px;
}

.card {
  width: 60px;
  height: 96px; /* Golden ratioish */
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: 2px solid white;
}

.card.closed {
  background: #333 url('img/card_bg_pink.jpg'); /* Fallback + image */
  background-size: cover;
}

/* Efekt "vějíře" */
.card.collapsed {
  margin-right: -58px; /* Sbalené */
  transform: rotate(0deg);
}

.card.uncollapsed {
  margin-right: -30px; /* Rozbalené do vějíře */
}

.card.closed:hover {
  transform: translateY(-15px) scale(1.1);
  z-index: 100;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  margin-right: 5px; /* Udělá místo */
  margin-left: 5px;
}

/* Selected Cards Area */
#selected-container {
  text-align: center;
  min-height: 300px;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 20px;
}

#selected-container h3 {
  font-family: var(--font-heading);
  color: var(--text-light);
  margin-bottom: 30px;
}

#selected {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* Opened Card Styles */
.card.opened {
  width: 250px;
  height: auto;
  background: white;
  padding: 10px;
  border-radius: 15px;
  margin: 10px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: appear 0.6s ease-out;
  transition: transform 0.3s;
  cursor: default; /* Změna z pointeru na výchozí kurzor */
}

.card.opened:hover {
  transform: translateY(-5px);
}

.card.opened img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.card.opened h3 {
  font-family: var(--font-heading);
  font-size: 1.2em;
  margin: 5px 0;
  color: #333;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 0.9em;
  margin-top: auto;
}

/* Modal */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px); /* Modern glass effect */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

#modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
}

#modal-overlay.active .modal-content {
  transform: scale(1);
}

#modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

#modal-close:hover {
  color: var(--primary-color);
}

#modal-body img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

#modal-body h2 {
  font-family: var(--font-heading);
  color: #333;
  margin-bottom: 10px;
}

#modal-body p {
  font-size: 1.1em;
  line-height: 1.6;
  color: #555;
}