* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #1e1245 0%, #0d0a1e 65%);
  font-family: 'Georgia', serif;
  color: #e0d8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 1.5rem;
  width: 100%;
  max-width: 720px;
}

/* Title */
.title {
  font-size: 2.8rem;
  font-weight: normal;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #c9a84c;
}

/* Spread selector */
.spread-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.spread-btn {
  background: transparent;
  border: 1px solid #6b5f80;
  color: #9b8eb0;
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.spread-btn:hover {
  border-color: #c9a84c;
  color: #c9a84c;
}

.spread-btn.active {
  border-color: #c9a84c;
  color: #c9a84c;
  background: rgba(201, 168, 76, 0.08);
}

.spread-hint {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #9b8eb0;
  font-style: italic;
  min-height: 1.1em;
  text-align: center;
}

/* Cards area */
.cards-area {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
}

.card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.card-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b5f80;
  min-height: 1.1em;
  transition: color 0.4s;
}

.card-slot.revealed .card-label {
  color: #c9a84c;
}

/* Card flip mechanics */
.card {
  width: 160px;
  height: 280px;
  perspective: 1000px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.card.dealt {
  opacity: 1;
  transform: translateY(0);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-back,
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Card back */
.card-back {
  background: linear-gradient(150deg, #1b1042 0%, #2a186a 50%, #1b1042 100%);
  border: 2px solid #c9a84c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
}

.card-back::after {
  content: '✦';
  font-size: 2.2rem;
  color: rgba(201, 168, 76, 0.5);
}

/* Card face */
.card-face {
  background: #f5f0e6;
  border: 2px solid #c9a84c;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.2rem 0.8rem;
  text-align: center;
}

.card-numeral {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #a09070;
}

.card-arcana {
  font-size: 1rem;
  font-weight: bold;
  color: #1a1035;
  line-height: 1.3;
}

.card-divider {
  width: 40px;
  height: 1px;
  background: rgba(201, 168, 76, 0.5);
}

.card-custom {
  font-size: 0.7rem;
  color: #6b5f4a;
  font-style: italic;
  line-height: 1.4;
}

/* Deal button */
.deal-btn {
  background: transparent;
  border: 1px solid #c9a84c;
  color: #c9a84c;
  padding: 0.75rem 2.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.deal-btn:hover {
  background: rgba(201, 168, 76, 0.12);
}

/* Tablet: tighten the gap, shrink cards slightly */
@media (max-width: 560px) {
  .cards-area {
    gap: 0.75rem;
  }

  .card {
    width: 100px;
    height: 175px;
  }

  .card-back::after {
    font-size: 1.5rem;
  }

  .card-arcana {
    font-size: 0.8rem;
  }

  .card-custom {
    font-size: 0.6rem;
  }

  .title {
    font-size: 2rem;
  }
}

/* Small mobile: stack vertically, restore full card size */
@media (max-width: 380px) {
  .cards-area {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .card {
    width: 160px;
    height: 280px;
  }

  .card-back::after {
    font-size: 2.2rem;
  }

  .card-arcana {
    font-size: 1rem;
  }

  .card-custom {
    font-size: 0.7rem;
  }
}
