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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 183, 77, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(132, 250, 176, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

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

.header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  min-height: 500px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Screen Management */
.screen {
  display: none;
  padding: 40px;
  text-align: center;
}

.screen.active {
  display: block;
}

/* Start Screen */
.start-content {
  max-width: 400px;
  margin: 0 auto;
}

.game-info {
  margin-bottom: 40px;
}

.game-info h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #333;
}

.game-info ul {
  text-align: left;
  list-style: none;
  padding: 0;
}

.game-info li {
  padding: 10px 0;
  padding-left: 30px;
  position: relative;
  font-size: 1rem;
  line-height: 1.5;
}

.game-info li::before {
  content: "✨";
  position: absolute;
  left: 0;
  top: 10px;
}

.start-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: white;
  border: none;
  padding: 18px 45px;
  border-radius: 50px;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 15px 30px rgba(255, 107, 107, 0.4),
    0 5px 15px rgba(255, 142, 83, 0.2);
  position: relative;
  overflow: hidden;
}

.start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.start-button:hover::before {
  left: 100%;
}

.start-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(255, 107, 107, 0.5),
    0 10px 20px rgba(255, 142, 83, 0.3);
}

/* Game Screen */
.progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding: 0 20px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  width: 10%;
  transition: width 0.5s ease;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.round-text {
  font-weight: 600;
  color: #666;
  font-size: 1rem;
}

.vs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.food-option {
  flex: 1;
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 35px 25px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.food-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      rgba(255, 107, 107, 0.1) 0%,
      rgba(255, 142, 83, 0.1) 50%,
      rgba(132, 250, 176, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.food-option::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.food-option:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(255, 107, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: #ff6b6b;
}

.food-option:hover::before {
  opacity: 1;
}

.food-option:hover::after {
  opacity: 1;
}

.food-emoji {
  font-size: 4.5rem;
  margin-bottom: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  position: relative;
  z-index: 2;
}

.food-option:hover .food-emoji {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.food-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #2d3748;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.food-desc {
  color: #4a5568;
  font-size: 1rem;
  line-height: 1.5;
  position: relative;
  z-index: 2;
  font-weight: 400;
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.vs-text {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: white;
  padding: 12px 18px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
  animation: pulse-vs 2s ease-in-out infinite;
}

@keyframes pulse-vs {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.6);
  }
}

/* Result Screen */
.result-content {
  max-width: 400px;
  margin: 0 auto;
}

.result-content h2 {
  font-size: 2rem;
  margin-bottom: 30px;
  color: #333;
}

.final-food {
  background: linear-gradient(145deg,
      rgba(255, 107, 107, 0.1) 0%,
      rgba(255, 142, 83, 0.1) 50%,
      rgba(132, 250, 176, 0.1) 100%);
  border-radius: 25px;
  padding: 45px;
  margin-bottom: 35px;
  border: 3px solid #ff6b6b;
  box-shadow:
    0 20px 40px rgba(255, 107, 107, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.final-food::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0.3;
    transform: rotate(0deg);
  }

  50% {
    opacity: 0.6;
    transform: rotate(180deg);
  }
}

.final-emoji {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: bounce 1s ease-in-out;
}

.final-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
}

.final-desc {
  font-size: 1.1rem;
  color: #666;
}

.restart-button {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
  color: white;
  border: none;
  padding: 18px 45px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 15px 30px rgba(132, 250, 176, 0.4),
    0 5px 15px rgba(143, 211, 244, 0.2);
  position: relative;
  overflow: hidden;
}

.restart-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.restart-button:hover::before {
  left: 100%;
}

.restart-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(132, 250, 176, 0.5),
    0 10px 20px rgba(143, 211, 244, 0.3);
}

/* Animations */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }

  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }

  70% {
    transform: translate3d(0, -15px, 0);
  }

  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.food-option.selected {
  animation: pulse 0.6s ease-in-out;
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .vs-container {
    flex-direction: column;
    gap: 15px;
  }

  .food-option {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .food-emoji {
    font-size: 3rem;
  }

  .screen {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .food-emoji {
    font-size: 2.5rem;
  }

  .final-emoji {
    font-size: 4rem;
  }

  .food-name {
    font-size: 1.3rem;
  }

  .final-name {
    font-size: 1.8rem;
  }
}

/* 단계별 음식 옵션 스타일 */
.food-option.phase-1,
.food-option.phase-2,
.food-option.phase-3 {
  border-left: 4px solid #ff6b6b;
}





/* 최종 결과 스타일 개선 */
.final-stats {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
  border-radius: 15px;
  border-left: 4px solid #ff6b6b;
  position: relative;
  z-index: 2;
}

.final-stats p {
  margin: 8px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #2d3748;
  text-align: center;
}

/* Winner Display Styles */
.winner-food {
  margin: 30px 0;
}

.winner-display {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.2);
  position: relative;
  overflow: hidden;
}

.winner-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.winner-emoji {
  font-size: 5rem;
  margin-bottom: 15px;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.winner-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.winner-description {
  font-size: 1.1rem;
  color: #718096;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* Game Stats Styles */
.game-stats {
  margin: 30px 0;
  padding: 25px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
  border-radius: 15px;
  border-left: 4px solid #ff6b6b;
}

.stats-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 20px;
}

.top-foods-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.food-item .rank {
  font-weight: 700;
  color: #667eea;
  min-width: 35px;
}

.food-item .food-emoji {
  font-size: 1.5rem;
  margin: 0 10px;
}

.food-item .food-name {
  flex: 1;
  text-align: left;
  font-weight: 600;
  color: #2d3748;
}

.food-item .food-count {
  font-size: 0.9rem;
  color: #718096;
  font-weight: 500;
}

/* 근처 음식점 찾기 섹션 */
.nearby-section {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
}

.find-nearby-button {
  background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
  color: white;
  border: none;
  padding: 15px 35px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 10px 25px rgba(33, 150, 243, 0.3),
    0 5px 15px rgba(33, 203, 243, 0.2);
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
}

.find-nearby-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.find-nearby-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.find-nearby-button:hover:not(:disabled)::before {
  left: 100%;
}

.find-nearby-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 15px 35px rgba(33, 150, 243, 0.4),
    0 8px 20px rgba(33, 203, 243, 0.3);
}

/* 현재 위치 정보 */
.location-info {
  margin: 15px 0;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
  border: 1px solid #d1e7ff;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.location-info.hidden {
  display: none;
}

.current-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.location-icon {
  font-size: 16px;
}

.current-address {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

/* 위치 상태 메시지 */
.location-status {
  margin: 10px 0;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.location-status.loading {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.location-status.success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.location-status.error {
  background: #ffebee;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

/* 음식점 컨테이너 */
.restaurants-container {
  margin-top: 20px;
  text-align: left;
}

.restaurants-container.hidden {
  display: none;
}

.restaurants-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

.restaurants-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 0;
}

/* 음식점 아이템 */
.restaurant-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.restaurant-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-color: #2196F3;
}

.restaurant-info {
  margin-bottom: 12px;
}

.restaurant-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.restaurant-category {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 3px;
}

.restaurant-address {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.4;
}

.restaurant-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.restaurant-phone,
.restaurant-link,
.restaurant-map-btn {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.restaurant-phone {
  background: #4caf50;
  color: white;
}

.restaurant-phone:hover {
  background: #45a049;
  transform: scale(1.05);
}

.restaurant-link {
  background: #ff9800;
  color: white;
}

.restaurant-link:hover {
  background: #f57c00;
  transform: scale(1.05);
}

.restaurant-map-btn {
  background: #2196f3;
  color: white;
}

.restaurant-map-btn:hover {
  background: #1976d2;
  transform: scale(1.05);
}

/* 음식점이 없을 때 */
.no-restaurants {
  text-align: center;
  padding: 30px 20px;
  color: #666;
}

.no-restaurants p {
  margin-bottom: 10px;
  line-height: 1.5;
}

/* 스크롤바 스타일링 */
.restaurants-list::-webkit-scrollbar {
  width: 6px;
}

.restaurants-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.restaurants-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.restaurants-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 모바일 반응형 - 음식점 리스트 */
@media (max-width: 768px) {
  .nearby-section {
    margin: 20px 0;
    padding: 15px 0;
  }

  .find-nearby-button {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .restaurants-list {
    max-height: 300px;
  }

  .restaurant-item {
    padding: 12px;
  }

  .restaurant-actions {
    gap: 6px;
  }

  .restaurant-phone,
  .restaurant-link,
  .restaurant-map-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .restaurant-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .restaurant-phone,
  .restaurant-link,
  .restaurant-map-btn {
    text-align: center;
    justify-content: center;
  }
}