/* ==============================================================================
   Kundli Game — Ultra-Minimalist Tinder Swipe & Flip Card
   Orange Hindu Theme (#FF6B00) + Pure White • Zero Clutter • Mobile-First
   ============================================================================== */

:root {
  --orange-primary: #FF6B00;
  --orange-dark: #E05300;
  --orange-light: #FF8533;
  --bg-sand: #FFF8F0;
  --card-white: #FFFFFF;
  --text-dark: #1E1A17;
  --green-safe: #059669;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-sand);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.app-root {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}

/* ==============================================================================
   Stages
   ============================================================================== */
.stage-view {
  display: none;
  width: 100%;
  max-width: 380px;
  height: 100%;
  max-height: 560px;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stage-view.active {
  display: flex;
}

/* ==============================================================================
   STAGE 1: TINDER SWIPE CARD
   ============================================================================== */
.swipe-container {
  width: 100%;
  height: 460px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.tinder-card {
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #FF6B00 0%, #FF801A 60%, #E65100 100%);
  border-radius: 32px;
  box-shadow: 0 16px 40px rgba(255, 107, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FFFFFF;
  cursor: grab;
  touch-action: pan-y;
  position: absolute;
  transition: transform 0.2s ease-out;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.tinder-card:active {
  cursor: grabbing;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 12px;
  border-radius: 999px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-hero-content {
  text-align: center;
  margin: auto 0;
}

.card-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.card-question {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.25;
  color: #FFFFFF;
}

.swipe-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.guide-item.right {
  color: #FFE6CC;
}

.guide-item.left {
  color: #FFFFFF;
  opacity: 0.85;
}

.guide-arrow {
  font-size: 1.1rem;
}

/* Tinder Stamp Overlays */
.swipe-indicator-overlay {
  position: absolute;
  top: 30px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-15deg);
  transition: opacity 0.1s ease;
}

.swipe-indicator-overlay.right {
  right: 20px;
  border: 4px solid #10B981;
  color: #10B981;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(15deg);
}

.swipe-indicator-overlay.left {
  left: 20px;
  border: 4px solid #EF4444;
  color: #EF4444;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(-15deg);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 24px;
  margin-top: 18px;
}

.btn-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-circle:active {
  transform: scale(0.9);
}

.btn-pass {
  border: 2px solid #EFE4D6;
}

.btn-check {
  background: #FF6B00;
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

/* ==============================================================================
   STAGE 2: KUNDLI 3D FLIP CARD
   ============================================================================== */
.flip-wrapper {
  width: 100%;
  height: 520px;
  perspective: 1200px;
}

.card-3d-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-3d-flipper.is-flipped {
  transform: rotateY(180deg);
}

.flipper-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 32px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Face Front */
.face-front {
  background: #FFFFFF;
  border: 3px solid #FF6B00;
  box-shadow: 0 16px 40px rgba(255, 107, 0, 0.2);
  transform: rotateY(0deg);
}

.btn-back-deck {
  align-self: flex-start;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--orange-primary);
  cursor: pointer;
  padding: 0;
}

.kundli-instruction {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 6px 0 12px;
}

.kundli-box {
  width: 100%;
  max-width: 320px;
  margin: 0 auto auto;
  aspect-ratio: 1/1;
}

.kundli-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.k-house {
  fill: #FFF5EC;
  cursor: pointer;
  transition: fill 0.15s ease;
}

.k-house:hover, .k-house:active {
  fill: #FF6B00;
}

.k-num {
  fill: #1E1A17;
  font-weight: 900;
  font-size: 18px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Face Back */
.face-back {
  background: linear-gradient(155deg, #FF6B00 0%, #E65100 100%);
  color: #FFFFFF;
  border: 3px solid #FFFFFF;
  box-shadow: 0 16px 40px rgba(255, 107, 0, 0.35);
  transform: rotateY(180deg);
}

.res-badge {
  align-self: flex-start;
  background: #FFFFFF;
  color: var(--green-safe);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
}

.res-title {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 8px 0 4px;
}

.res-summary {
  font-size: 0.86rem;
  line-height: 1.4;
  opacity: 0.95;
  margin-bottom: 12px;
}

.res-cancels {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.cancel-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.res-upay {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 14px;
  line-height: 1.35;
}

.btn-reset {
  width: 100%;
  padding: 12px;
  background: #FFFFFF;
  color: var(--orange-dark);
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-reset:active {
  transform: scale(0.97);
}
