:root {
  --page-green: #285f3a;
  --stamp-green: #173822;
  --stamp-red: #a82109;
  --cream: #fff9ed;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.w-full {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  width: 100%;
}

body {
  width: 100%;
  margin: 0;
  background-color: var(--page-green);
  color: var(--cream);
  font-family: "Work Sans", sans-serif;
  cursor: none;
}

body.modal-open {
  overflow: hidden;
}

body,
body * {
  cursor: none !important;
}

#offer-dialog,
#offer-dialog *,
#settings-overlay,
#settings-overlay *,
#completion-banner,
#completion-banner *,
.editor-topbar,
.editor-topbar *,
.settings-trigger,
.settings-trigger *,
.toast-notice,
.toast-notice *,
.login-card,
.login-card *,
.user-logout-btn,
.user-logout-btn *,
.ambient-music-btn,
.ambient-music-btn *,
.editor-theme-select {
  cursor: auto !important;
}

#offer-dialog input,
#offer-dialog textarea,
#settings-overlay input,
#settings-overlay textarea,
.login-card input {
  cursor: text !important;
}

#offer-dialog button,
#offer-dialog a,
#offer-dialog select,
#offer-dialog label,
#settings-overlay button,
#settings-overlay a,
#settings-overlay label,
#completion-banner button,
.editor-topbar a,
.editor-topbar button,
.settings-trigger,
.login-card button,
.user-logout-btn,
.ambient-music-btn,
.editor-theme-select {
  cursor: pointer !important;
}

button {
  font: inherit;
}

.app-wrapper {
  width: 100%;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  padding: clamp(40px, 5vw, 64px);
}

body[data-mode="editor"] .app-wrapper {
  padding-top: clamp(78px, 8vw, 96px);
}

/* Editor Topbar (solo visible en editor.html) */
.editor-topbar {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 45;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(23, 56, 34, 0.92);
  border: 1px solid rgba(255, 249, 237, 0.22);
  box-shadow: 0 10px 26px rgba(5, 22, 12, 0.35);
  backdrop-filter: blur(8px);
}

.editor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #f5d77f;
}

.editor-topbar-hint {
  font-size: 12px;
  color: rgba(255, 249, 237, 0.85);
}

.editor-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  background: #fff9ed;
  color: #173822;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.editor-topbar-link:hover {
  background: #f5d77f;
  transform: translateY(-1px);
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  max-width: 360px;
  padding: 13px 18px;
  border-radius: 12px;
  background: #173822;
  color: #fff9ed;
  border: 1px solid rgba(245, 215, 127, 0.55);
  box-shadow: 0 14px 36px rgba(5, 22, 12, 0.45);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.toast-notice.is-error {
  background: #8f1b08;
  border-color: rgba(255, 249, 237, 0.4);
}

/* Snow Cursor */
#snow-cursor-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  overflow: hidden;
}

#snow-cursor {
  position: fixed;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #f7fbff;
  box-shadow: 0 0 7px rgba(210, 235, 248, 0.75), inset -2px -2px 0 rgba(195, 222, 238, 0.42);
  pointer-events: none;
  transition: opacity 160ms ease;
  opacity: 0;
}

#snow-cursor.is-visible {
  opacity: 1;
}

.snow-particle {
  position: fixed;
  width: var(--particle-size);
  height: var(--particle-size);
  margin: calc(var(--particle-size) / -2) 0 0 calc(var(--particle-size) / -2);
  border-radius: 50%;
  background: rgba(247, 251, 255, 0.78);
  box-shadow: 0 0 4px rgba(210, 235, 248, 0.55);
  animation: snow-drift 800ms ease-out forwards;
}

@keyframes snow-drift {
  to {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.45);
  }
}

@media (pointer: coarse) {
  body,
  body * {
    cursor: auto !important;
  }
  #snow-cursor-layer {
    display: none;
  }
}

/* Header */
.calendar-header {
  width: 100%;
  margin: 0 auto 55px;
  text-align: center;
}

.page-title {
  margin: 0;
  font-family: "Cardo", serif;
  font-size: clamp(44px, 7vw, 99px);
  font-weight: 400;
  line-height: 1.16;
  color: var(--cream);
  overflow-wrap: anywhere;
  transition: transform 200ms ease-out, color 200ms ease-out;
}

.page-title:hover {
  transform: translateY(-2px) scale(1.05);
  color: #a82109;
}

.page-subheading {
  max-width: 630px;
  margin: 12px auto 0;
  font-family: "Work Sans", sans-serif;
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.55;
  font-weight: 300;
  color: var(--cream);
  transition: transform 200ms ease-out, color 200ms ease-out;
}

.page-subheading:hover {
  transform: translateY(-2px) scale(1.05);
  color: #a82109;
}

/* Calendar Grid & Stamps */
.calendar-grid {
  display: grid;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  overflow: visible;
}

.stamp-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .stamp-shell {
    transition: filter 180ms ease;
  }
  .stamp-shell:hover {
    filter: drop-shadow(0 0 10px rgba(255, 249, 237, 0.28));
  }
}

.stamp {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  container-type: inline-size;
  clip-path: url(#postage-stamp);
  -webkit-clip-path: url(#postage-stamp);
  border: 0;
  outline: 0;
  isolation: isolate;
  pointer-events: auto;
  --door-saturation: 1;
  opacity: 1;
  filter: saturate(var(--door-saturation));
  transition: opacity 220ms ease, filter 220ms ease, background-color 220ms ease;
}

.stamp-green {
  background-color: var(--stamp-green);
  color: var(--cream);
}

.stamp-red {
  background-color: var(--stamp-red);
  color: var(--cream);
}

.stamp-white {
  background-color: #ffffff;
  color: var(--stamp-green);
}

.stamp-gold {
  background: linear-gradient(135deg, #fff1b8 0%, #e5bc5b 42%, #c9922c 76%, #f5d882 100%);
  color: #173822;
}

.stamp-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.38) 48%,
    transparent 74%
  );
  background-size: 220% 220%;
  animation: gold-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes gold-shimmer {
  0%,
  100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0 100%;
  }
}

/* Casilla 24 destacada como la final y más grande */
.stamp-shell-final {
  z-index: 3;
  transform: scale(1.08);
  filter: drop-shadow(0 0 18px rgba(245, 215, 127, 0.62));
  transition: transform 200ms ease, filter 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .stamp-shell-final:hover {
    transform: scale(1.13);
    filter: drop-shadow(0 0 26px rgba(255, 232, 156, 0.85));
  }
}

.stamp-shell-final .day-number {
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 250, 224, 0.7);
}

.stamp.is-opened {
  opacity: 0.56;
  --door-saturation: 0.12;
}

.stamp[aria-disabled="true"] {
  opacity: 0.85;
}

/* Editor-only badges on stamps */
.stamp-edit-pill {
  position: absolute;
  right: 8%;
  top: 7%;
  z-index: 4;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(23, 56, 34, 0.85);
  color: #fff9ed;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.stamp-white .stamp-edit-pill {
  background: #173822;
}

.stamp:hover .stamp-edit-pill {
  opacity: 1;
}

.stamp-lock-badge {
  position: absolute;
  right: 9%;
  bottom: 9%;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 249, 237, 0.92);
  box-shadow: 0 3px 10px rgba(5, 22, 12, 0.28);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

@container (max-width: 110px) {
  .stamp-lock-badge {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}

.stamp-shell:has(> .stamp.is-today) {
  filter: brightness(1.14) drop-shadow(0 0 12px rgba(255, 249, 237, 0.30));
  animation: daily-nudge 3s ease-in-out infinite;
}

.stamp:focus-visible::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px dashed currentColor;
  pointer-events: none;
  z-index: 3;
}

.day-number {
  position: absolute;
  left: 10%;
  top: 7%;
  z-index: 1;
  display: block;
  font-family: "Work Sans", sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  transform-origin: left top;
}

.door-image {
  position: absolute;
  display: block;
  left: var(--image-left);
  top: var(--image-top);
  width: var(--image-width);
  height: var(--image-height);
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

@container (max-width: 125px) {
  .day-number {
    transform: scale(0.75);
  }
}

@container (max-width: 95px) {
  .day-number {
    transform: scale(0.6);
  }
}

@keyframes daily-nudge {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1.08) drop-shadow(0 0 12px rgba(255, 249, 237, 0.30));
  }
  50% {
    transform: translateY(-6px);
    filter: brightness(1.14) drop-shadow(0 0 22px rgba(255, 249, 237, 0.48));
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  z-index: 100;
  place-items: center;
  padding: 20px;
  background: rgba(5, 22, 12, 0.68);
}

.offer-dialog {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 780px;
  max-width: min(780px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  background: #ffffff;
  color: var(--stamp-green);
  padding: 40px;
  border-radius: 12px;
  outline: none;
  z-index: 120;
  box-shadow: 0 24px 60px rgba(5, 22, 12, 0.45);
}

/* Editor Tabs inside Modal */
.modal-editor-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -10px 44px 24px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e3e8e4;
}

.modal-tab-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #d7ded8;
  background: #f5f7f4;
  color: #173822;
  font-size: 13px;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.modal-tab-btn.is-active {
  background: #016036;
  color: #fff9ed;
  border-color: #016036;
}

.modal-tab-btn:hover:not(.is-active) {
  background: #e9efe9;
}

/* Editor Form inside Modal */
.day-editor-form {
  display: grid;
  gap: 16px;
}

.editor-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.editor-field {
  display: grid;
  gap: 6px;
}

.editor-field label {
  font-size: 13px;
  font-weight: 600;
  color: #173822;
}

.editor-input,
.editor-select,
.editor-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8d1;
  border-radius: 8px;
  background: #ffffff;
  color: #173822;
  font: 14px/1.45 "Work Sans", sans-serif;
}

.editor-textarea {
  min-height: 120px;
  resize: vertical;
}

.editor-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f7f4;
  font-size: 14px;
  color: #173822;
}

.editor-photo-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
  border: 1px dashed #b9c7bc;
  border-radius: 10px;
  background: #f8faf8;
}

.editor-photo-preview {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #d7ded8;
  background: #edf0eb;
}

.editor-photo-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 200px;
}

.editor-photo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-photo-status {
  margin: 0;
  font-size: 12px;
  color: #466350;
}

.editor-audio-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #b9c7bc;
  border-radius: 10px;
  background: #f8faf8;
}

.editor-sub-label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #466350 !important;
  margin-top: 4px;
}

.editor-btn-primary {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: #016036;
  color: #fff9ed;
  font-size: 14px;
  font-weight: 600;
}

.editor-btn-primary:hover {
  background: #0b452b;
}

.editor-btn-secondary {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cfd8d1;
  border-radius: 9px;
  background: #ffffff;
  color: #173822;
  font-size: 13px;
  font-weight: 600;
}

.editor-btn-secondary:hover {
  background: #f0f4f1;
}

.editor-btn-danger {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(168, 33, 9, 0.35);
  border-radius: 9px;
  background: #fff5f3;
  color: #a82109;
  font-size: 13px;
  font-weight: 600;
}

.editor-btn-danger:hover {
  background: #fde4df;
}

.editor-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #e3e8e4;
}

.editor-save-msg {
  font-size: 13px;
  font-weight: 600;
  color: #016036;
}

.editor-save-msg.is-error {
  color: #a82109;
}

/* Modal Preview Panel Layouts */
#offer-preview-root {
  position: relative;
  z-index: 0;
  min-width: 0;
}

.dialog-layout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  min-width: 0;
}

.dialog-layout:not(:has(.modal-media)) {
  grid-template-columns: minmax(0, 1fr);
}

.modal-media {
  min-width: 0;
  width: max-content;
  display: grid;
  place-items: center;
  padding: 0;
}

.modal-image {
  --media-height: min(300px, max(1px, calc(100vh - 110px)));
  display: block;
  width: min(260px, calc(var(--media-height) * var(--modal-ratio, 1)), max(1px, calc(100cqw - 276px)));
  height: auto;
  min-width: 0;
  max-width: 260px;
  max-height: 320px;
  aspect-ratio: var(--modal-ratio, 1) / 1;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 12px;
  color: transparent;
}

.offer-copy {
  min-width: 0;
}

.offer-day {
  margin: 0 0 12px;
  color: var(--stamp-green);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.offer-headline {
  margin: 0 0 16px;
  font-family: "Cardo", serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--stamp-green);
  overflow-wrap: anywhere;
}

.offer-subcopy {
  margin: 0;
  max-width: 38ch;
  font-family: "Work Sans", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--stamp-green);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.offer-expiry {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 56, 34, 0.22);
  color: var(--stamp-green);
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Audio Block */
.audio-link-block {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #d9bf82;
  background: linear-gradient(145deg, #fffdf7 0%, #f7efe0 100%);
  box-shadow: 0 10px 24px rgba(23, 56, 34, 0.08);
}

.audio-link-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a82109;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.audio-inline-player {
  width: 100%;
  height: 44px;
  border-radius: 999px;
}

.audio-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audio-link-input {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 56, 34, 0.25);
  border-radius: 10px;
  color: var(--stamp-green);
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
}

.audio-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: #016036;
  color: var(--cream);
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.audio-link-button:hover {
  background: #0b452b;
}

.audio-link-message {
  margin: 0;
  color: var(--stamp-green);
  font-family: "Work Sans", sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.audio-inline-player {
  width: 100%;
  margin-top: 4px;
}

/* Promo Code & Copy Button */
.code-slot {
  flex: 0 0 auto;
  min-width: 0;
}

.offer-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 44px;
  height: 100%;
  padding: 10px 20px;
  background: #edf0eb;
  color: var(--stamp-green);
  border-radius: 12px;
  font-family: "Work Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.offer-code.is-copied {
  background: #016036;
  color: #ffffff;
}

.copy-button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  min-width: 120px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: #016036;
  color: var(--cream);
  box-shadow: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.copy-button span {
  font-family: "Work Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.copy-label-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.copy-button:not(.is-copied) .copy-label-default,
.copy-button.is-copied .copy-label-done {
  opacity: 1;
  pointer-events: auto;
}

.copy-button.is-copied,
.copy-button:hover,
.copy-button:active {
  background: #0b452b;
}

.close-button {
  position: absolute;
  z-index: 30;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--stamp-green);
  pointer-events: auto;
}

.close-button svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.close-button:hover {
  opacity: 0.7;
}

/* Generic Special Layouts (applicable to ANY day!) */
.dialog-layout.layout-letter {
  position: relative;
  display: block;
  min-height: 380px;
  padding: 46px 50px 50px;
  border: 1px solid #d8c7a7;
  background: #fffdf7;
  box-shadow: inset 0 0 0 8px #f6eddc, 0 14px 30px rgba(23, 56, 34, 0.12);
}

.dialog-layout.layout-letter::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(168, 33, 9, 0.26);
  pointer-events: none;
}

.dialog-layout.layout-letter .modal-media {
  display: none;
}

.dialog-layout.layout-letter.has-custom-photo .modal-media {
  display: grid;
  width: 100%;
  margin: 0 auto 24px;
}

.dialog-layout.layout-letter.has-custom-photo .modal-image {
  margin: 0 auto;
  max-width: 280px;
  max-height: 280px;
}

.dialog-layout.layout-letter .offer-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
}

.dialog-layout.layout-letter .offer-day {
  margin-bottom: 18px;
  color: #a82109;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-layout.layout-letter .offer-headline {
  margin-bottom: 24px;
  color: #173822;
}

.dialog-layout.layout-letter .offer-subcopy {
  max-width: none;
  padding: 20px 0 8px;
  border-top: 1px solid rgba(23, 56, 34, 0.22);
  color: #173822;
}

.dialog-layout.layout-voucher {
  position: relative;
  display: block;
  min-height: 380px;
  padding: 50px 54px 54px;
  border: 1px solid #b8b8ad;
  background: #fffef8;
  box-shadow: inset 0 0 0 8px #f1f0e7, 0 14px 30px rgba(23, 56, 34, 0.12);
  overflow: hidden;
}

.dialog-layout.layout-voucher::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid #a82109;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    #a82109 12px 20px,
    #fffef8 20px 28px,
    #285f3a 28px 36px,
    #fffef8 36px 48px
  );
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 5px;
}

.dialog-layout.layout-voucher .modal-media {
  display: none;
}

.dialog-layout.layout-voucher.has-custom-photo .modal-media {
  display: grid;
  width: 100%;
  margin: 0 auto 24px;
}

.dialog-layout.layout-voucher.has-custom-photo .modal-image {
  margin: 0 auto;
  max-width: 260px;
  max-height: 260px;
}

.dialog-layout.layout-voucher .offer-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.dialog-layout.layout-voucher .offer-day {
  margin-bottom: 22px;
  color: #a82109;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-layout.layout-voucher .offer-headline {
  margin-bottom: 26px;
  color: #173822;
  text-transform: uppercase;
}

.dialog-layout.layout-voucher .offer-subcopy {
  max-width: none;
  padding: 22px 0 8px;
  border-top: 1px solid rgba(23, 56, 34, 0.22);
  color: #173822;
}

.dialog-layout.layout-voucher .offer-expiry {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 56, 34, 0.22);
  color: #173822;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dialog-layout.layout-full-image {
  display: block;
}

.dialog-layout.layout-full-image .modal-media {
  width: 100%;
  height: 100%;
  padding: 0;
}

.dialog-layout.layout-full-image .modal-image {
  width: 100%;
  max-width: none;
  max-height: none;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  object-fit: contain;
  border-radius: 12px;
}

.dialog-layout.layout-full-image .offer-copy {
  display: none;
}

/* Festive Christmas Gift Card Layout (layout-gift) */
.dialog-layout.layout-gift {
  position: relative;
  padding: 36px 34px;
  border-radius: 14px;
  border: 1px solid #d9bf82;
  background: linear-gradient(145deg, #fffdf7 0%, #f9f1de 100%);
  box-shadow: inset 0 0 0 6px #ffffff, 0 14px 32px rgba(23, 56, 34, 0.14);
  overflow: hidden;
}

.dialog-layout.layout-gift::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    #a82109 0 14px,
    #fffdf7 14px 20px,
    #173822 20px 34px,
    #d4a843 34px 40px
  );
  pointer-events: none;
}

.dialog-layout.layout-gift::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    #173822 0 14px,
    #d4a843 14px 20px,
    #a82109 20px 34px,
    #fffdf7 34px 40px
  );
  pointer-events: none;
}

.dialog-layout.layout-gift .modal-image {
  border: 3px solid #e2be67;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(23, 56, 34, 0.24);
  max-width: 280px;
  max-height: 280px;
}

.dialog-layout.layout-gift .offer-day {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #a82109;
  color: #fff9ed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-layout.layout-gift .offer-headline {
  margin-bottom: 16px;
  color: #173822;
  font-size: 36px;
}

.dialog-layout.layout-gift .offer-subcopy {
  padding-top: 16px;
  border-top: 1px dashed rgba(168, 33, 9, 0.35);
  color: #173822;
  font-size: 18px;
  line-height: 1.65;
}

/* Scratch & Win Christmas Ticket (layout_type = "scratch") */
.scratch-ticket {
  position: relative;
  text-align: center;
  padding: 36px 32px 34px;
  border-radius: 16px;
  border: 1px solid #d9bf82;
  background: linear-gradient(155deg, #fffdf7 0%, #f9f0dc 100%);
  box-shadow: inset 0 0 0 6px #ffffff, 0 18px 40px rgba(23, 56, 34, 0.16);
  overflow: hidden;
}

.scratch-ticket::before,
.scratch-ticket::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  pointer-events: none;
}

.scratch-ticket::before {
  top: 0;
  background: repeating-linear-gradient(
    135deg,
    #a82109 0 14px,
    #fffdf7 14px 20px,
    #173822 20px 34px,
    #d4a843 34px 40px
  );
}

.scratch-ticket::after {
  bottom: 0;
  background: repeating-linear-gradient(
    135deg,
    #173822 0 14px,
    #d4a843 14px 20px,
    #a82109 20px 34px,
    #fffdf7 34px 40px
  );
}

.scratch-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.scratch-confetti {
  position: absolute;
  top: 18%;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  opacity: 0;
  animation: scratch-confetti-fall 1.45s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes scratch-confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-x), 360px, 0) rotate(var(--confetti-rot)) scale(1.1);
  }
}

.scratch-header {
  margin-bottom: 20px;
}

.scratch-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #a82109;
  color: #fff9ed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scratch-title {
  margin: 0;
  font-family: "Cardo", serif;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.2;
  color: #173822;
}

.scratch-stage-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.scratch-stage {
  position: relative;
  width: min(310px, 100%);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 4px solid #e0ba5f;
  box-shadow: 0 14px 32px rgba(23, 56, 34, 0.22);
  background: #173822;
  user-select: none;
  -webkit-user-select: none;
}

.scratch-prize-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab !important;
  transition: opacity 550ms ease;
}

.scratch-canvas:active {
  cursor: grabbing !important;
}

.scratch-ticket.is-revealed .scratch-canvas {
  opacity: 0;
  pointer-events: none;
}

.scratch-hint-status {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #466350;
}

.scratch-ticket.is-revealed .scratch-hint-status {
  color: #a82109;
}

.scratch-prize-box {
  max-width: 460px;
  margin: 18px auto 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(168, 33, 9, 0.35);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  overflow: hidden;
  transform: translateY(10px);
  transition: opacity 450ms ease, transform 450ms ease, max-height 450ms ease, padding 450ms ease, margin 450ms ease;
}

.scratch-ticket.is-revealed .scratch-prize-box {
  opacity: 1;
  max-height: 400px;
  padding: 18px 20px;
  margin-top: 18px;
  transform: translateY(0);
}

.scratch-prize-text {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  color: #173822;
  white-space: pre-line;
}

.scratch-replay-btn {
  margin-top: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #cfd8d1;
  background: #ffffff;
  color: #173822;
  font-size: 13px;
  font-weight: 600;
}

.scratch-replay-btn:hover {
  background: #edf2ee;
}

@media (max-width: 540px) {
  .scratch-ticket {
    padding: 28px 18px 26px;
  }
  .scratch-prize-text {
    font-size: 16px;
  }
}

/* Bubble Pop Minigame (layout_type = "bubbles") */
.bubble-game-card {
  position: relative;
  text-align: center;
  padding: 28px 26px 26px;
  border-radius: 16px;
  border: 2px solid #d4a843;
  background: radial-gradient(circle at top, #1f5232 0%, #143320 65%, #0d2316 100%);
  color: #fff9ed;
  box-shadow: 0 18px 40px rgba(5, 22, 12, 0.35);
  overflow: hidden;
  transition: opacity 360ms ease, transform 360ms ease;
}

.bubble-game-card.is-victory {
  opacity: 0;
  transform: scale(0.97);
}

.bubble-game-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.bubble-game-badge {
  display: inline-block;
  margin: 0 auto;
  padding: 5px 14px;
  border-radius: 999px;
  background: #a82109;
  color: #fff9ed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bubble-game-title {
  margin: 0;
  font-family: "Cardo", serif;
  font-size: clamp(26px, 4vw, 35px);
  font-weight: 400;
  line-height: 1.15;
  color: #fff9ed;
}

.bubble-game-sub {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 249, 237, 0.88);
}

.bubble-progress-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 380px;
  width: 100%;
  margin: 6px auto 0;
}

.bubble-progress-bar {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 249, 237, 0.16);
  border: 1px solid rgba(245, 215, 127, 0.45);
  overflow: hidden;
}

.bubble-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f5d77f 0%, #e6b84c 60%, #ffefc2 100%);
  transition: width 220ms ease;
}

.bubble-progress-label {
  font-size: 13px;
  font-weight: 700;
  color: #f5d77f;
  white-space: nowrap;
}

.bubble-goals-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  width: 100%;
  margin: 8px auto 0;
}

.bubble-goal-pill {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(6, 20, 12, 0.48);
  border: 1px solid rgba(245, 215, 127, 0.35);
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.bubble-goal-pill.is-complete {
  border-color: #f5d77f;
  background: rgba(212, 168, 67, 0.24);
  box-shadow: 0 0 16px rgba(245, 215, 127, 0.28);
}

.bubble-goal-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff9ed;
}

.bubble-goal-count {
  font-size: 12px;
  font-weight: 700;
  color: #f5d77f;
}

.bubble-pop-burst.is-decoy {
  color: rgba(255, 249, 237, 0.8);
  font-size: 13px;
}

.bubble-arena {
  position: relative;
  width: 100%;
  height: 330px;
  border-radius: 14px;
  border: 1px solid rgba(245, 215, 127, 0.32);
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 215, 127, 0.14), transparent 36%),
    radial-gradient(circle at 80% 70%, rgba(168, 33, 9, 0.16), transparent 40%),
    rgba(6, 20, 12, 0.42);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.magic-bubble {
  position: absolute;
  bottom: -86px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  animation: bubble-rise var(--float-duration, 6.5s) linear forwards;
  transition: transform 150ms ease, opacity 180ms ease;
  box-shadow:
    inset -8px -10px 18px rgba(0, 0, 0, 0.18),
    inset 8px 10px 16px rgba(255, 255, 255, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer !important;
}

.magic-bubble::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 18%;
  width: 26%;
  height: 16%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-28deg);
  pointer-events: none;
}

.magic-bubble:hover {
  transform: scale(1.1);
}

.magic-bubble.bubble-gold {
  background: radial-gradient(circle at 30% 30%, rgba(255, 245, 205, 0.9), rgba(226, 179, 72, 0.72));
}

.magic-bubble.bubble-red {
  background: radial-gradient(circle at 30% 30%, rgba(255, 195, 185, 0.88), rgba(186, 40, 16, 0.75));
}

.magic-bubble.bubble-emerald {
  background: radial-gradient(circle at 30% 30%, rgba(196, 247, 214, 0.88), rgba(40, 128, 76, 0.75));
}

.magic-bubble.bubble-pearl {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), rgba(220, 232, 242, 0.68));
}

.bubble-icon {
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

.magic-bubble.is-popped {
  transform: scale(1.45) !important;
  opacity: 0 !important;
  pointer-events: none;
}

@keyframes bubble-rise {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(var(--sway-x, 14px), -220px, 0);
  }
  100% {
    transform: translate3d(calc(var(--sway-x, 14px) * -0.6), -450px, 0);
  }
}

.bubble-pop-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  color: #fff4c9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: pop-burst-rise 680ms ease-out forwards;
  z-index: 6;
}

@keyframes pop-burst-rise {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.75);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -115%) scale(1.2);
  }
}

/* Deluxe Christmas Voucher (Premio Día 5 y estilo Vale mejorado) */
.voucher-deluxe {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  background: repeating-linear-gradient(
    135deg,
    #a82109 0 14px,
    #fffdf7 14px 20px,
    #173822 20px 34px,
    #d4a843 34px 40px
  );
  box-shadow: 0 20px 44px rgba(23, 56, 34, 0.22);
  overflow: hidden;
}

.voucher-deluxe.is-just-revealed {
  animation: voucher-pop-in 520ms cubic-bezier(0.2, 0.85, 0.3, 1.05);
}

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

.voucher-deluxe-inner {
  position: relative;
  text-align: center;
  padding: 36px 34px 32px;
  border-radius: 12px;
  border: 2px solid #d4a843;
  background: linear-gradient(155deg, #fffef9 0%, #f8eed9 100%);
  box-shadow: inset 0 0 0 6px #ffffff;
}

.voucher-deluxe-inner::before,
.voucher-deluxe-inner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #d4a843;
  transform: translateY(-50%);
}

.voucher-deluxe-inner::before {
  left: -14px;
}

.voucher-deluxe-inner::after {
  right: -14px;
}

.voucher-deluxe-ribbon {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a82109 0%, #861805 100%);
  color: #fff9ed;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(168, 33, 9, 0.25);
}

.voucher-emblem {
  font-size: 38px;
  line-height: 1.2;
  margin: 0 auto 14px;
}

.voucher-gif-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
}

.voucher-gif {
  max-width: min(320px, 100%);
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  border: 3px solid #e2be67;
  box-shadow: 0 12px 26px rgba(23, 56, 34, 0.2);
  background: #fff9ed;
}

.voucher-deluxe-title {
  margin: 0 0 14px;
  font-family: "Cardo", serif;
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  color: #173822;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.voucher-deluxe-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 260px;
  margin: 0 auto 18px;
  color: #c9922c;
}

.voucher-deluxe-divider span {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9922c, transparent);
}

.voucher-deluxe-divider em {
  font-style: normal;
  font-size: 14px;
}

.voucher-deluxe-body {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(212, 168, 67, 0.45);
}

.voucher-deluxe-text {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.55;
  color: #173822;
  white-space: pre-line;
}

.voucher-deluxe-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed rgba(168, 33, 9, 0.28);
  font-size: 13px;
  font-weight: 600;
}

.voucher-deluxe-seal {
  padding: 5px 12px;
  border-radius: 999px;
  background: #173822;
  color: #f5d77f;
  letter-spacing: 0.03em;
}

.voucher-deluxe-expiry {
  color: #a82109;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 540px) {
  .bubble-game-card {
    padding: 22px 16px 20px;
  }
  .bubble-arena {
    height: 290px;
  }
  .voucher-deluxe {
    padding: 12px;
  }
  .voucher-deluxe-inner {
    padding: 26px 18px 24px;
  }
  .voucher-deluxe-text {
    font-size: 17px;
  }
  .voucher-deluxe-footer {
    justify-content: center;
  }
}

/* Locked Day Countdown Card */
.locked-countdown-card {
  position: relative;
  text-align: center;
  padding: 44px 36px 40px;
  border-radius: 14px;
  border: 1px solid #d9bf82;
  background: linear-gradient(145deg, #fffdf7 0%, #f8efe0 100%);
  box-shadow: inset 0 0 0 6px #ffffff, 0 14px 30px rgba(23, 56, 34, 0.12);
}

.locked-countdown-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #173822;
  color: #fff9ed;
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(23, 56, 34, 0.25);
}

.locked-countdown-day {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #a82109;
  color: #fff9ed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locked-countdown-title {
  margin: 0 auto 26px;
  max-width: 24ch;
  font-family: "Cardo", serif;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.25;
  color: #173822;
}

.locked-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 460px;
  margin: 0 auto 22px;
}

.countdown-box {
  display: grid;
  gap: 4px;
  padding: 16px 8px;
  border-radius: 12px;
  background: #173822;
  color: #fff9ed;
  box-shadow: 0 8px 18px rgba(23, 56, 34, 0.18);
}

.countdown-num {
  font-family: "Cardo", serif;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 400;
  line-height: 1;
  color: #f5d77f;
}

.countdown-unit {
  font-family: "Work Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 249, 237, 0.88);
}

.locked-countdown-date {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #466350;
}

.locked-countdown-subtitle {
  margin: -14px auto 24px;
  max-width: 34ch;
  font-family: "Work Sans", sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: #a82109;
}

.locked-countdown-card.is-day-24 {
  border: 2px solid #d4a843;
  background: linear-gradient(145deg, #fffdf4 0%, #f9ecc9 100%);
  box-shadow: inset 0 0 0 6px #ffffff, 0 16px 38px rgba(201, 146, 44, 0.28);
}

.locked-countdown-card.is-day-24 .locked-countdown-icon {
  background: linear-gradient(135deg, #f5d77f 0%, #c9922c 100%);
  color: #173822;
}

.locked-countdown-card.is-day-24 .locked-countdown-day {
  background: linear-gradient(135deg, #c9922c 0%, #a87217 100%);
  color: #fff9ed;
}

/* User Login Screen */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, #317247 0%, #285f3a 52%, #173822 100%);
}

.login-card {
  position: relative;
  width: min(430px, 100%);
  padding: 40px 34px 36px;
  border-radius: 18px;
  border: 1px solid #d9bf82;
  background: linear-gradient(155deg, #fffdf7 0%, #f8efe0 100%);
  color: #173822;
  text-align: center;
  box-shadow: inset 0 0 0 6px #ffffff, 0 26px 64px rgba(5, 22, 12, 0.45);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    #a82109 0 14px,
    #fffdf7 14px 20px,
    #173822 20px 34px,
    #d4a843 34px 40px
  );
}

.login-card.is-shake {
  animation: locked-shake 300ms ease-in-out;
}

.login-avatar {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  border: 3px solid #e2be67;
  box-shadow: 0 10px 24px rgba(23, 56, 34, 0.18);
}

.login-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #a82109;
  color: #fff9ed;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-title {
  margin: 0 0 8px;
  font-family: "Cardo", serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  color: #173822;
}

.login-hint {
  margin: 0 0 24px;
  font-size: 15px;
  color: #466350;
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 16px;
  text-align: left;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: #173822;
}

.login-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #cfd8d1;
  border-radius: 10px;
  background: #ffffff;
  color: #173822;
  font: 15px/1.4 "Work Sans", sans-serif;
}

.login-input:focus {
  outline: 2px solid #016036;
  outline-offset: 1px;
  border-color: #016036;
}

.login-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-password-wrap .login-input {
  padding-right: 46px;
}

.login-eye-btn {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  display: grid;
  place-items: center;
}

.login-eye-btn:hover {
  background: rgba(23, 56, 34, 0.08);
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff2ef;
  border: 1px solid rgba(168, 33, 9, 0.28);
  color: #a82109;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.login-submit-btn {
  min-height: 46px;
  margin-top: 4px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: #016036;
  color: #fff9ed;
  font: 600 15px/1.4 "Work Sans", sans-serif;
  box-shadow: 0 10px 22px rgba(1, 96, 54, 0.26);
  transition: background 150ms ease, transform 150ms ease;
}

.login-submit-btn:hover {
  background: #0b452b;
  transform: translateY(-1px);
}

.login-submit-btn:disabled {
  opacity: 0.65;
}

.user-logout-btn {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 40;
  padding: 8px 14px;
  border: 1px solid rgba(255, 249, 237, 0.28);
  border-radius: 999px;
  background: rgba(23, 56, 34, 0.82);
  color: #fff9ed;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background 150ms ease, transform 150ms ease;
}

.user-logout-btn:hover {
  background: #a82109;
  transform: translateY(-1px);
}

/* ========================================================
   AMBIENTES VISUALES POR DÍA (Días 1 al 5) + MÚSICA
   ======================================================== */

body {
  transition: background 600ms ease, background-color 600ms ease;
}

.daily-ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.daily-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 600ms ease;
}

.daily-bg-image.has-image {
  opacity: 0.34;
}

.daily-decor-layer,
.daily-particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Día 1: Clásico Bosque Esmeralda */
body.theme-day-1 {
  background-color: #285f3a;
  background-image: none;
}

/* Día 2: Noche de Carta Romántica (Burdeos + Guirnalda + Estrellitas/Corazones) */
body.theme-day-2 {
  background-color: #3d0d11;
  background-image: radial-gradient(ellipse at 50% 0%, #7d1d24 0%, #4b1016 48%, #21070a 100%);
  background-attachment: fixed;
}

body.theme-day-2 .page-title {
  text-shadow: 0 4px 28px rgba(245, 215, 127, 0.34);
}

body.theme-day-2 .page-title:hover,
body.theme-day-2 .page-subheading:hover {
  color: #f5d77f;
}

/* Día 3: Noche Nevada de Chocolate (Azul medianoche + Nieve + Pinos nevados) */
body.theme-day-3 {
  background-color: #132a42;
  background-image: radial-gradient(ellipse at 50% 0%, #244d73 0%, #132a42 52%, #091522 100%);
  background-attachment: fixed;
}

body.theme-day-3 .page-title {
  text-shadow: 0 4px 28px rgba(210, 236, 255, 0.32);
}

body.theme-day-3 .page-title:hover,
body.theme-day-3 .page-subheading:hover {
  color: #bfe4ff;
}

/* Día 4: Bosque de Luces Bokeh (Esmeralda nocturno + Bokeh cálido + Guirnalda dorada) */
body.theme-day-4 {
  background-color: #10301f;
  background-image: radial-gradient(ellipse at 50% 12%, #205739 0%, #10301f 52%, #07170e 100%);
  background-attachment: fixed;
}

body.theme-day-4 .page-title {
  text-shadow: 0 4px 28px rgba(245, 215, 127, 0.38);
}

body.theme-day-4 .page-title:hover,
body.theme-day-4 .page-subheading:hover {
  color: #f5d77f;
}

/* Día 5: Cena a la Luz de las Velas (Ámbar cálido + Velas + Chispas doradas) */
body.theme-day-5 {
  background-color: #3b1c0e;
  background-image: radial-gradient(ellipse at 50% 100%, #6b3518 0%, #3b1c0e 48%, #1a0b05 100%);
  background-attachment: fixed;
}

body.theme-day-5 .page-title {
  text-shadow: 0 4px 28px rgba(255, 214, 122, 0.4);
}

body.theme-day-5 .page-title:hover,
body.theme-day-5 .page-subheading:hover {
  color: #ffd97d;
}

/* Guirnalda de luces navideñas superior (Días 2 y 4) */
.christmas-garland {
  position: absolute;
  top: 0;
  left: -2%;
  right: -2%;
  height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  border-top: 2px solid rgba(245, 215, 127, 0.28);
}

.garland-bulb {
  position: relative;
  width: 11px;
  height: 15px;
  margin-top: 6px;
  border-radius: 50% 50% 45% 45%;
  background: var(--bulb-color, #f5d77f);
  box-shadow: 0 0 12px var(--bulb-color, #f5d77f), 0 0 24px var(--bulb-color, #f5d77f);
  animation: garland-twinkle 2.6s ease-in-out infinite;
  animation-delay: var(--bulb-delay, 0s);
}

.garland-bulb:nth-child(odd) {
  margin-top: 12px;
}

.garland-bulb::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 5px;
  height: 7px;
  transform: translateX(-50%);
  background: rgba(35, 35, 35, 0.75);
  border-radius: 2px 2px 0 0;
}

@keyframes garland-twinkle {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Silueta de pinos nevados (Día 3) */
.winter-pines-silhouette {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(85px, 14vh, 155px);
  display: block;
}

/* Velas cálidas en esquinas (Día 5) */
.candle-warm-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 196, 94, 0.24), transparent 72%);
}

.candle-corner {
  position: absolute;
  bottom: -6px;
  width: clamp(72px, 9vw, 120px);
  opacity: 0.85;
}

.candle-left {
  left: 14px;
}

.candle-right {
  right: 14px;
  transform: scaleX(-1);
}

.corner-candles {
  width: 100%;
  height: auto;
  display: block;
}

.candle-flame {
  transform-origin: 42px 44px;
  animation: flame-flicker 2.1s ease-in-out infinite;
}

.candle-flame.flame-2 {
  transform-origin: 82px 70px;
  animation-duration: 1.75s;
}

@keyframes flame-flicker {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08, 1.15) rotate(2deg);
    opacity: 1;
  }
}

/* Partículas ambientales */
.ambient-particle {
  position: absolute;
  pointer-events: none;
}

.ambient-romantic {
  top: -32px;
  color: rgba(255, 224, 150, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.32);
  animation: ambient-fall-sway var(--p-dur, 10s) linear forwards;
}

.ambient-sticker {
  top: -72px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
  animation: ambient-fall-sway var(--p-dur, 11s) linear forwards;
}

@keyframes ambient-fall-sway {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.86;
  }
  88% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(var(--p-drift, 30px), 112vh, 0) rotate(var(--p-rot, 16deg));
    opacity: 0;
  }
}

.ambient-snow {
  top: -16px;
  border-radius: 50%;
  background: rgba(240, 249, 255, 0.82);
  box-shadow: 0 0 8px rgba(200, 232, 255, 0.65);
  animation: ambient-fall var(--p-dur, 8s) linear forwards;
}

@keyframes ambient-fall {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
  10% {
    opacity: 0.88;
  }
  90% {
    opacity: 0.72;
  }
  100% {
    transform: translate3d(var(--p-drift, 25px), 108vh, 0);
    opacity: 0;
  }
}

.ambient-ember {
  bottom: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c2 0%, #f5b942 65%, transparent 100%);
  box-shadow: 0 0 10px rgba(255, 200, 92, 0.8);
  animation: ambient-rise var(--p-dur, 7s) ease-out forwards;
}

@keyframes ambient-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.7);
    opacity: 0;
  }
  18% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--p-drift, 20px), -92vh, 0) scale(0.35);
    opacity: 0;
  }
}

/* Luces Bokeh (Día 4) */
.ambient-bokeh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  animation: bokeh-float var(--bokeh-dur, 10s) ease-in-out infinite;
  animation-delay: var(--bokeh-delay, 0s);
}

@keyframes bokeh-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(0.95);
    opacity: 0.45;
  }
  50% {
    transform: translate3d(16px, -24px, 0) scale(1.12);
    opacity: 0.88;
  }
}

/* Botón flotante de Música y Selector de Ambiente */
.ambient-music-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(245, 215, 127, 0.38);
  border-radius: 999px;
  background: rgba(15, 36, 23, 0.84);
  color: #fff9ed;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.ambient-music-btn.is-playing {
  border-color: #f5d77f;
  color: #f5d77f;
}

.ambient-music-btn:hover {
  background: rgba(168, 33, 9, 0.88);
  color: #fff9ed;
  transform: translateY(-1px);
}

body[data-mode="user"] .ambient-music-btn {
  position: fixed;
  top: 20px;
  left: 22px;
  z-index: 40;
}

.editor-theme-select {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(245, 215, 127, 0.4);
  background: rgba(255, 249, 237, 0.12);
  color: #fff9ed;
  font: 600 12px/1.3 "Work Sans", sans-serif;
}

.editor-theme-select option {
  background: #173822;
  color: #fff9ed;
}

@media (max-width: 639px) {
  .candle-corner {
    opacity: 0.5;
  }
  body[data-mode="user"] .ambient-music-btn {
    top: 14px;
    left: 14px;
    padding: 7px 12px;
    font-size: 12px;
  }
  .user-logout-btn {
    top: 14px;
    right: 14px;
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* ========================================================
   CARTA NAVIDEÑA DE LUJO (layout_type = "letter")
   ======================================================== */
.letter-deluxe {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  background: repeating-linear-gradient(
    135deg,
    #a82109 0 14px,
    #fffdf7 14px 20px,
    #173822 20px 34px,
    #d4a843 34px 40px
  );
  box-shadow: 0 22px 48px rgba(23, 56, 34, 0.24);
  overflow: hidden;
}

.letter-deluxe-paper {
  position: relative;
  padding: 28px 42px 34px;
  border-radius: 12px;
  border: 2px solid #d4a843;
  background:
    radial-gradient(circle at 12% 85%, rgba(212, 168, 67, 0.10), transparent 38%),
    radial-gradient(circle at 88% 15%, rgba(168, 33, 9, 0.08), transparent 36%),
    linear-gradient(160deg, #fffef9 0%, #faf1de 100%);
  box-shadow: inset 0 0 0 6px #ffffff;
  color: #173822;
}

.letter-deluxe-paper::before {
  content: "❄   ✦   ❄";
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: rgba(201, 146, 44, 0.45);
  pointer-events: none;
}

.letter-top-decor {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.letter-holly-corner {
  width: 112px;
  margin: -10px 0 0 -14px;
  flex-shrink: 0;
}

.letter-holly-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(23, 56, 34, 0.16));
}

.letter-postage-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
}

.letter-postmark-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px dashed rgba(168, 33, 9, 0.48);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(168, 33, 9, 0.72);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.25;
  transform: rotate(-12deg);
}

.letter-postmark-ring strong {
  font-size: 9px;
  color: #a82109;
}

.letter-mini-stamp {
  width: 56px;
  height: 64px;
  padding: 5px;
  border-radius: 6px;
  background: #ffffff;
  border: 2px dashed #c9922c;
  box-shadow: 0 6px 14px rgba(23, 56, 34, 0.16);
  display: grid;
  place-items: center;
  transform: rotate(4deg);
}

.letter-mini-stamp img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.letter-deluxe-header {
  text-align: center;
  margin-bottom: 22px;
}

.letter-deluxe-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a82109 0%, #831705 100%);
  color: #fff9ed;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(168, 33, 9, 0.24);
}

.letter-deluxe-title {
  margin: 0 0 14px;
  font-family: "Cardo", serif;
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  color: #173822;
}

.letter-deluxe-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
  color: #c9922c;
}

.letter-deluxe-divider span {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9922c, transparent);
}

.letter-deluxe-divider em {
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.15em;
}

.letter-photo-frame {
  display: flex;
  justify-content: center;
  margin: 0 auto 22px;
}

.letter-photo-frame img {
  max-width: 260px;
  max-height: 240px;
  border-radius: 12px;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 2px #d9b562, 0 12px 24px rgba(23, 56, 34, 0.18);
  object-fit: cover;
}

.letter-deluxe-body {
  padding: 20px 24px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 33px,
      rgba(201, 146, 44, 0.12) 33px 34px
    ),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(212, 168, 67, 0.36);
}

.letter-deluxe-text {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.88;
  color: #173822;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.letter-deluxe-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(168, 33, 9, 0.28);
}

.letter-footer-ornament {
  font-size: 16px;
  letter-spacing: 0.16em;
}

.letter-wax-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #dc381c 0%, #a82109 62%, #6e1204 100%);
  border: 2px solid rgba(245, 215, 127, 0.65);
  box-shadow:
    inset 0 2px 5px rgba(255, 195, 180, 0.45),
    0 6px 14px rgba(110, 18, 4, 0.32);
  display: grid;
  place-items: center;
  font-size: 19px;
}

.letter-footer-sign {
  font-family: "Cardo", serif;
  font-size: 19px;
  font-style: italic;
  color: #8f1b08;
}

@media (max-width: 639px) {
  .letter-deluxe {
    padding: 11px;
  }
  .letter-deluxe-paper {
    padding: 20px 18px 26px;
  }
  .letter-holly-corner {
    width: 82px;
    margin: -6px 0 0 -8px;
  }
  .letter-postmark-ring {
    display: none;
  }
  .letter-mini-stamp {
    width: 48px;
    height: 54px;
  }
  .letter-deluxe-body {
    padding: 16px 14px;
  }
  .letter-deluxe-text {
    font-size: 16px;
    line-height: 1.75;
  }
  .letter-deluxe-footer {
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .locked-countdown-card {
    padding: 32px 18px 28px;
  }
  .locked-countdown-grid {
    gap: 8px;
  }
  .countdown-box {
    padding: 12px 4px;
  }
}

/* Completion Banner & Snowfall */
.completion-banner {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: min(760px, calc(100% - 40px));
  height: fit-content;
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 40px 44px 38px;
  background: #173822;
  color: #fff9ed;
  border-radius: 12px;
  box-shadow: 0 0 48px rgba(255, 249, 237, 0.35), 0 18px 40px rgba(5, 22, 12, 0.55);
}

.completion-banner h2 {
  margin: 0 28px 12px 0;
  font-family: "Cardo", serif;
  font-size: clamp(28px, 4vw, 43px);
  font-weight: 400;
  line-height: 1.15;
}

.completion-banner p {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.55;
  color: #fff9ed;
}

.completion-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff9ed;
  font-size: 20px;
}

.completion-close:hover {
  opacity: 0.7;
}

.completion-snow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.completion-snow-particle {
  position: absolute;
  top: -12px;
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: rgba(247, 251, 255, 0.82);
  box-shadow: 0 0 5px rgba(210, 235, 248, 0.62);
  animation: completion-snowfall var(--fall-duration) linear forwards;
  pointer-events: none;
}

@keyframes completion-snowfall {
  to {
    transform: translate3d(var(--fall-drift), var(--fall-distance), 0);
    opacity: 0.08;
  }
}

/* Creator Settings Panel (solo en editor.html) */
.settings-trigger {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 45;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: #173822;
  box-shadow: 0 8px 22px rgba(5, 22, 12, 0.24);
  transition: transform 160ms ease;
}

.settings-trigger:hover {
  transform: scale(1.06);
}

.settings-trigger svg {
  width: 21px;
  height: 21px;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 22, 12, 0.68);
}

.settings-panel {
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 34px;
  border-radius: 12px;
  background: #ffffff;
  color: #173822;
  font-family: "Work Sans", sans-serif;
  box-shadow: 0 24px 60px rgba(5, 22, 12, 0.45);
}

.settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.settings-title,
.ready-title {
  margin: 0;
  font-family: "Cardo", serif;
  font-weight: 400;
  color: #173822;
}

.settings-title {
  font-size: 30px;
}

.ready-title {
  font-size: 24px;
}

.settings-close {
  border: 0;
  background: transparent;
  color: #173822;
  padding: 8px;
  display: grid;
  place-items: center;
}

.settings-close svg {
  width: 20px;
  height: 20px;
}

.settings-field {
  margin-top: 18px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-label {
  display: block;
  color: #173822;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.settings-input,
.settings-textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d7ded8;
  border-radius: 8px;
  color: #173822;
  font: 14px/1.45 "Work Sans", sans-serif;
}

.settings-textarea {
  min-height: 68px;
  resize: vertical;
}

.settings-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d7ded8;
  transition: background 160ms ease;
}

.settings-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.settings-switch input:checked + .settings-slider {
  background: #016036;
}

.settings-switch input:checked + .settings-slider::before {
  transform: translateX(20px);
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: #016036;
  color: #fff9ed;
  font: 600 14px/1.4 "Work Sans", sans-serif;
  text-decoration: none;
}

.settings-button:hover {
  background: #0b452b;
}

.settings-button-secondary {
  background: #edf0eb;
  color: #173822;
}

.settings-button-secondary:hover {
  background: #dfe5dc;
}

.settings-ready {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e3e8e4;
}

.settings-lead {
  margin: 8px 0 14px;
  color: #173822;
  font-size: 14px;
  line-height: 1.55;
}

.is-locked {
  animation: locked-shake 280ms ease-in-out;
}

@keyframes locked-shake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.clip-definitions {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 960px) {
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .calendar-header {
    margin-bottom: 28px;
  }
  .offer-dialog {
    padding: 32px 24px;
    max-height: calc(100dvh - 40px);
    touch-action: auto;
    overscroll-behavior: auto;
  }
  .dialog-layout.layout-letter,
  .dialog-layout.layout-voucher {
    padding: 34px 24px;
  }
  .editor-grid-2 {
    grid-template-columns: 1fr;
  }
  .editor-topbar {
    left: 14px;
    right: 76px;
    top: 14px;
  }
  .settings-trigger {
    top: 14px;
    right: 14px;
  }
}

@media (max-width: 540px) {
  .modal-overlay {
    padding: 16px;
  }
  .dialog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .modal-media {
    justify-self: center;
    max-width: 100%;
  }
  .modal-image {
    width: min(260px, 100%);
    margin: 0;
  }
  .offer-headline {
    font-size: 32px;
  }
  .offer-subcopy {
    font-size: 17px;
  }
  .settings-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-shell:has(> .stamp.is-today) {
    animation: none;
    transform: none;
    filter: brightness(1.14) drop-shadow(0 0 12px rgba(255, 249, 237, 0.30));
  }
}
