:root {
  --xmass-green: #278900;
  --xmass-green-bright: #50b400;
  --xmass-green-dark: #176f00;
  --xmass-green-soft: #edf6e9;
  --xmass-red: #c51c20;
  --xmass-gold: #d3a94f;
}

body[data-theme="xmass"] {
  color: #26352d !important;
}

body[data-theme="xmass"].campaign-form-page {
  color: #00159f !important;
  font-family: "Myriad Pro", "Segoe UI", Arial, sans-serif;
  background: #0c2e55 !important;
}

body[data-theme="xmass"].campaign-form-page .app-content {
  min-height: 100vh;
  padding: 0 !important;
}

body[data-theme="xmass"] .xmass-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0c2e55;
  animation: xmass-splash-hide 3s step-end forwards;
}

body[data-theme="xmass"] .xmass-splash img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body[data-theme="xmass"] .xmass-splash-status {
  position: absolute;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  padding: .5rem 1rem;
  border-radius: 999px;
  background: rgba(12, 46, 85, .9);
  color: #fff;
  font-weight: 700;
}

body[data-theme="xmass"] .xmass-splash-countdown::after {
  content: "3";
  animation: xmass-splash-countdown 3s step-end forwards;
}

@keyframes xmass-splash-hide {
  to { visibility: hidden; }
}

@keyframes xmass-splash-countdown {
  0% { content: "3"; }
  33.333% { content: "2"; }
  66.667%, 100% { content: "1"; }
}

body[data-theme="xmass"] .xmass-campaign {
  position: relative;
  isolation: isolate;
  min-height: max(100vh, 56.25vw);
  min-height: max(100svh, 56.25vw);
  padding: 4.8vw 0 5vw;
  background: url("/skins/xmass/assets/vianoce.webp") center top / cover no-repeat;
  color: #00159f;
  text-align: center;
}

body[data-theme="xmass"] .xmass-campaign-snow {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body[data-theme="xmass"] .xmass-campaign-gallery,
body[data-theme="xmass"] .xmass-campaign-result {
  background: none;
}

body[data-theme="xmass"] .xmass-campaign-gallery::before,
body[data-theme="xmass"] .xmass-campaign-result::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/skins/xmass/assets/vianoce.webp") center / cover no-repeat;
}

body[data-theme="xmass"] .xmass-campaign-gallery .xmass-campaign-snow,
body[data-theme="xmass"] .xmass-campaign-result .xmass-campaign-snow {
  position: fixed;
}

body[data-theme="xmass"] .xmass-result-panel {
  max-width: 40rem;
}

body[data-theme="xmass"] .xmass-result-heading {
  margin: 0 0 1rem;
  font-weight: 700;
}

body[data-theme="xmass"] .xmass-result-image {
  width: min(100%, 25rem);
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
  border: 0;
  border-radius: .6rem;
}

body[data-theme="xmass"] .xmass-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  max-width: 25rem;
  margin: 0 auto;
}

body[data-theme="xmass"] .xmass-result-actions .xmass-campaign-primary,
body[data-theme="xmass"] .xmass-result-actions .xmass-campaign-secondary {
  width: 100%;
  min-width: 0;
  gap: .4rem;
}

body[data-theme="xmass"] .xmass-gallery-panel {
  max-width: 72rem;
}

body[data-theme="xmass"] .xmass-gallery-intro {
  margin: 0 0 1rem;
}

body[data-theme="xmass"] .xmass-gallery-counter {
  margin: 1.25rem 0;
}

body[data-theme="xmass"] .xmass-gallery-empty {
  margin: 1.5rem 0 0;
}

body[data-theme="xmass"] .xmass-gallery-panel .card {
  overflow: hidden;
  border-radius: .6rem;
}

body[data-theme="xmass"].campaign-form-page #dedicationModal .modal-content {
  color: #00159f;
  background: #eef7ff;
}

body[data-theme="xmass"].campaign-form-page #dedicationModal .btn-outline-secondary {
  color: #00159f;
  border-color: #00159f;
}

body[data-theme="xmass"].campaign-form-page #dedicationModal .btn-outline-secondary:hover {
  color: #fff;
  background: #00159f;
}

body[data-theme="xmass"].campaign-form-page #dedicationModal .modal-footer .text-white {
  background: #00159f !important;
}

@media (min-width: 768px) {
  body[data-theme="xmass"] .xmass-gallery-panel #gallery-grid > .col-6 {
    width: 33.333333%;
  }
}

@media (min-width: 1200px) {
  body[data-theme="xmass"] .xmass-gallery-panel #gallery-grid > .col-6 {
    width: 25%;
  }
}

body[data-theme="xmass"] .xmass-campaign-logo {
  position: absolute;
  top: 2.59vw;
  right: 3.98%;
  width: 21.3%;
}

body[data-theme="xmass"] .xmass-campaign-title {
  position: relative;
  margin: 0 auto 2.2vw;
  color: #fff;
  font-size: 2.49vw;
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.29;
}

body[data-theme="xmass"] .xmass-campaign-title span {
  display: block;
}

body[data-theme="xmass"] .xmass-campaign-panel {
  width: 63.021%;
  margin: 0 auto;
  border-radius: .82vw;
  padding: 2.68vw 2.08vw 1.56vw;
  background: rgb(255 255 255 / 80%);
  font-size: max(12px, 1.17vw);
  line-height: 1.25;
}

body[data-theme="xmass"] .xmass-campaign-intro {
  margin: 0 0 2.68vw;
}

body[data-theme="xmass"] .xmass-lottery {
  max-width: 32rem;
  margin: 0 auto;
}

body[data-theme="xmass"] .xmass-lottery h2 {
  font-size: 1.4em;
  font-weight: 700;
  margin: 0 0 .75rem;
}

body[data-theme="xmass"] .xmass-lottery-details summary {
  cursor: pointer;
  list-style: none;
}

body[data-theme="xmass"] .xmass-lottery-details summary::-webkit-details-marker {
  display: none;
}

body[data-theme="xmass"] .xmass-lottery-details form {
  margin-top: 1.25rem;
  text-align: left;
}

body[data-theme="xmass"] .xmass-lottery-details form > label:not(.xmass-lottery-consent) {
  display: block;
  margin: .75rem 0 .25rem;
  font-weight: 600;
}

body[data-theme="xmass"] .xmass-lottery-details input:not([type="hidden"]):not([type="checkbox"]) {
  display: block;
  width: 100%;
  border: 1px solid #6267a5;
  border-radius: 9px;
  padding: .7rem;
  color: #17213a;
  background: #fcfcfc;
  font: inherit;
}

body[data-theme="xmass"] .xmass-lottery-consent {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 1.25rem 0;
  text-align: left;
}

body[data-theme="xmass"] .xmass-lottery-consent input {
  flex-shrink: 0;
  margin-top: .3em;
}

body[data-theme="xmass"] .xmass-lottery a {
  color: #00159f;
}

body[data-theme="xmass"] .xmass-lottery-skip {
  margin-top: .75rem;
}

body[data-theme="xmass"] .xmass-campaign-panel textarea {
  display: block;
  width: 100%;
  min-height: 8.95vw;
  border: 1px solid #6267a5;
  border-radius: .72vw;
  padding: .65vw .95vw;
  background: #fcfcfc;
  color: #17213a;
  font: inherit;
  resize: vertical;
}

body[data-theme="xmass"] .xmass-campaign-panel textarea::placeholder {
  color: #767676;
}

body[data-theme="xmass"] .xmass-campaign-submit {
  margin-top: .52vw;
}

body[data-theme="xmass"] .xmass-campaign-primary,
body[data-theme="xmass"] .xmass-campaign-secondary {
  display: inline-flex;
  min-width: 18.49vw;
  min-height: max(32px, 3.02vw);
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .63vw;
  padding: .45em .75em;
  font: inherit;
  text-decoration: none;
}

body[data-theme="xmass"] .xmass-campaign-primary {
  background: #00159f;
  color: #fff;
}

body[data-theme="xmass"] .xmass-campaign-primary:hover {
  background: #172cba;
}

body[data-theme="xmass"] .xmass-campaign-secondary {
  border-color: #fff;
  background: #9dd6ff;
  color: #00159f;
}

body[data-theme="xmass"] .xmass-campaign-secondary:hover {
  background: #c4e7ff;
}

body[data-theme="xmass"] .xmass-campaign-counter {
  margin: 1.36vw 0 .58vw;
}

body[data-theme="xmass"] .xmass-campaign-counter strong {
  display: block;
  font-size: max(23px, 2.35vw);
  font-weight: 900;
  line-height: 1.03;
}

body[data-theme="xmass"] .xmass-campaign-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body[data-theme="xmass"].campaign-form-page :focus-visible {
  outline: 3px solid #2275d5;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  body[data-theme="xmass"] .xmass-campaign {
    padding: 1.25rem 1rem 2.75rem;
    background-position: center;
  }

  body[data-theme="xmass"] .xmass-campaign-logo {
    display: block;
    position: static;
    width: clamp(110px, 26vw, 190px);
    margin: 0 auto 1rem;
  }

  body[data-theme="xmass"] .xmass-campaign-title {
    margin-bottom: 1.2rem;
    font-size: clamp(21px, 4.55vw, 38px);
    line-height: 1.2;
  }

  body[data-theme="xmass"] .xmass-campaign-panel {
    width: min(100%, 40rem);
    border-radius: 14px;
    padding: 1.25rem;
    font-size: .96rem;
  }

  body[data-theme="xmass"] .xmass-campaign-intro {
    margin-bottom: 1.25rem;
    line-height: 1.45;
  }

  body[data-theme="xmass"] .xmass-campaign-panel textarea {
    min-height: 7rem;
    border-radius: 9px;
    padding: .7rem;
    font-size: 1rem;
  }

  body[data-theme="xmass"] .xmass-campaign-submit {
    margin-top: .65rem;
  }

  body[data-theme="xmass"] .xmass-campaign-primary,
  body[data-theme="xmass"] .xmass-campaign-secondary {
    min-height: 44px;
    border-radius: 8px;
  }

  body[data-theme="xmass"] .xmass-campaign-counter {
    margin: 1rem 0 .65rem;
  }
}

@media (max-width: 480px) {
  body[data-theme="xmass"] .xmass-campaign {
    padding-right: .75rem;
    padding-left: .75rem;
  }

  body[data-theme="xmass"] .xmass-campaign-panel {
    padding: 1rem .85rem;
  }

  body[data-theme="xmass"] .xmass-campaign-panel button {
    width: 100%;
  }

  body[data-theme="xmass"] .xmass-lottery-details summary {
    width: 100%;
  }
}

body[data-theme="xmass"] .bottom-nav-link.nav-active-item::before {
  background: var(--xmass-gold);
}

body[data-theme="xmass"] .bottom-nav-link.text-danger {
  color: var(--xmass-green) !important;
}

body[data-theme="xmass"] .nav-highlight {
  background: var(--xmass-red);
}

body[data-theme="xmass"] .xmass-mobile-header {
  background: linear-gradient(100deg, var(--xmass-green-bright), var(--xmass-green-dark)) !important;
}

body[data-theme="xmass"] .xmass-startup-overlay {
  background: rgba(255, 255, 255, .97) !important;
}

body[data-theme="xmass"] .xmass-startup-icon,
body[data-theme="xmass"] .xmass-icon-badge {
  background: var(--xmass-green-soft) !important;
}

body[data-theme="xmass"] .xmass-startup-icon {
  border: 1px solid rgba(211, 169, 79, .55);
  box-shadow: 0 6px 18px rgba(23, 111, 0, .12);
}

body[data-theme="xmass"] .xmass-startup-image {
  animation: xmass-preloader-float 2.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(23, 111, 0, .2));
}

body[data-theme="xmass"] .xmass-startup-message {
  color: var(--xmass-green-dark) !important;
}

body[data-theme="xmass"] .xmass-startup-progress-track {
  background: var(--xmass-green-soft) !important;
}

body[data-theme="xmass"] .xmass-startup-progress {
  background: linear-gradient(90deg, var(--xmass-green-bright), var(--xmass-green-dark)) !important;
}

body[data-theme="xmass"] .xmass-counter-card {
  background: linear-gradient(135deg, #f2f8ee, #e5f2df) !important;
}

body[data-theme="xmass"] .xmass-form-heading {
  color: var(--xmass-red);
}

body[data-theme="xmass"] .btn-primary {
  background: linear-gradient(100deg, var(--xmass-green-bright), var(--xmass-green-dark));
  border-color: var(--xmass-green-dark);
}

body[data-theme="xmass"] .btn-danger {
  background: var(--xmass-green);
  border-color: var(--xmass-green-dark);
}

body[data-theme="xmass"] .btn-outline-danger {
  color: var(--xmass-green);
  border-color: var(--xmass-green);
}

body[data-theme="xmass"] .btn-outline-danger:hover {
  color: #fff;
  background: var(--xmass-green);
}

body[data-theme="xmass"] .xmass-submit {
  background: linear-gradient(100deg, var(--xmass-green-bright), var(--xmass-green-dark)) !important;
  box-shadow: 0 4px 15px rgba(39, 137, 0, .3) !important;
}

body[data-theme="xmass"] .dedication-textarea {
  border-color: #70b85d !important;
}

body[data-theme="xmass"] .dedication-textarea:focus {
  border-color: var(--xmass-green) !important;
  box-shadow: 0 0 0 .2rem rgba(39, 137, 0, .2) !important;
}

body[data-theme="xmass"] .text-primary {
  color: var(--xmass-green) !important;
}

body[data-theme="xmass"] .form-control:focus {
  border-color: var(--xmass-green);
  box-shadow: 0 0 0 .2rem rgba(39, 137, 0, .2);
}

@keyframes xmass-preloader-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="xmass"] .xmass-startup-image {
    animation: none;
  }
}
