/* ============================================================
   Modo app (app de Android «ChatsFun Juegos» o /juegos/?app=1)
   Todo cuelga de .modo-app: no cambia nada en la web normal.
   ============================================================ */
.am-top, .am-tabs, #am-inicio, #am-mesas, #am-amigos, #am-cuenta { display: none; }

html.modo-app { --am-violeta: #7c3aed; --am-violeta-osc: #5b21b6; --am-rosa: #db2777; --am-fondo: #f4f1fb; --am-tinta: #1f1630; --am-suave: #6b6480;
  --am-arriba: env(safe-area-inset-top, 0px); --am-abajo: env(safe-area-inset-bottom, 0px); }
html.modo-app body { background: var(--am-fondo); color: var(--am-tinta); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
html.modo-app body::before { display: none; }

/* Fuera lo que es de la web: cabecera con el chat, pie, salón antiguo y avisos de cookies */
html.modo-app .barra, html.modo-app .pie, html.modo-app .aviso-cookies,
html.modo-app #vista-salon > .intro, html.modo-app #vista-salon > .abiertas, html.modo-app #vista-salon > #lista-juegos, html.modo-app #vista-salon > #aviso-servidor,
html.modo-app #invitar-chat, html.modo-app #btn-pantalla { display: none !important; }
html.modo-app .pagina { max-width: 720px; margin: 0 auto; padding: 0 0 calc(86px + var(--am-abajo)); }
html.modo-app [aria-label="Aviso de cookies"] { display: none !important; } /* solo cookies técnicas: en la app se explica en Cuenta > Privacidad */
html.modo-app #vista-espera, html.modo-app #vista-solitario { padding: 12px 14px 0; }
html.modo-app .aviso-flotante { bottom: calc(92px + var(--am-abajo)); z-index: 90; max-width: calc(100vw - 32px); }
html.modo-app body[data-vista="partida"] .aviso-flotante, html.modo-app body[data-vista="espera"] .aviso-flotante { bottom: calc(24px + var(--am-abajo)); }

/* ---------- barra de arriba ---------- */
html.modo-app .am-top { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
  padding: calc(10px + var(--am-arriba)) 16px 10px; color: #fff; background: linear-gradient(120deg, var(--am-violeta-osc), var(--am-violeta) 55%, #9333ea); }
.am-logo { width: 38px; height: 38px; border-radius: 12px; background: #fff; padding: 3px; box-sizing: border-box; box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.am-marca { display: grid; line-height: 1.05; flex: 1 1 auto; min-width: 0; }
.am-marca strong { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.am-marca span { font-size: 12px; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .12em; }
.am-conexion { display: grid; place-items: center; }
.am-conexion .punto { display: block; width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.am-conexion .punto.ok { background: #4ade80; }
.am-conexion .punto.mal { background: #f87171; }
.am-yo { border: 0; background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 3px; display: grid; place-items: center; min-width: 42px; height: 42px; cursor: pointer; color: #fff; font: inherit; }
.am-yo .av { width: 36px; height: 36px; font-size: 14px; }
.am-entrar { padding: 0 14px; font-weight: 900; font-size: 14px; }
html.modo-app body[data-vista="partida"] .am-top { display: none; }

/* ---------- cabecera de la portada ---------- */
html.modo-app #am-inicio:not([hidden]), html.modo-app #am-mesas:not([hidden]), html.modo-app #am-amigos:not([hidden]), html.modo-app #am-cuenta:not([hidden]) { display: block; }
.am-hero { padding: 6px 18px 26px; color: #fff; border-radius: 0 0 28px 28px;
  background: linear-gradient(120deg, var(--am-violeta-osc), var(--am-violeta) 55%, #9333ea); box-shadow: 0 10px 26px rgba(91, 33, 182, .25); }
.am-hero.corto { padding-bottom: 20px; }
.am-hero h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -.02em; color: #fff; }
.am-hero p { margin: 4px 0 0; font-size: 15px; opacity: .9; font-weight: 600; }
.am-busca { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 0 16px; height: 50px; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(30, 10, 70, .18); }
.am-busca input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; font-weight: 700; color: var(--am-tinta); }
.am-busca input::placeholder { color: #a39cb8; }

.am-chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-left: 16px; }
.am-chips::-webkit-scrollbar { display: none; }
.am-chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 14.5px; font-weight: 800;
  background: #fff; color: var(--am-tinta); box-shadow: 0 2px 8px rgba(30, 10, 70, .08); cursor: pointer; scroll-snap-align: start; }
.am-chips button.activa { background: var(--am-violeta); color: #fff; box-shadow: 0 6px 14px rgba(124, 58, 237, .35); }

.am-aviso { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: #fff7ed; color: #9a3412; font-weight: 700; font-size: 14px; }
.am-aviso[hidden] { display: none; }
.am-bloque { padding: 18px 16px 0; }
.am-bloque[hidden] { display: none; }
.am-tit { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.am-tit h2 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: -.01em; color: var(--am-tinta); flex: 1 1 auto; }
.am-ver { border: 0; background: none; color: var(--am-violeta); font: inherit; font-weight: 800; font-size: 14px; padding: 4px 0; cursor: pointer; }
.am-cuenta-juegos { font-weight: 800; font-size: 13px; color: var(--am-suave); background: #e9e3f7; border-radius: 999px; padding: 2px 10px; }

/* ---------- tarjetas de juego ---------- */
.am-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .am-rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.am-juego { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: var(--c, #7c3aed); cursor: pointer; text-align: left; font: inherit; color: #fff;
  box-shadow: 0 6px 16px rgba(30, 10, 70, .16); transition: transform .12s ease; aspect-ratio: 4 / 3.4; }
.am-juego:active { transform: scale(.96); }
.am-cover { position: absolute; inset: 0; background-size: cover; background-position: center; display: grid; place-items: center; }
.am-cover em { font-style: normal; font-size: 54px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3)); }
.am-datos { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 1px; padding: 26px 12px 10px; background: linear-gradient(to top, rgba(15, 8, 35, .88) 0%, rgba(15, 8, 35, .55) 55%, transparent 100%); }
.am-datos strong { font-size: 16.5px; font-weight: 900; line-height: 1.15; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.am-datos small { font-size: 12px; font-weight: 700; opacity: .88; }
.am-carrusel { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-left: 16px; }
.am-carrusel::-webkit-scrollbar { display: none; }
.am-carrusel > * { flex: none; scroll-snap-align: start; }
.am-juego.ancha { width: min(68vw, 270px); aspect-ratio: 16 / 10; border-radius: 22px; }
.am-juego.ancha .am-datos strong { font-size: 19px; }
.am-juego.mini { width: 118px; aspect-ratio: 1 / 1; border-radius: 18px; }
.am-juego.mini .am-datos { padding: 18px 9px 8px; }
.am-juego.mini .am-datos strong { font-size: 13.5px; }
.am-juego.mini .am-datos small { display: none; }
.am-vacio { text-align: center; color: var(--am-suave); font-weight: 700; padding: 18px 8px; display: grid; gap: 12px; justify-items: center; }
.am-vacio[hidden] { display: none; }
.am-vacio p { margin: 0; }

/* ---------- mesas ---------- */
.am-mesa { display: flex; align-items: center; gap: 10px; width: min(74vw, 280px); padding: 10px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(30, 10, 70, .1); font: inherit; text-align: left; cursor: pointer; color: var(--am-tinta); }
.am-mesa-img { flex: none; width: 58px; height: 58px; border-radius: 14px; background: #ddd6fe center / cover; }
.am-mesa-t { display: grid; min-width: 0; }
.am-mesa-t strong, .am-lista-mesas strong { font-size: 15.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-mesa-t small, .am-lista-mesas small { font-size: 12.5px; color: var(--am-suave); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-mesa-t em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--am-suave); }
.am-mesa-t em.libre { color: #15803d; }
.am-codigo { margin: 16px 16px 0; padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(30, 10, 70, .08); display: grid; gap: 10px; }
.am-codigo label { font-weight: 900; font-size: 16px; }
.am-codigo div { display: flex; gap: 10px; }
.am-codigo .am-btn { flex: none; }
.am-codigo input { flex: 1 1 0; width: 0; min-width: 0; padding: 0 0 0 .3em; box-sizing: border-box; height: 52px; border: 2px solid #ddd6fe; border-radius: 14px; text-align: center; font: inherit; font-size: 24px; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; color: var(--am-tinta); background: #faf8ff; outline: 0; }
.am-codigo input:focus { border-color: var(--am-violeta); }
.am-lista-mesas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.am-lista-mesas li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(30, 10, 70, .08); }
.am-lista-mesas li > div { flex: 1 1 auto; min-width: 0; display: grid; }

/* ---------- botones ---------- */
.am-btn { border: 0; border-radius: 14px; padding: 0 20px; height: 52px; font: inherit; font-size: 16px; font-weight: 900; color: #fff; cursor: pointer;
  background: linear-gradient(120deg, var(--am-violeta), var(--am-rosa)); box-shadow: 0 6px 16px rgba(124, 58, 237, .32); }
.am-btn:active { transform: scale(.97); }
.am-btn:disabled { opacity: .6; }
.am-btn.pequeno { height: 42px; padding: 0 16px; font-size: 14.5px; border-radius: 12px; flex: none; }
.am-btn.grande { width: 100%; height: 56px; font-size: 17.5px; border-radius: 16px; }
.am-btn.claro { background: #ede9fe; color: var(--am-violeta-osc); box-shadow: none; }

/* ---------- pestañas de abajo ---------- */
html.modo-app .am-tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 6px 8px calc(6px + var(--am-abajo)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); box-shadow: 0 -6px 24px rgba(30, 10, 70, .12); border-radius: 22px 22px 0 0; }
html.modo-app body[data-vista="partida"] .am-tabs, html.modo-app body[data-vista="espera"] .am-tabs { display: none; }
.am-tabs button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 800; color: #8f88a6; cursor: pointer; border-radius: 14px; }
.am-tabs .i { font-size: 22px; line-height: 1; filter: grayscale(1) opacity(.65); transition: transform .15s; }
.am-tabs button.activa { color: var(--am-violeta); }
.am-tabs button.activa .i { filter: none; transform: translateY(-2px) scale(1.12); }
.am-globo { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--am-rosa); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-sizing: border-box; }
.am-globo[hidden] { display: none; }

/* ---------- hoja de un juego ---------- */
html.modo-app body.am-con-hoja { overflow: hidden; }
.am-capa { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 8, 50, .55); animation: am-aparece .18s ease-out; }
.am-hoja { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: #fff; border-radius: 26px 26px 0 0; animation: am-sube .26s cubic-bezier(.2, .9, .3, 1); overscroll-behavior: contain; }
.am-hoja-cover { position: relative; height: min(46vw, 230px); background: var(--c, #7c3aed) center / cover; border-radius: 26px 26px 0 0; }
.am-cerrar { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(15, 8, 35, .55); color: #fff; font-size: 17px; font-weight: 900; cursor: pointer; display: grid; place-items: center; }
.am-cerrar.oscuro { background: #ede9fe; color: var(--am-violeta-osc); }
.am-hoja-cuerpo { padding: 16px 20px calc(22px + var(--am-abajo)); display: grid; gap: 10px; }
.am-etq { justify-self: start; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--am-violeta); background: #ede9fe; border-radius: 999px; padding: 4px 10px; }
.am-hoja-cuerpo h2 { margin: 0; font-size: 27px; font-weight: 900; letter-spacing: -.02em; color: var(--am-tinta); }
.am-hoja-cuerpo > p { margin: 0; font-size: 15.5px; line-height: 1.45; color: #4b4560; font-weight: 600; }
.am-jugadores { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.am-jugadores > span { font-weight: 900; font-size: 15px; }
.am-num { display: flex; gap: 8px; flex-wrap: wrap; }
.am-num button { width: 46px; height: 46px; border-radius: 14px; border: 2px solid #ddd6fe; background: #faf8ff; font: inherit; font-size: 17px; font-weight: 900; color: var(--am-tinta); cursor: pointer; }
.am-num button.activa { border-color: var(--am-violeta); background: var(--am-violeta); color: #fff; }
.am-acciones { display: grid; gap: 10px; margin-top: 8px; }
.am-hoja-cuerpo > p.am-nota { font-size: 13px; color: var(--am-suave); }
.am-reglas { border-radius: 14px; background: #f7f4fd; padding: 0 14px; }
.am-reglas summary { padding: 13px 0; font-weight: 900; font-size: 15px; cursor: pointer; color: var(--am-tinta); }
.am-reglas p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #4b4560; }
@keyframes am-aparece { from { opacity: 0; } }
@keyframes am-sube { from { transform: translateY(40%); opacity: .4; } }

/* ---------- cuenta ---------- */
.am-perfil { display: flex; align-items: center; gap: 14px; margin: 16px; padding: 18px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, var(--am-violeta-osc), var(--am-violeta) 60%, var(--am-rosa)); box-shadow: 0 10px 24px rgba(91, 33, 182, .25); }
.am-perfil .av.grande { width: 64px; height: 64px; font-size: 24px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.am-perfil > div { display: grid; flex: 1 1 auto; min-width: 0; }
.am-perfil strong { font-size: 21px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-perfil small { font-weight: 700; opacity: .9; }
.am-perfil .am-btn { background: #fff; color: var(--am-violeta-osc); box-shadow: none; height: 44px; }
.am-opciones { list-style: none; margin: 0 16px; padding: 4px 0; border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(30, 10, 70, .08); }
.am-opciones li[hidden] { display: none; }
.am-opciones li + li { border-top: 1px solid #f0ebfa; }
.am-opciones a, .am-opciones button { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 15px 16px; border: 0; background: none; font: inherit; font-size: 15.5px; font-weight: 800; color: var(--am-tinta); text-decoration: none; text-align: left; cursor: pointer; }
.am-opciones span { font-size: 20px; width: 26px; text-align: center; }
.am-opciones i { margin-left: auto; font-style: normal; font-size: 22px; color: #c4bcd9; }
.am-opciones .peligro { color: #be123c; }
.am-pie { margin: 16px 20px; font-size: 12px; line-height: 1.5; color: var(--am-suave); text-align: center; }

/* ---------- entrar / crear cuenta ---------- */
.am-login { position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: linear-gradient(160deg, var(--am-violeta-osc), var(--am-violeta) 50%, var(--am-rosa)); display: flex; align-items: flex-start; justify-content: center; padding: calc(24px + var(--am-arriba, 0px)) 16px calc(24px + var(--am-abajo, 0px)); animation: am-aparece .2s ease-out; }
.am-login-caja { position: relative; width: 100%; max-width: 420px; margin: auto 0; padding: 26px 20px 18px; border-radius: 26px; background: #fff; box-shadow: 0 24px 60px rgba(20, 8, 50, .4); display: grid; gap: 8px; justify-items: center; text-align: center; }
.am-login-caja > img { border-radius: 20px; box-shadow: 0 8px 20px rgba(124, 58, 237, .3); }
.am-login-caja h2 { margin: 6px 0 0; font-size: 25px; font-weight: 900; color: var(--am-tinta); letter-spacing: -.02em; }
.am-login-sub { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--am-suave); }
.am-modos { display: grid; grid-template-columns: 1fr 1fr; width: 100%; padding: 4px; border-radius: 14px; background: #f0ebfa; box-sizing: border-box; }
.am-modos button { border: 0; background: none; height: 42px; border-radius: 11px; font: inherit; font-size: 15px; font-weight: 900; color: var(--am-suave); cursor: pointer; }
.am-modos button.activa { background: #fff; color: var(--am-violeta-osc); box-shadow: 0 2px 8px rgba(30, 10, 70, .12); }
.am-login form { width: 100%; display: grid; gap: 12px; margin-top: 8px; text-align: left; }
.am-login label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 900; color: var(--am-tinta); }
.am-login label[hidden] { display: none; }
.am-login input:not([type="checkbox"]), .am-login select { height: 50px; padding: 0 14px; border: 2px solid #e4dcf5; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 700; color: var(--am-tinta); background: #faf8ff; outline: 0; width: 100%; box-sizing: border-box; }
.am-login input:focus, .am-login select:focus { border-color: var(--am-violeta); background: #fff; }
.am-login label.am-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; font-size: 13px; line-height: 1.4; color: #4b4560; }
.am-check input { width: 22px; height: 22px; flex: none; accent-color: var(--am-violeta); margin: 0; }
.am-check a { color: var(--am-violeta); font-weight: 900; }
.am-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff1f2; color: #be123c; font-weight: 800; font-size: 14px; }
.am-error[hidden] { display: none; }
.am-luego { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 800; color: var(--am-suave); padding: 12px; cursor: pointer; }

/* ---------- sala de espera y partida dentro de la app ---------- */
html.modo-app #vista-espera .cabeza h1 { font-size: 24px; }
html.modo-app body.pantalla-completa #vista-partida { padding-top: calc(8px + var(--am-arriba)); padding-bottom: calc(8px + var(--am-abajo)); }
@media (prefers-reduced-motion: reduce) { .am-capa, .am-hoja, .am-login { animation: none; } }

/* ---------- interruptores de la cuenta (sonidos, vibración) ---------- */
.am-interruptor { display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-size: 15.5px; font-weight: 800; color: var(--am-tinta); cursor: pointer; }
.am-interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.am-interruptor b { margin-left: auto; width: 50px; height: 30px; border-radius: 999px; background: #d9d2ea; position: relative; transition: background .18s; flex: none; }
.am-interruptor b::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .18s; }
.am-interruptor input:checked + b { background: var(--am-violeta); }
.am-interruptor input:checked + b::after { transform: translateX(20px); }
.am-interruptor input:focus-visible + b { outline: 3px solid #c4b5fd; outline-offset: 2px; }

/* ---------- efectos comunes de las partidas (efectos.js) ---------- */
.fx-piedra { position: fixed; z-index: 70; width: 14px; height: 12px; border-radius: 50% 50% 46% 54% / 60% 58% 42% 40%; pointer-events: none;
  background: radial-gradient(circle at 34% 28%, #fff3c4, #f2b33d 55%, #9a5b0a); box-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.fx-confeti { position: fixed; inset: 0; z-index: 75; pointer-events: none; overflow: hidden; }
.fx-confeti i { position: absolute; top: -24px; width: 10px; height: 16px; border-radius: 3px; animation: fx-cae 2.4s linear forwards; }
@keyframes fx-cae { to { top: 110%; transform: rotate(720deg); } }

/* ---------- la partida dentro de la app ---------- */
/* Tocar una carta o un botón responde al dedo */
html.modo-app .mano .carta.jugable:active, html.modo-app .botones .btn:active { transform: translateY(-4px) scale(1.04); }
html.modo-app .botones .btn { min-height: 50px; font-weight: 900; }
html.modo-app .botones .btn:not(.fantasma):not(.peligro) { box-shadow: 0 6px 16px rgba(124, 58, 237, .45); }
/* Mi turno: la placa y la mano se iluminan */
html.modo-app .mi-placa.turno { box-shadow: 0 0 0 2px #fde047, 0 0 22px 2px rgba(253, 224, 71, .5); }
html.modo-app .asiento.turno .av { box-shadow: 0 0 0 3px #fde047, 0 0 16px 3px rgba(253, 224, 71, .6); }
/* Cabecera de la partida: marcadores de pareja más grandes */
html.modo-app body.pantalla-completa #vista-partida > .cabeza .pastilla.de-equipo { font-size: 14.5px; padding: 7px 13px 10px; }

/* ---------- entrar con Google ---------- */
.am-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; margin-top: 8px; border: 2px solid #e4dcf5; border-radius: 14px; background: #fff; font: inherit; font-size: 16px; font-weight: 900; color: var(--am-tinta); cursor: pointer; }
.am-google[hidden], .am-o[hidden] { display: none; }
.am-google:active { background: #f7f4fd; }
.am-o { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; color: var(--am-suave); font-size: 12.5px; font-weight: 800; }
.am-o::before, .am-o::after { content: ""; flex: 1; height: 1px; background: #e4dcf5; }

/* ---------- amigos ---------- */
.am-busca-amigo input { text-align: left; font-size: 17px; letter-spacing: 0; text-transform: none; padding: 0 14px; }
.am-personas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.am-personas[hidden] { display: none; }
.am-personas li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(30, 10, 70, .08); }
.am-busca-amigo .am-personas li { box-shadow: none; background: #faf8ff; }
.am-personas li > div { flex: 1 1 auto; min-width: 0; display: grid; }
.am-personas strong { font-size: 15.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--am-tinta); }
.am-personas small { font-size: 12.5px; color: var(--am-suave); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-personas li.on small { color: #15803d; }
.am-personas li.vacia { display: block; text-align: center; color: var(--am-suave); font-weight: 700; font-size: 14px; }
.am-av { position: relative; flex: none; display: grid; }
.am-av .av { width: 44px; height: 44px; font-size: 16px; }
.am-av i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #c4bfd6; border: 2.5px solid #fff; }
.am-personas li.on .am-av i { background: #22c55e; }
.am-personas .am-btn.pequeno { padding: 0 13px; }
.am-personas .am-btn.mini { width: 42px; padding: 0; }
.am-hoja-simple { padding-top: 6px; }
.am-hoja-tit { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 0; }
.am-hoja-tit h2 { margin: 0; font-size: 22px; font-weight: 900; color: var(--am-tinta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-hoja-tit .am-cerrar { position: static; flex: none; }
.am-btn.peligro { color: #b91c1c; background: #fee2e2; }

/* ---------- editar perfil ---------- */
.am-perfil #am-editar { flex: none; }
.am-login .am-foto { justify-items: center; gap: 8px; cursor: pointer; margin-top: 6px; }
.am-foto .av.grande { width: 104px; height: 104px; font-size: 38px; box-shadow: 0 0 0 4px #ede9fe; }
.am-foto b { padding: 8px 14px; border-radius: 999px; background: #ede9fe; color: var(--am-violeta-osc); font-size: 14px; }
.am-login input:disabled { opacity: .6; }
/* Cabecera de la partida en móviles estrechos: que quepan los dos marcadores, la charla, «?» y Salir */
@media (max-width: 400px) {
  html.modo-app body.pantalla-completa #vista-partida > .cabeza .pastilla.de-equipo { font-size: 13px; padding: 6px 8px 9px; gap: 4px; }
  html.modo-app body.pantalla-completa #vista-partida > .cabeza .btn.pequeno { padding-left: 9px; padding-right: 9px; }
  html.modo-app body.pantalla-completa #vista-partida > .cabeza .btn-reglas { padding: 0; }
}

/* ================= monedas (app) ================= */
.am-monedas { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 9px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .2); color: #fff; font: inherit; font-weight: 900; font-size: 15px; }
.am-monedas[hidden] { display: none; }
.am-monedas .moneda { width: 20px; height: 20px; }

/* ================= chat con un amigo (app) ================= */
.am-personas li.toca { cursor: pointer; }
.am-personas .am-btn.chat { position: relative; }
.am-personas .am-btn.chat .am-globo { top: -6px; left: auto; right: -6px; }
.am-chat { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #f4f1fb; height: 100dvh; }
.am-chat header { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 6px; color: #fff;
  background: linear-gradient(120deg, var(--am-violeta-osc), var(--am-violeta)); box-shadow: 0 2px 10px rgba(30, 10, 70, .25); }
.am-chat header > div { flex: 1 1 auto; min-width: 0; display: grid; }
.am-chat header strong { font-size: 16.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-chat header small { font-size: 12.5px; font-weight: 700; opacity: .85; }
.am-chat header .am-av .av { width: 38px; height: 38px; font-size: 14px; }
.am-chat-atras { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 34px; line-height: 1; padding: 0 0 5px; cursor: pointer; }
.am-chat header .am-btn { flex: none; background: #fff; color: var(--am-violeta-osc); }
.am-chat-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.am-chat-msgs li { display: flex; }
.am-chat-msgs li.mio { justify-content: flex-end; }
.am-chat-msgs li.dia, .am-chat-msgs li.vacio { justify-content: center; color: var(--am-suave); font-size: 12.5px; font-weight: 800; padding: 6px 0; text-align: center; }
.am-chat-msgs li.dia span { background: #e7e1f7; border-radius: 999px; padding: 3px 12px; }
.am-chat-msgs li.vacio { font-size: 14.5px; padding: 30px 20px; }
.am-burbuja { max-width: 82%; display: grid; gap: 4px; padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: #fff; color: var(--am-tinta);
  box-shadow: 0 2px 6px rgba(30, 10, 70, .08); font-size: 15.5px; line-height: 1.38; overflow-wrap: anywhere; }
.am-chat-msgs li.mio .am-burbuja { border-radius: 18px 18px 6px 18px; background: var(--am-violeta); color: #fff; }
.am-burbuja img { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; }
.am-burbuja time { justify-self: end; font-size: 11px; font-weight: 700; opacity: .6; }
.am-chat form { flex: none; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #fff; box-shadow: 0 -2px 10px rgba(30, 10, 70, .08); }
.am-chat form input { flex: 1 1 auto; min-width: 0; height: 46px; border: 2px solid #e4def5; border-radius: 999px; padding: 0 16px; font: inherit; font-size: 16px; background: #faf8ff; color: var(--am-tinta); }
.am-chat form input:focus { outline: none; border-color: var(--am-violeta); }
.am-chat form .am-btn { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 18px; }
body.am-con-chat { overflow: hidden; }
