@font-face { font-family: 'Sculpin'; src: url('../fonts/sculpin-light.otf') format('opentype'); font-style: normal; font-weight: 300; font-display: swap; }
@font-face { font-family: 'Sculpin'; src: url('../fonts/sculpin-regular.otf') format('opentype'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sculpin'; src: url('../fonts/sculpin-bold.otf') format('opentype'); font-style: normal; font-weight: 700; font-display: swap; }
:root { color-scheme: light; --green: #004627; --mint: #a3ffa7; --ink: #004328; --error: #ffd7b1; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--green) url('../img/background.png') center top / cover fixed no-repeat; color: #fffdf0; font-family: 'Sculpin', Arial, Helvetica, sans-serif; font-size: 16px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #ffce41; outline-offset: 5px; }
.demo-note { padding: 7px 16px; text-align: center; background: #002b1ee8; font-size: 12px; line-height: 1.4; }
main { max-width: 760px; margin: 0 auto; padding: 30px 30px 0; text-align: center; }
.brand { display: block; width: min(100%, 520px); height: auto; margin: 0 auto; }
h1 { margin: 12px 0 18px; font-family: 'Sculpin', Arial, Helvetica, sans-serif; font-size: clamp(34px, 6vw, 54px); line-height: 1.1; font-weight: 700; }
.campaign-title { display: block; width: min(100%, 650px); height: auto; margin: 0 auto; }
.instructions { max-width: 630px; margin: 0 auto 20px; font-size: 19px; line-height: 1.45; }
.toolbar { display: flex; justify-content: center; align-items: center; margin-bottom: 22px; }
.button { border: 0; border-radius: 26px; background: var(--mint); color: var(--ink); padding: 12px 22px; text-transform: uppercase; letter-spacing: .04em; font-size: 14px; line-height: 1.25; display: inline-block; text-decoration: none; font-weight: 700; }
.button:hover:not(:disabled) { background: #cbffbc; }
.button:disabled { opacity: .6; }
.clock span { display: block; text-transform: uppercase; font-size: 13px; letter-spacing: .05em; }
.clock strong { display: block; font-size: 32px; font-weight: 300; font-variant-numeric: tabular-nums; }
.clock.urgent strong { color: #ffdb75; }
.game-status { margin: -12px 0 15px; font-size: 13px; }
.game-status:empty { display: none; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.card { padding: 0; border: 0; border-radius: 7px; background: transparent; aspect-ratio: 1; position: relative; perspective: 700px; }
.card-inner { position: relative; display: block; width: 100%; height: 100%; border-radius: inherit; transform-style: preserve-3d; transition: transform .4s ease; }
.card.is-revealed .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: contain; background: #238f39; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.card-front { transform: rotateY(180deg); background: #fff; }
/* Ocultar cada cara a mitad del giro también evita transparencias en Safari/iOS. */
.card-front, .card.is-revealed .card-back { visibility: hidden; transition: visibility 0s linear .2s; }
.card-back, .card.is-revealed .card-front { visibility: visible; transition: visibility 0s linear .2s; }
.card:not(:disabled):hover { box-shadow: 0 0 0 2px #c4ffba; }
.card.matched { box-shadow: 0 0 0 2px var(--mint); }
/*.card.matched::after { content: '✓'; position: absolute; right: 5px; top: 5px; width: 21px; height: 21px; border-radius: 50%; color: #fff; background: var(--green); font-size: 15px; line-height: 21px; }*/
.progress { margin: 14px 0 0; font-size: 13px; }
footer { margin: 42px 0 24px; }
footer img { width: min(100%, 520px); max-width: 100%; height: auto; }
dialog { border: 3px solid var(--mint); border-radius: 7px; background: #fff; color: var(--ink); width: min(340px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 25px 18px; text-align: center; overflow-y: auto; box-shadow: 0 15px 70px #001d1955; }
dialog::backdrop { background: #002b1d99; }
#modal-image { height: 110px; width: 110px; object-fit: contain; margin: 0 auto 15px; display: block; }
dialog h2 { margin: 0 0 16px; font-size: 23px; line-height: 1.15; font-weight: 700; }
dialog p { line-height: 1.5; font-size: 16px; margin: 0 0 23px; }
#instructions-modal { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 62px 140px 66px; border: 0; color: #00371e; background: transparent url('../img/instructions-popup.png?v=live-copy-20261112') center / 100% 100% no-repeat; box-shadow: none; overflow-y: auto; }
#instructions-modal .instructions-copy { position: relative; z-index: 1; }
#instructions-modal h2 { font-family: inherit; font-size: 32px; font-weight: 700; line-height: 1.2; margin: 0 0 16px; }
#instructions-title:focus { outline: none; }
#instructions-modal p, #instructions-modal ol { font-size: 17px; line-height: 1.45; }
#instructions-modal #instructions-intro { margin: 0 0 18px; }
#instructions-modal ol { text-align: left; margin: 0 0 20px; padding-left: 26px; }
#instructions-modal li { padding-left: 2px; margin-bottom: 5px; }
#instructions-modal .button { position: relative; z-index: 1; min-height: 52px; padding: 12px 32px; border: 2px solid #fffdf0; border-radius: 999px; background: #005631; color: #fffdf0; box-shadow: 0 4px 8px #00462733; font-size: 22px; font-weight: 700; }
#instructions-modal .button:hover { background: #00673b; }
#instructions-modal .button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #004627; }
#instructions-modal .instructions-note { position: relative; z-index: 1; max-width: 440px; margin: 14px auto 0; font-size: 13px; line-height: 1.45; }
@media (min-width: 701px) {
  #instructions-modal { aspect-ratio: 3 / 2; }
  #instructions-modal[open] { display: flex; flex-direction: column; align-items: center; justify-content: safe center; }
  #instructions-modal .instructions-copy { width: 100%; }
}
@media (min-width: 768px) {
  body { background-image: url('../img/background-scientific.png'); }
}
#modal-actions { display: flex; flex-direction: column; align-items: center; gap: 13px; }
#modal-actions .button { max-width: 100%; }
.text-button { color: inherit; background: transparent; padding: 10px; border: 0; text-decoration: underline; line-height: 1.4; }
#form-screen, #thanks-screen { margin: 38px auto 0; max-width: 540px; line-height: 1.5; }
h2 { font-size: 30px; font-weight: 700; }
form { text-align: left; margin-top: 30px; }
.name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 5px; }
.field input { width: 100%; min-height: 46px; border: 2px solid transparent; border-radius: 4px; padding: 10px; background: #fffef5; color: var(--ink); }
.field input[aria-invalid=true] { border-color: #ffb76d; }
.field-error { display: block; font-size: 14px; color: var(--error); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; }
.privacy-notice { margin: 24px 0 16px; font-size: 14px; line-height: 1.5; }
.privacy-notice a { color: inherit; }
.consent input { appearance: auto; flex: 0 0 22px; width: 22px; height: 22px; margin: 0; accent-color: #7bea91; }
.consent label { font-size: 14px; line-height: 1.5; }
.consent a { color: inherit; }
#form-status { color: var(--error); }
#form-status:empty { margin: 0; }
#form-button{display: flex; justify-content: center; gap: 20px;}
form > .button { margin: 22px 15px 0 0; }
.pending-copy { font-size: 13px; color: #f9d890; }
.receipt { font-size: 13px; }
.noscript { position: fixed; inset: 30% 15%; background: white; color: var(--ink); padding: 30px; }
@media (max-width: 600px) {
  body { background-size: auto 100vh; background-attachment: scroll; }
  main { padding: 23px 18px 0; }
  .brand { width: 95%; }
  h1 { margin: 8px 0 16px; }
  .instructions { font-size: 16px; margin-bottom: 18px; line-height: 1.45; }
  .toolbar { margin-bottom: 18px; }
  .clock span { font-size: 10px; }
  .clock strong { font-size: 27px; }
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .card { border-radius: 5px; }
  footer { margin-top: 30px; }
  .name-fields { grid-template-columns: 1fr; gap: 0; }
  #form-screen, #thanks-screen { margin-top: 28px; }
  h2 { font-size: 26px; }
}
/* En móvil se conserva el fondo y la decoración existentes, con texto adaptable. */
@media (max-width: 700px) {
  #instructions-modal { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 26px 22px; border: 6px solid #fffdf0; border-radius: 28px; background: linear-gradient(135deg, #d8f0cf, #e1f5dd); box-shadow: 0 12px 44px #001d1966; overflow-y: auto; }
  #instructions-modal h2 { font-size: clamp(22px, 5.5vw, 30px); }
  #instructions-modal p { margin-bottom: 20px; }
  #instructions-modal ol { padding-left: 24px; margin-bottom: 24px; }
  #instructions-modal .button { min-height: 52px; padding: 12px 26px; font-size: 20px; }
  #instructions-modal .instructions-note { margin: 14px 0 0; font-size: 12px; }
  #instructions-modal::before, #instructions-modal::after { content: ''; position: absolute; z-index: 0; pointer-events: none; background-image: url('../img/instructions-popup.png?v=live-copy-20261112'); background-repeat: no-repeat; background-size: 768px 512px; }
  #instructions-modal::before { left: 0; top: 0; width: 90px; height: 155px; background-position: -48px -40px; opacity: .35; -webkit-mask-image: linear-gradient(135deg, #000, transparent 85%); mask-image: linear-gradient(135deg, #000, transparent 85%); }
  #instructions-modal::after { right: 0; bottom: 0; width: 110px; height: 125px; background-position: -585px -330px; opacity: .5; -webkit-mask-image: radial-gradient(ellipse closest-side at center, #000 35%, transparent 100%); mask-image: radial-gradient(ellipse closest-side at center, #000 35%, transparent 100%); }
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: box-shadow .15s; }
  dialog[open] { animation: appear .15s ease-out; }
  @keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  .card-inner, .card-face, .card.is-revealed .card-face { transition: none; }
}
@media (max-width: 767px) {
  body {
    background: var(--green);
    position: relative;
    overflow-x: hidden;
  }

  /* Flores del fondo original recortadas en dos esquinas, con bordes difuminados. */
  body::before,
  body::after {
    content: '';
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.9;
  }

  body::before {
    top: 0;
    left: 0;
    width: 26vw;
    aspect-ratio: 460 / 640;
    opacity: 0.7;
    background-image: url('../img/esquina-izquierda.png');
    -webkit-mask-image: linear-gradient(to right, #000 55%, transparent), linear-gradient(to bottom, #000 55%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, #000 55%, transparent), linear-gradient(to bottom, #000 55%, transparent);
    mask-composite: intersect;
    z-index: -1;
  }

  body::after {
    right: 0;
    bottom: -25px;
    width: 40vw;
    aspect-ratio: 480 / 600;
    background-image: url('../img/esquina-derecha.png');
    -webkit-mask-image: linear-gradient(to left, #000 55%, transparent), linear-gradient(to top, #000 55%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to left, #000 55%, transparent), linear-gradient(to top, #000 55%, transparent);
    mask-composite: intersect;
    z-index: -1;
  }

}

/* Compact consent banner and preferences, with the same actions at every width. */
#cookie-modal { position: fixed; inset: auto 12px 12px; margin: 0 auto; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px 24px; border: 1px solid #fffdf070; border-radius: 12px; background: #003d29; color: #fffdf0; text-align: left; }
#cookie-modal::backdrop { background: #001d1966; }
#cookie-modal h2 { font-size: 21px; margin: 0 0 10px; }
#cookie-modal h3 { font-size: 17px; margin: 0 0 12px; }
#cookie-modal p { font-size: 15px; line-height: 1.45; margin: 0 0 14px; }
#cookie-modal .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#cookie-modal button { border: 1px solid #fffdf0; border-radius: 999px; background: transparent; color: inherit; padding: 10px 18px; min-height: 44px; line-height: 1.25; font-weight: 700; font-size: 14px; }
#cookie-modal button:hover { background: #ffffff20; }
#cookie-modal a { color: inherit; text-decoration: underline; }
#cookie-modal .cookie-policy { display: inline-block; margin-top: 14px; font-size: 13px; }
#cookie-modal .cookie-option { border-top: 1px solid #fffdf04d; padding-top: 14px; margin-top: 14px; }
#cookie-modal label { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-bottom: 8px; }
#cookie-modal input { width: 20px; height: 20px; accent-color: #a3ffa7; flex-shrink: 0; }
#cookie-modal .cookie-description { font-size: 13px; }
#cookie-settings { margin-top: 16px; font-size: 13px; }
@media (max-width: 450px) {
  #cookie-modal { padding: 18px; }
  #cookie-modal .cookie-actions { flex-direction: column; }
  #cookie-modal .cookie-actions button { width: 100%; }
}
