/* Pappitas — "Tu mundo en vivo" (Dashboard del suscriptor). Ver live-world.js */
.pw { --pw-text: #0d0e11; --pw-sub: #5a6070; --pw-line: rgb(13 14 17 / .08); --pw-acc: #476300; --pw-glass: rgb(255 255 255 / .62); --pw-bg: #eef1f5;
  position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: 6px 18px; height: 470px; margin: 0 0 22px; padding: 22px 24px 22px 28px; border-radius: 24px; color: var(--pw-text);
  background:
    radial-gradient(55% 75% at 74% 55%, rgb(198 244 50 / .30), transparent 64%),
    radial-gradient(45% 70% at 4% 100%, rgb(139 92 246 / .16), transparent 62%),
    radial-gradient(35% 45% at 0% 0%, rgb(56 189 248 / .12), transparent 62%),
    linear-gradient(160deg, #f6f8fb, var(--pw-bg));
  box-shadow: 0 0 0 1px var(--pw-line), 0 24px 50px -36px rgb(30 40 70 / .45); }
[data-theme="dark"] .pw { --pw-text: #fff; --pw-sub: rgb(255 255 255 / .62); --pw-line: rgb(255 255 255 / .09); --pw-acc: #c6f432; --pw-glass: rgb(22 25 33 / .55); --pw-bg: #07080c;
  background:
    radial-gradient(55% 75% at 74% 55%, rgb(198 244 50 / .15), transparent 64%),
    radial-gradient(45% 70% at 4% 100%, rgb(139 92 246 / .22), transparent 62%),
    radial-gradient(35% 45% at 0% 0%, rgb(56 189 248 / .09), transparent 62%),
    linear-gradient(160deg, #0e1119, var(--pw-bg)); }
body.pw-client #dash-live { display: none !important; }

.pw-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; position: relative; z-index: 3; }
.pw-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--pw-text); }
.pw-title i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pwPulse 1.8s infinite; }
@keyframes pwPulse { 0% { box-shadow: 0 0 0 0 rgb(34 197 94 / .55); } 70%, 100% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); } }
.pw-sp { flex: 1; }
.pw-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--pw-glass); box-shadow: inset 0 0 0 1px var(--pw-line); backdrop-filter: blur(14px); font-size: 13px; font-weight: 700; color: var(--pw-sub); white-space: nowrap; }
.pw-pill b { color: var(--pw-text); font-weight: 900; }
.pw-pill svg, .pw-ib svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.pw-pill[hidden] { display: none; }
.pw-ib { width: 36px; height: 36px; flex: none; border: 0; border-radius: 12px; background: var(--pw-glass); box-shadow: inset 0 0 0 1px var(--pw-line); backdrop-filter: blur(14px); color: var(--pw-text); cursor: pointer; display: grid; place-items: center; }
.pw-ib:hover { background: rgb(198 244 50 / .35); }

.pw-left { position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-height: 0; }
.pw-money small { font-size: 14px; font-weight: 800; color: var(--pw-sub); }
.pw-money b { display: block; margin-top: 6px; font-size: clamp(46px, 5vw, 84px); line-height: .92; font-weight: 900; letter-spacing: -.055em; font-variant-numeric: tabular-nums; color: var(--pw-text); white-space: nowrap; }
.pw-money b sup { font-size: .38em; vertical-align: 1.15em; letter-spacing: -.02em; color: var(--pw-sub); margin-left: 2px; }
.pw-money p { margin: 10px 0 0; font-size: 14.5px; font-weight: 700; color: var(--pw-sub); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pw-money p strong { color: var(--pw-text); }
.pw-delta { font-style: normal; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 900; background: #c6f432; color: #0b0c0f; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.pw-delta.on { opacity: 1; transform: none; }

.pw-feed { max-width: 460px; padding: 6px 16px 6px; border-radius: 22px; background: var(--pw-glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 0 0 1px var(--pw-line), 0 22px 44px -30px rgb(30 40 70 / .45); }
[data-theme="dark"] .pw-feed { box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), inset 0 0 0 1px var(--pw-line), 0 22px 44px -30px rgb(0 0 0 / .7); }
.pw-feed-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 4px; }
.pw-feed h4 { margin: 0; font-size: 13px; font-weight: 800; color: var(--pw-text); }
.pw-feed-h button { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 12.5px; font-weight: 800; color: var(--pw-sub); cursor: pointer; }
.pw-feed-h button:hover { color: var(--pw-text); }
#pw-list { display: flex; flex-direction: column; }
.pw-ord { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--pw-line); }
.pw-ord:last-child { border-bottom: 0; }
.pw[data-mode="master"] .pw-empty, .pw[data-mode="master"] #pw-all { display: none !important; }
.pw-feed[hidden] { display: none !important; }
.pw-ord.new { animation: pwDrop .55s cubic-bezier(.2, 1.3, .3, 1); }
.pw-ord.new em { color: var(--pw-acc); }
.pw-ord.new .pw-th { box-shadow: 0 0 0 3px var(--pw-bg), 0 0 0 5px #c6f432; }
@keyframes pwDrop { from { opacity: 0; transform: translateY(-10px); } }
.pw-th { position: relative; overflow: hidden; width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-style: normal; transition: box-shadow 1.2s ease;
  background: color-mix(in srgb, var(--pw-text) 6%, transparent); color: var(--pw-text); box-shadow: inset 0 0 0 1px var(--pw-line); }
.pw-th svg { width: 19px; height: 19px; opacity: .85; }
.pw-th.pw-src-wa { color: #1fae55; background: rgb(37 211 102 / .12); }
.pw-th.pw-src-store { color: var(--pw-acc); background: rgb(198 244 50 / .22); }
[data-theme="dark"] .pw-th.pw-src-store { background: rgb(198 244 50 / .14); }
.pw-th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pw-ord span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pw-ord span b { font-size: 14px; font-weight: 800; color: var(--pw-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-ord span small { font-size: 12px; font-weight: 600; color: var(--pw-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-ord em { font-style: normal; font-weight: 900; font-size: 15px; color: var(--pw-text); font-variant-numeric: tabular-nums; white-space: nowrap; transition: color 1.2s ease; }

.pw-empty { display: none; }
.pw.is-empty .pw-feed { display: none; }
.pw.is-empty .pw-empty { display: block; }
.pw-empty button { height: 46px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--pw-text); color: var(--pw-bg); font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer; }

.pw-stage { position: relative; z-index: 1; min-height: 0; }
.pw-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pw-pop { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 14px)); display: flex; align-items: center; gap: 8px; white-space: nowrap; pointer-events: none; animation: pwIn .5s cubic-bezier(.2, 1.4, .3, 1); }
.pw-pop.out { animation: pwOut .5s ease forwards; }
@keyframes pwIn { from { opacity: 0; transform: translate(-50%, calc(-100% + 4px)) scale(.85); } }
@keyframes pwOut { to { opacity: 0; transform: translate(-50%, calc(-100% - 34px)); } }
.pw-pop .pw-th { width: 32px; height: 32px; border-radius: 10px; background: var(--pw-bg); box-shadow: inset 0 0 0 1px var(--pw-line), 0 8px 18px -6px rgb(0 0 0 / .35); }
.pw-pop .pw-th svg { width: 17px; height: 17px; }
.pw-pop span { display: flex; flex-direction: column; line-height: 1.2; }
.pw-pop b { font-size: 17px; font-weight: 900; color: var(--pw-text); text-shadow: 0 0 10px var(--pw-bg), 0 0 18px var(--pw-bg); }
.pw-pop small { font-size: 12px; font-weight: 800; color: var(--pw-sub); text-shadow: 0 0 8px var(--pw-bg), 0 0 14px var(--pw-bg); }

.pw-goal { position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; pointer-events: none; }
.pw-goal.on { display: flex; animation: pwVeil 3.6s ease forwards; }
@keyframes pwVeil { 0%, 100% { background: transparent; backdrop-filter: blur(0); } 12%, 82% { background: color-mix(in srgb, var(--pw-bg) 72%, transparent); backdrop-filter: blur(14px); } }
.pw-goal div { display: flex; flex-direction: column; align-items: center; transform: scale(.6); opacity: 0; }
.pw-goal.on div { animation: pwGoal 3.6s cubic-bezier(.2, 1.3, .3, 1) forwards; }
@keyframes pwGoal { 14% { transform: scale(1.03); opacity: 1; } 22%, 82% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.04); opacity: 0; } }
.pw-goal small { font-size: 14px; font-weight: 900; padding: 6px 14px; border-radius: 999px; background: #c6f432; color: #0b0c0f; }
.pw-goal b { margin-top: 12px; font-size: clamp(64px, 10vw, 180px); font-weight: 900; letter-spacing: -.055em; line-height: 1; color: var(--pw-text); text-shadow: 0 0 80px rgb(198 244 50 / .55); }
.pw-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }

/* Pantalla completa */
.pw.pw-max { position: fixed; inset: 0; z-index: 10050; height: 100vh; height: 100dvh; margin: 0; border-radius: 0; padding: 26px 32px 30px 40px; grid-template-columns: minmax(340px, 36%) minmax(0, 1fr); }
.pw.pw-max .pw-money b { font-size: clamp(60px, 7.2vw, 128px); }
.pw.pw-max .pw-title { font-size: 17px; }
html.pw-lock, html.pw-lock body { overflow: hidden; }

/* Celular: compacto (cifra a la izquierda, planeta chico a la derecha, un solo pedido) */
@media (max-width: 720px) {
  .pw { grid-template-columns: minmax(0, 1fr) 42%; grid-template-rows: auto auto auto; height: auto; gap: 4px 6px; padding: 14px 14px 12px 16px; border-radius: 20px; margin-bottom: 16px; }
  .pw-pill span { display: none; }
  .pw-left { display: contents; }
  .pw-money { grid-column: 1; grid-row: 2; align-self: center; }
  .pw-money b { font-size: clamp(34px, 11vw, 46px); }
  .pw-money p { font-size: 12.5px; margin-top: 6px; }
  .pw-stage { grid-column: 2; grid-row: 2; height: 150px; }
  .pw-feed, .pw-empty { grid-column: 1 / -1; grid-row: 3; }
  .pw-feed h4 { display: none; }
  #pw-list { max-width: none; }
  .pw-ord:nth-child(n+2) { display: none; }
  .pw-feed { max-width: none; padding: 2px 12px; border-radius: 16px; }
  .pw-feed-h { display: none; }
  .pw-ord { padding: 9px 0; border: 0; }
  .pw-empty { padding-top: 8px; } .pw-empty button { width: 100%; height: 44px; }
  .pw-pop { display: none; }
  .pw-delta { display: none; }
  .pw-money p { display: block; line-height: 1.35; }
  .pw.pw-max { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; padding: max(18px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); gap: 10px; }
  .pw.pw-max .pw-money { grid-column: 1; grid-row: 2; }
  .pw.pw-max .pw-money b { font-size: clamp(44px, 14vw, 64px); }
  .pw.pw-max .pw-stage { grid-column: 1; grid-row: 3; height: auto; }
  .pw.pw-max .pw-feed, .pw.pw-max .pw-empty { grid-row: 4; }
  .pw.pw-max .pw-ord:nth-child(-n+3) { display: flex; }
  .pw.pw-max .pw-pop { display: flex; }
  .pw.pw-max .pw-delta { display: inline-block; }
}
@media (prefers-reduced-motion: reduce) { .pw-title i { animation: none; } .pw-ord.new, .pw-pop { animation: none; } }

/* Nada se sale por la derecha (lista de pedidos) y la X para salir de pantalla completa siempre a la vista */
.pw > *, .pw-left > * { min-width: 0; }
.pw-feed { max-width: min(460px, 100%); box-sizing: border-box; }
.pw-ord em { flex: none; }
.pw-ord .pw-th { flex: none; }
.pw-top { min-width: 0; }
.pw-title { min-width: 0; overflow: hidden; }
.pw-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-top .pw-ib { flex: none; }
.pw.pw-max .pw-top .pw-ib { width: 42px; height: 42px; border-radius: 50%; background: var(--pw-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--pw-line), 0 8px 20px -10px rgb(0 0 0 / .35); }
@media (max-width: 720px) {
  .pw { grid-template-columns: minmax(0, 1fr) 42%; }
  .pw.pw-max .pw-feed { max-width: none; }
  .pw.pw-max .pw-top .pw-ib { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 5; }
  .pw.pw-max .pw-top { padding-right: 52px; }
}

/* Cargando (solo la primera vez, sin datos guardados): esqueleto suave en vez de huecos */
.pw.pw-loading .pw-feed, .pw.pw-loading .pw-empty, .pw.pw-loading .pw-money p { visibility: hidden; }
.pw.pw-loading #pw-rev { width: min(240px, 70%); height: .9em; border-radius: 14px; background: linear-gradient(90deg, var(--pw-line), rgb(127 127 127 / .14), var(--pw-line)); background-size: 200% 100%; animation: pwSk 1.2s linear infinite; }
@keyframes pwSk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
