:root {
    --ivory:     #faf8f4;
    --cream:     #f2ede4;
    --warm:      #e8e0d2;
    --sky-pale:  #eaf3f8;
    --sky-mid:   #cce0ed;
    --sky-soft:  #7ab5cc;
    --text:      #2c2825;
    --text-mid:  #6b6259;
    --text-soft: #9e9189;
    --gold:      #b8a082;
    --sombra: rgba(60,50,40,0.08);
    --sombra-hover: rgba(60,50,40,0.14);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  html { touch-action: manipulation; }
  body { font-family: 'Raleway', sans-serif; font-weight: 300; background: var(--ivory); color: var(--text); min-height: 100vh; overflow-x: hidden; }

  nav { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; max-width: 860px; margin: 0 auto; }
  .nav-logo { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 600; color: var(--text); text-decoration: none; }
  .nav-logo span { display: block; font-family: 'Raleway', sans-serif; font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-soft); font-weight: 400; }
  .nav-cta { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; color: var(--ivory); background: var(--sky-soft); padding: 0.55rem 1.1rem; border-radius: 2rem; text-decoration: none; transition: background .2s; }
  .nav-cta:hover { background: var(--sky-mid); color: var(--text); }

  .wrap { max-width: 480px; margin: 0 auto; padding: 0.6rem 1.2rem 3.5rem; }

  .fade-in { animation: fadeIn .35s ease both; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

  /* ── Menú ── */
  .intro { text-align: center; padding-top: 1.6rem; }
  .intro .castillo { font-size: 2.6rem; margin-bottom: .7rem; }
  .intro h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 500; line-height: 1.15; margin-bottom: .6rem; }
  .intro h1 em { font-style: italic; color: var(--sky-soft); }
  .intro p { color: var(--text-mid); font-size: .92rem; line-height: 1.6; margin-bottom: 1.5rem; }
  .modo-card { display: flex; align-items: center; gap: .9rem; text-align: left; width: 100%; border: 1px solid var(--warm); background: #fff; border-radius: 1.1rem; padding: 1.05rem 1.1rem; margin-bottom: .8rem; cursor: pointer; box-shadow: 0 2px 12px var(--sombra); transition: transform .12s, box-shadow .2s; font-family: 'Raleway', sans-serif; color: var(--text); }
  .modo-card:hover { box-shadow: 0 5px 18px var(--sombra-hover); }
  .modo-card:active { transform: scale(.98); }
  .modo-card .m-emoji { font-size: 1.9rem; }
  .modo-card .m-tit { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 600; line-height: 1.15; }
  .modo-card .m-sub { font-size: .76rem; color: var(--text-mid); margin-top: .2rem; line-height: 1.4; font-weight: 400; }
  .intro .mini { font-size: .78rem; color: var(--text-soft); font-style: italic; font-family: 'Playfair Display', serif; margin-top: .5rem; }

  /* ── Pregunta ── */
  .q-top { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0 .6rem; }
  .q-progress-txt { font-size: .72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; }
  .q-bar { height: 4px; background: var(--cream); border-radius: 3px; overflow: hidden; margin-bottom: 1.5rem; }
  .q-bar-fill { height: 100%; background: linear-gradient(90deg, var(--sky-mid), var(--sky-soft)); border-radius: 3px; width: 0; transition: width .35s ease; }
  .q-text { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 500; line-height: 1.3; margin-bottom: 1.3rem; }
  .opt { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; background: #fff; border: 1px solid var(--warm); border-radius: 1rem; padding: .9rem 1rem; margin-bottom: .65rem; cursor: pointer; font-family: 'Raleway', sans-serif; font-size: .9rem; font-weight: 500; color: var(--text); box-shadow: 0 2px 10px var(--sombra); transition: transform .12s, border-color .12s, background .12s; line-height: 1.45; }
  .opt .opt-emoji { font-size: 1.25rem; flex-shrink: 0; }
  .opt:hover { border-color: var(--sky-mid); }
  .opt:active { transform: scale(.98); }
  .opt.sel { border-color: var(--sky-soft); background: var(--sky-pale); }
  .q-quit { margin-top: 1rem; background: none; border: none; color: var(--text-soft); font-size: .78rem; cursor: pointer; text-decoration: underline; font-family: 'Raleway', sans-serif; }

  /* ── Calculando ── */
  .calc { text-align: center; padding-top: 5rem; }
  .calc .spark { font-size: 3rem; animation: pulse 1s ease infinite alternate; }
  @keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.25); opacity: 1; } }
  .calc p { font-family: 'Playfair Display', serif; font-style: italic; color: var(--text-mid); margin-top: 1rem; font-size: 1.1rem; }

  /* ── Resultado ── */
  .res { text-align: center; padding-top: 1.4rem; }
  .res .sos { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.1rem; color: var(--text-mid); }
  .res-card { border-radius: 1.3rem; padding: 1.8rem 1.4rem 1.5rem; margin: .9rem 0 1.1rem; box-shadow: 0 6px 24px var(--sombra-hover); }
  .res-emoji { font-size: 4rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.12)); }
  .res-nombre { font-family: 'Playfair Display', serif; font-size: 2.3rem; font-weight: 600; margin: .4rem 0 .1rem; color: var(--text); }
  .res-tag { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1rem; color: var(--text); opacity: .75; margin-bottom: .8rem; }
  .res-afin { display: inline-block; background: rgba(255,255,255,.8); border-radius: 2rem; padding: .35rem 1rem; font-size: .8rem; font-weight: 700; color: var(--text); }
  .res-desc { font-size: .92rem; line-height: 1.7; color: var(--text); text-align: left; background: #fff; border: 1px solid var(--warm); border-radius: 1.1rem; padding: 1.1rem 1.2rem; box-shadow: 0 2px 12px var(--sombra); font-weight: 400; }
  .res-btns { display: flex; gap: .7rem; margin-top: 1.4rem; }
  .res-btns button { flex: 1; padding: .85rem 0; border: none; border-radius: 2rem; cursor: pointer; font-family: 'Raleway', sans-serif; font-size: .88rem; font-weight: 600; box-shadow: 0 3px 12px var(--sombra); }
  .btn-again { background: var(--sky-pale); color: var(--text); border: 1px solid var(--sky-mid) !important; }
  .btn-share { background: var(--sky-soft); color: var(--ivory); }
  /* Volver a jugar pasa al pie: son las salidas, no la oferta */
  .res-pie { margin-top: 1.5rem; }
  .res-pie button { background: none !important; border: 1px solid var(--sky-mid) !important;
                    color: var(--text-soft); box-shadow: none; font-size: .8rem; padding: .7rem 0; }
  .btn-menu { display: block; margin: 1rem auto 0; background: none; border: none; color: var(--text-soft); font-size: .8rem; cursor: pointer; text-decoration: underline; font-family: 'Raleway', sans-serif; }

  /* ── CTA Sofi ── */
  .cta-sofi { margin-top: 1.8rem; background: var(--sky-pale); border: 1px solid var(--sky-mid); border-radius: 1.2rem; padding: 1.3rem 1.2rem; text-align: center; }
  .cta-sofi .cta-tit { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 600; line-height: 1.25; margin-bottom: .4rem; }
  .cta-sofi .cta-tit em { font-style: italic; color: var(--sky-soft); }
  .cta-sofi p { font-size: .85rem; color: var(--text-mid); line-height: 1.55; margin-bottom: .9rem; }
  .cta-sofi a { display: inline-block; background: var(--sky-soft); color: var(--ivory); text-decoration: none; font-size: .85rem; font-weight: 600; padding: .7rem 1.5rem; border-radius: 2rem; transition: background .2s; }
  .cta-sofi a:hover { background: var(--sky-mid); color: var(--text); }

  footer { text-align: center; padding: 1.5rem 1rem 2.5rem; font-size: .72rem; color: var(--text-soft); }
  footer a { color: var(--text-mid); }

  /* ── Tarjetas usadas como enlace (hub) y enlaces a los otros tests ── */
  a.modo-card { text-decoration: none; }

  .otros-tests { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--warm); }
  .otros-tests .mini { margin-bottom: .7rem; }
  .otro-test { display: block; text-decoration: none; color: var(--text-mid); font-size: .85rem;
               font-family: 'Raleway', sans-serif; padding: .55rem .8rem; margin-bottom: .45rem;
               border: 1px solid var(--warm); border-radius: .8rem; background: #fff;
               transition: border-color .12s, color .12s; }
  .otro-test:hover { border-color: var(--sky-mid); color: var(--text); }


  /* ── 🎩 El Sombrero Seleccionador ── */
  .sh-hat { font-size: 4.2rem; line-height: 1; display: inline-block;
            animation: shWobble 2.4s ease-in-out infinite;
            filter: drop-shadow(0 6px 10px rgba(60,50,40,.18)); }
  @keyframes shWobble { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

  .sh-voz { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.2rem;
            line-height: 1.45; color: var(--text); margin-top: .8rem; }
  .sh-susurro { background: linear-gradient(135deg, #2e2a45, #4a3f6b); color: #f3e6c4;
                border-radius: 1rem; padding: .7rem 1rem; margin-bottom: 1.1rem;
                font-family: 'Playfair Display', serif; font-size: 1rem;
                box-shadow: 0 3px 12px var(--sombra); }
  .sh-grito { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 600;
              letter-spacing: .04em; margin-top: .2rem;
              animation: shGrito .6s cubic-bezier(.2,1.6,.4,1) both; }
  @keyframes shGrito { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

  .sh-costado { margin: .9rem 0 0; padding-top: .8rem; border-top: 1px dashed var(--warm);
                font-size: .88rem; color: var(--text-mid); }
  .sh-datos { background: #fff; border-radius: 1.1rem; padding: .4rem 1.2rem; margin-top: .9rem;
              box-shadow: 0 2px 12px var(--sombra); text-align: left; }
  .sh-datos div { padding: .55rem 0; border-bottom: 1px solid var(--cream); font-size: .86rem; line-height: 1.4; }
  .sh-datos div:last-child { border-bottom: none; }
  .sh-datos span { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .06em; color: var(--text-soft); }
  .sh-disnerd { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1rem;
                margin-top: 1rem; color: var(--text-mid); }
  .sh-aviso { font-size: .72rem; color: var(--text-soft); line-height: 1.5; margin-top: 2rem;
              padding-top: 1rem; border-top: 1px solid var(--warm); }

  /* ── El sombrero dibujado, en lugar del emoji de galera ── */
  img.sh-hat { width: 5.4rem; height: 5.4rem; display: inline-block;
               animation: shWobble 2.4s ease-in-out infinite;
               filter: drop-shadow(0 6px 10px rgba(60,50,40,.18)); }
  img.m-emoji { width: 2.1rem; height: 2.1rem; flex-shrink: 0; }
  .ico-sombrero { width: 1.25em; height: 1.25em; vertical-align: -.3em; flex-shrink: 0; }
  .sh-susurro .ico-sombrero { vertical-align: -.25em; }
