/* =========================================================
   CUSTOM NAUTICAL GLASS SCROLLBAR - KHẮC PHỤC VỆT TRẮNG TRÌNH DUYỆT
   ========================================================= */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 24, 46, 0.4);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  border: 1px solid rgba(143, 227, 240, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) rgba(11, 24, 46, 0.4);
}

/* =========================================================
   THƯ TRONG CHAI - GIAO DIỆN CHUẨN DESKTOP & MOBILE (STYLE.CSS V3)
   ========================================================= */

:root {
  --night: #030712;
  --ocean-deep: #071731;
  --glow: #8fe3f0;
  --glow-light: #d0f4fa;
  --mist: #e2e8f0;
  --paper-bg: #f6edd4;
  --paper-ink: #2b1f14;
  --paper-muted: #6b5c4f;
  --wax-red: #b91c1c;
  --heart-pink: #f43f5e;
  --amber-gold: #d97706;

  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
  --safe-right: max(16px, env(safe-area-inset-right));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--night);
  color: var(--mist);
  font-family: "Lora", "EB Garamond", Georgia, serif;
  user-select: none;
  touch-action: manipulation;
}

#seaCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* =========================================================
   HIỆU ỨNG KÉO LƯỚI & MỞ NẮP CHAI NGHỆ THUẬT (CINEMATIC)
   ========================================================= */
.fishing-net-rig {
  position: fixed;
  left: 50%;
  top: -76vh;
  height: 76vh;
  width: min(84vw, 360px);
  margin-left: calc(min(84vw, 360px) / -2);
  z-index: 60;
  pointer-events: none;
  transform-origin: top center;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.75));
}

.fishing-net-rig svg {
  width: 100%;
  height: 100%;
}

.net-captured-bottle {
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 0 18px rgba(143, 227, 240, 0.95)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
}

.fishing-net-rig.active {
  animation: netPlungeHaulCinematic 2.5s cubic-bezier(0.25, 1, 0.4, 1) forwards;
}

.fishing-net-rig.active .net-captured-bottle {
  animation: showCapturedCargo 2.5s steps(1) forwards;
}

@keyframes netPlungeHaulCinematic {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(60vh) rotate(-3deg);
  }
  48% {
    transform: translateY(63vh) rotate(2deg);
  }
  68% {
    transform: translateY(42vh) rotate(-1.5deg);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes showCapturedCargo {
  0%, 46% {
    opacity: 0;
  }
  47%, 100% {
    opacity: 1;
  }
}

/* =========================================================
   GIAI ĐOẠN MỞ NẮP CHAI & RÚT CUỘN THƯ (BOTTLE UNCORKING)
   ========================================================= */
.uncorking-stage {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(14px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.uncorking-stage.active {
  opacity: 1;
  visibility: visible;
}

.uncorking-bottle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transform: scale(0.9);
  animation: floatBottleSlow 3s ease-in-out infinite alternate;
}

@keyframes floatBottleSlow {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-12px) rotate(2deg); }
}

.big-glass-bottle {
  width: 140px;
  height: 280px;
  position: relative;
  filter: drop-shadow(0 0 25px rgba(143, 227, 240, 0.6)) drop-shadow(0 15px 35px rgba(0,0,0,0.8));
}

.hero-bottle-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Nút bần gỗ bật văng */
.popping-cork {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 24px;
  z-index: 10;
}

.cork-wood {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #b45309, #78350f);
  border-radius: 4px;
  border: 1px solid #d97706;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.uncorking-stage.pop .popping-cork {
  animation: corkPopLaunch 0.75s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes corkPopLaunch {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-35px) translateY(-140px) rotate(-160deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-20px) translateY(-220px) rotate(-320deg);
    opacity: 0;
  }
}

/* Cuộn giấy da cổ điển rút từ trong chai bay ra */
.emerging-scroll {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  width: 46px;
  height: 114px;
  z-index: 5;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.scroll-paper-rolled {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 74, 32, 0.32), transparent 35%),
    radial-gradient(ellipse at 50% 100%, rgba(120, 74, 32, 0.38), transparent 35%),
    linear-gradient(90deg, #a87b47 0%, #e5c990 20%, #faedd0 46%, #e7cb8f 76%, #996c38 100%);
  border-left: 1px solid #8a5e2d;
  border-right: 1px solid #784f22;
  border-radius: 9px;
  box-shadow:
    inset 0 6px 8px rgba(102, 58, 18, 0.25),
    inset 0 -6px 8px rgba(102, 58, 18, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.55);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Lõi xoắn giấy ở 2 đầu cuộn thư */
.scroll-roll-top,
.scroll-roll-bottom {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #5c3715 20%, #b58952 55%, #f3dfb3 85%, #8a5e2d 100%);
  border: 1px solid rgba(110, 68, 28, 0.75);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.scroll-roll-top {
  top: -4px;
}

.scroll-roll-bottom {
  bottom: -4px;
}

/* Vết mực chữ viết tay thoang thoảng trên cuộn giấy */
.scroll-ink-lines {
  position: absolute;
  inset: 16px 8px;
  pointer-events: none;
  opacity: 0.28;
  background-image: repeating-linear-gradient(
    to bottom,
    #4b2e16 0px,
    #4b2e16 1.5px,
    transparent 1.5px,
    transparent 9px
  );
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}

/* Dải ruy-băng nhung đỏ thắt nút + dấu sáp mini */
.scroll-red-ribbon {
  width: calc(100% + 4px);
  height: 14px;
  background: linear-gradient(90deg, #5e0b0b 0%, #991b1b 25%, #dc2626 50%, #991b1b 75%, #4c0909 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(254, 202, 202, 0.35);
  border-top: 1px solid #450a0a;
  border-bottom: 1px solid #450a0a;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.scroll-mini-seal {
  width: 20px;
  height: 20px;
  border-radius: 48% 52% 50% 46%;
  background: radial-gradient(circle at 35% 30%, #ef4444, #991b1b 65%, #5c0a0a 100%);
  border: 1px solid #450a0a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(254, 202, 202, 0.4);
  color: #fde68a;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Khi mở nắp: Cuộn thư bay vút lên khỏi cổ chai và bung sáng nhẹ */
.uncorking-stage.unfurl .emerging-scroll {
  animation: scrollFlyOut 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes scrollFlyOut {
  0% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  55% {
    transform: translateX(-50%) translateY(-145px) scale(1.38) rotate(-8deg);
    filter: drop-shadow(0 0 18px rgba(254, 240, 138, 0.55));
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-175px) scaleX(2.4) scaleY(1.55) rotate(0deg);
    filter: drop-shadow(0 0 28px rgba(254, 243, 199, 0.85));
    opacity: 0;
  }
}

.uncork-hint-text {
  margin-top: 24px;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--glow-light);
  text-shadow: 0 0 15px rgba(143, 227, 240, 0.6);
  letter-spacing: 0.5px;
}

/* =========================================================
   HIỆU ỨNG THẢ CHAI ĐIỆN ẢNH (CASTING BOTTLE SEQUENCE)
   ========================================================= */
.casting-stage {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, background 0.5s ease, backdrop-filter 0.5s ease;
}

.casting-stage.active {
  opacity: 1;
  visibility: visible;
}

.casting-stage.throw {
  background: rgba(3, 7, 18, 0.12);
  backdrop-filter: blur(0px);
}

.casting-bottle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.casting-bottle-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.95);
}

.casting-cork {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 32px;
  height: 24px;
  z-index: 10;
  transform: translateX(-50%) translateY(-95px);
  opacity: 0;
}

.casting-stage.seal .casting-cork {
  animation: corkSealIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes corkSealIn {
  0% {
    transform: translateX(-50%) translateY(-95px) rotate(-18deg);
    opacity: 0;
  }
  70% {
    transform: translateX(-50%) translateY(3px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 1;
  }
}

.casting-scroll {
  position: absolute;
  left: 50%;
  bottom: 45px;
  width: 44px;
  height: 110px;
  z-index: 5;
  transform: translateX(-50%) translateY(-195px) scale(1.25);
  opacity: 0;
}

.casting-stage.insert .casting-scroll {
  animation: scrollInsertIn 0.58s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scrollInsertIn {
  0% {
    transform: translateX(-50%) translateY(-195px) scale(1.25) rotate(-10deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
    opacity: 0.92;
  }
}

.casting-stage.throw .casting-bottle-unit {
  animation: bottleParabolicThrow 0.85s cubic-bezier(0.32, 0.04, 0.58, 1) forwards;
}

@keyframes bottleParabolicThrow {
  0% {
    transform: translate(0, 0) scale(0.95) rotate(0deg);
    opacity: 1;
  }
  35% {
    transform: translate(18px, -110px) scale(0.78) rotate(28deg);
    opacity: 1;
  }
  85% {
    transform: translate(6px, 95px) scale(0.32) rotate(74deg);
    opacity: 0.92;
  }
  100% {
    transform: translate(0, 145px) scale(0.18) rotate(84deg);
    opacity: 0;
  }
}

.casting-stage.throw #castHintText {
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

/* =========================================================
   HỆ SINH THÁI BIỂN CẢ SỐNG ĐỘNG (BACKGROUND ECOSYSTEM)
   ========================================================= */
.sea-ecosystem {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  transform: translateZ(0);
}

.flock-sky, .vessels-layer, .marine-schools, .ocean-drift-bottles {
  position: absolute;
  inset: 0;
}

/* 1. HẢI ÂU BAY LƯỢN */
.gull-item {
  position: absolute;
  left: 0;
  top: var(--top);
  width: 48px;
  animation: glideSky var(--dur) linear var(--delay) infinite;
  pointer-events: none;
  transform: scale(var(--scale, 0.7));
}

.gull-item svg {
  display: block;
  width: 100%;
  height: auto;
  animation: flapWing var(--bob) ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes glideSky {
  0% { transform: translateX(-15vw) translateY(0) scale(var(--scale, 0.7)); }
  50% { transform: translateX(50vw) translateY(-16px) scale(var(--scale, 0.7)); }
  100% { transform: translateX(115vw) translateY(6px) scale(var(--scale, 0.7)); }
}

@keyframes flapWing {
  0% { transform: scaleY(0.7) rotate(-3deg); }
  50% { transform: scaleY(1.15) rotate(0deg); }
  100% { transform: scaleY(0.65) rotate(3deg); }
}

/* 2. ĐOÀN THUYỀN DẬP DỀNH */
.vessel-entity {
  position: absolute;
  left: 0;
  top: var(--top);
  width: var(--size);
  opacity: var(--o, 0.9);
  margin-top: calc(var(--size) * -0.58);
  animation: cruiseOcean var(--dur) linear var(--delay) infinite;
  will-change: transform;
}

.vessel-entity.rev { animation-direction: reverse; }
.vessel-entity.rev svg { transform: scaleX(-1); }

.vessel-entity .bob-frame {
  display: block;
  width: 100%;
  animation: rockBoat 4.5s ease-in-out infinite alternate;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.boat-lantern {
  animation: lanternFlicker 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px #fef08a);
}

.boat-lantern-glow { animation: lanternPulse 3s ease-in-out infinite; }

@keyframes lanternFlicker {
  0%, 100% { opacity: 1; }
  35% { opacity: 0.75; }
  60% { opacity: 0.95; }
  85% { opacity: 0.65; }
}

@keyframes lanternPulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes cruiseOcean {
  from { transform: translateX(-18vw); }
  to { transform: translateX(118vw); }
}

@keyframes rockBoat {
  0% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(5px) rotate(1deg); }
  100% { transform: translateY(2px) rotate(3deg); }
}

/* 3. ĐÀN CÁ LÂN TINH */
.fish-entity {
  position: absolute;
  left: 0;
  top: var(--top);
  width: var(--size);
  opacity: var(--o, 0.7);
  animation: swimSchool var(--dur) linear var(--delay) infinite;
}

.fish-entity.rev { animation-direction: reverse; }
.fish-entity.rev svg { transform: scaleX(-1); }

.fish-entity .wiggle-frame {
  display: block;
  width: 100%;
  color: var(--c, #8fe3f0);
  animation: fishWiggle var(--wig, 1.4s) ease-in-out infinite;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--c, #8fe3f0) 45%, transparent));
  transform-origin: center;
}

@keyframes swimSchool {
  0% { transform: translateX(-15vw) translateY(0); }
  50% { transform: translateX(50vw) translateY(-12px); }
  100% { transform: translateX(115vw) translateY(8px); }
}

@keyframes fishWiggle {
  0%, 100% { transform: translateY(-4px) rotate(-6deg) scaleY(0.95); }
  50% { transform: translateY(4px) rotate(6deg) scaleY(1.05); }
}

/* 4. CHAI TRÔI DẠT (CLICK ĐƯỢC) */
.ocean-drift-bottles { pointer-events: none; }

.drift-bottle-obj {
  position: absolute;
  left: 0;
  top: var(--top);
  width: var(--size);
  opacity: var(--o, 0.9);
  animation: driftBottle var(--dur) linear var(--delay) infinite;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
}

.drift-bottle-obj.rev { animation-direction: reverse; }

.drift-bottle-obj .bottle-frame {
  display: block;
  width: 100%;
  rotate: var(--tilt, 76deg);
  animation: bobBottle var(--bob, 5s) ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(143, 227, 240, 0.55)) drop-shadow(0 8px 16px rgba(0,0,0,0.4));
  transform-origin: center 70%;
  transition: filter 0.3s ease, scale 0.3s ease;
}

.drift-bottle-obj:hover .bottle-frame {
  filter: drop-shadow(0 0 20px rgba(143, 227, 240, 0.95)) drop-shadow(0 0 25px rgba(255, 255, 255, 0.8));
  scale: 1.15;
}

.drift-bottle-obj .click-hint {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 29, 54, 0.9);
  border: 1px solid rgba(143, 227, 240, 0.5);
  color: #e0f2fe;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.drift-bottle-obj:hover .click-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(-3px);
}



@keyframes driftBottle {
  from { transform: translateX(-12vw); }
  to { transform: translateX(112vw); }
}

@keyframes bobBottle {
  0% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(10px) rotate(4deg); }
  100% { transform: translateY(0) rotate(-4deg); }
}

/* =========================================================
   BỐ CỤC CHÍNH (APP SHELL) - RESPONSIVE TOÀN DIỆN
   ========================================================= */
.app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  z-index: 10;
  pointer-events: none;
}

.app-shell > * {
  pointer-events: auto;
}

/* 1. THANH ĐIỀU HƯỚNG TRÊN (UNIFIED NAUTICAL DOCK) - COHESIVE LUXURY SYSTEM */
.top-app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
  flex-wrap: nowrap;
  box-sizing: border-box;
}

/* KHỐI CAPSULE THỦY TINH ĐỒNG NHẤT (UNIFIED GLASS PODS) */
.top-bar-pod {
  height: 42px;
  background: rgba(11, 24, 46, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(143, 227, 240, 0.28);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  gap: 3px;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

/* Các phân đoạn trạng thái (Status Pod Cells) */
.pod-cell {
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  background: transparent;
  cursor: default;
  font-family: inherit;
  flex-shrink: 0;
}

.pod-cell.clock-cell,
.pod-cell.weather-cell,
.pod-cell.rules-cell,
.pod-cell.bulletin-cell {
  cursor: pointer;
}

.pod-cell:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #ffffff;
}

.pod-sep {
  width: 1px;
  height: 16px;
  background: rgba(143, 227, 240, 0.22);
  margin: 0 2px;
  flex-shrink: 0;
}

.cell-svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  color: #7dd3fc;
  flex-shrink: 0;
  display: inline-block;
}

.live-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* Nút tiện ích bên trong Action Pod */
.action-dock-item {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  flex-shrink: 0;
}

.action-dock-item:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-1.5px);
}

.action-dock-item:active {
  transform: translateY(0);
}

.action-icon,
.cell-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-nav-svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  color: #bae6fd;
  flex-shrink: 0;
  display: inline-block;
}

.unread-bubble {
  position: absolute;
  top: -3px;
  right: -2px;
  background: var(--heart-pink);
  color: #fff;
  border-radius: 999px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 0 8px var(--heart-pink);
}

/* 2. TIÊU ĐỀ ĐƯA LÊN CAO GỌN GÀNG (HERO BRAND) */
.hero-brand {
  text-align: center;
  margin-top: clamp(14px, 3vh, 32px);
  pointer-events: none;
  z-index: 10;
}

.main-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  color: #f8fafc;
  text-shadow: 0 0 35px rgba(143, 227, 240, 0.45), 0 2px 10px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
}

.main-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: #cbd5e1;
  margin-top: 4px;
  font-style: italic;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

/* LỜI THÌ THẦM CỦA BIỂN: BANNER HIỂN THỊ TRỰC TIẾP DƯỚI HERO BRAND */
.midnight-whisper-banner {
  pointer-events: auto;
  max-width: 540px;
  width: 90%;
  margin: 14px auto 0 auto;
  padding: 12px 18px 12px 18px;
  background: linear-gradient(135deg, rgba(8, 20, 42, 0.85), rgba(15, 32, 64, 0.76));
  border: 1px solid rgba(254, 240, 138, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(254, 240, 138, 0.12), inset 0 0 16px rgba(56, 189, 248, 0.08);
  animation: whisperBreath 6s ease-in-out infinite alternate;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.midnight-whisper-banner:hover {
  border-color: rgba(254, 240, 138, 0.7);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.55), 0 0 28px rgba(254, 240, 138, 0.22);
  transform: translateY(-2px);
}

@keyframes whisperBreath {
  0% {
    border-color: rgba(254, 240, 138, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 12px rgba(254, 240, 138, 0.08);
  }
  100% {
    border-color: rgba(254, 240, 138, 0.55);
    box-shadow: 0 8px 34px rgba(0, 0, 0, 0.52), 0 0 24px rgba(254, 240, 138, 0.2);
  }
}

.whisper-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.whisper-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.whisper-moon-pulse {
  font-size: 0.95rem;
  filter: drop-shadow(0 0 6px #fde047);
  animation: moonPulse 3s ease-in-out infinite alternate;
}

@keyframes moonPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px #fde047); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 10px #fde047); }
}

.whisper-tag-text {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fef08a;
  text-shadow: 0 0 8px rgba(254, 240, 138, 0.5);
}

.whisper-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  font-family: 'Lora', serif;
  font-style: italic;
  margin: 4px 0 6px 0;
  white-space: pre-line;
  word-break: break-word;
}

.whisper-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.whisper-sign {
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: normal;
}

/* 3. THANH ĐIỀU KHIỂN ĐÁY (FLOATING ACTION DOCK) */
.bottom-dock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(6px, 2vh, 16px);
}

.mood-scroller {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mood-scroller::-webkit-scrollbar { display: none; }

.mood-pill {
  background: rgba(15, 29, 54, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(143, 227, 240, 0.22);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.mood-pill:hover, .mood-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.action-dock-buttons {
  display: flex;
  gap: 14px;
  width: 100%;
}

.dock-action-btn {
  flex: 1;
  height: 52px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.dock-action-btn:active {
  transform: scale(0.97);
}

.dock-action-btn.btn-cast {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid rgba(143, 227, 240, 0.5);
}

.dock-action-btn.btn-cast:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.55);
}

.dock-action-btn.btn-fish {
  background: rgba(15, 29, 54, 0.85);
  backdrop-filter: blur(14px);
  color: #e0f2fe;
  border: 1px solid rgba(143, 227, 240, 0.4);
}

.dock-action-btn.btn-fish:hover {
  background: rgba(23, 44, 82, 0.95);
  border-color: rgba(143, 227, 240, 0.8);
}

/* =========================================================
   MODALS CHUNG (OVERLAY & WRAPPER)
   ========================================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s ease;
  overflow-y: auto;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-wrapper {
  width: 100%;
  max-width: 580px;
  margin: auto;
  display: flex;
  justify-content: center;
}

/* =========================================================
   LÁ THƯ GIẤY PARCHMENT CỔ ĐIỂN (AGED VINTAGE MANUSCRIPT)
   ========================================================= */
.parchment-sheet {
  width: 100%;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255, 250, 235, 0.72), transparent 55%),
    radial-gradient(ellipse at 85% 88%, rgba(168, 118, 62, 0.22), transparent 60%),
    linear-gradient(168deg, #f5e6c4 0%, #edd9ac 48%, #e4ca96 100%);
  color: #3b2614;
  border-radius: 8px 14px 10px 12px;
  border: 1px solid rgba(120, 78, 38, 0.55);
  box-shadow:
    inset 0 0 55px rgba(128, 79, 34, 0.24),
    inset 0 0 16px rgba(92, 52, 18, 0.16),
    inset 0 0 0 6px rgba(247, 234, 203, 0.35),
    inset 0 0 0 7px rgba(139, 90, 43, 0.22),
    0 28px 65px rgba(0, 0, 0, 0.72);
  padding: 24px 26px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  transform: translateY(20px) scale(0.97);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Lora', 'Times New Roman', serif;
}

/* Sớ giấy cổ tự nhiên (không cắt ngang chữ) */
.parchment-sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  z-index: 0;
}

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

.overlay.active .parchment-sheet {
  transform: translateY(0) scale(1);
}

/* Con dấu sáp nằm trọn bên trong góc trên phải của tờ thư */
.wax-seal-stamp {
  position: absolute;
  top: 16px;
  right: 54px;
  width: 46px;
  height: 46px;
  border-radius: 48% 52% 50% 46% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 32% 30%, #dc2626 0%, #991b1b 55%, #650d0d 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(254, 202, 202, 0.35),
    inset 0 -3px 6px rgba(45, 4, 4, 0.65),
    inset 0 0 0 3.5px rgba(127, 29, 29, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fde68a;
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(40, 0, 0, 0.8);
  border: 1.5px solid #5c0c0c;
  transform: rotate(-8deg);
  z-index: 5;
}

.sheet-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(120, 78, 38, 0.1);
  border: 1px solid rgba(120, 78, 38, 0.25);
  font-size: 1.25rem;
  color: #6b492a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  z-index: 6;
}
.sheet-close-btn:hover {
  background: rgba(120, 78, 38, 0.22);
  color: #2f1b0c;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1.5px double rgba(120, 78, 38, 0.38);
  padding-bottom: 12px;
  padding-right: 96px;
  margin-top: 0;
  margin-bottom: 12px;
}

.from-label {
  font-size: 0.82rem;
  color: #7c5836;
  font-style: italic;
  letter-spacing: 0.3px;
}
.from-nickname {
  font-size: 1.28rem;
  font-weight: 700;
  color: #2f1b0c;
  font-family: 'Lora', serif;
  margin: 2px 0;
}
.from-time {
  font-size: 0.78rem;
  color: #8b6542;
  font-style: italic;
}

.sheet-mood-badge {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
  border: 1px solid rgba(180, 83, 9, 0.25);
}

.sheet-body-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 44vh;
  padding-right: 8px;
  margin-bottom: 12px;
}
.sheet-body-scroll::-webkit-scrollbar { width: 5px; }
.sheet-body-scroll::-webkit-scrollbar-track { background: rgba(120, 78, 38, 0.08); border-radius: 4px; }
.sheet-body-scroll::-webkit-scrollbar-thumb { background: rgba(120, 78, 38, 0.35); border-radius: 4px; }

.sheet-letter-content {
  font-family: 'Lora', serif;
  font-size: 1.12rem;
  line-height: 2rem;
  color: #2d1b0e;
  white-space: pre-wrap;
  margin-bottom: 16px;
  padding: 2px 2px 8px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(2rem - 1px),
    rgba(128, 84, 42, 0.16) calc(2rem - 1px),
    rgba(128, 84, 42, 0.16) 2rem
  );
  background-position: 0 2px;
}

.sheet-replies-area {
  border-top: 1.5px double rgba(120, 78, 38, 0.35);
  padding-top: 12px;
}
.replies-header {
  font-size: 0.94rem;
  font-weight: 600;
  color: #5c3a1e;
  margin-bottom: 8px;
  font-family: 'Lora', serif;
}
.replies-stream { display: flex; flex-direction: column; gap: 8px; }
.replies-empty { font-size: 0.86rem; color: #8b6542; font-style: italic; }

.reply-item {
  background: rgba(255, 249, 232, 0.55);
  border: 1px solid rgba(139, 90, 43, 0.22);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #3b2614;
  border-left: 3px solid #9a5b25;
}

.reply-meta {
  font-size: 0.76rem;
  color: #8b6542;
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-style: italic;
}

.sheet-reply-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sheet-reply-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(120, 78, 38, 0.42);
  background: rgba(255, 249, 235, 0.72);
  color: #2f1b0c;
  font-family: 'Lora', serif;
  font-size: 0.92rem;
}
.sheet-reply-input::placeholder { color: #9c7a56; font-style: italic; }
.sheet-reply-input:focus {
  outline: none;
  border-color: #92400e;
  background: rgba(255, 252, 244, 0.95);
  box-shadow: 0 0 0 2px rgba(146, 64, 14, 0.14);
}

.sheet-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(120, 78, 38, 0.25);
  padding-top: 12px;
}

.footer-row-primary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.footer-row-share {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.sheet-btn {
  background: rgba(139, 90, 43, 0.1);
  border: 1px solid rgba(120, 78, 38, 0.34);
  color: #3b2614;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.sheet-btn:hover { background: rgba(139, 90, 43, 0.2); border-color: rgba(120, 78, 38, 0.55); }
.sheet-btn.heart-btn { color: #991b1b; border-color: rgba(153, 27, 27, 0.36); background: rgba(185, 28, 28, 0.08); }
.sheet-btn.heart-btn:hover { background: rgba(185, 28, 28, 0.16); }
.sheet-btn.primary { background: #7c3f16; color: #fef3c7; border-color: #632f0e; }
.sheet-btn.primary:hover { background: #924b1c; }
.sheet-btn.danger-btn { color: #991b1b; border-color: rgba(153, 27, 27, 0.32); }

/* =========================================================
   MODAL DARK OCEAN GLASS DIALOG (VIẾT THƯ, CHAT, HỘP THƯ)
   ========================================================= */
.ocean-glass-dialog {
  width: 100%;
  background: rgba(15, 29, 54, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 227, 240, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  padding: 22px;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 36px);
  position: relative;
  transform: translateY(20px);
  transition: all 0.28s ease;
}

.overlay.active .ocean-glass-dialog { transform: translateY(0); }

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.dialog-title { font-size: 1.3rem; font-weight: 600; color: #f8fafc; }
.dialog-subtitle { font-size: 0.84rem; color: #94a3b8; margin-top: 2px; }

.dialog-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.dialog-close-btn:hover { color: #fff; }

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

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.86rem; color: #cbd5e1; }
.label-with-counter { display: flex; justify-content: space-between; align-items: center; }
.char-count { font-size: 0.78rem; color: #94a3b8; }

.dialog-input, .dialog-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(8, 17, 36, 0.85);
  border: 1px solid rgba(143, 227, 240, 0.25);
  border-radius: 10px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.dialog-input:focus, .dialog-textarea:focus {
  outline: none;
  border-color: var(--glow);
  box-shadow: 0 0 10px rgba(143, 227, 240, 0.25);
}

.dialog-textarea {
  resize: none;
  height: 130px;
  line-height: 1.6;
}

.pill-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.picker-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(143, 227, 240, 0.2);
  background: rgba(15, 29, 54, 0.55);
  font-size: 0.82rem;
  font-family: inherit;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}
.picker-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.dialog-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.dialog-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
.dialog-btn.secondary:hover { background: rgba(255, 255, 255, 0.18); }
.dialog-btn.primary { background: #0284c7; color: #fff; }
.dialog-btn.primary:hover { background: #0369a1; }

/* CHAT MODAL STREAM - KHUNG TRÒ CHUYỆN BỜ BIỂN CAO CẤP */
.chat-dialog {
  max-width: 540px;
  background: rgba(11, 22, 42, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(143, 227, 240, 0.32);
  border-radius: 24px;
}

.chat-stream-box {
  flex: 1;
  overflow-y: auto;
  max-height: 48vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  background: rgba(7, 16, 32, 0.65);
  border: 1px solid rgba(143, 227, 240, 0.16);
  border-radius: 18px;
  margin-bottom: 14px;
}

.chat-bubble {
  background: rgba(15, 29, 54, 0.85);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  font-size: 0.93rem;
  line-height: 1.55;
  border: 1px solid rgba(143, 227, 240, 0.2);
  position: relative;
  max-width: 86%;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  animation: fadeIn 0.25s ease;
}

.chat-bubble.mine {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(14, 116, 144, 0.45));
  border-color: rgba(56, 189, 248, 0.45);
  align-self: flex-end;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25);
}

.chat-sender {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7dd3fc;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-nick-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-bubble.mine .chat-sender {
  color: #fef08a;
}

.chat-text-body {
  color: #f8fafc;
  line-height: 1.55;
}

.chat-time {
  font-weight: normal;
  color: #94a3b8;
  font-size: 0.72rem;
  white-space: nowrap;
}

.chat-delete-action {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-delete-action:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.chat-composer-row {
  display: flex;
  gap: 6px;
  background: rgba(11, 24, 46, 0.75);
  border: 1px solid rgba(143, 227, 240, 0.28);
  border-radius: 16px;
  padding: 4px 6px;
  align-items: center;
}

.chat-nick-input {
  width: 95px;
  flex-shrink: 0;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(143, 227, 240, 0.2) !important;
  border-radius: 0 !important;
  color: #7dd3fc !important;
  font-weight: 600;
  padding: 8px 10px !important;
  font-size: 0.88rem;
}

.chat-nick-input:focus,
.chat-text-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.chat-text-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  font-size: 0.92rem;
}

.chat-send-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #0284c7, #025078) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 12px !important;
  padding: 8px 16px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

/* VAULT TABS & HÒM THƯ KỶ NIỆM */
.vault-dialog {
  max-width: 580px;
  background: rgba(11, 24, 46, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(143, 227, 240, 0.32);
  border-radius: 24px;
}

.vault-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(143, 227, 240, 0.2);
  margin-bottom: 14px;
  padding-bottom: 4px;
}

.vault-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.vault-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.vault-list-container {
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

/* Thẻ thư nghệ thuật trong Hòm Thư */
.vault-card-item {
  background: linear-gradient(135deg, rgba(17, 34, 62, 0.75), rgba(9, 20, 38, 0.88));
  border: 1px solid rgba(143, 227, 240, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.32);
}

.vault-card-item:hover {
  background: linear-gradient(135deg, rgba(25, 48, 86, 0.85), rgba(13, 28, 54, 0.95));
  border-color: rgba(143, 227, 240, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(56, 189, 248, 0.2);
}

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

.vault-mood-badge {
  background: rgba(14, 116, 144, 0.32);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.vault-time-text {
  color: #94a3b8;
  font-size: 0.74rem;
}

.vault-card-message {
  font-family: 'Lora', serif;
  font-size: 0.96rem;
  color: #f8fafc;
  line-height: 1.6;
  font-style: italic;
  margin-bottom: 8px;
}

.vault-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.vault-stat-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  color: #cbd5e1;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.stat-card {
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-card.cyan { background: rgba(2, 132, 199, 0.16); border-color: rgba(56, 189, 248, 0.35); }
.stat-card.rose { background: rgba(225, 29, 72, 0.16); border-color: rgba(244, 63, 94, 0.35); }
.stat-card.emerald { background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 211, 153, 0.35); }
.stat-card.amber { background: rgba(217, 119, 6, 0.16); border-color: rgba(251, 191, 36, 0.35); }

.stat-num { font-size: 1.8rem; font-weight: 700; color: #f8fafc; display: block; }
.stat-desc { font-size: 0.82rem; color: #94a3b8; margin-top: 4px; display: block; }
.stats-quote { font-size: 0.86rem; color: #cbd5e1; font-style: italic; text-align: center; margin-bottom: 8px; }

/* TOAST */
.toast-box {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 72px);
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(15, 29, 54, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(143, 227, 240, 0.45);
  color: #f0f9ff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  max-width: 90vw;
}

.toast-box.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================
   RESPONSIVE DESIGN CHO MOBILE (< 768px)
   ========================================================= */
@media (max-width: 768px) {
  .app-shell {
    padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)) 12px;
  }

  .top-app-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  /* Đồng nhất 2 thanh capsule trên Mobile cùng chiều cao, viền và độ mờ */
  .top-bar-pod {
    width: 100%;
    height: 38px;
    padding: 0 4px;
    gap: 2px;
  }

  /* Hàng 1: Trạng thái đại dương */
  .status-pod {
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    height: 36px;
    padding: 0 4px;
    box-sizing: border-box;
  }

  .status-pod .pod-cell {
    padding: 0 5px;
    font-size: 0.72rem;
    gap: 3px;
    height: 28px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .status-pod .cell-svg {
    width: 12px;
    height: 12px;
  }

  /* Hàng 2: Thanh dock công cụ tiện ích đồng nhất */
  .action-pod {
    justify-content: space-around;
    height: 42px;
    padding: 0 4px;
  }

  .action-dock-item {
    width: 36px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
  }

  .action-dock-item .action-label {
    display: none;
  }

  .action-dock-item .top-nav-svg {
    width: 18px;
    height: 18px;
  }

  .action-dock-item:hover,
  .action-dock-item:active {
    background: rgba(56, 189, 248, 0.22);
    transform: scale(1.08);
  }

  /* Ẩn bớt chai để đại dương trên mobile thoáng đãng, không bị xếp hàng dọc */
  .drift-bottle-obj:nth-child(n+3) {
    display: none !important;
  }

  .hero-brand {
    margin-top: 10px;
    padding: 0 12px;
  }

  .main-title {
    font-size: clamp(1.38rem, 5.2vw, 1.75rem);
    letter-spacing: 0.3px;
    line-height: 1.25;
  }

  .main-subtitle {
    font-size: clamp(0.76rem, 2.8vw, 0.86rem);
    margin-top: 3px;
    color: rgba(226, 232, 240, 0.85);
  }

  .midnight-whisper-banner {
    width: 94%;
    max-width: 480px;
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: 14px;
  }

  .whisper-body {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  /* Nút bấm đáy màn hình trên mobile */
  .bottom-dock {
    max-width: 100%;
    margin-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .action-dock-buttons {
    gap: 10px;
    width: 100%;
  }

  .dock-action-btn {
    height: 50px;
    font-size: clamp(0.88rem, 3.8vw, 1rem);
    padding: 0 10px;
    white-space: nowrap;
    border-radius: 14px;
    flex: 1;
  }

  .parchment-sheet {
    padding: 20px 16px 16px;
    border-radius: 8px 12px 8px 10px;
  }

  .wax-seal-stamp {
    top: 14px;
    right: 48px;
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .sheet-close-btn {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .sheet-header {
    padding-right: 84px;
  }

  .sheet-letter-content {
    font-size: 1.02rem;
    line-height: 1.85rem;
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(1.85rem - 1px),
      rgba(128, 84, 42, 0.16) calc(1.85rem - 1px),
      rgba(128, 84, 42, 0.16) 1.85rem
    );
  }

  .footer-row-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .footer-row-share {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .sheet-btn {
    padding: 7px 6px;
    font-size: 0.78rem;
  }
}

/* =========================================================
   CÁC TÍNH NĂNG MỞ RỘNG MỚI (6 FEATURES STYLING)
   ========================================================= */



/* 2. NÚT XUẤT STORY 9:16 - TÔNG ĐỒNG CỔ ĐIỂN HÀI HÒA VỚI GIẤY THƯ */
.sheet-btn.highlight-story {
  background: linear-gradient(135deg, #8b4513, #6b310a);
  color: #fef3c7;
  border: 1px solid rgba(146, 64, 14, 0.75);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(92, 42, 10, 0.25);
}
.sheet-btn.highlight-story:hover {
  background: linear-gradient(135deg, #a0521a, #7c3a0d);
  box-shadow: 0 4px 14px rgba(92, 42, 10, 0.38);
  transform: translateY(-1px);
}

/* 3. FORM THẢ CHAI - HÌNH THỨC & HẸN GIỜ */

.form-subhint {
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.65);
  margin-top: 6px;
  line-height: 1.4;
  font-style: italic;
}

/* 4. MODAL NGỌN HẢI ĐĂNG (THE GUIDING LIGHTHOUSE) */
.lighthouse-dialog {
  max-width: 520px;
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 45px rgba(251, 191, 36, 0.15);
}
.lh-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lh-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
}
.lh-intro-text {
  font-size: 0.94rem;
  line-height: 1.6;
  color: rgba(241, 245, 249, 0.85);
  margin-bottom: 16px;
}
.lh-textarea {
  min-height: 120px;
  border-color: rgba(251, 191, 36, 0.25);
}
.lh-textarea:focus {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}
.lh-send-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}
.lh-send-btn:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.5);
}
.lh-response-body {
  position: relative;
  overflow: hidden;
}
.lh-light-beam-effect {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 90px;
  background: radial-gradient(ellipse at center, rgba(253, 224, 71, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
.lh-quote-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(253, 224, 71, 0.3);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.lh-quote-glow {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.3rem;
}
.lh-quote-title {
  font-size: 0.95rem;
  color: #fde047;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.lh-quote-text {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #f8fafc;
  white-space: pre-wrap;
  font-style: italic;
}
.lh-quote-signature {
  margin-top: 14px;
  text-align: right;
  font-size: 0.85rem;
  color: rgba(253, 224, 71, 0.8);
}

/* 5. MODAL HÒA ÂM LOFI (OCEAN SOUND MIXER) */
.mixer-dialog {
  max-width: 480px;
}
.mixer-master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 20px;
}
.mixer-master-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}
.mixer-channels-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mixer-channel {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}
.channel-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.channel-icon {
  font-size: 1.25rem;
}
.channel-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: #cbd5e1;
}
.channel-val {
  font-size: 0.85rem;
  color: #38bdf8;
  font-family: monospace;
}
.ocean-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
}
.ocean-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  transition: transform 0.15s ease;
}
.ocean-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.ocean-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* =========================================================
   BẢN TIN ĐÊM & LỜI GIAO ƯỚC BỜ BIỂN (RULES & NIGHT BULLETIN)
   ========================================================= */

/* Nút badge nội quy trên header chat */
.rules-badge-btn {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rules-badge-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Modal Bản Tin Đêm */
.bulletin-dialog {
  max-width: 520px;
  border-color: rgba(254, 240, 138, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 45px rgba(253, 224, 71, 0.18);
}

.bulletin-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulletin-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(253, 224, 71, 0.8));
}

.bulletin-body-card {
  background: linear-gradient(135deg, rgba(15, 29, 54, 0.85), rgba(9, 16, 32, 0.95));
  border: 1px solid rgba(254, 240, 138, 0.25);
  border-radius: 18px;
  padding: 22px;
  margin-top: 14px;
}

.bulletin-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bulletin-author-badge {
  background: rgba(217, 119, 6, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fef08a;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bulletin-time-text {
  font-size: 0.78rem;
  color: #94a3b8;
}

.bulletin-headline {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  color: #fef9e7;
  margin: 0 0 10px;
  line-height: 1.4;
}

.bulletin-message-text {
  font-size: 0.94rem;
  color: #e2e8f0;
  line-height: 1.7;
  font-style: italic;
}

/* Modal Lời Giao Ước Bờ Biển (Nội Quy) */
.rules-dialog {
  max-width: 560px;
}

.rules-scroll-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 14px;
}

.rule-item-box {
  background: rgba(15, 29, 54, 0.65);
  border: 1px solid rgba(143, 227, 240, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.rule-item-box:hover {
  background: rgba(23, 44, 82, 0.85);
  border-color: rgba(143, 227, 240, 0.4);
}

.rule-item-box.highlight-tide {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.55), rgba(15, 29, 54, 0.8));
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.12);
}

.rule-num {
  background: rgba(143, 227, 240, 0.16);
  color: #38bdf8;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.rule-detail h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.rule-detail p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Thông báo sóng cuốn trôi lịch sử chat lúc 03:30 */
.tide-wash-notice {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.6), rgba(15, 29, 54, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: #e0f2fe;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 20px 0;
  animation: fadeIn 0.5s ease;
}

.tide-wash-notice .tide-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}


/* LỜI GIAO ƯỚC TỪ BIỂN (THE SACRED SEA COVENANT) */
.covenant-dialog {
  max-width: 580px;
  background: rgba(11, 24, 46, 0.96);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(143, 227, 240, 0.38);
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 50px rgba(56, 189, 248, 0.18);
}

.covenant-header-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.covenant-beacon-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.8));
}

.covenant-prologue {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.92rem;
  color: #bae6fd;
  line-height: 1.65;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
  margin: 12px 0 14px;
}

.covenant-scroll-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}

.covenant-article-card {
  background: rgba(11, 24, 46, 0.7);
  border: 1px solid rgba(143, 227, 240, 0.2);
  border-radius: 14px;
  padding: 12px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.covenant-article-card:hover {
  background: rgba(19, 39, 72, 0.85);
  border-color: rgba(143, 227, 240, 0.45);
  transform: translateX(3px);
}

.covenant-article-card.highlight-tide {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.65), rgba(15, 29, 54, 0.88));
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.16);
}

.covenant-badge-num {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.covenant-badge-num.tide-badge {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
}

.covenant-article-body h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: #f1f5f9;
  font-weight: 600;
}

.covenant-article-body p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.55;
}

.covenant-badge-btn {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #7dd3fc;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.covenant-badge-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.covenant-confirm-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid rgba(143, 227, 240, 0.6);
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
  font-family: inherit;
}

.covenant-confirm-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.55);
}

/* =========================================================
   MODAL XEM TRƯỚC & CHIA SẺ LINK STORY / BƯU THIẾP
   ========================================================= */
.share-card-dialog {
  max-width: 540px;
}

.share-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 12, 26, 0.72);
  border: 1px solid rgba(143, 227, 240, 0.2);
  border-radius: 14px;
  padding: 10px;
  min-height: 180px;
  max-height: 44vh;
  overflow: hidden;
  margin-bottom: 12px;
}

.share-preview-img {
  max-width: 100%;
  max-height: 40vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  object-fit: contain;
}

.share-loading-hint {
  color: #7dd3fc;
  font-size: 0.92rem;
  font-style: italic;
}

.share-link-section {
  margin-bottom: 14px;
}

.share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  font-family: monospace;
  font-size: 0.82rem;
  color: #bae6fd;
  background: rgba(8, 20, 42, 0.85);
}

.share-copy-btn {
  white-space: nowrap;
  padding: 10px 16px;
}

.share-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .share-dialog-footer {
    justify-content: stretch;
  }
  .share-dialog-footer .dialog-btn {
    flex: 1;
    min-width: 110px;
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}

/* =========================================================
   NHỊP CẦU SẺ CHIA (COMPASSION CASES & DONATION MODAL)
   ========================================================= */
.cases-modal-wrap {
  max-width: 720px;
}

.cases-dialog {
  max-width: 720px;
}

.cases-scroll-body {
  overflow-y: auto;
  max-height: 70vh;
  padding-right: 4px;
}

.cases-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  background: rgba(8, 20, 42, 0.72);
  border: 1px solid rgba(254, 240, 138, 0.22);
  border-radius: 16px;
  padding: 14px;
  transition: all 0.22s ease;
}

.case-card:hover {
  border-color: rgba(254, 240, 138, 0.55);
  background: rgba(12, 28, 56, 0.85);
}

.case-thumb-wrap {
  width: 100%;
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.35), rgba(15, 23, 42, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.case-location-tag {
  display: inline-block;
  font-size: 0.74rem;
  color: #fde047;
  background: rgba(254, 240, 138, 0.1);
  border: 1px solid rgba(254, 240, 138, 0.28);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.case-card-title {
  margin: 0;
  font-family: 'Lora', serif;
  font-size: 1.02rem;
  line-height: 1.4;
  color: #f8fafc;
  cursor: pointer;
}

.case-card-title:hover { color: #7dd3fc; }

.case-card-summary {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.case-meta-stats {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  gap: 10px;
}

.case-card-actions {
  display: flex;
  gap: 6px;
}

.case-mini-btn {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.case-mini-btn:hover { background: rgba(56, 189, 248, 0.28); }
.case-mini-btn.warm {
  background: rgba(217, 119, 6, 0.22);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fef08a;
}
.case-mini-btn.warm:hover { background: rgba(217, 119, 6, 0.38); }

.case-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(143, 227, 240, 0.25);
  color: #bae6fd;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  transition: all 0.2s;
}
.case-back-btn:hover { background: rgba(56, 189, 248, 0.18); color: #fff; }

.case-detail-hero {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(143, 227, 240, 0.2);
}

.case-detail-title {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  color: #f8fafc;
  line-height: 1.45;
  margin: 6px 0 12px;
}

.case-detail-story {
  font-size: 0.94rem;
  line-height: 1.72;
  color: #e2e8f0;
  white-space: pre-line;
  margin-bottom: 18px;
}

.case-bank-box {
  background: linear-gradient(135deg, rgba(12, 31, 61, 0.92), rgba(23, 37, 84, 0.82));
  border: 1px solid rgba(254, 240, 138, 0.42);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.case-bank-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fef08a;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.case-bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(3, 9, 23, 0.55);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.case-bank-val {
  font-weight: 700;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.95rem;
}

.case-qr-wrap {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  text-align: center;
  width: 148px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.case-qr-img {
  width: 132px;
  height: 132px;
  display: block;
  object-fit: contain;
}

.case-qr-cap {
  font-size: 0.7rem;
  color: #0f172a;
  font-weight: 700;
  margin-top: 4px;
}

.case-detail-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .case-card {
    grid-template-columns: 1fr;
  }
  .case-thumb-wrap {
    height: 160px;
  }
  .case-bank-box {
    grid-template-columns: 1fr;
  }
  .case-qr-wrap {
    margin: 0 auto;
  }
}

@media (max-width: 1380px) and (min-width: 769px) {
  .top-app-bar {
    max-width: 100%;
    padding: 0 10px;
    gap: 6px;
  }
  .top-bar-pod {
    padding: 0 5px;
    gap: 2px;
  }
  .pod-cell {
    padding: 0 7px;
    font-size: 0.74rem;
    gap: 4px;
  }
  .action-dock-item {
    padding: 0 7px;
    font-size: 0.74rem;
    gap: 4px;
  }
  .action-dock-item .top-nav-svg {
    width: 15px;
    height: 15px;
  }
}

/* --- MODAL ỦNG HỘ LY CÀ PHÊ (COFFEE DONATION) --- */
.coffee-modal-wrap {
  max-width: 640px;
  width: 94%;
}

.coffee-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.coffee-scroll-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.coffee-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.coffee-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.82rem;
}

.coffee-message-card {
  margin: 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(15, 29, 54, 0.65);
  border: 1px solid rgba(143, 227, 240, 0.18);
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.62;
  white-space: pre-line;
}

.coffee-preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.coffee-preset-btn {
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(15, 29, 54, 0.72);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.coffee-preset-btn:hover {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(245, 158, 11, 0.16);
}

.coffee-preset-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(217, 119, 6, 0.28));
  border-color: #fbbf24;
  color: #fef08a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
}

.coffee-custom-amount-row {
  margin-top: 10px;
}

.coffee-footer-actions {
  display: flex;
  justify-content: center;
}

.coffee-clink-btn {
  width: 100%;
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  border: 1px solid rgba(253, 224, 71, 0.45) !important;
  color: #fffbeb !important;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}

.coffee-clink-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.dock-seo-nav {
  margin-top: 8px;
  text-align: center;
}

.dock-seo-nav a {
  color: rgba(186, 230, 253, 0.72);
  font-size: 0.74rem;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
}

.dock-seo-nav a:hover {
  color: #fde68a;
  text-decoration: underline;
}

@media (max-width: 540px) {
  .coffee-preset-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
