/* 기본 모바일 및 태블릿 세로(Portrait) 모드: 화면 전체를 100% 모바일 형태로 가득 채움 (바깥 여백 없음) */
#app-container {
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: none;
  border: none;
  margin: 0;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* PC 가로(Landscape) 와이드 모니터 화면에서만 가운데 스마트폰 프레임으로 센터링 (태블릿/패드 세로모드는 100% 모바일 전체화면) */
@media (orientation: landscape) and (min-width: 900px), (min-aspect-ratio: 1.15/1) and (min-width: 600px) {
  body {
    background: #0b0f17;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #app-container {
    width: 100%;
    max-width: 480px;
    height: 94vh;
    max-height: 920px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  }
}

/* 상단 헤더 & 유저 레벨 바 */
header {
  padding: 12px 16px;
  background: #1a2333;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  flex-shrink: 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}


.brand-logo-img {
  width: auto;
  height: 46px;
  max-width: 98px;
  padding: 0;
  border-radius: 0;
  object-fit: contain;
  display: block;
  box-shadow: none;
  border: none;
  background: transparent;
}

.k-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -2px 0;
  filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.82)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

.brand h1 {
  font-size: 1.22rem;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.4px;
}

.brand-inline-sub {
  display: inline-block;
  font-family: "East Sea Dokdo", -apple-system, BlinkMacSystemFont, "Pretendard", sans-serif;
  font-size: 1.48rem;
  font-weight: 400;
  color: #f8fafc;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transform: skewX(-5deg);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-pill {
  font-size: 0.72rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.progress-pill {
  font-size: 0.72rem;
  background: var(--primary-soft);
  color: #93c5fd;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid rgba(49, 130, 246, 0.45);
}

.header-toolbar {
  display: none;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 5px 10px;
  border-radius: 8px;
}

.toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 700;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
}

.toolbar-toggle.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

/* 하단 4단 탭 네비게이션 (모바일 퍼스트 Bottom Bar) */
.tab-bar {
  display: flex;
  background: #0f172a;
  border-top: 2px solid var(--primary);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
  flex-shrink: 0;
  width: 100%;
  z-index: 20;
}

.tab-btn {
  flex: 1;
  min-height: 54px;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #94a3b8;
  background: #131c2e;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.tab-btn.active {
  color: #ffffff;
  background: var(--primary);
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.view.active {
  display: flex;
}

/* 공통 모달 오버레이 */
.modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(9, 13, 24, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 2500;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  max-height: 88vh;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  animation: popIn 0.2s ease-out;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.modal-close-x {
  background: #334155;
  color: #e2e8f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

/* Custom Retro Pixel Art Icons */
.k-pixel-icon {
  image-rendering: pixelated;
  shape-rendering: crispEdges;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.k-pixel-icon:hover {
  transform: scale(1.08);
}

.k-pixel-icon-fallback {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* 🛠️ 개발자/관리자 모드 활성화 시에만 툴바 표시 */
body.admin-mode .header-toolbar {
  display: flex !important;
}


/* =========================================================================
   ⚙️ 우측 상단 설정 아이콘 버튼 & 환경설정 모달
   ========================================================================= */
.header-settings-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  touch-action: manipulation;
}

.header-settings-btn:hover {
  background: #334155;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: rotate(30deg);
}

.header-settings-btn:active {
  transform: scale(0.92);
}

.settings-modal-card {
  max-width: 440px;
  padding: 18px 20px;
}

.settings-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.settings-section {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
}

.settings-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* 사운드 / 효과음 컨트롤 카드 */
.settings-sound-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px 14px;
}

.settings-sound-mute-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 1.5px solid #38bdf8;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(2, 132, 199, 0.25) 100%);
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.settings-sound-mute-btn:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(2, 132, 199, 0.4) 100%);
  transform: translateY(-1px);
}

.settings-sound-mute-btn:active {
  transform: scale(0.96);
}

.settings-sound-mute-btn.is-muted {
  border-color: #64748b;
  background: rgba(30, 41, 59, 0.5);
  color: #94a3b8;
}

.sound-icon-display {
  font-size: 1.45rem;
  line-height: 1;
}

.sound-mute-btn-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.settings-sound-control-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.settings-sound-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sound-status-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #f1f5f9;
}

.sound-vol-percent {
  font-size: 0.74rem;
  font-weight: 900;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

.settings-sound-mute-btn.is-muted + .settings-sound-control-col .sound-vol-percent {
  color: #94a3b8;
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-min-icon, .slider-max-icon {
  font-size: 0.95rem;
  opacity: 0.75;
  cursor: pointer;
  padding: 4px;
  user-select: none;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.slider-min-icon:hover, .slider-max-icon:hover {
  opacity: 1;
  transform: scale(1.15);
}

.settings-sound-range {
  flex: 1;
  height: 32px;
  background: transparent;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
  touch-action: none;
}

.settings-sound-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--track-fill, #334155);
  cursor: pointer;
}

.settings-sound-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7), 0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.settings-sound-range:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.18);
  background: #0ea5e9;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.9);
}

.settings-sound-range::-moz-range-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--track-fill, #334155);
  cursor: pointer;
}

.settings-sound-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7), 0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.1s ease;
}

.settings-sound-range:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.18);
  background: #0ea5e9;
}

.settings-danger-section {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(30, 20, 28, 0.6);
}

.settings-reset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.settings-reset-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-reset-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fca5a5;
}

.settings-reset-desc {
  font-size: 0.66rem;
  color: #94a3b8;
  line-height: 1.35;
}

.settings-danger-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.settings-danger-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.settings-danger-btn.full-reset {
  background: rgba(220, 38, 38, 0.25);
  border-color: #dc2626;
  color: #f87171;
}

.settings-danger-btn.full-reset:hover {
  background: #dc2626;
  color: #ffffff;
}


/* 타이쿤 BGM 스타일 콤보박스 */
.settings-bgm-combobox-wrap {
  width: 100%;
  position: relative;
  margin-top: 4px;
}

.settings-bgm-select {
  width: 100%;
  padding: 12px 38px 12px 14px;
  background-color: #0f172a;
  color: #f8fafc;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  border: 1.5px solid #334155;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.settings-bgm-select:hover {
  border-color: #64748b;
  background-color: #1e293b;
}

.settings-bgm-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  background-color: #0f172a;
}

.settings-bgm-select option {
  background-color: #0f172a;
  color: #f8fafc;
  font-size: 0.90rem;
  font-weight: 600;
  padding: 10px 12px;
}


/* ==========================================================================
   🌟 게임 모드 선택 SPA 게이트웨이 뷰 (#view-portal)
   ========================================================================== */
#view-portal.view {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  background: radial-gradient(circle at 50% 15%, rgba(14, 165, 233, 0.12) 0%, transparent 55%),
              radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.12) 0%, transparent 55%),
              #0b1120;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: clamp(10px, 2.5vh, 24px) 14px clamp(14px, 3vh, 26px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.portal-spa-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 14px);
  margin: 0 auto;
  animation: portalFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.portal-spa-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
}

.portal-spa-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.portal-spa-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vh, 1.35rem);
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.4px;
}

.portal-spa-subtitle {
  margin: 0;
  font-size: clamp(0.72rem, 1.5vh, 0.8rem);
  color: #94a3b8;
  font-weight: 500;
}

.portal-spa-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.3vh, 12px);
}

/* 2대 모드 카드 (영역 전체가 버튼) */
.portal-mode-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #334155;
  border-radius: 16px;
  padding: clamp(10px, 1.4vh, 15px) clamp(12px, 3vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.9vh, 9px);
  cursor: pointer;
  text-align: left;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  color: inherit;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.portal-mode-card * {
  pointer-events: none;
}

.portal-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.portal-mode-card:active {
  transform: scale(0.985);
}

/* 퀴즈 모드 테마 */
.portal-mode-card.quiz {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.portal-mode-card.quiz:hover,
.portal-mode-card.quiz.is-active-mode {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 10px 32px rgba(14, 165, 233, 0.3);
}

/* 타이쿤 모드 테마 */
.portal-mode-card.tycoon {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.portal-mode-card.tycoon:hover,
.portal-mode-card.tycoon.is-active-mode {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 10px 32px rgba(245, 158, 11, 0.3);
}

/* 미니게임 모드 테마 */
.portal-mode-card.party {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.portal-mode-card.party:hover {
  border-color: #a855f7;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.3);
}

.portal-card-badge.party {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.portal-card-icon-box.party {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.portal-card-action.party {
  color: #c084fc;
}

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.portal-card-badges-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-card-diff-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: 999px;
  letter-spacing: -0.2px;
}

.portal-card-diff-tag.easy {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.portal-card-diff-tag.hard {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.portal-card-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: -0.2px;
}

.portal-card-badge.quiz {
  background: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.portal-card-badge.tycoon {
  background: rgba(245, 158, 11, 0.25);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.portal-card-current-tag {
  font-size: 0.64rem;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(51, 65, 85, 0.6);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.portal-card-main {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 14px);
}

.portal-card-icon-box {
  width: clamp(38px, 5vh, 46px);
  height: clamp(38px, 5vh, 46px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: clamp(1.3rem, 2.6vh, 1.55rem);
}

.portal-card-icon-box.quiz {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.portal-card-icon-box.tycoon {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.portal-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-card-title {
  margin: 0;
  font-size: clamp(0.94rem, 2vh, 1.05rem);
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.portal-card-desc {
  margin: 0;
  font-size: clamp(0.70rem, 1.4vh, 0.76rem);
  color: #cbd5e1;
  font-weight: 600;
}

.portal-card-bullets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.portal-card-bullets span {
  font-size: 0.70rem;
  color: #94a3b8;
  line-height: 1.35;
}

.portal-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: clamp(0.68rem, 1.4vh, 0.74rem);
  font-weight: 800;
  padding-top: clamp(4px, 0.7vh, 7px);
  border-top: 1px dashed rgba(71, 85, 105, 0.4);
}

.portal-card-action.quiz {
  color: #38bdf8;
}

.portal-card-action.tycoon {
  color: #fbbf24;
}

.portal-card-arrow {
  font-size: 0.95rem;
  transition: transform 0.15s ease;
}

.portal-mode-card:hover .portal-card-arrow {
  transform: translateX(4px);
}

.portal-spa-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 1vh, 8px);
  width: 100%;
  text-align: center;
}

.portal-return-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid #475569;
  border-radius: 12px;
  color: #e2e8f0;
  font-size: clamp(0.76rem, 1.5vh, 0.82rem);
  font-weight: 800;
  padding: clamp(8px, 1.2vh, 11px) 16px;
  cursor: pointer;
  width: 100%;
  transition: all 0.18s ease;
}

.portal-return-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #94a3b8;
  color: #ffffff;
}

.portal-spa-notice {
  margin: 0;
  font-size: clamp(0.66rem, 1.3vh, 0.72rem);
  color: #64748b;
}

/* ==========================================================================
   🏠 상단 헤더 모드 선택 버튼
   ========================================================================== */
.header-mode-portal-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid #475569;
  border-radius: 999px;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.header-mode-portal-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.portal-btn-icon {
  font-size: 0.9rem;
}

/* ==========================================================================
   💌 퀴즈 모드: 친구에게 도움요청 (SOS) 버튼 & 배너
   ========================================================================== */
.quiz-sos-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(168, 85, 247, 0.28) 100%);
  border: 1.5px solid #ec4899;
  border-radius: 999px;
  color: #f472b6;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
  margin-left: 6px;
  white-space: nowrap;
}

.quiz-sos-share-btn:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.32) 0%, rgba(168, 85, 247, 0.45) 100%);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}

.friend-sos-banner {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(236, 72, 153, 0.15) 100%);
  border: 1.5px solid #c084fc;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 12px 10px 12px;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.2);
}

.sos-banner-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sos-badge {
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: #c084fc;
  color: #1e1b4b;
}

.sos-banner-left strong {
  font-size: 0.84rem;
  color: #fdf4ff;
}

.sos-desc {
  font-size: 0.72rem;
  color: #e9d5ff;
  line-height: 1.35;
}

.sos-exit-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #c084fc;
  color: #fdf4ff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.sos-exit-btn:hover {
  background: #a855f7;
  color: #ffffff;
}

/* 설정 모달: 심플 광고 제거 (인앱 결제) - .settings-guide-btn 과 크기·정렬·테두리 100% 통일 */
.settings-guide-btn.settings-iap-simple-btn {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.32), rgba(15, 23, 42, 0.95));
  border: 1.5px solid #fbbf24;
  color: #fde68a;
}

.settings-guide-btn.settings-iap-simple-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.42), rgba(15, 23, 42, 0.95));
}

.settings-guide-btn.settings-iap-simple-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.settings-guide-btn.settings-iap-simple-done {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(15, 23, 42, 0.95));
  border: 1.5px solid #a78bfa;
  color: #ddd6fe;
  cursor: default;
}

.settings-guide-btn.settings-iap-simple-done:active {
  transform: none;
}

.ad-tag.ad-free-tag {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.45);
}
