:root {
  --cw-navy: #132A35;
  --cw-ivory: #FFFDF7;
  --cw-yellow: #F6C928;
  --cw-red: #B3261E;
  --cw-coffee-dark: #3B2314;
  --cw-coffee-mid: #6F4124;
  --cw-coffee-crema: #C78E54;
}

.coffee-page {
  background: var(--cw-ivory);
  color: var(--cw-navy);
}

.cw-main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 18px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cw-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
}

@media (max-width: 820px) {
  .cw-hero-grid {
    grid-template-columns: 1fr;
  }
}

.cw-card {
  background: #FFFFFF;
  border: 1.5px solid rgba(19, 42, 53, 0.14);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(19, 42, 53, 0.06);
}

.cw-tank-card {
  background: linear-gradient(155deg, #132A35 0%, #1C3E4F 100%);
  color: var(--cw-ivory);
  border-color: rgba(246, 201, 40, 0.45);
}

.cw-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(246, 201, 40, 0.2);
  color: var(--cw-yellow);
  border: 1px solid rgba(246, 201, 40, 0.45);
}

.cw-title {
  margin: 10px 0 6px;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.2;
}

.cw-lead {
  margin: 0 0 18px;
  font-size: 14px;
  opacity: 0.88;
}

.cw-tank-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cw-tank-vessel {
  position: relative;
  height: 240px;
  border-radius: 18px 18px 28px 28px;
  border: 2.5px solid rgba(255, 253, 247, 0.32);
  background: rgba(8, 20, 26, 0.55);
  overflow: hidden;
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.45);
}

.cw-tank-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 12%;
  background: linear-gradient(180deg, var(--cw-coffee-crema) 0%, var(--cw-coffee-mid) 16%, var(--cw-coffee-dark) 100%);
  transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.cw-tank-wave {
  position: absolute;
  top: -10px;
  left: -25%;
  width: 150%;
  height: 20px;
  border-radius: 45%;
  background: rgba(255, 232, 198, 0.28);
  animation: cw-wave 5.5s ease-in-out infinite alternate;
}

@keyframes cw-wave {
  0% { transform: translateX(-6%) rotate(-1deg); }
  100% { transform: translateX(6%) rotate(1deg); }
}

.cw-tank-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.cw-tank-cups {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cw-tank-cups small {
  font-size: 20px;
  margin-left: 4px;
}

.cw-tank-ml {
  font-size: 15px;
  font-weight: 700;
  color: var(--cw-yellow);
  margin-top: 6px;
}

.cw-tank-tier {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: rgba(19, 42, 53, 0.72);
  border: 1px solid rgba(246, 201, 40, 0.5);
}

.cw-tank-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  opacity: 0.88;
}

.cw-pride-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cw-pride-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--cw-navy);
  background: #FFF4CC;
  border: 1px solid var(--cw-yellow);
  padding: 3px 10px;
  border-radius: 999px;
}

.cw-sync-pill {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.75;
}

.cw-my-cups-row {
  margin: 14px 0 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cw-my-cups-num {
  font-size: 38px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cw-my-cups-num small {
  font-size: 15px;
  margin-left: 4px;
  font-weight: 700;
}

.cw-active-title-badge {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--cw-navy);
  color: var(--cw-yellow);
  font-weight: 800;
  font-size: 13.5px;
}

.cw-thanks-box {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #FFFDF7;
  border: 1px solid rgba(19, 42, 53, 0.14);
  font-size: 14px;
  line-height: 1.65;
}

.cw-buy-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.cw-buy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cw-buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1.5px solid rgba(19, 42, 53, 0.22);
  background: var(--cw-ivory);
  color: var(--cw-navy);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.cw-buy-btn.is-featured {
  background: var(--cw-navy);
  color: var(--cw-ivory);
  border-color: var(--cw-yellow);
}

.cw-buy-btn.is-featured span {
  color: var(--cw-yellow);
}

.cw-buy-btn:hover {
  transform: translateY(-2px);
  border-color: var(--cw-yellow);
  box-shadow: 0 8px 18px rgba(19, 42, 53, 0.14);
}

.cw-buy-btn strong {
  font-size: 14px;
}

.cw-buy-btn span {
  font-size: 13px;
  font-weight: 800;
}

.cw-fine-note {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: 0.72;
}

.cw-return-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #FFF8DC;
  border: 1.5px solid var(--cw-yellow);
  font-size: 13px;
}

.cw-return-box p {
  margin: 6px 0 8px;
  line-height: 1.55;
}

.cw-return-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.cw-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cw-sec-head h2 {
  margin: 0;
  font-size: 19px;
}

.cw-sec-sub {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.78;
}

.cw-unlock-count {
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #EEF3F6;
}

.cw-titles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.cw-title-chip {
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(19, 42, 53, 0.14);
  background: var(--cw-ivory);
  color: var(--cw-navy);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.cw-title-chip.is-unlocked:hover {
  transform: translateY(-1px);
  border-color: var(--cw-yellow);
}

.cw-title-chip.is-equipped {
  background: var(--cw-navy);
  color: var(--cw-ivory);
  border-color: var(--cw-yellow);
}

.cw-title-chip.is-locked {
  opacity: 0.5;
  cursor: default;
  background: #F4F6F7;
}

.cw-title-chip strong {
  font-size: 13.5px;
}

.cw-title-chip small {
  font-size: 11.5px;
  opacity: 0.8;
}

.cw-trivia-card {
  background: linear-gradient(135deg, #FFFDF7 0%, #FFF7E0 100%);
  border-color: rgba(246, 201, 40, 0.6);
}

.cw-trivia-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.cw-trivia-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.cw-mini-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--cw-navy);
  background: #FFFFFF;
  color: var(--cw-navy);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.cw-mini-btn:hover {
  background: var(--cw-navy);
  color: var(--cw-ivory);
}

/* ===== Celebration Overlay & Pour Dopamine Effects ===== */
.cw-celebration[hidden] {
  display: none !important;
}

.cw-celebration {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(19, 42, 53, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  animation: cw-fade-in 0.28s ease-out;
}

.cw-cel-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9001;
}

.cw-confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  opacity: 0;
  animation: cw-confetti-fall var(--dur, 2.8s) cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes cw-confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, -10px, 0) rotate(0deg);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 40px), 105vh, 0) rotate(var(--rot, 540deg));
  }
}

.cw-cel-card {
  position: relative;
  z-index: 9002;
  width: min(500px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cw-ivory);
  color: var(--cw-navy);
  border: 2.5px solid var(--cw-yellow);
  border-radius: 24px;
  padding: 28px 24px 24px;
  box-sizing: border-box;
  box-shadow: 0 24px 64px rgba(8, 20, 26, 0.45), 0 0 0 4px rgba(246, 201, 40, 0.18);
  text-align: center;
  animation: cw-pop-in 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}

.cw-celebration.is-grand .cw-cel-card {
  background: linear-gradient(165deg, #FFFDF7 0%, #FFF7DC 100%);
  border-width: 3px;
  box-shadow: 0 28px 72px rgba(8, 20, 26, 0.55), 0 0 36px rgba(246, 201, 40, 0.38);
}

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

@keyframes cw-pop-in {
  0% { opacity: 0; transform: scale(0.9) translateY(14px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.cw-cel-steam {
  display: flex;
  justify-content: center;
  gap: 8px;
  height: 28px;
  margin-bottom: 6px;
}

.cw-cel-steam span {
  display: block;
  width: 5px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(199, 142, 84, 0) 0%, var(--cw-coffee-crema) 100%);
  animation: cw-steam-rise 2.2s ease-in-out infinite;
}

.cw-cel-steam span:nth-child(2) {
  height: 28px;
  animation-delay: 0.35s;
}

.cw-cel-steam span:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes cw-steam-rise {
  0%, 100% { transform: translateY(4px) scaleY(0.85); opacity: 0.4; }
  50% { transform: translateY(-5px) scaleY(1.1); opacity: 0.95; }
}

.cw-cel-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--cw-navy);
  color: var(--cw-yellow);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.cw-cel-title {
  margin: 0 0 10px;
  font-size: clamp(20px, 4vw, 25px);
  line-height: 1.3;
  color: var(--cw-navy);
}

.cw-cel-body {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--cw-navy);
  text-align: left;
  background: #FFFFFF;
  border: 1.5px solid rgba(19, 42, 53, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
}

.cw-cel-sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(19, 42, 53, 0.07);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--cw-navy);
  margin-bottom: 16px;
}

.cw-cel-sync.is-done {
  background: #FFF4CC;
  border: 1px solid var(--cw-yellow);
}

.cw-cel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cw-coffee-crema);
  animation: cw-pulse-dot 1.1s ease-in-out infinite;
}

.cw-cel-sync.is-done .cw-cel-dot {
  background: #1B7A43;
  animation: none;
}

@keyframes cw-pulse-dot {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.25); }
}

.cw-cel-unlocked {
  margin: 0 0 18px;
  text-align: left;
  background: rgba(246, 201, 40, 0.14);
  border: 1.5px solid rgba(246, 201, 40, 0.65);
  border-radius: 16px;
  padding: 12px 14px;
}

.cw-cel-unlocked-head {
  font-size: 12px;
  font-weight: 800;
  color: var(--cw-navy);
  margin-bottom: 8px;
}

.cw-cel-unlocked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cw-cel-title-pill {
  border: 1.5px solid var(--cw-navy);
  background: #FFFFFF;
  color: var(--cw-navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.cw-cel-title-pill:hover {
  transform: translateY(-1px);
  border-color: var(--cw-yellow);
}

.cw-cel-title-pill.is-equipped {
  background: var(--cw-navy);
  color: var(--cw-yellow);
  border-color: var(--cw-navy);
}

.cw-cel-actions {
  display: flex;
  justify-content: center;
}

.cw-cel-primary-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: 2px solid var(--cw-navy);
  background: var(--cw-navy);
  color: var(--cw-yellow);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.cw-cel-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(19, 42, 53, 0.22);
}

/* Tank Pour Highlight */
.cw-tank-vessel.is-pouring {
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 28px rgba(246, 201, 40, 0.65);
  border-color: var(--cw-yellow);
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

.cw-title-chip.is-newly-unlocked {
  border-color: var(--cw-yellow);
  box-shadow: 0 0 0 3px rgba(246, 201, 40, 0.35);
}

.cw-new-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--cw-yellow);
  color: var(--cw-navy);
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  .cw-celebration,
  .cw-cel-card,
  .cw-cel-steam span,
  .cw-confetti-piece,
  .cw-cel-dot,
  .cw-tank-wave {
    animation: none !important;
  }
  .cw-confetti-piece {
    display: none !important;
  }
}

/* Coffee Share Video Card Trigger & Modal */
.cw-share-trigger-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.cw-share-trigger-btn {
  appearance: none;
  border: 2px solid #132A35;
  background: #F6C928;
  color: #132A35;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cw-share-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(19, 42, 53, 0.22);
}
.cw-share-modal[hidden] { display: none; }
.cw-share-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(19, 42, 53, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cw-share-dialog {
  width: min(440px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #FFFDF7;
  color: #132A35;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.cw-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cw-share-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.cw-share-close {
  border: none;
  background: transparent;
  color: #132A35;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
}
.cw-share-canvas-wrap {
  display: flex;
  justify-content: center;
  background: #132A35;
  border-radius: 14px;
  padding: 8px;
}
#cw-share-canvas {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 10px;
  display: block;
}
.cw-share-status {
  min-height: 20px;
  margin: 8px 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: #132A35;
}
.cw-share-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.cw-share-btn {
  appearance: none;
  border: 2px solid #132A35;
  background: #FFFDF7;
  color: #132A35;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.cw-share-btn.is-primary {
  background: #F6C928;
  color: #132A35;
}
.cw-share-btn.is-ghost {
  border-color: rgba(19, 42, 53, 0.35);
}
.cw-share-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
