/* =====================================================================
   Free Lotty — cuenta de jugador: registro, inicio de sesión y perfil.
   Usa los tokens de styles.css / casino.css, así funciona en ambos temas.
   ===================================================================== */
#account.account-section { display: block; }

/* ---------- Registro / inicio de sesión ---------- */
.auth-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: start; }
.auth-pitch { position: relative; min-height: 100%; }
.auth-pitch h2 { font-size: 32px; letter-spacing: -.03em; }
.auth-pitch > p:not(.eyebrow) { font-size: 18px; color: var(--muted); margin-top: 12px; max-width: 46ch; }
.auth-perks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; font-size: 17px; font-weight: 600; }
.auth-perks li { display: flex; gap: 10px; align-items: center; }
.auth-perks li::before { content: '✓'; display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--mint); color: var(--green); font-weight: 800; font-size: 14px; }
/* Lotti y Lady Lottey reciben juntos a los nuevos jugadores */
.auth-hosts { display: flex; align-items: flex-end; margin-top: 24px; }
.auth-hosts img { display: block; height: auto; filter: drop-shadow(0 16px 24px #0000004d); }
.auth-lotti { width: 220px; }
.auth-lady { width: 132px; margin-left: -18px; transform-origin: 50% 100%; animation: lady-wave 3.2s ease-in-out infinite; }
@keyframes lady-wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-3deg) translateY(-4px); } }
/* Ron y Janet animan a crear el primer boleto */
.empty-hosts { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 0 auto 14px; }
.empty-hosts img { display: block; height: auto; filter: drop-shadow(0 12px 18px #00000040); animation: lady-wave 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.empty-ron { width: 126px; }
.empty-janet { width: 128px; margin-left: -6px; }
.empty-hosts .empty-janet { animation-delay: -1.6s; }
/* Lucky Lottie espera los resultados sentada en su bola 7, sobre la barra del próximo sorteo */
#results .section-heading { position: relative; }
.results-lottie { position: absolute; right: 230px; bottom: -30px; width: 116px; height: auto; z-index: 1; pointer-events: none; filter: drop-shadow(0 14px 20px #00000059); transform-origin: 30% 100%; animation: lottie-sway 4s ease-in-out infinite; }
@keyframes lottie-sway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .auth-lady, .empty-hosts img, .results-lottie { animation: none; } }

.auth-card { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--ground); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 20px; }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 700; }
.auth-tabs button[aria-selected="true"] { background: var(--green); color: white; }
html[data-theme="casino"] .auth-tabs button[aria-selected="true"] { background: var(--gold-button); color: var(--gold-ink); }

.auth-form label, #profile-form label { display: block; font-size: 16px; }
.auth-form input, #profile-form input { width: 100%; min-height: 46px; display: block; border: 1px solid #bdc9c0; background: white; border-radius: 8px; color: var(--ink); padding: 10px 12px; margin: 6px 0 16px; font: inherit; }
html[data-theme="casino"] .auth-form input, html[data-theme="casino"] #profile-form input { background: var(--paper); border-color: var(--line); }
.auth-form input:focus-visible, #profile-form input:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.auth-form input[aria-invalid="true"], #profile-form input[aria-invalid="true"] { border-color: #d6455a; }
.field-hint { display: block; margin: -10px 0 16px; font-size: 14px; color: var(--muted); }
.auth-form .primary-button { width: 100%; justify-content: center; margin-top: 4px; }
.auth-form .primary-button:disabled { opacity: .6; cursor: progress; }
.auth-message { min-height: 1.4em; margin-top: 12px; font-size: 15px; font-weight: 600; color: #d6455a; }
#profile-message, #avatar-message { color: var(--green); }

/* ---------- Perfil ---------- */
.profile-view { display: grid; gap: 28px; }
.profile-card { display: flex; gap: 28px; align-items: center; padding: 24px; border-radius: 16px; background: var(--ground); border: 1px solid var(--line); }
.profile-avatar { width: 128px; height: 128px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 4px solid var(--yellow); box-shadow: 0 10px 24px #0000003d; background: var(--paper); }
html[data-theme="casino"] .profile-avatar { border-color: var(--gold); box-shadow: 0 0 0 4px #ffcf3326, 0 10px 28px #00000080; }
.profile-card h2 { font-size: 28px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.profile-data { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 10px; }
.profile-data dt { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.profile-data dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.profile-card .field-hint { margin: 0; }
.profile-section h3 { font-size: 21px; }
.profile-section > .muted { margin-top: 4px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; margin: 16px 0; max-width: 1250px; }
.avatar-option { padding: 0; border: 3px solid transparent; border-radius: 50%; background: none; aspect-ratio: 1; transition: transform .15s, border-color .15s; }
.avatar-option img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-option:hover { transform: scale(1.06); }
.avatar-option[aria-checked="true"] { border-color: var(--green); box-shadow: 0 0 0 3px var(--mint); }
html[data-theme="casino"] .avatar-option[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px #ffcf3333, 0 0 18px #ffcf3366; }
.photo-upload { cursor: pointer; }
.photo-upload:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
#profile-form { max-width: 460px; }

/* ---------- Método de pago ---------- */
.payment-section { max-width: 620px; scroll-margin-top: 84px; } /* que la cabecera fija del móvil no tape el título */
.payment-choice { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 16px 0; }
.payment-choice legend { font-weight: 700; font-size: 16px; margin-bottom: 10px; padding: 0; }
.payment-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); font-weight: 600; cursor: pointer; }
.payment-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
html[data-theme="casino"] .payment-option input { accent-color: var(--gold); }
.payment-option:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px var(--mint); }
html[data-theme="casino"] .payment-option:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px #ffcf3333; }
.payment-option:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.paypal-form label { display: block; font-size: 16px; }
.paypal-form input { width: 100%; min-height: 46px; display: block; border: 1px solid #bdc9c0; background: white; border-radius: 8px; color: var(--ink); padding: 10px 12px; margin: 6px 0 16px; font: inherit; }
html[data-theme="casino"] .paypal-form input { background: var(--paper); border-color: var(--line); }
.paypal-form input[aria-invalid="true"] { border-color: #d6455a; }
.payment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#paypal-remove { color: #d6455a; }
#payment-message { color: var(--green); }
.paypal-help { padding: 18px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground); }
.paypal-help h4 { font-size: 18px; margin: 0 0 10px; }
.paypal-help ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; font-size: 16px; line-height: 1.45; }
#profile-payment-note.missing { color: #c98a00; font-weight: 600; }
html[data-theme="casino"] #profile-payment-note.missing { color: var(--gold); }
#profile-payment-note a { color: inherit; text-decoration: underline; }
.profile-logout { border-top: 1px solid var(--line); padding-top: 12px; }
#logout-button { color: #d6455a; padding-left: 0; }

/* ---------- Cabecera y avisos de invitado / usuario ---------- */
.header-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid #ffffffcc; margin: -4px 0 -4px -6px; }
.player-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.45; background: var(--mint); color: var(--ink); }
.player-note.guest { background: #fbefcf; color: #6b4a05; }
html[data-theme="casino"] .player-note.guest { background: var(--gold-light); color: var(--gold-soft); }
.player-note a { font-weight: 700; text-decoration: underline; color: inherit; }
.entries-summary + .player-note { max-width: 560px; }

@media (max-width: 900px) {
  .auth-view { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .auth-hosts, .results-lottie { display: none; }
  /* En modo app no hay menú: el acceso a la cuenta queda como un círculo con el avatar */
  .site-header .signup { display: inline-flex; justify-content: center; width: 40px; min-height: 40px; height: 40px; padding: 0; border-radius: 50%; flex: 0 0 auto; overflow: hidden; }
  .site-header .signup #header-account-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-header .signup .header-avatar { width: 100%; height: 100%; margin: 0; border: 0; }
}
@media (max-width: 640px) {
  .auth-pitch h2 { font-size: 26px; }
  .auth-card { padding: 16px; }
  .profile-card { flex-direction: column; text-align: center; padding: 20px 16px; gap: 16px; }
  .profile-data { justify-content: center; }
  .avatar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .photo-upload, #profile-form .secondary-button, .payment-actions .secondary-button, .paypal-help .secondary-button { width: 100%; justify-content: center; }
  .payment-option { flex: 1 1 100%; }
}

/* Hamid celebra con sus boletos junto a "Arma tu boleto" */
.play-intro { position: relative; }
.play-intro > :not(.play-hamid) { position: relative; z-index: 1; padding-right: 160px; }
.play-hamid { position: absolute; right: 0; top: -12px; width: 150px; height: auto; pointer-events: none; filter: drop-shadow(0 14px 20px #00000059); transform-origin: 50% 100%; animation: lady-wave 3.6s ease-in-out infinite; }
@media (max-width: 1240px) { .play-hamid { width: 120px; } .play-intro > :not(.play-hamid) { padding-right: 130px; } }
@media (prefers-reduced-motion: reduce) { .play-hamid { animation: none; } }
@media (max-width: 640px) { .play-hamid { display: none; } .play-intro > :not(.play-hamid) { padding-right: 0; } }

/* ---------- Modal para invitados en "Crear un boleto": invitar a registrarse ---------- */
.guest-dialog { width: min(440px, calc(100% - 28px)); text-align: center; padding: 22px 28px 20px; }
.guest-dialog .dialog-close { margin-bottom: -30px; position: relative; }
.guest-lotti { display: block; width: 170px; height: auto; margin: 0 auto 6px; filter: drop-shadow(0 10px 16px #7a4f0340); animation: float 5s ease-in-out infinite; }
.guest-dialog h2 { font-size: 26px; line-height: 1.15; margin-bottom: 10px; }
.guest-dialog p:not(.eyebrow) { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 auto 20px; max-width: 340px; }
.guest-actions { display: grid; gap: 10px; }
.guest-actions .primary-button, .guest-actions .secondary-button { width: 100%; justify-content: center; }
.guest-actions .text-button { font-size: 15px; font-weight: 600; color: var(--muted); }
.guest-actions .text-button:hover { text-decoration: underline; }
html[data-theme="casino"] .guest-dialog .primary-button { background: var(--gold-button); color: var(--gold-ink); }
html[data-theme="casino"] .guest-actions .text-button { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .guest-lotti { animation: none; } }
@media (max-width: 640px) { .guest-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; } }
