/* style.css - Apple Liquid Glass UI Design System */

:root {
  /* Colors */
  --bg-primary: #fff0f3;
  --bg-gradient: linear-gradient(135deg, #ffe5ec 0%, #ecd5ff 45%, #d5f0ff 100%);
  
  /* Apple Liquid Glass Parameters */
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-darker: rgba(255, 255, 255, 0.68);
  --glass-border: rgba(255, 255, 255, 0.58);
  --glass-shadow: 0 10px 35px 0 rgba(236, 72, 153, 0.15);
  --glass-shadow-active: 0 15px 45px 0 rgba(236, 72, 153, 0.32);
  
  /* Accent Colors */
  --primary-rose: #db2777;
  --accent-pink: #ec4899;
  --accent-coral: #f43f5e;
  --accent-orange: #f97316;
  --accent-gold: #eab308;
  --text-dark: #312e81;
  --text-muted: #6366f1;
  
  /* Sudoku Specific */
  --cell-prefilled: #1e1b4b;
  --cell-userfilled: #db2777;
  --cell-selected-bg: linear-gradient(135deg, rgba(236, 72, 153, 0.35) 0%, rgba(244, 63, 94, 0.35) 100%);
  --cell-highlight-bg: rgba(236, 72, 153, 0.08);
  --cell-same-number-bg: rgba(234, 179, 8, 0.22);
  --cell-error-bg: rgba(239, 68, 68, 0.12);
  --cell-error-text: #ef4444;
  
  /* Fonts */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-love: 'Caveat', cursive;
  
  --border-radius-lg: 24px;
  --border-radius-md: 18px;
  --border-radius-sm: 12px;
}

/* Reset settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Liquid Blob Background */
.blob-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.82;
  mix-blend-mode: multiply;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  background: rgba(244, 63, 94, 0.85);
  width: 350px;
  height: 350px;
  top: -50px;
  left: -50px;
  animation-duration: 25s;
}

.blob-2 {
  background: rgba(139, 92, 246, 0.88);
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -50px;
  animation-duration: 30s;
  animation-delay: -5s;
}

.blob-3 {
  background: rgba(236, 72, 153, 0.82);
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(45px, -65px) scale(1.15) rotate(120deg); }
  66% { transform: translate(-35px, 35px) scale(0.9) rotate(240deg); }
}

/* App View Wrapper */
.app-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.02);
}

.app-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 15px) 16px calc(env(safe-area-inset-bottom) + 15px) 16px;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.3s ease-in-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-view.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.scroll-view {
  flex: 1;
  overflow-y: auto;
  padding: 8px 2px;
  margin: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.scroll-view::-webkit-scrollbar {
  display: none;
}

/* Glassmorphism Specs */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  position: relative;
}

/* Specular Reflection Overlay */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
  z-index: 1;
}

.glass-pill {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.04);
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dark);
}

.glass-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-btn:active {
  transform: scale(0.94);
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.08);
}

/* Header Styles */
.glass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px;
  z-index: 5;
  flex-shrink: 0;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--accent-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.back-btn, .kasa-entry-btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dark);
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 50px;
  transition: all 0.15s ease;
}

.back-btn:active, .kasa-entry-btn:active {
  transform: scale(0.93);
}

/* ======================================= */
/* VIEW 1: PORTAL HOME SCREEN DESIGN       */
/* ======================================= */
#view-portal {
  padding-top: calc(env(safe-area-inset-top) + 30px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
}

.portal-header {
  margin-bottom: 24px;
}

.portal-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -1.2px;
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--accent-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-family: var(--font-love);
  font-size: 1.45rem;
  color: var(--accent-pink);
  margin-top: 2px;
}

/* Widgets Container List */
.portal-widgets {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: auto;
}

.widget-card {
  padding: 16px 20px;
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
}

/* Widget 1: Love Day Counter */
.love-counter-widget {
  flex-direction: row !important;
  align-items: center;
  gap: 18px;
}

.counter-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.counter-details {
  display: flex;
  flex-direction: column;
}

.counter-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.counter-days {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary-rose);
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--accent-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: -2px;
}

/* Widget 2: Photo Widget styling */
.photo-widget {
  padding: 12px;
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.couple-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.photo-caption {
  font-family: var(--font-love);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-rose);
  text-align: center;
  margin-top: 1px;
}

/* Widget 3: Daily Note styling */
.daily-note-widget {
  gap: 8px;
}

.daily-note-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.daily-note-content {
  font-family: var(--font-love);
  font-size: 1.5rem;
  color: var(--primary-rose);
  line-height: 1.25;
}

/* Expanded Portal Navigation Links Grid */
.portal-nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 14px;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#go-to-sudoku.nav-card {
  background: rgba(253, 242, 248, 0.65);
  border: 1px solid rgba(236, 72, 153, 0.4);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.08);
}
#go-to-sudoku.nav-card:active {
  transform: scale(0.95);
  background: rgba(253, 242, 248, 0.85);
}

#go-to-yansin.nav-card {
  background: rgba(255, 247, 237, 0.65);
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.08);
}
#go-to-yansin.nav-card:active {
  transform: scale(0.95);
  background: rgba(255, 247, 237, 0.85);
}

.icon-nav {
  font-size: 1.8rem;
}

.nav-card span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

.portal-footer {
  margin-top: 14px;
  flex-shrink: 0;
}

/* ======================================= */
/* VIEW 2: SUDOKU GAME DESIGN             */
/* ======================================= */
.game-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Hearts Lives */
.hearts-container {
  display: flex;
  gap: 4px;
}

.heart-life-icon {
  font-size: 1.05rem;
  color: var(--accent-coral);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart-life-icon.lost {
  transform: scale(0) rotate(-45deg);
  opacity: 0;
}

.heart-pulse {
  animation: pulse 1.2s infinite alternate;
  display: inline-block;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* Love Ticker */
.love-ticker-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin-top: 2px;
  margin-bottom: 2px;
  border-radius: var(--border-radius-md);
  font-size: 0.88rem;
}

.ticker-icon {
  font-size: 1.05rem;
  color: var(--accent-pink);
  flex-shrink: 0;
  animation: pulse 1.5s infinite alternate;
}

.ticker-text-wrapper {
  overflow: hidden;
  width: 100%;
}

.ticker-text {
  font-weight: 600;
  white-space: nowrap;
  animation: textSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  color: var(--text-dark);
}

@keyframes textSlideIn {
  0% { transform: translateY(15px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Info Bar */
.info-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}

.info-item {
  color: var(--text-dark);
}

.info-item i {
  color: var(--accent-pink);
}

/* Sudoku Board Layout */
.board-outer-container {
  padding: 6px;
  margin-bottom: 6px;
  border-radius: var(--border-radius-lg);
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Cells */
.cell {
  position: relative;
  aspect-ratio: 1/1;
  background: rgba(255, 255, 255, 0.35);
  border-right: 0.5px solid rgba(236, 72, 153, 0.15);
  border-bottom: 0.5px solid rgba(236, 72, 153, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cell-prefilled);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}

/* Dividers */
.cell:nth-child(3n) {
  border-right: 2px solid rgba(236, 72, 153, 0.4);
}
.cell:nth-child(9n) {
  border-right: none;
}
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 2px solid rgba(236, 72, 153, 0.4);
}
.cell:nth-child(n+73) {
  border-bottom: none;
}

/* States */
.cell.pre-filled {
  background: rgba(255, 255, 255, 0.68) !important;
  color: var(--cell-prefilled);
  font-weight: 700;
}

.cell.user-filled {
  color: #c2185b;
  font-weight: 600;
}

.cell.selected {
  background-color: var(--cell-selected-bg) !important;
  box-shadow: inset 0 0 8px rgba(236, 72, 153, 0.25);
  z-index: 2;
}

.cell.highlighted {
  background-color: var(--cell-highlight-bg);
}

.cell.same-number {
  background-color: var(--cell-same-number-bg);
}

.cell.error {
  background-color: var(--cell-error-bg);
  color: var(--cell-error-text);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Pencil Marks */
.cell-notes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 1.5px;
  pointer-events: none;
}

.note-num {
  font-size: 0.52rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.note-num.active {
  opacity: 1;
}

/* Keypad styling */
.keypad-container {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  padding: 8px;
  border-radius: var(--border-radius-md);
  margin-bottom: 4px;
}

.key-btn {
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.key-btn:nth-child(3n+1) {
  background: rgba(253, 242, 248, 0.8);
  border-color: rgba(236, 72, 153, 0.35);
}
.key-btn:nth-child(3n+2) {
  background: rgba(245, 243, 255, 0.8);
  border-color: rgba(139, 92, 246, 0.35);
}
.key-btn:nth-child(3n+3) {
  background: rgba(239, 246, 255, 0.8);
  border-color: rgba(59, 130, 246, 0.35);
}

.key-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
}

.key-btn:active {
  transform: scale(0.88);
  background: rgba(236, 72, 153, 0.3) !important;
  border-color: var(--accent-pink) !important;
}

/* Controls */
.controls-container {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.control-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
}

.control-btn i {
  font-size: 1.05rem;
  color: var(--primary-rose);
}

.control-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.52rem;
  padding: 1px 4px;
  background: var(--accent-pink);
  color: white;
  border-radius: 50px;
  transform: scale(0.85);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(236, 72, 153, 0.2);
}

.control-btn.active-pencil {
  background: rgba(236, 72, 153, 0.18);
  border-color: var(--accent-pink);
}

.control-btn.active-pencil .badge {
  background: #10b981;
}

/* ======================================= */
/* VIEW 3: SNAP UPLOAD DESIGN             */
/* ======================================= */
.snap-dropzone {
  width: 240px;
  height: 300px;
  margin: 0 auto 16px auto;
  border: 1.5px dashed rgba(236, 72, 153, 0.3);
  border-radius: var(--border-radius-lg);
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.snap-dropzone:active {
  transform: scale(0.98);
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.04);
}

.dropzone-empty {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dark);
}

.upload-icon-pulse {
  font-size: 2.6rem;
  color: var(--accent-pink);
  animation: pulse 1.5s infinite alternate;
}

.upload-prompt {
  font-weight: 700;
  font-size: 0.95rem;
}

.upload-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropzone-preview {
  width: 100%;
  height: 100%;
  position: relative;
}

.dropzone-preview img,
.dropzone-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
}

.preview-remove-btn {
  background: rgba(239, 68, 68, 0.8);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.15s;
}

.preview-remove-btn:active {
  transform: scale(0.92);
  background: rgba(239, 68, 68, 1.0);
}

/* Upload progress */
.upload-progress-container {
  width: 100%;
  margin-bottom: 14px;
  text-align: center;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 3px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink) 0%, var(--accent-coral) 100%);
  border-radius: 10px;
}

.progress-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-rose);
}

/* Notes Textbox */
.note-input-container {
  display: flex;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.45);
}

.note-input-container textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 0.88rem;
  color: var(--text-dark);
  font-weight: 500;
  resize: none;
}

.note-input-container textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.upload-btn {
  width: 100%;
  margin-top: 0;
}

/* ======================================= */
/* VIEW 4: SECURE PIN LOCK DESIGN          */
/* ======================================= */
#view-pin {
  padding-top: calc(env(safe-area-inset-top) + 20px);
}

.pin-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.lock-icon-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--glass-shadow);
  font-size: 1.8rem;
  color: var(--accent-pink);
}

.pin-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

/* Passcode dots */
.passcode-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.passcode-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent-pink);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.passcode-dots .dot.active {
  background: var(--accent-pink);
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35);
}

.pin-error-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cell-error-text);
  height: 18px;
  margin-bottom: 12px;
}

/* PIN pad grid */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px 20px;
  justify-content: center;
  margin-top: 10px;
}

.pin-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-dark);
  font-size: 1.7rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow);
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin-btn:active {
  transform: scale(0.86);
  background: rgba(236, 72, 153, 0.25);
  border-color: var(--accent-pink);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.18);
}

.pin-btn.clear, .pin-btn.delete {
  font-size: 1.2rem;
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.pin-btn.clear:active, .pin-btn.delete:active {
  background: rgba(255,255,255,0.25);
}

.shake-lock {
  animation: shake 0.4s ease-in-out;
}

/* ======================================= */
/* VIEW 5: VAULT GALLERY DESIGN            */
/* ======================================= */
.vault-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--border-radius-lg);
  margin-bottom: 16px;
}

.icon-lg {
  font-size: 2rem;
  color: var(--accent-pink);
  margin-bottom: 6px;
}

.vault-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.vault-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
  max-width: 240px;
}

.snaps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 20px;
}

.snap-thumbnail {
  aspect-ratio: 1/1;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.snap-thumbnail:active {
  transform: scale(0.94);
}

.snap-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px) brightness(0.9);
  transition: filter 0.3s;
}

.snap-thumbnail.opened .snap-thumb-media {
  filter: blur(0);
}

.snap-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 5;
  background: rgba(219, 39, 119, 0.22);
  transition: opacity 0.3s;
}

.snap-lock-overlay i {
  font-size: 1.3rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.snap-lock-type {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: 0.4px;
  background: var(--primary-rose);
  padding: 1px 4.5px;
  border-radius: 20px;
}

.snap-thumbnail.opened .snap-lock-overlay {
  opacity: 0;
  pointer-events: none;
}

.snap-date-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.5px 3.5px;
  border-radius: 4px;
  z-index: 6;
}

.snap-thumbnail.burned {
  background: rgba(255,255,255,0.12);
  border-color: rgba(0,0,0,0.03);
  cursor: default;
}
.snap-thumbnail.burned .snap-thumb-media {
  display: none;
}
.snap-thumbnail.burned .snap-lock-overlay {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}
.snap-thumbnail.burned .snap-lock-type {
  background: #9ca3af;
}

/* ======================================= */
/* OVERLAYS & MODALS                       */
/* ======================================= */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 241, 242, 0.5);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 50px rgba(244, 63, 94, 0.16);
}

.modal-scale {
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay.visible .modal-scale {
  transform: scale(1);
}

.overlay-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--accent-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.overlay-card p {
  font-size: 0.9rem;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 20px;
}

.overlay-badge-icon {
  font-size: 2.8rem;
  color: var(--accent-pink);
  margin-bottom: 12px;
  animation: pulse 1s infinite alternate;
}

/* Difficulty Option Buttons */
.difficulty-options {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
}

.diff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.7);
  width: 100%;
}

.diff-btn .diff-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-rose);
}

.diff-btn:active {
  background: rgba(236, 72, 153, 0.12);
  border-color: var(--accent-pink);
}

/* Big Action Button (Send/Play again) */
.action-btn {
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-coral) 100%);
  color: white;
  border: none;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.22);
  margin-top: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn:active {
  transform: scale(0.96);
  box-shadow: 0 3px 8px rgba(244, 63, 94, 0.15);
}

.text-center {
  text-align: center;
}

.font-lg {
  font-size: 1.05rem;
}

/* Win Screen overlay */
.win-badge-medal {
  font-size: 3rem;
  margin-bottom: 6px;
}

.win-love-letter {
  font-family: var(--font-love);
  font-size: 1.45rem !important;
  color: var(--primary-rose) !important;
  line-height: 1.25 !important;
}

.win-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: 8px;
  border-radius: var(--border-radius-md);
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.5);
}

.win-hearts-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.falling-heart {
  position: absolute;
  top: -20px;
  font-size: 1.4rem;
  color: var(--accent-pink);
  animation: fall 3s infinite linear;
}

.falling-heart:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 2.5s; }
.falling-heart:nth-child(2) { left: 30%; animation-delay: 0.5s; animation-duration: 3.2s; }
.falling-heart:nth-child(3) { left: 50%; animation-delay: 0.2s; animation-duration: 2.8s; }

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg) scale(0.8); opacity: 1; }
  100% { transform: translateY(400px) rotate(360deg) scale(1.2); opacity: 0; }
}

.gameover-icon-badge {
  font-size: 3rem;
  color: var(--accent-pink);
  margin-bottom: 8px;
}

/* ======================================= */
/* SNAP VIEWER OVERLAY DESIGN              */
/* ======================================= */
.snap-viewer-card {
  width: 100%;
  max-width: 380px;
  height: 100%;
  max-height: 88%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 15px 45px rgba(0,0,0,0.12);
}

.viewer-countdown-ring {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-pink);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.countdown-seconds {
  position: absolute;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.snap-media-content {
  width: 100%;
  flex: 1;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: rgba(0,0,0,0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--glass-border);
}

.snap-media-content img,
.snap-media-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.snap-love-note-view {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.65);
}

/* Glow colors */
.pink-glow {
  color: var(--accent-pink);
  filter: drop-shadow(0 0 3px rgba(236, 72, 153, 0.25));
}
.orange-glow {
  color: var(--accent-orange);
  filter: drop-shadow(0 0 3px rgba(249, 115, 22, 0.25));
}
.gold-glow {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 3px rgba(234, 179, 8, 0.25));
}
.lock-glow {
  color: var(--accent-pink);
  filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.4));
}

/* Desktop sizing adaptation */
@media (min-width: 440px) {
  body {
    background: radial-gradient(circle at top left, #ffeef0 0%, #f6f0ff 40%, #fbf0ff 100%);
  }
  .app-container {
    height: 820px;
    border-radius: 40px;
    border: 4px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.32);
    box-shadow: 0 25px 55px rgba(244, 63, 94, 0.12);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
  }
}

.hidden {
  display: none !important;
}
