:root {
  --paper-bg: #F6F2E9;
  --song-cyan: #4F7D7E;
  --palace-red: #B83B32;
  --gilt-gold: #C69C6D;
  --ink-black: #232120;
  --muted-ink: #6B6661;
  --soft-ink: #4A4642;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--paper-bg);
  color: var(--ink-black);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

h1, h2, h3, h4, p { margin: 0; }

.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto { overflow: auto; }
.select-text { user-select: text; -webkit-user-select: text; }
.cursor-pointer { cursor: pointer; }

.font-song {
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}

.safe-top { padding-top: max(12px, env(safe-area-inset-top)); }
.safe-bottom { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Fullscreen Background */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.5s ease;
}
.bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(246, 242, 233, 0.55) 0%, transparent 45%, rgba(246, 242, 233, 0.68) 100%);
}

/* Gate Lock Screen */
.gate-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper-bg);
  transition: opacity 0.45s ease;
}
.gate-bg-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
}
.gate-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.gate-seal {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  border: 3px solid var(--palace-red);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 25px rgba(184, 59, 50, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
}
.gate-seal-sub { font-size: 11px; font-weight: 700; color: var(--palace-red); letter-spacing: 0.12em; }
.gate-seal-main { font-size: 24px; font-weight: 900; color: var(--palace-red); line-height: 1.15; }
.gate-title { font-size: 24px; font-weight: 900; color: var(--ink-black); letter-spacing: 0.06em; }
.gate-subtitle { font-size: 12px; color: var(--muted-ink); margin-top: 4px; }
.pin-dots { display: flex; align-items: center; justify-content: center; gap: 16px; }
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--palace-red);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.pin-dot.filled {
  background: var(--palace-red);
  transform: scale(1.12);
}
.pin-error {
  font-size: 12px;
  font-weight: 700;
  color: var(--palace-red);
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pin-error.visible { opacity: 1; }
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 260px;
}
.key-btn {
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(198, 156, 109, 0.45);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-black);
  box-shadow: 0 2px 6px rgba(35, 33, 32, 0.06);
  transition: transform 0.1s ease, background-color 0.12s ease, color 0.12s ease;
}
.key-btn:active { transform: scale(0.92); background: var(--palace-red); color: #fff; }
.key-btn-muted {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(198, 156, 109, 0.3);
  font-size: 13px;
  color: var(--muted-ink);
}
.gate-hint { font-size: 11px; color: rgba(107, 102, 97, 0.85); }

/* Main Viewport */
.app-viewport {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.top-toolbar {
  padding: 4px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; }

.float-pill {
  background: rgba(255, 253, 248, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(198, 156, 109, 0.45);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(35, 33, 32, 0.08);
}
.pill-btn {
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  transition: transform 0.12s ease;
}
.pill-btn:active { transform: scale(0.94); }
.pill-red { color: var(--palace-red); }
.pill-cyan { color: var(--song-cyan); }

.day-nav-bar {
  padding: 6px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.nav-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-black);
}
.nav-arrow:active { transform: scale(0.9); }
.day-dots { display: flex; align-items: center; gap: 8px; }
.day-dot {
  height: 8px;
  width: 8px;
  border-radius: 999px;
  background: rgba(35, 33, 32, 0.25);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.day-dot.active { width: 24px; background: var(--palace-red); }

/* Stage */
.swipe-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 16px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.float-text-shadow {
  text-shadow: 0 1px 10px rgba(255, 253, 248, 0.96), 0 0 3px rgba(255, 253, 248, 0.95);
}

.hero-top { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.hero-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.day-meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--palace-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.date-text { font-size: 12px; font-weight: 700; color: var(--ink-black); }
.weather-text { font-size: 12px; font-weight: 500; color: var(--song-cyan); }
.main-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink-black);
  margin-top: 3px;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
@media (min-width: 640px) {
  .main-title { font-size: 24px; }
}

.pouch-btn {
  flex-shrink: 0;
  animation: pouchSwing 2.8s ease-in-out infinite;
  transform-origin: top center;
}
.pouch-btn:active { transform: scale(0.92); }
.pouch-inner {
  border-radius: 16px;
  background: linear-gradient(180deg, #C84339, #99251D);
  border: 2px solid #E6C280;
  box-shadow: 0 8px 18px rgba(153, 37, 29, 0.28);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #FFF9DB;
}
.pouch-icon { font-size: 18px; line-height: 1; }
.pouch-label { font-size: 10px; font-weight: 700; margin-top: 2px; }

.outfit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-black);
}

/* Glass Itinerary Card */
.card-wrap { margin: auto 0; padding: 4px 0; }
.itinerary-glass-card {
  background: rgba(255, 253, 248, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px -8px rgba(35, 33, 32, 0.16);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 39dvh;
  overflow-y: auto;
}
.card-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 4px;
  border-bottom: 1px solid rgba(198, 156, 109, 0.25);
  font-size: 10px;
  font-weight: 700;
}
.schedule-list { display: flex; flex-direction: column; gap: 8px; }
.sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.sched-row:active { transform: scale(0.98); }
.sched-row.has-photo {
  background: rgba(184, 59, 50, 0.08);
  border-color: rgba(184, 59, 50, 0.25);
}
.sched-left { display: flex; align-items: flex-start; gap: 8px; min-width: 0; flex: 1; }
.time-tag {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--song-cyan);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.sched-heading-row { display: flex; align-items: center; gap: 6px; }
.sched-heading { font-size: 13px; font-weight: 700; color: var(--ink-black); line-height: 1.3; }
.stamped-mini {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--palace-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.sched-desc { font-size: 11px; color: var(--soft-ink); line-height: 1.35; margin-top: 2px; }
.sched-thumb {
  flex-shrink: 0;
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--palace-red);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.sched-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sched-thumb-cap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 8px;
  text-align: center;
  padding: 1px 0;
}
.sched-cam-box {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px dashed var(--gilt-gold);
  background: rgba(255, 253, 248, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--palace-red);
  font-size: 8px;
  font-weight: 700;
}
.sched-cam-box span:first-child { font-size: 14px; line-height: 1; }

.final-cta-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(90deg, #B83B32, #A32E26, #8A221B);
  border: 1px solid #E6C280;
  color: #FFF9DB;
  box-shadow: 0 6px 14px rgba(184, 59, 50, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.final-cta-btn:active { transform: scale(0.97); }

.secret-block { padding-top: 6px; border-top: 1px solid rgba(198, 156, 109, 0.35); }
.secret-locked-btn {
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(35, 33, 32, 0.07);
  font-size: 11px;
  font-weight: 700;
  color: var(--song-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.secret-unlocked-box {
  background: rgba(35, 33, 32, 0.92);
  color: #FFFDF8;
  padding: 10px;
  border-radius: 14px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.5;
}

/* Bottom Stage: 3D Mascot & Seals */
.bottom-stage {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
  flex-shrink: 0;
  position: relative;
}
.mascot-col { display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.mascot-bubble {
  margin: 0 0 4px 4px;
  max-width: 196px;
  padding: 6px 12px;
  border-radius: 16px 16px 16px 2px;
  font-size: 11px;
  line-height: 1.38;
  font-weight: 700;
  color: var(--ink-black);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mascot-bubble.angry {
  background: rgba(255, 228, 225, 0.95);
  border-color: var(--palace-red);
  color: var(--palace-red);
}
.mascot-stage {
  width: 152px;
  height: 158px;
  cursor: pointer;
  transform-origin: bottom center;
}
@media (min-width: 640px) {
  .mascot-stage { width: 174px; height: 180px; }
}

.seals-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 4px; }
.seals-hint { font-size: 11px; font-weight: 700; color: var(--song-cyan); padding-right: 4px; }
.seals-row { display: flex; align-items: center; gap: 8px; }
.seal-box {
  width: 76px;
  height: 86px;
  border: 2.5px solid var(--palace-red);
  color: var(--palace-red);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px rgba(184, 59, 50, 0.28);
  background: rgba(255, 250, 248, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.seal-box:active { transform: scale(0.92); }
.seal-box.stamped {
  background: rgba(184, 59, 50, 0.16);
  transform: rotate(-5deg) scale(1);
  box-shadow: 0 6px 16px rgba(184, 59, 50, 0.26), inset 0 0 0 1.5px rgba(184, 59, 50, 0.55);
  animation: sealDrop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.seal-who { font-size: 10px; font-weight: 700; margin-bottom: 2px; max-width: 100%; }
.seal-title { font-size: 12px; font-weight: 900; line-height: 1.15; text-align: center; }
.seal-state {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(184, 59, 50, 0.15);
  color: var(--palace-red);
}
.seal-box.stamped .seal-state { background: var(--palace-red); color: #fff; }

/* Album Page */
.album-page {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--paper-bg);
  overflow: hidden;
}
.album-topbar {
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 12px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(198, 156, 109, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.back-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: #EFEAE0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-black);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.album-count-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(184, 59, 50, 0.12);
  color: var(--palace-red);
  font-size: 11px;
  font-weight: 700;
}
.album-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.album-article {
  border-radius: 24px;
  background: #FFFDF8;
  border: 1px solid rgba(198, 156, 109, 0.45);
  box-shadow: 0 6px 18px rgba(35, 33, 32, 0.08);
  overflow: hidden;
}
.album-art-head {
  padding: 12px 16px;
  background: linear-gradient(90deg, #F6F2E9, #EFE7D6);
  border-bottom: 1px solid rgba(198, 156, 109, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.album-stamp-chip {
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
}
.album-stamp-chip.done {
  border-color: var(--palace-red);
  background: rgba(184, 59, 50, 0.12);
  color: var(--palace-red);
}
.album-art-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.diary-poem {
  font-size: 13px;
  color: var(--song-cyan);
  font-style: italic;
  background: rgba(246, 242, 233, 0.85);
  padding: 8px 12px;
  border-radius: 12px;
  border-left: 4px solid var(--palace-red);
}
.album-cover-photo {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--gilt-gold);
  cursor: pointer;
}
.album-cover-photo img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.album-cover-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.album-cover-placeholder {
  position: relative;
  height: 112px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(198, 156, 109, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 640px) {
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.album-item-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(198, 156, 109, 0.45);
  background: #fff;
  cursor: pointer;
}
.album-item-img { aspect-ratio: 4 / 3; width: 100%; overflow: hidden; background: #EFEAE0; }
.album-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-item-empty {
  border-radius: 16px;
  border: 1px dashed rgba(198, 156, 109, 0.65);
  background: rgba(255, 253, 248, 0.75);
  padding: 10px;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

/* Lightbox & Modals */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.95);
  color: #fff;
}
.lightbox-top {
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: auto;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox-foot {
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
}
.lb-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.lb-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(4px);
}
.modal-box {
  width: 100%;
  max-width: 340px;
  border-radius: 24px;
  background: #FFFDF8;
  border: 2px solid var(--gilt-gold);
  padding: 20px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-primary-btn {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: var(--ink-black);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.modal-primary-btn:active { transform: scale(0.97); }
.parent-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 230px;
  margin: 0 auto;
}
.parent-key {
  height: 44px;
  border-radius: 12px;
  background: var(--paper-bg);
  border: 1px solid rgba(198, 156, 109, 0.42);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-black);
}
.parent-key:active { background: var(--palace-red); color: #fff; }
.parent-key-muted { background: #EFEAE0; font-size: 12px; color: var(--muted-ink); }

/* Toast */
.toast-bar {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.toast-bar.visible { opacity: 1; }
.toast-pill {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(35, 33, 32, 0.92);
  color: #FFFDF8;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* Animations */
@keyframes sealDrop {
  0% { transform: scale(2.1) rotate(12deg); opacity: 0.15; }
  65% { transform: scale(0.9) rotate(-7deg); opacity: 1; }
  100% { transform: scale(1) rotate(-5deg); opacity: 1; }
}
@keyframes idleBreathe {
  0%, 100% { transform: translateY(0px) scaleY(1); }
  50% { transform: translateY(-4px) scaleY(1.02); }
}
@keyframes reactFlyBounce {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-22px) rotate(-6deg) scale(1.06); }
  60% { transform: translateY(-8px) rotate(5deg) scale(0.98); }
  80% { transform: translateY(-14px) rotate(-2deg); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes reactScholarSway {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) translateX(-5px) scale(1.04); }
  55% { transform: rotate(10deg) translateX(5px) scale(1.04); }
  80% { transform: rotate(-4deg); }
  100% { transform: rotate(0deg) scale(1); }
}
@keyframes reactSpinJump {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(4px) scale(1.12, 0.88); }
  55% { transform: translateY(-24px) rotate(14deg) scale(0.95, 1.08); }
  80% { transform: translateY(2px) scale(1.05, 0.95); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes reactDrumRoll {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-8deg) scale(1.06); }
  40% { transform: rotate(8deg) scale(1.06); }
  60% { transform: rotate(-8deg) scale(1.06); }
  80% { transform: rotate(8deg) scale(1.06); }
}
@keyframes reactFlashPose {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.1) rotate(-4deg); filter: brightness(1.35); }
  50% { transform: scale(0.96) rotate(3deg); filter: brightness(1); }
  75% { transform: scale(1.05); filter: brightness(1.25); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes reactSmash {
  0% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-18px) rotate(-14deg) scale(1.06); }
  55% { transform: translateY(4px) rotate(12deg) scale(1.1, 0.9); }
  80% { transform: translateY(-4px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
@keyframes reactWave {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(8deg) translateY(-6px); }
  50% { transform: rotate(-6deg) translateY(-3px); }
  75% { transform: rotate(8deg) translateY(-6px); }
}
@keyframes angryRageShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1.06); }
  15% { transform: translate(-6px, -2px) rotate(-5deg) scale(1.08); }
  30% { transform: translate(6px, 1px) rotate(5deg) scale(1.08); }
  45% { transform: translate(-5px, 2px) rotate(-4deg) scale(1.07); }
  60% { transform: translate(5px, -2px) rotate(4deg) scale(1.08); }
  75% { transform: translate(-4px, 0px) rotate(-3deg) scale(1.07); }
  90% { transform: translate(4px, 1px) rotate(3deg) scale(1.06); }
}
@keyframes veinPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.32); }
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes pouchSwing {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-3px); }
}

.anim-idle { animation: idleBreathe 3.2s ease-in-out infinite; }
.react-fly { animation: reactFlyBounce 0.65s ease; }
.react-scholar { animation: reactScholarSway 0.7s ease; }
.react-spin { animation: reactSpinJump 0.65s ease; }
.react-drum { animation: reactDrumRoll 0.6s ease; }
.react-flash { animation: reactFlashPose 0.65s ease; }
.react-smash { animation: reactSmash 0.6s ease; }
.react-wave { animation: reactWave 0.7s ease; }
.anim-angry { animation: angryRageShake 0.42s ease-in-out infinite; }
.vein-beat { animation: veinPulse 0.45s ease-in-out infinite; transform-origin: center; }
.shake-box { animation: shakeError 0.35s ease; }

/* ================= iPad & Tablet Responsive Enhancement ================= */
@media (min-width: 700px) {
  .top-toolbar,
  .day-nav-bar,
  .swipe-stage {
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }

  .top-toolbar { padding: 10px 28px 0; }
  .day-nav-bar { padding: 10px 28px 0; }
  .swipe-stage { padding: 12px 28px 18px; }

  .pill-btn { padding: 8px 14px; font-size: 13px; gap: 6px; }
  .nav-arrow { width: 42px; height: 42px; font-size: 22px; }
  .day-dot { height: 10px; width: 10px; }
  .day-dot.active { width: 32px; }

  .day-badge { font-size: 13px; padding: 3px 10px; }
  .date-text, .weather-text { font-size: 14px; }
  .main-title { font-size: 30px; margin-top: 6px; }
  .outfit-pill { font-size: 13px; padding: 6px 15px; }
  .pouch-inner { padding: 8px 14px; }
  .pouch-icon { font-size: 22px; }
  .pouch-label { font-size: 12px; }

  .itinerary-glass-card {
    padding: 20px 22px;
    gap: 12px;
    border-radius: 28px;
    max-height: 48dvh;
  }
  .card-hint-row { font-size: 12px; padding-bottom: 6px; }
  .sched-row { padding: 12px 14px; border-radius: 18px; gap: 14px; }
  .time-tag { font-size: 12px; padding: 3px 8px; }
  .sched-heading { font-size: 16px; }
  .sched-desc { font-size: 13px; }
  .sched-thumb { width: 64px; height: 64px; border-radius: 14px; }
  .sched-cam-box { width: 54px; height: 54px; font-size: 10px; }
  .sched-cam-box span:first-child { font-size: 18px; }
  .secret-locked-btn, .secret-unlocked-box { font-size: 13px; padding: 10px 14px; }
  .final-cta-btn { padding: 14px 20px; font-size: 15px; }

  .mascot-bubble { max-width: 280px; padding: 10px 16px; font-size: 13px; }
  .mascot-stage { width: 220px; height: 228px; }
  .seals-hint { font-size: 13px; }
  .seals-row { gap: 14px; }
  .seal-box { width: 100px; height: 112px; border-radius: 18px; padding: 10px; }
  .seal-who { font-size: 12px; }
  .seal-title { font-size: 15px; }
  .seal-state { font-size: 11px; padding: 2px 8px; }

  /* Gate & Modals on iPad */
  .gate-card { max-width: 390px; gap: 22px; }
  .gate-seal { width: 96px; height: 96px; }
  .gate-seal-main { font-size: 30px; }
  .gate-title { font-size: 30px; }
  .gate-subtitle { font-size: 14px; }
  .keypad-grid { max-width: 310px; gap: 14px; }
  .key-btn { height: 64px; font-size: 24px; }
  .modal-box { max-width: 420px; padding: 26px; }

  /* Album Diary on iPad */
  .album-scroll { max-width: 980px; width: 100%; margin: 0 auto; padding: 22px 28px; gap: 24px; }
  .album-cover-photo img { max-height: 360px; }
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

/* iPad Landscape Two-Column Open-Book Magazine Spread */
@media (min-width: 900px) and (orientation: landscape) {
  .top-toolbar,
  .day-nav-bar,
  .swipe-stage {
    max-width: 1200px;
  }

  .swipe-stage {
    display: grid;
    grid-template-columns: minmax(340px, 0.92fr) minmax(420px, 1.15fr);
    grid-template-rows: auto 1fr;
    column-gap: 28px;
    row-gap: 12px;
    align-items: stretch;
  }

  .hero-top {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }

  .bottom-stage {
    grid-column: 1;
    grid-row: 2;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 6px;
  }

  .card-wrap {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    min-height: 0;
  }

  .itinerary-glass-card {
    width: 100%;
    max-height: 76dvh;
    padding: 22px 24px;
  }

  .mascot-stage { width: 208px; height: 216px; }
  .seal-box { width: 92px; height: 104px; }
}
