/* Perfil, avatar de la barra, recompensa diaria y guía */
.pf-more { margin-top: 10px; }
.pf-more .btn { flex: 1; }
.bk-text { display: block; width: 100%; box-sizing: border-box; font: 12px/1.35 ui-monospace, Menlo, Consolas, monospace; resize: vertical; word-break: break-all; margin: 6px 0; }
.bk-meta { margin-bottom: 8px; }
.bk-file { display: inline-block; margin: 4px 0 8px; cursor: pointer; }
.bk-sum { margin: 8px 0; }
button.player { background: none; border: 0; padding: 2px; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
button.player:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.player .pinfo { display: grid; gap: 4px; }
.avatar { position: relative; display: inline-block; width: 40px; height: 40px; flex: none; }
.avatar-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center 25%;
  background: radial-gradient(circle at 35% 30%, #6a52c9, #2a1f52); border: 2px solid var(--gold); display: block;
}
.avatar-lv {
  position: absolute; right: -5px; bottom: -4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 99px;
  display: grid; place-items: center; font: 800 11px/1 var(--sans); background: #2a1f52; color: #fff; border: 1.5px solid var(--gold);
}
.coin-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -0.25em; }
.rank-shield { width: 100%; height: 100%; object-fit: contain; }
.rank-mini { width: 15px; height: 18px; object-fit: contain; vertical-align: -0.3em; }

/* Perfil */
.pf-top { display: flex; align-items: center; gap: 14px; }
.pf-avatar .avatar, .pf-avatar .avatar-img { width: 72px; height: 72px; }
.pf-avatar .avatar-lv { min-width: 26px; height: 26px; font-size: 14px; }
.pf-id { flex: 1; min-width: 0; }
.pf-name { font: 700 20px var(--serif); overflow-wrap: anywhere; }
.pf-id .bar { margin: 6px 0 4px; }
.pf-name-row { display: flex; gap: 8px; }
.pf-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 16px;
  background: var(--panel2); color: var(--text); border: 1px solid #3d3558;
}
.pf-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.pf-err { min-height: 20px; margin-top: 6px; font-size: 13px; color: var(--bad); }
.pf-avs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pf-av {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 12px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer;
}
.pf-av.on { border-color: var(--gold); box-shadow: 0 0 14px -5px var(--gold); }
.pf-av-img { width: 52px; height: 52px; object-fit: contain; }
.pf-av.locked { cursor: default; }
.pf-av.locked .pf-av-img { filter: grayscale(1) brightness(.45); }
.pf-av-n { font-size: 13px; font-weight: 700; }
.pf-av-h { font-size: 10.5px; line-height: 1.25; color: var(--muted); }
.pf-av.on .pf-av-h { color: var(--gold); }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-stat { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.pf-stat span { font-size: 11.5px; color: var(--muted); }
.pf-stat b { font-size: 15px; }
.pf-stat small { font-weight: 400; color: var(--muted); }
@media (max-width: 440px) { .pf-av-h { font-size: 10px; } }

/* Tile de recompensa diaria */
.daily-rw .ico { width: 1.15em; height: 1.15em; }
.daily-st { font-size: 12px; }
.daily-dots { display: flex; gap: 4px; margin-top: 2px; }
.dd { width: 12px; height: 6px; border-radius: 3px; background: var(--panel2); border: 1px solid #3d3558; }
.dd.done { background: var(--gold); border-color: var(--gold); }
.dd.now { border-color: var(--gold); animation: ddpulse 1.2s ease-in-out infinite; }
.dd.last { width: 16px; }
@keyframes ddpulse { 50% { background: #6b5518; } }

/* Animación del cofre diario */
.dly { position: absolute; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(6,5,10,0); transition: background .35s, opacity .3s; cursor: pointer; overflow: hidden; }
.dly.in { background: rgba(6,5,10,.78); }
.dly.out { opacity: 0; }
.dly-chest { position: relative; width: 150px; transform: scale(0) rotate(-12deg); }
.dly.in .dly-chest { transform: scale(1); transition: transform .55s cubic-bezier(.3,1.5,.5,1); }
.dly-img { width: 100%; display: block; filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)); }
.dly.shake .dly-chest { animation: dlyshake .18s ease-in-out infinite; }
@keyframes dlyshake { 0%,100% { transform: scale(1) rotate(-5deg); } 50% { transform: scale(1.04) rotate(5deg); } }
.dly-flash { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0%, #ffe9a0 35%, rgba(255,210,90,0) 70%); }
.dly.open .dly-chest { animation: dlypop .5s ease-out forwards; }
.dly.open .dly-img { filter: brightness(1.5) drop-shadow(0 0 24px #ffd45a); }
.dly.open .dly-flash { animation: dlyflash .8s ease-out forwards; }
@keyframes dlypop { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1.05); } }
@keyframes dlyflash { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(14); } }
.dly-txt { display: grid; gap: 4px; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; font-size: 17px; }
.dly-txt b { font-family: var(--serif); font-size: 20px; color: var(--gold); }
.dly.open .dly-txt { opacity: 1; transform: none; transition-delay: .35s; }
.dly-p { position: absolute; width: 26px; height: 26px; pointer-events: none; opacity: 0; }
.dly-p .ico { width: 26px; height: 26px; display: block; filter: drop-shadow(0 0 6px rgba(255,210,90,.8)); }
@media (prefers-reduced-motion: reduce) { .dly { display: none; } }

/* Guía */
.guide-x { margin-left: 8px; padding: 0; background: none; border: 0; color: var(--muted); font: 11px var(--sans); text-transform: none; letter-spacing: 0; text-decoration: underline; cursor: pointer; }
.guide-x:hover { color: var(--text); }
.tile-rank { display: flex; align-items: center; gap: 8px; }
.tile-rank .rank-mini { width: 24px; height: 29px; }
.dly-chest { margin-bottom: 28px; }

/* Celular: la barra superior no puede ensanchar la página. */
@media (max-width: 959px) { #app { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 440px) {
  .topbar .pinfo { display: none; }
  .topbar { gap: 6px; padding-inline: 12px; }
}
