/* ============================================================
   메이플 보스 파티 기록 — 스타일

   토큰 → 레이아웃 → 컴포넌트 → 모달 / 폼 → 반응형
   순서로 정렬.
   ============================================================ */

/* ── 디자인 토큰 ─────────────────────────────────────── */

:root {
  /* 배경 */
  --bg-base:        #050b18;
  --bg-elevated:    rgba(14, 28, 48, 0.78);
  --bg-card:        rgba(11, 24, 40, 0.72);
  --bg-card-hover:  rgba(20, 38, 60, 0.82);
  --bg-overlay:     rgba(4, 10, 20, 0.78);

  /* 보더 */
  --border-subtle:  rgba(120, 220, 240, 0.16);
  --border-strong:  rgba(120, 220, 240, 0.32);

  /* 텍스트 */
  --text-primary:   #eaf6fb;
  --text-secondary: #9ec3d6;
  --text-tertiary:  #6a8aa0;
  --text-muted:     #3d556a;

  /* 강조색 — 시안/aqua + 보라 액센트 (배경 톤에 맞춤) */
  --accent-gold:    #4ee5f5;     /* 본 강조색: 골드 → 시안 */
  --accent-purple:  #a78bff;
  --accent-rose:    #ff7eb6;
  --accent-aqua:    #4ee5f5;
  --danger:         #ff6b6b;

  --font-base: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);

  /* ── 테마용 의미 토큰 — css/theme.css 가 이 :root 값을 덮어쓴다 ──
     (클래스/구조는 절대 건드리지 않음. 아래 값은 현재 디자인과 1:1 동일) */

  /* 강조색 위에 올라가는 텍스트 */
  --on-accent:       #1a1102;   /* btn-primary·채널 active·오늘 날짜 (테마 강조색 위 글자) */
  --on-danger:       #2a0606;   /* btn-danger 글자 — danger는 모든 무드에서 밝은 빨강이라 항상 어둡게(대비 보장) */
  --on-boss:         #1a1102;   /* run-boss-badge — 배경이 JS 보스색이라 항상 어둡게 유지 */
  --accent-hover:    #e0ad62;   /* btn-primary hover 배경 */
  --btn-grad-text:   #0b1626;   /* 룰렛/사다리 그라디언트 버튼 글자 */

  /* 데코 알파 합성용 RGB 트리플 (rgba(var(--x), a) 형태로 사용) */
  --glow-rgb:        78, 229, 245;   /* 강조 글로우 */
  --shade-rgb:       5, 11, 24;      /* 어두운 패널/오버레이 음영 */
  --hairline-rgb:    255, 255, 255;  /* 밝은 헤어라인·미세 채움 */
  --ink-rgb:         0, 0, 0;        /* 검정 채움(전리품 썸네일 바탕) */
  --danger-rgb:      239, 68, 68;    /* danger 틴트 */

  /* 카드/오버레이 필터 — 테마에서 none 으로 끈다 */
  --card-filter:     blur(10px) saturate(125%);
  --overlay-filter:  blur(4px);

  /* 페이지 배경 — css/theme.css 가 라이트/다크 단색으로 덮는다 */
  --page-bg: var(--bg-base);
  --page-bg-attachment: fixed;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* 모바일 더블탭 확대 제거 (핀치 줌·스크롤은 유지). */
  touch-action: manipulation;
}

/* 배경 — html에 직접 fixed로 깔기. body는 transparent. */
html {
  background: var(--page-bg);
  background-attachment: var(--page-bg-attachment);
}
body {
  background: transparent;
}

/* 카드 / 모달 — 배경 위에서 가독성을 위해 blur. */

.run-card,
.modal{
  backdrop-filter: var(--card-filter);
  -webkit-backdrop-filter: var(--card-filter);
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── 페이지 셸 ───────────────────────────────────────── */

#app {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.back-btn {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text-primary); }

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

/* ── 모바일 햄버거 (toggle + drawer) ─────────────────── */
/* nav-toggle / mobile-drawer 는 모바일에서만 렌더됨(JS 분기). */

/* ── 위젯 단독 페이지 / 파티 설정 페이지 ───────────── */

/* 모바일 룰렛 단독 페이지 — 세로로 길게(슬롯머신 느낌) */

/* 모바일 사다리 단독 페이지 — 한 화면에 다 보이게.
   svg는 preserveAspectRatio="none"이라 높이만 줄여도 컬럼 정렬 유지(가로 100%). */

/* ── 버튼 ────────────────────────────────────────────── */

.btn {
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent-gold);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.icon-btn-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.icon-btn-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.icon-btn-sm:hover { background: rgba(var(--danger-rgb), 0.15); color: var(--danger); }

.btn-mini {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all 0.15s;
}
.btn-mini:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* ── 메인 (파티 목록) ───────────────────────────────── */

.member-chip {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state p { margin: 4px 0; }
.empty-state-sub { font-size: 13px; color: var(--text-tertiary); }

/* ── 파티 상세 ───────────────────────────────────────── */

/* ── 좌측 사이드 컬럼 (룰렛 + 사다리타기) ─────────── */

/* 룰렛/사다리는 sticky 컨테이너 안에 들어가므로 본인은 sticky 해제. */
.roulette-side{
  position: static;
}

.roulette-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: center;
  backdrop-filter: var(--card-filter);
  -webkit-backdrop-filter: var(--card-filter);
}

.roulette-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.roulette-window {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(var(--shade-rgb), 0.55);
  padding: 18px 8px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 0 24px rgba(var(--glow-rgb), 0.10),
    inset 0 0 0 1px rgba(var(--glow-rgb), 0.08);
}

.roulette-display {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-aqua);
  font-feature-settings: 'tnum';
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(var(--glow-rgb), 0.55);
  transition: transform 0.05s linear;
  white-space: nowrap;
}

.roulette-display-spinning {
  animation: roulette-shake 0.08s infinite alternate;
}

.roulette-display-final {
  animation: roulette-pop 0.45s ease-out 1;
}

@keyframes roulette-shake {
  from { transform: translateY(-2px); }
  to   { transform: translateY(2px); }
}

@keyframes roulette-pop {
  0%   { transform: scale(0.85); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.roulette-btn {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-aqua) 75%, transparent),
    color-mix(in srgb, var(--accent-purple) 75%, transparent));
  color: var(--btn-grad-text);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  box-shadow:
    0 4px 14px rgba(var(--glow-rgb), 0.20),
    inset 0 0 0 1px rgba(var(--hairline-rgb), 0.18);
}
.roulette-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(var(--glow-rgb), 0.30),
    inset 0 0 0 1px rgba(var(--hairline-rgb), 0.28);
}
.roulette-btn:active:not(:disabled) {
  transform: translateY(0);
}
.roulette-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.roulette-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ── 월별 누적 사이드바 ─────────────────────────────── */

/* ── 진행도 위젯 ─────────────────────────────────────── */

/* ── 보스 설정 · 결정석 페이지 ─────────────────────── */

/* ── 캘린더 ──────────────────────────────────────────── */

/* 모바일 주간 뷰 — 한 주만 보이므로 셀을 크게(세로 여유).
   미디어쿼리의 .calendar-grid 와 명시도 동률이라 .calendar-grid.calendar-week 로 확실히 이김. */

/* ── 모달 ────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: var(--overlay-filter);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade-in 0.15s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slide-up 0.2s ease-out;
}
.modal-wide { max-width: 600px; }

@keyframes slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 8px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── 폼 ─────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.text-input,
.select-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.15s;
}
.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.select-input:disabled,
.text-input:disabled {
  opacity: 1;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-style: dashed;
  cursor: not-allowed;
}

/* ── 채널 picker (날짜 모달) ───────────────────────── */

/* ── 예약 (미래 일정) ──────────────────────────────── */

/* ── 회차 카드 (조회) ──────────────────────────────── */

.run-card {
  --accent: var(--accent-gold);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px;
}

.run-boss-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-boss);
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 9px 2px;
}

/* ── 기록 추가 폼 — 전리품 행 ──────────────────────── */

/* 타일 그리드 — 보스의 전리품을 한눈에 */

/* 선택된 전리품들의 입력 행 */

/* ── 사다리타기 카드 ───────────────────────────────── */

/* 사다리 가림 cover */

/* trace path & dot */

/* 이름 칩 (공개 단계) */


/* ── 회차 참여자 picker (기록 폼) ──────────────────── */

/* ── 분배 체크박스 (전리품 행) ─────────────────────── */

/* 분배 회차 표시 (조회 카드) */

/* ── 파티원별 주간 수익 섹션 ─────────────────────── */

/* select-input wrapping slot — repaint시 자식 select만 교체 */

/* ── 반응형 ─────────────────────────────────────────── */

@media (max-width: 1080px) {
  
  
  .roulette-side{
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  #app { padding: 16px 10px 80px; }
  .page-title { font-size: 20px; }

  

  /* iOS·카카오톡 인앱 브라우저: 16px 미만 input 포커스 시 자동 확대됨 → 16px로 방지 */
  input, select, textarea,
  .text-input, .select-input { font-size: 16px; }

  /* 캘린더 — 셀 키우고 안쪽 여백 줄여 더 넓고 읽기 쉽게 */
  
  
  
  
  
  
  
  
}

@media (max-width: 480px) {
  #app { padding: 14px 6px 80px; }
  
  
}

@media (max-width: 540px) {
  

  
  
  
  
  
  

  .modal { padding: 18px; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; }
  .modal-actions .btn { width: 100%; }
  

  .header-actions .icon-btn { padding: 6px 10px; font-size: 12px; }
}

/* ── 파티 비밀번호 게이트 ───────────────────────────── */

.gate-main {
  display: flex;
  justify-content: center;
  padding: 48px 16px;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: var(--card-filter);
  -webkit-backdrop-filter: var(--card-filter);
}

.gate-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.gate-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 4px;
}
.gate-error {
  font-size: 12px;
  color: var(--accent-rose);
  min-height: 16px;
}
.gate-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.gate-actions .btn { flex: 1; text-align: center; }

/* ── 확인 다이얼로그 + 인라인 메시지 ─────────────────── */

.modal-confirm { max-width: 400px; }

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.dialog-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.dialog-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
  margin: 4px 0 0;
}

.btn-danger {
  background: var(--danger);
  color: var(--on-danger);
  font-weight: 600;
}
.btn-danger:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0); }

/* 저장 버튼 위 인라인 안내 — 성공/오류 색 분리 */

/* 토스트 — 하단 중앙 일시 알림 */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 88vw;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--card-filter);
  -webkit-backdrop-filter: var(--card-filter);
  animation: toast-in 0.2s ease-out;
  cursor: pointer;
}

.toast-out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

