/* styles/daily.css — Daily Restoration 전용 화면 스타일
   에이전트 B 생성 (2026-06-28).
   기존 01-base-tokens.css 토큰 100% 재사용. 신규 색상 변수 생성 금지.
   url() 에셋 경로: styles/ → ../assets/ (01-base-tokens.css 동일 규칙) */

/* ── #daily 풀스크린 화면 ─────────────────────────────────────────────────── */
#daily {
  position: fixed;
  inset: 0;
  display: none;           /* body[data-screen="daily"] #daily { display:flex } 는 아래 라우터 규칙 */
  flex-direction: column;
  overflow: hidden;
  background: url('../assets/setting/bg_daily.webp') center / cover no-repeat;
  color: var(--text);
  isolation: isolate;
}

body[data-screen="daily"] #daily { display: flex; }

#daily::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(245, 238, 214, 0.1), rgba(38, 28, 15, 0.18)),
    radial-gradient(120% 64% at 50% 4%, rgba(255, 246, 214, 0.12), transparent 60%);
  pointer-events: none;
}

/* ── 상단 헤더 ─────────────────────────────────────────────────────────────── */
.dailyHeader {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
  background: none;
  border-bottom: none;
  box-shadow: none;
  z-index: 8;
  flex-shrink: 0;
}

#dailyBack {
  min-width: 0;
  width: 56px !important;
  height: 56px !important;
  padding: 0;
  flex-shrink: 0;
  border: none !important;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: url('../assets/badge/back_round.png') center / contain no-repeat transparent !important;
  box-shadow: none !important;
  font-size: 0 !important;
  color: transparent !important;
}

#dailyBack .ico { display: none; }

.dailyHeaderTitle {
  flex: 1;
  text-align: center;
  align-self: center;
  height: 50px;
  line-height: 50px;
  max-width: 58%;
  min-width: 0;
  margin: 0 auto;
  padding: 0 8px;
  background: url('../assets/badge/row_bar.png') center / 100% 100% no-repeat;
  color: #fff6e2;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 #4a3214, -1px 0 0 #4a3214, 1px 0 0 #4a3214, 0 2px 5px rgba(0,0,0,.5);
}

.dailySeasonDate {
  min-width: 56px;
  height: 42px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-sizing: border-box;
  background: url('../assets/badge/count_tab.png') center / 100% 100% no-repeat;
  font-size: 11px;
  font-weight: 900;
  color: #fff2cf;
  text-shadow: 0 1px 2px rgba(40,20,4,.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.dailySeasonDate:empty {
  background: none;
  padding: 0;
}

/* ── 탭 바: 석재 명판 / 얕은 홈 느낌 ──────────────────────────────────────── */
.dailyTabs {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 5px 10px 8px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(128, 103, 59, 0.18), rgba(248, 237, 202, 0.18));
  border-bottom: none;
  flex-shrink: 0;
}

.dailyTab {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 5px 3px;
  border: none;
  border-radius: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  background: url('../assets/badge/row_bar.png') center / 100% 100% no-repeat;
  color: rgba(255, 246, 226, 0.62);
  filter: grayscale(0.3) brightness(0.78);
  opacity: 0.76;
  box-shadow: none;
  text-shadow: 0 2px 0 #4a3214, 0 2px 4px rgba(0, 0, 0, 0.46);
  transition: transform 0.12s, filter 0.12s, opacity 0.12s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 선택된 탭: 들어올려짐 + 금빛 테두리 */
.dailyTab[aria-selected="true"],
.dailyTab.active {
  color: #fff6e2;
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
  text-shadow: 0 2px 0 #4a3214, -1px 0 0 #4a3214, 1px 0 0 #4a3214, 0 2px 6px rgba(0,0,0,.58);
  z-index: 2;
}

.dailyTab[aria-selected="true"]::after,
.dailyTab.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ecd590 30%, #cda53a 50%, #ecd590 70%, transparent);
  box-shadow: 0 0 4px rgba(255, 226, 112, 0.28);
  pointer-events: none;
}

.dailyTab:focus-visible {
  outline: none;
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(255, 231, 128, 0.34);
}

/* ── 탭 콘텐츠 영역 ────────────────────────────────────────────────────────── */
.dailyBody {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dailyTabPane {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + clamp(92px, 24vw, 118px) + 96px);   /* clear the bottom nav + lifted CTA footer */
  min-height: 100%;
  box-sizing: border-box;
}

.dailyTabPane.active { display: flex; }
.dailyTabPane[hidden] { display: none !important; }

/* ── Restoration 탭: 작품판 ────────────────────────────────────────────────── */

#dailyRestoration {
  position: relative;
}

/* 온보딩 한 문장 */
.dailyOnboardHint {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0 2px;
  line-height: 1.45;
}

.dailyShaHelper {
  position: absolute;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
  z-index: 3;
  width: clamp(46px, 14vw, 64px);
  aspect-ratio: 1;
  pointer-events: none;
  transform: rotate(5deg);
}

.dailyBoardStatus {
  width: min(100%, 372px);
  min-height: 38px;
  margin: 0 auto -2px;
  padding: 0 44px 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: url('../assets/badge/count_tab.png') center / 100% 100% no-repeat;
  color: #fff2cf;
  text-shadow: 0 1px 2px rgba(40,20,4,.8);
  font-weight: 900;
  overflow: hidden;
}

.dailyBoardStatus[hidden] { display: none; }

.dailyBoardStatusMain {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(9.5px, 2.65vw, 11px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dailyBoardStatusSub {
  flex: 0 1 auto;
  max-width: 48%;
  min-width: 0;
  font-size: clamp(9.5px, 2.55vw, 10.5px);
  color: #fff8d9;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dailyShaHelper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(92, 62, 24, 0.22));
  animation: dailyShaFloat 3.8s ease-in-out infinite;
}

.dailyShaSpark {
  position: absolute;
  top: 9%;
  right: 1%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff1a8;
  box-shadow: 0 0 0 3px rgba(255, 241, 168, 0.24), 0 0 12px rgba(255, 223, 92, 0.55);
}

@keyframes dailyShaFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 작품 외곽 프레임: 석재 + 아주 얇은 금장.
   §4.3 — 하나의 framed artwork surface. 7조각은 이 위에 놓인 가로 밴드 마스크로, 작품이
   위(Day1)에서 아래(Day7)로 복원되는 portrait 작품처럼 보인다. 화면 세로를 채워 주인공이 된다. */
.artworkFrame {
  position: relative;
  display: flex;
  aspect-ratio: var(--daily-aspect, 0.66);
  width: min(100%, 372px);
  max-height: clamp(330px, 53vh, 560px);
  margin: 0 auto;
  border-radius: 12px;
  border: 2px solid rgba(255, 200, 80, 0.4);
  background: rgba(10, 7, 3, 0.22);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    0 14px 32px rgba(10, 6, 2, 0.55),
    inset 0 1px 0 rgba(255, 235, 160, 0.15);
  padding: 6px;
  overflow: hidden;
  isolation: isolate;
}

/* 작품 실루엣 / 흐린 배경 (온보딩 시 또는 미공개) */
.artworkSilhouette {
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  background: linear-gradient(160deg, #d0c8b5 0%, #bfb6a0 100%);
  opacity: 0.45;
  pointer-events: none;
}

.artworkFrame.has-cover .artworkSilhouette {
  background-image:
    linear-gradient(160deg, rgba(244, 238, 218, 0.28), rgba(98, 88, 65, 0.34)),
    var(--daily-cover);
  background-size: cover;
  background-position: center;
  opacity: 0.54;
  filter: blur(2px) saturate(0.62) brightness(1.05);
  transform: scale(1.03);
}

/* 조각 그리드: 작품을 가로 밴드로 나눈 세로 스택 (Day1=맨 위 … Day7=맨 아래).
   행 수는 조각 수에 맞춰 자동(auto-fill) — 1×7 스트립이 아니라 프레임을 꽉 채우는 작품판이 된다.
   gap을 얇게 둬서 밴드 사이가 석재/납선 이음매처럼 보이고 전체가 하나의 표면으로 읽힌다. */
.pieceGrid {
  display: grid;
  grid-template-columns: repeat(var(--daily-cols, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--daily-rows, 7), minmax(0, 1fr));
  gap: 3px;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);  /* gap 이음새 색 */
}

/* ── 조각(dailyPiece) 공통 ─────────────────────────────────────────────────── */
.dailyPiece {
  position: relative;
  min-width: 0; min-height: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* 가로 밴드는 위아래로만 살짝 눌리게 (좌우 scale은 작품 연속성을 깨뜨림) */
.dailyPiece:active { transform: scale(0.99); }

/* 날짜 힌트 텍스트 — 밴드 우측에 세로 중앙 */
.dailyPiece .pieceDate {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
}

.dailyPiece .pieceLabel {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
  z-index: 3;
  letter-spacing: 0;
}

/* 픽셀 이미지 (cleared) */
.dailyPiece .piecePixel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}

/* ── 상태: locked ──────────────────────────────────────────────────────────── */
.dailyPiece[data-state="locked"] {
  background: rgba(8, 5, 2, 0.48);
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dailyPiece[data-state="locked"]::after { display: none; }

.dailyPiece[data-state="locked"] .pieceDate {
  opacity: 0.55;
  z-index: 4;
  color: rgba(255, 255, 255, 0.6);
}

.dailyPiece[data-state="locked"] .pieceLabel {
  color: rgba(255, 255, 255, 0.35);
  font-size: 6px;
}

/* ── 상태: today ───────────────────────────────────────────────────────────── */
.dailyPiece[data-state="today"] {
  background: rgba(255, 235, 140, 0.22);
  box-shadow:
    inset 0 0 0 2px rgba(255, 210, 80, 0.75),
    inset 0 1px 0 rgba(255, 255, 220, 0.35),
    0 0 14px rgba(255, 200, 60, 0.28);
  z-index: 2;
}

.dailyPiece[data-state="today"] .pieceLabel {
  color: #fff8e0;
  text-shadow: 0 1px 3px rgba(100, 60, 0, 0.8);
  left: 50%;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(160, 100, 10, 0.55);
  transform: translate(-50%, -50%);
}

.dailyPiece[data-state="today"]::before {
  content: "";
  position: absolute;
  inset: 6px auto auto 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 241, 140, 0.9);
  box-shadow: 0 0 8px rgba(255, 220, 80, 0.7);
  pointer-events: none;
  z-index: 3;
}

@keyframes dailyTodayPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 210, 80, 0.75), inset 0 1px 0 rgba(255,255,220,.35), 0 0 10px rgba(255,200,60,.22); }
  50%       { box-shadow: inset 0 0 0 2px rgba(255, 210, 80, 0.75), inset 0 1px 0 rgba(255,255,220,.35), 0 0 22px rgba(255,200,60,.48); }
}

.dailyPiece[data-state="today"] {
  animation: dailyTodayPulse 2.6s ease-in-out infinite;
}

/* ── 상태: cleared (복원된 컬러 조각) ───────────────────────────────────────
   픽셀 이미지 + 약한 유리 광택. 채도폭발 금지. */
.dailyPiece[data-state="cleared"] {
  background: rgba(30, 22, 10, 0.55);
  box-shadow: none;
}

/* 이미지 로드 실패 시 숨김 (onerror와 병행) */
.dailyPiece[data-state="cleared"] .piecePixel[style*="display: none"],
.dailyPiece[data-state="cleared"] .piecePixel:not([src]) {
  display: none !important;
}

/* 복원된 밴드 위에는 ✓·날짜 텍스트를 띄우지 않는다 — 작품 자체가 보상.
   인접 cleared 밴드들이 끊김 없이 하나의 그림으로 읽히게 한다. */
.dailyPiece[data-state="cleared"] .pieceLabel,
.dailyPiece[data-state="cleared"] .pieceDate {
  display: none;
}

/* 약한 유리 광택 오버레이 (채도폭발 금지) */
.dailyPiece[data-state="cleared"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.16) 0%,
    transparent 40%
  );
  pointer-events: none;
  z-index: 2;
}

.dailyPiece.justRestored {
  z-index: 4;
  animation: dailyPieceLand 0.9s cubic-bezier(.18, .78, .18, 1) both;
}

.dailyPiece.justRestored::before {
  content: "";
  position: absolute;
  inset: -18%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 245, 176, 0.78), rgba(255, 210, 84, 0.22) 36%, transparent 64%);
  pointer-events: none;
  z-index: 4;
  animation: dailyPieceBloom 0.9s ease-out both;
}

@keyframes dailyPieceLand {
  0% { transform: scale(0.985); filter: brightness(1); }
  38% { transform: scale(1.018); filter: brightness(1.12); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes dailyPieceBloom {
  0% { opacity: 0; transform: scale(0.76); }
  32% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.22); }
}

.dailyPiece.tomorrowGlow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 238, 170, 0.18) 38%, rgba(255, 245, 194, 0.52) 50%, rgba(255, 238, 170, 0.18) 62%, transparent 100%);
  pointer-events: none;
  z-index: 4;
  animation: dailyTomorrowSweep 0.8s ease-out both;
}

@keyframes dailyTomorrowSweep {
  0% { transform: translateX(-115%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateX(115%); opacity: 0; }
}

/* ── 상태: recoverable ─────────────────────────────────────────────────────── */
.dailyPiece[data-state="recoverable"] {
  background: rgba(6, 4, 2, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* 작은 내부 빛점 */
.dailyPiece[data-state="recoverable"]::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(230, 200, 120, 0.85);
  top: 4px;
  right: 4px;
  box-shadow: 0 0 4px rgba(230, 200, 120, 0.6);
  z-index: 3;
  pointer-events: none;
  animation: dailyGlimmer 3s ease-in-out infinite;
}

@keyframes dailyGlimmer {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.dailyPiece[data-state="recoverable"] .pieceLabel {
  color: rgba(255, 240, 200, 0.5);
  font-size: 6px;
}

/* ── 상태: recovered_unplayed ──────────────────────────────────────────────── */
.dailyPiece[data-state="recovered_unplayed"] {
  background: rgba(255, 235, 140, 0.16);
  box-shadow: inset 0 0 0 1.5px rgba(200, 170, 60, 0.55), 0 0 10px rgba(200, 170, 60, 0.18);
  z-index: 2;
}

.dailyPiece[data-state="recovered_unplayed"] .pieceLabel {
  color: rgba(255, 248, 200, 0.85);
  text-shadow: 0 1px 3px rgba(80, 50, 0, 0.7);
}

.dailyPiece[data-state="recovered_unplayed"]::before {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 7px;
  color: rgba(255, 235, 140, 0.9);
  font-weight: 900;
  z-index: 3;
  pointer-events: none;
  line-height: 1;
  text-shadow: 0 0 4px rgba(255, 210, 60, 0.6);
}

/* ── 상태: expired ─────────────────────────────────────────────────────────── */
.dailyPiece[data-state="expired"] {
  background: rgba(20, 18, 22, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.dailyPiece[data-state="expired"] .pieceLabel {
  color: rgba(180, 178, 175, 0.55);
  font-size: 6px;
}

.dailyBoardCaption {
  width: min(100%, 360px);
  margin: -6px auto 0;
  text-align: center;
  color: rgba(255, 248, 220, 0.85);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

/* ── Today 탭 ──────────────────────────────────────────────────────────────── */
.dailyTodayCard {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 248, 221, 0.78), rgba(231, 217, 184, 0.6));
  border: none;
  border-radius: 12px;
  padding: 14px 12px 16px;
  box-shadow: 0 11px 18px rgba(86, 60, 24, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.dailyTodayCard::before { display: none; }

.dailyTodayCard > * {
  position: relative;
  z-index: 1;
}

.dailyTodayScene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(72px, 23vw, 104px);
  align-items: center;
  gap: 12px;
}

.dailyTodayCopy {
  min-width: 0;
}

.dailyTodayKicker {
  font-size: 11px;
  font-weight: 900;
  color: #8a6020;
  margin-bottom: 5px;
}

.dailyTodayHint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  color: #5f4723;
}

.dailyTodayReward {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(85% 95% at 12% 18%, rgba(255, 244, 181, 0.42), transparent 62%),
    linear-gradient(180deg, rgba(218, 184, 102, 0.26), rgba(115, 87, 42, 0.13));
  border: 1px solid rgba(137, 94, 31, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -1px 0 rgba(90, 57, 16, 0.13),
    0 3px 8px rgba(74, 48, 15, 0.08);
}

.dailyTodayReward::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 32%, rgba(255,255,255,.18) 48%, transparent 64% 100%);
  opacity: 0.55;
  pointer-events: none;
}

.dailyPieceToken {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 249, 210, 0.98), rgba(239, 192, 75, 0.94) 58%, rgba(151, 94, 24, 0.86));
  border: 2px solid rgba(255, 232, 150, 0.72);
  border-radius: 13px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.62),
    inset 0 -3px 5px rgba(110, 65, 13, 0.2),
    0 5px 10px rgba(97, 64, 18, 0.24);
  transform: rotate(-2deg);
}

.dailyPieceToken span {
  font-size: 21px;
  font-weight: 950;
  color: #5b380d;
  text-shadow: 0 1px 0 rgba(255, 246, 190, 0.8);
}

.dailyTodayRewardText {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dailyTodayRewardText b {
  color: var(--text);
  font-size: 14px;
}

.dailyTodayRewardText span {
  color: #8a6020;
  font-size: 12px;
  font-weight: 900;
}

.dailyTodayHelper {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: end center;
}

.dailyTodayHelper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 9px rgba(92, 62, 24, 0.22));
}

.dailyTodayTitle {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.dailyTodayMeta {
  font-size: 12px;
  color: #6b4c1f;
  font-weight: 700;
  line-height: 1.35;
}

.dailyTodayMapPanel {
  padding: 8px 9px 10px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(80, 57, 25, 0.08), rgba(255, 244, 202, 0.16)),
    radial-gradient(90% 110% at 50% 0%, rgba(255, 236, 160, 0.14), transparent 70%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 0 0 1px rgba(104, 73, 29, 0.12);
}

.dailyTodayMapHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: #70501f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 216, 0.7);
}

.dailyTodayMapHead b {
  color: #8a6020;
  font-size: 11px;
}

/* 미니맵: tileLayout(GR×GC) 그대로 — 금빛 칸이 "전체 그림 속 오늘 조각 위치"를 보여준다 */
.dailyTodayLocator {
  display: grid;
  grid-template-columns: repeat(var(--daily-cols, 9), 21px);
  grid-auto-rows: 21px;
  gap: 4px;
  justify-content: start;
}

.dailyTodayDot {
  position: relative;
  width: 21px;
  height: 21px;
  border-radius: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(7, 43, 80, 0.9);
  background: url('../assets/map/tile_blue.png') center / 100% 100% no-repeat;
  box-shadow: none;
  opacity: 0.55;
}

.dailyTodayDot::after { display: none; }

.dailyTodayDot.cleared {
  opacity: 1;
  filter: saturate(1.05) brightness(1.05);
}

.dailyTodayDot.today,
.dailyTodayDot.recovered_unplayed,
.dailyTodayDot.active {
  opacity: 1;
  filter: hue-rotate(160deg) saturate(1.6) brightness(1.1);
  text-shadow: 0 1px 2px rgba(80, 40, 0, 0.9);
  transform: translateY(-1px);
}

.dailyTodayDone {
  align-self: flex-start;
  margin-top: -2px;
  padding: 6px 11px 7px;
  border-radius: 999px;
  border: 1px solid rgba(150, 220, 135, 0.72);
  background: linear-gradient(180deg, #45bd65, #198d4f);
  color: #eeffdf;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(18, 78, 34, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    0 3px 6px rgba(31, 91, 33, 0.16);
  display: none;
}

.dailyTodayCard.done .dailyTodayDone { display: block; }

/* ── Collection 탭 ─────────────────────────────────────────────────────────── */
/* ── Collection 탭 Empty 상태 ─────────────────────────────────────────────── */

.dailyCollectionEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0 14px 32px;
}

/* 상단 히어로 영역: 정글 배경 위에 Sha + 프레임 미리보기 */
.dailyCollectionHero {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 180px;
  margin-bottom: -22px;
}

.dailyCollectionFramePreview {
  position: relative;
  width: min(188px, 52vw);
  aspect-ratio: 421 / 432;
  border: 0;
  box-sizing: border-box;
  background: none;
  filter: drop-shadow(0 10px 14px rgba(22, 32, 18, 0.34));
  overflow: visible;
  flex-shrink: 0;
}

.dailyCollectionFramePreview.has-cover { filter: drop-shadow(0 10px 14px rgba(22, 32, 18, 0.34)) saturate(0.92); }

.dailyCollectionFramePreview::before {
  content: "";
  position: absolute;
  inset: 22% 19% 18%;
  z-index: 0;
  clip-path: polygon(50% 0%, 95% 24%, 86% 76%, 50% 100%, 14% 76%, 5% 24%);
  background:
    linear-gradient(160deg, rgba(239, 248, 232, 0.72), rgba(143, 170, 130, 0.5)),
    radial-gradient(circle at 50% 38%, rgba(255, 248, 188, 0.34), transparent 62%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 220, 0.24),
    inset 0 -12px 18px rgba(68, 94, 55, 0.18);
}

.dailyCollectionFramePreview.has-cover::before {
  background-image:
    linear-gradient(160deg, rgba(242, 252, 232, 0.42), rgba(42, 67, 37, 0.18)),
    var(--daily-cover);
  background-size: cover;
  background-position: center;
  filter: blur(0.5px) saturate(0.9);
  transform: scale(1.02);
}

.dailyCollectionFramePreview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url('../assets/gallery/frame.webp') center / contain no-repeat;
  pointer-events: none;
}

.dailyCollectionLock {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 70px;
  transform: translate(-50%, -50%);
  background: url('../assets/gallery/locked.webp') center / contain no-repeat;
  filter: drop-shadow(0 4px 7px rgba(56, 32, 92, 0.22));
}

.dailyCollectionLock::before { display: none; }

.dailyCollectionSha {
  position: absolute;
  right: 18px;
  bottom: 2px;
  width: min(88px, 26vw);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(20, 10, 2, 0.28));
  pointer-events: none;
}

/* 텍스트 카드: 불투명 cream — 정글 위에서도 선명하게 */
.dailyCollectionTextCard {
  width: 100%;
  background: var(--card);
  border-radius: 14px;
  border: 1.5px solid rgba(180, 150, 70, 0.28);
  box-shadow: var(--lift), var(--sheen);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.dailyCollectionEmptyTitle {
  color: #1e1507;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.dailyCollectionEmptyBody {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #5a4118;
}

.dailyCollectionProgressText {
  align-self: flex-start;
  min-height: 28px;
  padding: 5px 13px 6px;
  border-radius: 999px;
  color: #fff2cf;
  background: url('../assets/badge/count_tab.png') center / 100% 100% no-repeat;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(40,20,4,.8);
  box-sizing: border-box;
}

/* ── Collection 탭 카드 목록 ──────────────────────────────────────────────── */

.dailyCollectionList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dailyCollectionCard {
  background: var(--card);
  border: 1.5px solid rgba(180, 150, 70, 0.22);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--lift), var(--sheen);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.12s;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.dailyCollectionCard:active { transform: scale(0.985); }
.dailyCollectionCard:focus-visible {
  outline: 2px solid #c8982a;
  outline-offset: 2px;
}

/* 왼쪽: 세로 썸네일 */
.dailyCollThumb {
  width: 90px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
  background: linear-gradient(160deg, #2a1d0f, #1a1208);
}

.dailyCollThumbBlank {
  min-height: 90px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 238, 150, 0.45), transparent 28%),
    linear-gradient(160deg, #cfc5ab, #b8ae94);
}

/* 오른쪽: 메타 텍스트 */
.dailyCollMeta {
  flex: 1;
  min-width: 0;
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-left: 1px solid rgba(180, 150, 70, 0.15);
}

.dailyCollTitle {
  font-size: 15px;
  font-weight: 900;
  color: #1e1507;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.dailyCollDates {
  font-size: 11.5px;
  color: #7a6540;
  font-weight: 700;
  line-height: 1.3;
}

/* perfectOnDate: 금빛 강조 */
.dailyCollectionCard.perfectOnDate {
  border-color: rgba(200, 152, 42, 0.55);
  box-shadow: var(--lift), var(--sheen), 0 0 10px rgba(200, 152, 42, 0.22);
}

.dailyCollectionCard.perfectOnDate .dailyCollMeta {
  border-left-color: rgba(200, 152, 42, 0.25);
}

/* perfectOnDate 왕관/별 표식 */
.dailyCollectionCard.perfectOnDate .dailyCollTitle::after {
  content: " ✦";
  color: #c8982a;
  font-size: 11px;
}

/* 복구 포함 표식 */
.dailyCollRecoveredMark {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sX);
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── 하단 CTA 영역 ─────────────────────────────────────────────────────────── */
.dailyFooter {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(92px, 24vw, 118px));   /* sit above the shared hub bottom nav (.titleNav) */
  left: 0;
  right: 0;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(0deg, rgba(244, 238, 218, 0.72) 0%, rgba(244, 238, 218, 0.44) 58%, transparent 100%);
  z-index: 3;
  pointer-events: none;
}

.dailyFooter > * { pointer-events: auto; }

/* 광고 복구 횟수 배지 — 압박형 카운터 아님 */
.adCountBadge {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: var(--lift-sm);
  display: none;  /* store에 recoverable 조각이 있을 때만 표시 */
}

.adCountBadge.visible { display: inline-block; }

/* 0회일 때: 회색 더 강하게 */
.adCountBadge.exhausted {
  opacity: 0.55;
  filter: saturate(0.4);
}

/* primary CTA — 타이틀 play_btn.webp와 동일한 에셋 + 텍스트 스타일 */
#dailyMainBtn {
  width: 100%;
  max-width: 147px;   /* 2/3 of 220 — shrunk so the bottom nav can sit below it */
  aspect-ratio: 463 / 175;
  border: none;
  border-radius: 0;
  background: url('../assets/title/play_btn.webp') center / 100% 100% no-repeat;
  color: #fffbe8;
  font-size: clamp(14px, 4.4vw, 16px);   /* button shrank to 2/3 but keep the label readable */
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow:
    1px 1px 0 #25510e, -1px -1px 0 #25510e,
    1px -1px 0 #25510e, -1px 1px 0 #25510e,
    0 3px 6px rgba(0,0,0,.45);
  -webkit-text-stroke: 1.2px #25510e;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 8%;
  transition: transform 0.08s, filter 0.12s;
  cursor: pointer;
}

#dailyMainBtn:active { transform: scaleX(1.04) scaleY(0.92); filter: brightness(0.95); }
#dailyMainBtn:disabled {
  opacity: 1;
  cursor: default;
  transform: none;
  filter: saturate(0.52) brightness(0.82);
}

.dailyTomorrowText {
  min-height: 20px;
  margin: -4px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  color: #8a6020;
}

/* ── 빈 시즌 상태 (active season 없음) ────────────────────────────────────── */
.dailyEmptyState {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.dailyEmptyStateCute img {
  width: min(116px, 36vw);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(92, 62, 24, 0.18));
}

.dailyEmptyTitle {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}

.dailyEmptyBody {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

/* ── 시즌 소개 연출 오버레이 (showSeasonIntroAnim) ───────────────────────── */
#dailyIntroOverlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(46, 39, 24, 0.72);
  padding: 32px 24px;
  text-align: center;
  pointer-events: auto;
}

#dailyIntroOverlay.active { display: flex; }

.dailyIntroTitle {
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 950;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--gold-deep), 0 4px 10px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
}

.dailyIntroSilhouette {
  width: min(72vw, 300px);
  aspect-ratio: 8 / 3;
  border-radius: 8px;
  border: 2px solid rgba(200, 152, 42, 0.4);
  background: linear-gradient(160deg, rgba(220, 210, 185, 0.25), rgba(180, 170, 150, 0.18));
  box-shadow: 0 0 24px rgba(200, 152, 42, 0.2);
}

.dailyIntroSilhouette.has-cover {
  background-image:
    linear-gradient(160deg, rgba(255, 238, 176, 0.26), rgba(47, 38, 21, 0.42)),
    var(--daily-cover);
  background-size: cover;
  background-position: center;
  filter: saturate(0.72) brightness(1.05);
}

.dailyIntroMsg {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 240, 200, 0.92);
  line-height: 1.5;
}

/* 1.5초 잠금 상태 */
#dailyIntroOverlay.locked {
  pointer-events: auto;   /* 탭 수신 (skip 의도 저장) */
}
#dailyIntroOverlay.unlocked {
  pointer-events: auto;   /* 탭 → 즉시 전환 */
  cursor: pointer;
}

.dailyIntroSkipHint {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 240, 200, 0.45);
  margin-top: 4px;
  transition: opacity 0.3s;
}

#dailyIntroOverlay.unlocked .dailyIntroSkipHint {
  opacity: 1;
  color: rgba(255, 240, 200, 0.7);
}

/* ── prefers-reduced-motion ─────────────────────────────────────────────────
   모든 애니메이션 중단. 색/밝기/테두리로 상태 의미 유지. */
@media (prefers-reduced-motion: reduce) {
  .dailyPiece[data-state="today"] {
    animation: none;
    box-shadow: var(--lift), var(--sheen), 0 0 12px rgba(200, 152, 42, 0.4);
  }

  .dailyPiece[data-state="recoverable"]::before {
    animation: none;
    opacity: 0.9;
  }

  .dailyShaHelper img,
  .dailyPiece.justRestored,
  .dailyPiece.justRestored::before,
  .dailyPiece.tomorrowGlow::after {
    animation: none;
  }

  @keyframes dailyTodayPulse { }
  @keyframes dailyGlimmer { }
}

/* html[data-motion="reduced"] (JS 설정 따름) — applyStaticText 이후 초기화될 수 있으므로 양쪽 다 */
html[data-motion="reduced"] .dailyPiece[data-state="today"] {
  animation: none;
  box-shadow: var(--lift), var(--sheen), 0 0 12px rgba(200, 152, 42, 0.4);
}

html[data-motion="reduced"] .dailyPiece[data-state="recoverable"]::before {
  animation: none;
  opacity: 0.9;
}

html[data-motion="reduced"] .dailyShaHelper img,
html[data-motion="reduced"] .dailyPiece.justRestored,
html[data-motion="reduced"] .dailyPiece.justRestored::before,
html[data-motion="reduced"] .dailyPiece.tomorrowGlow::after {
  animation: none;
}

/* ── 슬라이드 화면 전환 (screenRouter 패턴 공유) ────────────────────────── */
.screenSlideLeft  { animation: slideInLeft  .22s cubic-bezier(.25, .46, .45, .94) both; }
.screenSlideRight { animation: slideInRight .22s cubic-bezier(.25, .46, .45, .94) both; }

@keyframes slideInLeft  { from { transform: translateX(40px);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }

html[data-motion="reduced"] .screenSlideLeft,
html[data-motion="reduced"] .screenSlideRight {
  animation: none;
}

/* ── 복구/만료 하단 시트 (dailyRecovery.js .drSheet*) ──────────────────────
   석재 하단 시트 + 어두운 백드롭. 자동 닫기 없음(수동 닫기만, §6.2). 기존 depth
   토큰만 사용하고 새 색상 변수를 만들지 않는다. titleSettings(z 55) 위로 띄운다. */
.drSheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);          /* 모달 오버레이 토큰 (one-source) */
  backdrop-filter: blur(2px);
  animation: drFade .18s ease both;
}
.drSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 61;
  width: min(420px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--grad-card);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--lift-lg), var(--sheen);
  animation: drSlideUp .22s cubic-bezier(.25, .46, .45, .94) both;
}
.drSheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  line-height: 1;
  font-size: 20px;
}
.drSheet-preview {
  align-self: center;
  width: 92px;
  height: 92px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--press);
}
.drSheet-preview--recoverable {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 224, 150, 0.85), rgba(255, 224, 150, 0) 58%),
    linear-gradient(160deg, #6b5d44, #4d4231);
}
.drSheet-preview--expired {
  background: linear-gradient(160deg, #6e7178, #50535a);
  filter: saturate(0.6);
  opacity: 0.85;
}
.drSheet-msg {
  margin: 2px 4px 0;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.drSheet-submsg {
  margin: -4px 4px 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.drSheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.drSheet-actions button {
  width: 100%;
}
.drSheet-adBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}
.drSheet-adBadge {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

@keyframes drFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drSlideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

html[data-motion="reduced"] .drSheet,
html[data-motion="reduced"] .drSheet-backdrop {
  animation: none;
}
