/* ---- Oracle layout ---- */
#table {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hidden { display: none !important; }

/* ---- Spread picker: CSS grid, four corners + center ---- */
#spread-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr auto 1fr;
  width: 100%;
  max-width: 500px;
  height: 60vh;
  max-height: 400px;
  gap: 8px;
}

.spread-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 12px;
  border-radius: 12px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.spread-option:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* Position spread options in grid corners */
.spread-option[data-spread="love"]     { grid-column: 1; grid-row: 1; }
.spread-option[data-spread="yesno"]    { grid-column: 3; grid-row: 1; }
.spread-option[data-spread="forecast"] { grid-column: 1; grid-row: 3; }
.spread-option[data-spread="growth"]   { grid-column: 3; grid-row: 3; }

#center-deck {
  grid-column: 2;
  grid-row: 2;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-radius);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(200, 112, 152, 0.3), 0 0 40px rgba(200, 112, 152, 0.1), var(--shadow);
}

.spread-suit {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  line-height: 1;
}

.spread-suit.suit-pink { color: #C4908A; text-shadow: 0 0 12px rgba(196, 144, 138, 0.5); }
.spread-suit.suit-green { color: #8A9A7A; text-shadow: 0 0 12px rgba(138, 154, 122, 0.5); }

.spread-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #3A352F;
  margin-top: 6px;
}

.spread-count {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.65rem;
  color: #6B5F52;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ---- Reading title in controls ---- */
#reading-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9A7B8A;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(200, 112, 152, 0.4);
}

/* ---- Prompt area ---- */
#prompt-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex: 1;
}

#prompt-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  color: #3A352F;
  text-align: center;
  max-width: 320px;
  font-style: italic;
  line-height: 1.6;
  text-shadow: 0 0 12px rgba(200, 112, 152, 0.25);
}

#shuffle-deck {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-radius);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(200, 112, 152, 0.3), 0 0 40px rgba(200, 112, 152, 0.1), var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

#shuffle-deck:active {
  transform: scale(0.95);
}

#shuffle-counter {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  color: #6B5F52;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgba(200, 112, 152, 0.2);
}

/* ---- Shuffle wave animation ---- */
@keyframes shuffle-wave {
  0%   { transform: rotate(0deg) translateY(0); }
  25%  { transform: rotate(-3deg) translateY(-6px); }
  50%  { transform: rotate(2deg) translateY(-3px); }
  75%  { transform: rotate(-1deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

#shuffle-deck.shuffling {
  animation: shuffle-wave 0.35s ease-out;
}

/* ---- Day picker (Forecast) ---- */
#day-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

#day-picker p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: #3A352F;
  font-style: italic;
}

#day-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

#day-buttons button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.5);
  color: #3A352F;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

#day-buttons button:hover {
  background: rgba(138, 154, 122, 0.2);
  transform: scale(1.1);
}

/* ---- Spread area ---- */
#spread-area {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.oracle-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ---- Card flip container ---- */
.oracle-card {
  width: var(--card-width);
  height: var(--card-height);
  perspective: 600px;
  cursor: default;
}

.oracle-card.tappable {
  cursor: pointer;
}

.oracle-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

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

.oracle-card.flipped .oracle-card-front {
  box-shadow: 0 0 20px rgba(200, 112, 152, 0.4), 0 0 40px rgba(200, 112, 152, 0.15), var(--shadow);
}

.oracle-card.flipped .oracle-card-front.suit-green {
  box-shadow: 0 0 20px rgba(70, 140, 90, 0.4), 0 0 40px rgba(70, 140, 90, 0.15), var(--shadow);
}

.oracle-card-front,
.oracle-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.oracle-card-back {
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 16px rgba(200, 112, 152, 0.25), var(--shadow);
}

.oracle-card-front {
  transform: rotateY(180deg);
}

.oracle-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--card-radius);
  display: block;
}

.oracle-card-front.suit-pink {
  border: 2.5px solid rgba(200, 80, 120, 0.5);
}

.oracle-card-front.suit-green {
  border: 2.5px solid rgba(70, 140, 90, 0.5);
}

/* ---- Card labels ---- */
.card-label {
  text-align: center;
}

.card-label .position-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  color: #9A7B8A;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(200, 112, 152, 0.3);
}

.card-label .position-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.6rem;
  color: #6B5F52;
  font-style: italic;
  margin-top: 1px;
  text-shadow: 0 0 6px rgba(200, 112, 152, 0.2);
}

.card-label .card-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.8rem;
  color: #3A352F;
  margin-top: 2px;
  text-shadow: 0 0 10px rgba(200, 112, 152, 0.25);
}

.card-label .card-theme {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.6rem;
  color: #9A7B8A;
  font-style: italic;
  letter-spacing: 0.3px;
  margin-top: 1px;
  text-shadow: 0 0 8px rgba(200, 112, 152, 0.2);
}

/* ---- Deal animation ---- */
@keyframes deal-in {
  0%   { opacity: 0; transform: scale(0.5) translateY(-40px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.oracle-card-slot.dealing {
  animation: deal-in 0.4s ease-out both;
}

/* ---- Answer display (Yes/No) ---- */
#answer-display {
  text-align: center;
  padding: 16px;
}

#answer-display .answer-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  font-weight: 400;
  color: #3A352F;
  text-shadow: 0 0 20px rgba(200, 112, 152, 0.5), 0 0 40px rgba(200, 112, 152, 0.2);
}

#answer-display .answer-detail {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  color: #6B5F52;
  letter-spacing: 0.3px;
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(200, 112, 152, 0.25);
}

/* ---- Shuffle Again button (Yes/No between cards) ---- */
.shuffle-again-btn {
  margin-top: 20px;
}

/* ---- Complete area ---- */
#complete-area {
  padding: 20px;
  text-align: center;
}

/* ---- Sparkle canvas — full viewport width ---- */
#sparkle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

/* ---- Disable landscape rotation for oracle — stays portrait ---- */
@media (max-width: 700px) and (orientation: portrait) {
  .arcade-game {
    transform: none;
    width: 100%;
    height: 100vh;
    position: relative;
    top: auto;
    left: auto;
    padding: 4px 8px;
  }

  :root {
    --card-width: 70px;
    --card-height: 98px;
    --card-radius: 5px;
  }

  #spread-picker {
    max-width: 90%;
    height: 50vh;
  }

  .spread-suit { font-size: 1.5rem; }
  .spread-name { font-size: 0.8rem; }
  .spread-count { font-size: 0.65rem; }

  #prompt-text { font-size: 0.95rem; max-width: 260px; }

  #spread-area { gap: 8px; padding-top: 12px; }

  .card-label .position-name { font-size: 0.65rem; }
  .card-label .position-desc { font-size: 0.55rem; }
  .card-label .card-name { font-size: 0.7rem; }
  .card-label .card-theme { font-size: 0.6rem; }

  #answer-display .answer-text { font-size: 1.5rem; }
  #answer-display .answer-detail { font-size: 0.75rem; }
}

/* ---- Small phones: tighter card spacing ---- */
@media (max-width: 400px) {
  #spread-area { gap: 6px; }
}

/* ---- Tablet ---- */
@media (min-width: 701px) and (max-width: 1000px) {
  #spread-picker {
    max-width: 420px;
    height: 50vh;
  }
}
