/* ==========================================================================
   🤝 Friend SOS 풀이 전용 독립 뷰 (#view-sos)
   - 하단 탭바 없이 100% 화면을 사용하는 몰입형 모바일 최적화 레이아웃
   ========================================================================== */

#view-sos.view {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 10%, rgba(225, 29, 72, 0.12) 0%, transparent 60%),
              radial-gradient(circle at 50% 90%, rgba(168, 85, 247, 0.12) 0%, transparent 60%),
              #090d16;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#view-sos.view.active {
  display: flex !important;
}

.sos-solve-page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  animation: sosFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sosFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 상단 헤더 */
.sos-solve-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sos-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sos-pulse-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid #f43f5e;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 900;
  color: #fecdd3;
  animation: sosBadgePulse 2s infinite ease-in-out;
}

@keyframes sosBadgePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(244, 63, 94, 0.3); }
  50% { box-shadow: 0 0 14px rgba(244, 63, 94, 0.6); }
}

.sos-exit-link {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sos-exit-link:hover {
  background: #334155;
  color: #ffffff;
}

.sos-sharer-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.18) 0%, rgba(147, 51, 234, 0.18) 100%);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  border-radius: 12px;
  padding: 10px 14px;
}

.sos-sharer-avatar {
  font-size: 1.6rem;
}

.sos-sharer-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sos-sharer-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #fecdd3;
}

.sos-sharer-sub {
  font-size: 0.74rem;
  color: #e2e8f0;
}

/* 목표 레시피 카드 */
.sos-target-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #3b82f6;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.5);
}

.sos-target-left {
  flex-shrink: 0;
}

.sos-target-mystery-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #1e293b;
  border: 1.5px dashed #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #93c5fd;
}

.sos-target-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sos-target-number-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sos-target-num-badge {
  font-size: 0.78rem;
  font-weight: 900;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
  padding: 2px 7px;
  border-radius: 6px;
}

.sos-target-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 900;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sos-target-hint {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.sos-target-hint .bulb {
  color: #fde047;
}

/* 조주 가마솥 */
.sos-pot-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #131c2e;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 10px 12px;
}

.sos-pot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sos-pot-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #94a3b8;
}

.sos-pot-clear-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 6px;
}

.sos-pot-slots-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 44px;
}

.sos-pot-empty-guide {
  font-size: 0.74rem;
  color: #64748b;
  text-align: center;
  width: 100%;
  padding: 8px 0;
}

.sos-pot-slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.95);
  border: 1.5px solid #3b82f6;
  border-radius: 8px;
  padding: 5px 9px;
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sos-pot-slot-pill:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
}

.slot-pill-count {
  color: #fde047;
  font-weight: 900;
  background: rgba(245, 158, 11, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
}

.slot-pill-remove-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  cursor: pointer;
  padding: 0 2px;
}

.slot-pill-remove-btn:hover {
  color: #ef4444;
}

/* 재료 선택 영역 */
.sos-ingredients-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sos-cat-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sos-cat-chip {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sos-cat-chip.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  font-weight: 900;
}

.sos-ings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  max-height: 38vh;
  overflow-y: auto;
  padding-right: 2px;
}

.sos-empty-ings {
  grid-column: 1 / -1;
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
  padding: 24px 0;
}

.sos-ing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #e2e8f0;
}

.sos-ing-card:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
  transform: translateY(-1px);
}

.sos-ing-card.in-pot {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.sos-ing-count-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.64rem;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 5px;
}

.sos-ing-emoji {
  font-size: 1.5rem;
}

.sos-ing-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

/* 하단 액션 버튼 바 */
.sos-action-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.sos-mix-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
  transition: all 0.15s ease;
}

.sos-mix-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.55);
}

.sos-mix-btn:disabled {
  background: #334155;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.65;
}

.sos-play-my-game-btn {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sos-play-my-game-btn:hover {
  background: #1e293b;
  border-color: #60a5fa;
  color: #ffffff;
}
