/* Prediger Professional Design System - Enhanced Typography & Layout */

:root {
  --primary: #2563EB;
  --bg-main: #F8FAFC;
  --card-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.12);
}

html {
  height: -webkit-fill-available;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: #1E293B;
  font-family: 'Noto Sans KR', sans-serif;
  overflow-x: hidden;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

#app {
  width: 100%;
  max-width: 1550px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-bottom: 50px;
}

section {
  width: 100%;
  display: flex;
  flex-direction: column;
}

#sorting-section {
  height: 85vh;
  max-height: 800px;
  overflow: hidden;
}

#select9-section, #rank3-section, #result-section {
  height: auto !important;
  min-height: unset;
  overflow: visible !important;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 20px;
}

/* Phase Indicators */
.phase-badge {
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  color: #94A3B8;
  background: #F1F5F9;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.phase-badge.active {
  color: #2563EB;
  background: #EFF6FF;
  border-color: #BFDBFE;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.phase-badge.done {
  color: #10B981;
  background: #ECFDF5;
}

/* Card Stack Engine */
#card-stack {
  perspective: 2000px;
}

.card-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2.5rem;
  background: white;
  box-shadow: var(--card-shadow);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

/* PDF Export mode specifically for alignment */
.pdf-export-mode {
  width: 800px !important;
  max-width: 800px !important;
  margin: 0 auto !important;
  padding: 40px !important;
  box-shadow: none !important;
  background: white !important;
  display: block !important;
  border: none !important;
  overflow: visible !important;
}

.pdf-export-mode * {
  page-break-inside: avoid;
}

.selection-card {
  width: 100%;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.selection-card.selected {
  transform: scale(0.92);
  box-shadow: 0 0 0 6px var(--primary), 0 25px 60px -15px rgba(37, 99, 235, 0.5);
}

.rank-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: #4F46E5;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  border: 3px solid white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
  z-index: 50;
  animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stamp {
  opacity: 0;
  position: absolute;
  top: 40px;
  padding: 8px 16px;
  border-radius: 15px;
  border: 4px solid;
  font-weight: 900;
  font-size: 2rem;
  text-transform: uppercase;
  z-index: 100;
  pointer-events: none;
}

.stamp-like { left: 30px; color: #2563EB; border-color: #2563EB; transform: rotate(-12deg); }
.stamp-nope { right: 30px; color: #94A3B8; border-color: #94A3B8; transform: rotate(12deg); }
.stamp-hold { top: 40%; left: 50%; transform: translate(-50%, -50%); color: #F59E0B; border-color: #F59E0B; }
