/* "Mon Cocon" Stylesheet - Scrapbook & Analog Aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&family=Outfit:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Soft warm palette */
  --bg-cream: #fbf9f3;
  --paper-white: #fcfbf7;
  --paper-kraft: #ebd8b7;
  --dusty-rose: #d8a499;
  --rose-dark: #b87c71;
  --pastel-mint: #b5c4b1;
  --pastel-yellow: #f7e5b5;
  --ink-blue: #2c3e50;
  --ink-light: #56687a;
  
  /* Fonts */
  --font-handwritten: 'Caveat', cursive;
  --font-body: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-cream);
  color: var(--ink-blue);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* Lined paper or graph pattern for warm paper vibe */
  background-image: 
    radial-gradient(#f0ebe0 20%, transparent 20%),
    radial-gradient(#f0ebe0 20%, transparent 20%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

/* Film Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Auth Pages Styling */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-book {
  background: var(--paper-white);
  border: 1px solid #ebd8b7;
  border-radius: 6px;
  box-shadow: 0 15px 35px rgba(44, 62, 80, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
  max-width: 420px;
  width: 100%;
  padding: 40px 30px;
  position: relative;
  transform: rotate(-1deg);
  border-left: 12px solid var(--dusty-rose); /* Book spine effect */
}

.auth-book::before {
  content: '';
  position: absolute;
  top: 0;
  left: -12px;
  height: 100%;
  width: 3px;
  background: rgba(0, 0, 0, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-title {
  font-family: var(--font-handwritten);
  font-size: 2.8rem;
  color: var(--dusty-rose);
  line-height: 1.1;
}

.auth-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-top: 5px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: var(--ink-light);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ebd8b7;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-blue);
  background-color: var(--bg-cream);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--dusty-rose);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  background-color: var(--dusty-rose);
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(216, 164, 153, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--rose-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.auth-error {
  margin-bottom: 15px;
  color: #c0392b;
  font-size: 0.9rem;
  background-color: #fce4d6;
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #c0392b;
  display: none;
}

/* Washi Tape Accent */
.washi-tape {
  position: absolute;
  width: 110px;
  height: 28px;
  background-color: var(--washi-color, rgba(181, 196, 177, 0.55));
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--washi-rot, -3deg));
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  border-left: 2px dashed rgba(255,255,255,0.4);
  border-right: 2px dashed rgba(255,255,255,0.4);
  clip-path: polygon(0% 4%, 4% 50%, 0% 96%, 100% 100%, 96% 50%, 100% 0%);
  pointer-events: none;
}

/* Main Scrapbook Layout */
.app-header {
  padding: 40px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.app-title-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 30px;
}

.app-brand {
  font-family: var(--font-handwritten);
  font-size: 3.2rem;
  color: var(--dusty-rose);
  position: relative;
}

.app-brand-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-light);
}

.btn-logout {
  padding: 8px 16px;
  border: 2px solid var(--dusty-rose);
  background: transparent;
  color: var(--dusty-rose);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.btn-logout:hover {
  background: var(--dusty-rose);
  color: white;
}

/* Scrapbook Corkboard Container */
.corkboard {
  max-width: 1200px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 30px;
}

/* Cards & Corkboard pins styling */
.scrapbook-card {
  background: var(--paper-white);
  border: 1px solid rgba(235, 216, 183, 0.5);
  box-shadow: 3px 6px 18px rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 24px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scrapbook-card:hover {
  transform: translateY(-2px) rotate(0deg) !important;
}

/* Pins */
.pushpin {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  background-color: var(--pin-color, #e74c3c);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 -3px 3px rgba(0,0,0,0.2);
  z-index: 10;
}

.pushpin::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 8px;
  width: 4px;
  height: 8px;
  background-color: #bdc3c7;
  border-radius: 1px;
}

/* Rotations for scrapbook chaos */
.rotate-left {
  transform: rotate(-1.5deg);
}

.rotate-right {
  transform: rotate(1.2deg);
}

.rotate-slight-left {
  transform: rotate(-0.8deg);
}

.rotate-slight-right {
  transform: rotate(0.9deg);
}

/* --- FEATURE 1: Countdown Card --- */
.countdown-card {
  grid-column: span 12;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.countdown-title {
  font-family: var(--font-handwritten);
  font-size: 2.2rem;
  color: var(--dusty-rose);
  margin-bottom: 12px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.countdown-item {
  background: var(--bg-cream);
  border: 1px solid #eee5d2;
  border-radius: 6px;
  padding: 10px 15px;
  min-width: 90px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.countdown-val {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink-blue);
  line-height: 1;
}

.countdown-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--ink-light);
  letter-spacing: 1px;
  margin-top: 4px;
}

.countdown-subtext {
  font-family: var(--font-handwritten);
  font-size: 1.4rem;
  color: var(--ink-light);
}

/* --- FEATURE 2: Dog Photo (Polaroid) --- */
.polaroid-card {
  grid-column: span 4;
  background: var(--paper-white);
  padding: 15px 15px 40px 15px; /* Large bottom border */
  border-radius: 2px;
  box-shadow: 5px 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transform: rotate(-2.5deg);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.03) !important;
  z-index: 10;
}

.polaroid-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #eee;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  position: relative;
}

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

.polaroid-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-light);
  padding: 20px;
  text-align: center;
}

.polaroid-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  color: var(--dusty-rose);
  opacity: 0.6;
}

.polaroid-placeholder p {
  font-family: var(--font-handwritten);
  font-size: 1.2rem;
}

.polaroid-caption {
  font-family: var(--font-handwritten);
  font-size: 1.6rem;
  text-align: center;
  color: var(--ink-blue);
  margin-top: 15px;
}

/* --- FEATURE 3: Drawing Canvas --- */
.canvas-card {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-handwritten);
  font-size: 2.2rem;
  color: var(--dusty-rose);
  margin-bottom: 15px;
  border-bottom: 1px dashed #ebd8b7;
  padding-bottom: 5px;
}

.canvas-container {
  width: 100%;
  position: relative;
  background-color: var(--bg-cream);
  border: 3px solid var(--paper-kraft);
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  /* Grid paper layout in CSS */
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(235, 216, 183, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(235, 216, 183, 0.4) 1px, transparent 1px);
}

.canvas-board {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}

.color-presets {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

.color-swatch.active {
  border-color: var(--ink-blue);
  transform: scale(1.15);
}

.brush-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brush-slider {
  accent-color: var(--dusty-rose);
  width: 100px;
  cursor: pointer;
}

.brush-val {
  font-size: 0.85rem;
  min-width: 20px;
  color: var(--ink-light);
}

.btn-secondary {
  padding: 8px 16px;
  border: 1px solid var(--ink-light);
  background: white;
  color: var(--ink-blue);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-cream);
  border-color: var(--ink-blue);
}

.btn-secondary.active {
  background: var(--ink-blue);
  color: var(--paper-white);
  border-color: var(--ink-blue);
}

.canvas-board.eraser-cursor {
  cursor: cell;
}

/* --- FEATURE 4: Summer Money Tracker --- */
.tracker-card {
  grid-column: span 12;
}

.tracker-layout {
  display: flex;
  gap: 30px;
  flex-direction: row;
}

@media (max-width: 768px) {
  .tracker-layout {
    flex-direction: column;
  }
}

.tracker-column {
  flex: 1;
  background: #fbfbfc;
  border: 1px solid #ebd8b7;
  border-radius: 6px;
  padding: 20px;
  position: relative;
  /* Lined ledger sheet effect */
  background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 100% 28px;
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--dusty-rose);
  padding-bottom: 10px;
}

.tracker-name {
  font-family: var(--font-handwritten);
  font-size: 2rem;
  color: var(--ink-blue);
}

.tracker-total {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--rose-dark);
}

.btn-add-earning {
  font-family: var(--font-handwritten);
  font-size: 1.2rem;
  padding: 4px 14px;
  background: var(--pastel-mint);
  border: 1px solid #9fb09a;
  border-radius: 15px;
  color: var(--ink-blue);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-add-earning:hover {
  background: #a3b59e;
  transform: translateY(-1px);
}

.btn-add-earning:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.receipt-log {
  margin-top: 15px;
  min-height: 120px;
}

.receipt-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--ink-light);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.receipt-list {
  list-style: none;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(44, 62, 80, 0.15);
  font-size: 0.9rem;
}

.receipt-info {
  flex: 1;
  min-width: 0;
}

.receipt-actions {
  display: flex;
  gap: 2px;
  margin-left: 4px;
}

.receipt-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.95rem;
  border-radius: 6px;
  opacity: 0.55;
  transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.receipt-action-btn:hover {
  opacity: 1;
  background-color: rgba(44, 62, 80, 0.06);
  transform: translateY(-1px);
}

.receipt-label {
  color: var(--ink-blue);
  font-weight: 500;
}

.receipt-date {
  font-size: 0.75rem;
  color: var(--ink-light);
  margin-left: 8px;
}

.receipt-amount {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink-blue);
}

.receipt-empty {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-light);
  text-align: center;
  padding: 20px 0;
}

/* --- Love Note Card --- */
.note-card {
  grid-column: span 6;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.note-text {
  font-family: var(--font-handwritten);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--ink-blue);
  margin: 12px 0 6px;
  min-height: 2em;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.note-text.empty {
  font-style: italic;
  color: var(--ink-light);
  opacity: 0.7;
}

.note-meta {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: var(--ink-light);
  font-style: italic;
  margin: 0;
}

/* --- Shared Track Card --- */
.track-card {
  grid-column: span 6;
  text-align: center;
}

.track-embed-wrapper {
  margin: 12px 0 6px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-music-iframe {
  width: 100%;
  height: 175px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

.track-empty {
  font-family: var(--font-handwritten);
  font-size: 1.1rem;
  color: var(--ink-light);
  font-style: italic;
  margin: 0;
}

/* --- Photos de nous Collage Section --- */
.collage-section {
  grid-column: span 12;
  margin-top: 20px;
}

.collage-title {
  font-family: var(--font-handwritten);
  font-size: 2.2rem;
  color: var(--dusty-rose);
  text-align: center;
  margin-bottom: 25px;
}

.collage-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 10px;
}

.collage-polaroid {
  background: var(--paper-white);
  padding: 12px 12px 30px 12px;
  width: 200px;
  box-shadow: 4px 6px 15px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.collage-polaroid:hover {
  transform: rotate(0deg) scale(1.05) !important;
  z-index: 5;
}

.collage-polaroid:nth-child(3n+1) {
  transform: rotate(-3deg);
}

.collage-polaroid:nth-child(3n+2) {
  transform: rotate(2deg);
}

.collage-polaroid:nth-child(3n) {
  transform: rotate(-1.5deg);
}

.collage-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-cream);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-placeholder-txt {
  font-family: var(--font-handwritten);
  font-size: 1.1rem;
  color: var(--ink-light);
}

.collage-caption {
  font-family: var(--font-handwritten);
  font-size: 1.2rem;
  text-align: center;
  color: var(--ink-light);
  margin: 0;
  word-break: break-word;
}

.collage-caption-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.collage-edit-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px 6px;
  border-radius: 50%;
  opacity: 0.45;
  transition: all 0.2s ease;
  line-height: 1;
}

.collage-edit-btn:hover,
.collage-edit-btn:focus-visible {
  opacity: 1;
  background: var(--bg-cream);
  transform: scale(1.15);
  outline: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 62, 80, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sticker-modal {
  background: var(--paper-white);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 380px;
  padding: 30px 24px;
  position: relative;
  transform: scale(0.9) rotate(-1deg);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--paper-kraft);
}

.modal-overlay.active .sticker-modal {
  transform: scale(1) rotate(0deg);
}

.modal-title {
  font-family: var(--font-handwritten);
  font-size: 2.2rem;
  color: var(--dusty-rose);
  margin-bottom: 15px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Footer Section */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-light);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  position: relative;
}

/* Heart Easter Egg Trigger */
.easter-heart {
  display: inline-block;
  color: var(--dusty-rose);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
  user-select: none;
}

.easter-heart:hover {
  transform: scale(1.3);
  color: #e74c3c;
}

.easter-tooltip {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper-kraft);
  color: var(--ink-blue);
  padding: 5px 12px;
  border-radius: 12px;
  font-family: var(--font-handwritten);
  font-size: 1.1rem;
  white-space: nowrap;
  box-shadow: 2px 4px 10px rgba(0,0,0,0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  border: 1px solid rgba(0,0,0,0.05);
}

.easter-heart:hover .easter-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* Heart shower animation overlay */
.heart-shower-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  font-size: 24px;
  color: #e74c3c;
  animation: floatUp 3s forwards linear;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.5);
    opacity: 0;
  }
}

/* Easter Egg Maggie Popup */
.maggie-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: var(--paper-white);
  padding: 40px 30px;
  border-radius: 8px;
  border: 2px solid var(--dusty-rose);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-family: var(--font-handwritten);
  font-size: 2.5rem;
  text-align: center;
  color: var(--rose-dark);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.maggie-banner.active {
  transform: translate(-50%, -50%) scale(1) rotate(-2deg);
  opacity: 1;
  pointer-events: all;
}

.close-banner {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--ink-light);
}

/* Konami canvas explosion style */
#konami-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  pointer-events: none;
}

/* ============================================ */
/* MOBILE RESPONSIVENESS                        */
/* ============================================ */

@media (max-width: 1024px) {
  .corkboard {
    grid-template-columns: repeat(6, 1fr);
    gap: 22px;
    padding: 0 16px;
  }

  /* Every card takes the full mobile row */
  .countdown-card,
  .canvas-card,
  .polaroid-card,
  .tracker-card,
  .note-card,
  .track-card,
  .collage-section {
    grid-column: span 6;
    max-width: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }

  /* Kill scrapbook rotations on mobile so nothing clips at screen edges */
  .countdown-card,
  .canvas-card,
  .polaroid-card,
  .tracker-card,
  .note-card,
  .track-card {
    transform: none !important;
  }

  /* Explicit top-to-bottom order on mobile, regardless of HTML order */
  .countdown-card  { order: 1; }
  .canvas-card     { order: 2; }
  .note-card       { order: 3; }
  .track-card      { order: 4; }
  .polaroid-card   { order: 5; }
  .tracker-card    { order: 6; }
  .collage-section { order: 7; }

  /* Polaroid: full width on mobile, no centered cap */
  .polaroid-card {
    padding: 14px 14px 30px 14px;
  }

  /* Doodle board: keep a comfortable height for portrait phones */
  .canvas-card .canvas-container {
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 768px) {
  body {
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
  }

  /* Header stacks on mobile */
  .app-header {
    padding: 24px 16px 16px 16px;
  }

  .app-title-container {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    text-align: center;
  }

  .app-brand {
    font-size: 2.4rem;
  }

  .app-brand-subtitle {
    font-size: 0.9rem;
  }

  /* Countdown shrinks */
  .countdown-title {
    font-size: 1.7rem;
  }

  .countdown-timer {
    gap: 10px;
    flex-wrap: wrap;
  }

  .countdown-item {
    min-width: 64px;
    padding: 8px 10px;
    flex: 1 0 60px;
  }

  .countdown-val {
    font-size: 1.8rem;
  }

  .countdown-lbl {
    font-size: 0.65rem;
  }

  .countdown-subtext {
    font-size: 1.1rem;
  }

  /* Cards spacing */
  .scrapbook-card {
    padding: 18px 14px;
  }

  .card-title {
    font-size: 1.6rem;
  }

  .canvas-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .color-presets {
    justify-content: center;
    flex-wrap: wrap;
  }

  .color-swatch {
    width: 30px;
    height: 30px;
  }

  .brush-control {
    justify-content: center;
  }

  /* Tracker columns stack */
  .tracker-layout {
    flex-direction: column;
    gap: 18px;
  }

  /* Collage */
  .collage-title {
    font-size: 1.7rem;
  }

  .collage-container {
    gap: 18px;
    padding: 6px;
  }

  .collage-polaroid {
    width: calc(50% - 9px);
    max-width: 220px;
    padding: 10px 10px 22px 10px;
  }

  .collage-caption {
    font-size: 1rem;
  }

  /* Footer */
  .footer {
    font-size: 0.85rem;
    padding: 18px 16px 30px 16px;
  }

  /* Modal */
  .sticker-modal {
    width: 92%;
    padding: 24px 20px;
  }

  .modal-title {
    font-size: 1.4rem;
  }

  /* Auth */
  .auth-book {
    margin: 30px 16px;
    padding: 30px 22px;
  }

  .auth-title {
    font-size: 2.4rem;
  }
}

@media (max-width: 480px) {
  .app-brand {
    font-size: 2rem;
  }

  .countdown-item {
    min-width: 54px;
    padding: 6px 8px;
  }

  .countdown-val {
    font-size: 1.5rem;
  }

  .polaroid-caption {
    font-size: 1.3rem;
  }

  .collage-polaroid {
    width: 100%;
    max-width: 280px;
  }

  .tracker-name {
    font-size: 1.4rem;
  }

  .tracker-total {
    font-size: 1.2rem;
  }

  .maggie-banner {
    width: 88%;
    font-size: 1rem;
  }
}

/* Disable scrapbook rotations on small screens to avoid layout overflow */
@media (max-width: 768px) {
  .rotate-left,
  .rotate-right,
  .rotate-slight-left,
  .rotate-slight-right,
  .polaroid-card,
  .collage-polaroid {
    transform: none !important;
  }

  .scrapbook-card:hover,
  .polaroid-card:hover,
  .collage-polaroid:hover {
    transform: none !important;
  }
}

/* Hint pencil button is always visible on touch devices (no hover) */
@media (hover: none) {
  .collage-edit-btn {
    opacity: 0.8;
  }
}
