/* ═════════════ 👤 Perfil, ranking, medallas, tienda, duelo y configuración ═════════════ */

/* ---------- banderas ---------- */
.flag { width: 20px; height: 15px; flex: none; border-radius: 3px; object-fit: cover; vertical-align: -2px; margin-right: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.25); background: rgba(42,28,14,.12); }
.flag.none { display: inline-block; }
.flag.big { width: 44px; height: 33px; border-radius: 5px; margin: 0; }
.seg-b .flag { width: 17px; height: 13px; margin-right: 4px; }

/* ---------- sub-pestañas (Configuración, Tienda) ---------- */
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 860px) { .sub-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; } .sub-tabs::-webkit-scrollbar { display: none; } .sub-tab { flex: none; } }
.sub-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 800 13.5px 'Nunito', sans-serif; color: var(--p1); background: rgba(0,0,0,.28); border: 1px solid rgba(201,162,74,.35); transition: background .15s; }
.sub-tab .ic { width: 16px; height: 16px; color: var(--g3); }
.sub-tab:hover { background: rgba(236,208,138,.12); }
.sub-tab.on { background: linear-gradient(var(--p1), var(--p3)); color: var(--ink2); border-color: var(--g1); }
.sub-tab.on .ic { color: #6b4421; }

/* ---------- configuración ---------- */
.pnum { margin-left: auto; font: 800 13px 'Nunito', sans-serif !important; opacity: .7 !important; }
.pais-sel { display: flex; align-items: center; gap: 4px; }
.pais-sel select { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--g1); background: #fffaf0; color: var(--ink2); font: 700 14px 'Nunito', sans-serif; }
.lang-seg .seg-b, .track-seg .seg-b { flex: 1; padding: 8px 6px; }
.track-seg .seg-b { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.track-seg .seg-b small { font-size: 10.5px; font-weight: 700; opacity: .7; }
.patch-list { display: grid; gap: 10px; max-width: 860px; }
.patch header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.patch .pv { font: 900 20px 'Cinzel', serif; }
.patch header span { font-size: 13px; font-weight: 700; opacity: .7; }
.patch header em { margin-left: auto; font: 800 11px 'Nunito', sans-serif; font-style: normal; text-transform: uppercase; letter-spacing: .8px; padding: 2px 8px; border-radius: 6px; background: #3d8a2e; color: #fff; }
.patch ul, .doc ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.patch:not(.new) { opacity: .92; }
.doc { max-width: 860px; font-size: 14.5px; line-height: 1.55; font-weight: 600; }
.doc h4 { margin: 14px 0 6px; font: 700 16px 'Cinzel', serif; }
.doc p { margin: 0 0 8px; }
.doc .contact { display: flex; align-items: center; gap: 6px; }

/* ---------- ranking ---------- */
.rk-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 12px; align-items: start; }
.rk-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pf-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pf-av { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(42,28,14,.08); box-shadow: inset 0 0 0 1px rgba(138,106,46,.4); }
.pf-name { flex: 1; min-width: 0; }
.pf-name b { display: block; font: 900 21px/1.1 'Cinzel', serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-name small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 800; opacity: .75; }
.pf-name em { font-style: normal; color: #8a4f12; }
.pf-coins, .coins-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: 900 17px 'Cinzel', serif;
  background: linear-gradient(#fff2c2, #f0c95a); color: #5a3a0a; box-shadow: 0 0 0 1.5px #a07a1e, 0 3px 8px rgba(0,0,0,.25); }
.pf-coins .ic, .coins-pill .ic { width: 20px; height: 20px; color: #8a5a0a; }
.coins-pill small { font: 800 11px 'Nunito', sans-serif; opacity: .75; }
.pf-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-modes span { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 8px; background: rgba(42,28,14,.07); font-size: 13px; font-weight: 800; }
.pf-modes span b { font-size: 11.5px; opacity: .7; }
.pf-modes .bots { opacity: .75; }

.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.md-cell { display: grid; justify-items: center; gap: 3px; padding: 6px 2px 5px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: transparent; font: inherit; color: inherit; }
.md-cell small { font-size: 10.5px; font-weight: 800; line-height: 1.15; text-align: center; opacity: .55; }
.md-cell.got small { opacity: 1; }
.md-cell:hover, .md-cell.sel { background: rgba(42,28,14,.07); border-color: rgba(138,106,46,.4); }
.md-detail { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; min-height: 52px; border-radius: 10px; background: rgba(42,28,14,.06); }
.md-detail b { display: block; font: 700 15px 'Cinzel', serif; }
.md-detail span { display: block; font-size: 13px; font-weight: 700; }
.md-detail small { display: block; font-size: 11.5px; font-weight: 800; opacity: .7; margin-top: 2px; }
.md-detail p { margin: 0; }

.medalla { position: relative; display: inline-block; flex: none; }
.medalla svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.medalla .md-ico { position: absolute; left: 0; right: 0; top: 36%; height: 46%; display: grid; place-items: center; }
.medalla .md-ico .ic { width: 42%; height: auto; color: rgba(60,35,5,.85); stroke-width: 2; }
.medalla.m-plata .md-ico .ic { color: rgba(30,40,60,.85); }
.medalla.no { filter: grayscale(1); opacity: .55; }
.medalla.no .md-ico .ic { color: rgba(40,40,40,.7); width: 34%; }

.rk-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rk-head h3 { margin: 0; }
.rk-ver { margin-left: auto; }
.rk-ver .seg-b, .rk-modos .seg-b { padding: 6px 10px; font-size: 12.5px; display: inline-flex; align-items: center; }
.rk-modos { width: 100%; margin-bottom: 8px; }
.rk-modos .seg-b { flex: 1; justify-content: center; }
.rk-t { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13.5px; font-weight: 700; }
.rk-t th { text-align: left; font: 800 11px 'Nunito', sans-serif; text-transform: uppercase; letter-spacing: .6px; opacity: .65; padding: 0 8px; }
.rk-t th .ic { width: 13px; height: 13px; }
.rk-t td { padding: 7px 8px; background: rgba(42,28,14,.06); }
.rk-t td:first-child { border-radius: 9px 0 0 9px; width: 40px; text-align: center; }
.rk-t td:last-child { border-radius: 0 9px 9px 0; }
.rk-t tr.me td { background: rgba(236,208,138,.45); box-shadow: inset 0 2px 0 var(--g2), inset 0 -2px 0 var(--g2); }
.rk-t .pos .rk-medal { margin: 0 auto; }
.rk-t .who { display: flex; align-items: center; min-width: 0; }
.rk-t .who span { min-width: 0; }
.rk-t .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.rk-t .who small { display: block; font-size: 11px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.rk-foot { margin: 8px 2px 0; font-size: 13px; font-weight: 700; }
.rk-tabla .pub-empty .ic { width: 40px; height: 40px; color: var(--g1); }

/* ---------- tienda ---------- */
.shop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shop-note { color: rgba(247,238,214,.8); margin: 0; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sh-item { display: grid; gap: 8px; padding: 12px; border-radius: 12px; color: var(--ink2); text-align: center;
  background: linear-gradient(170deg, var(--p1), var(--p2)); border: 1px solid var(--g1);
  box-shadow: inset 0 0 0 3px var(--p1), inset 0 0 0 4px rgba(138,106,46,.35), 0 8px 18px rgba(0,0,0,.3); }
.sh-item.on { box-shadow: inset 0 0 0 3px var(--p1), inset 0 0 0 5px #3d8a2e, 0 8px 18px rgba(0,0,0,.3); }
.sh-item .btn { justify-self: center; min-width: 110px; }
.sh-info b { display: block; font: 700 16px 'Cinzel', serif; }
.sh-info small { font-size: 12px; font-weight: 800; opacity: .7; }
.sh-prev { height: 92px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, #2e6b3a, #173d22 80%); box-shadow: inset 0 0 0 3px #7a4f23, inset 0 3px 10px rgba(0,0,0,.5); }
.sh-prev.title { flex-direction: column; gap: 2px; background: radial-gradient(circle at 50% 40%, #3a2412, #1d1108 85%); }
.sh-prev.title small { font: 700 12px 'Nunito', sans-serif; color: rgba(247,238,214,.6); }
.sh-prev.title b { font: 900 18px 'Cinzel', serif; color: var(--g3); text-shadow: 0 2px 0 #000; padding: 0 8px; }
.sh-die { width: 46px; height: 46px; padding: 6px; border-radius: 10px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  background: radial-gradient(circle at 30% 25%, var(--a), var(--b) 58%, var(--c)); box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 8px 12px rgba(0,0,0,.4), inset 0 -2px 4px rgba(0,0,0,.25); }
.sh-die:first-child { transform: rotate(-9deg); } .sh-die:last-child { transform: rotate(7deg) translateY(4px); }
.sh-die i { display: grid; place-items: center; }
.sh-die i.p::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--pa), var(--pb)); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.sh-item.metal .sh-die { box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 8px 12px rgba(0,0,0,.4), inset 0 -2px 4px rgba(0,0,0,.25), inset 2px 2px 6px rgba(255,255,255,.6); }

/* ---------- duelo ---------- */
.home-duel h3 .ic, .home-duel .btn .ic { color: inherit; }
.home-duel .btn.big { width: 100%; }
.duel-search { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.duel-search b { display: block; font: 700 16px 'Cinzel', serif; }
.duel-search small { font-size: 12.5px; font-weight: 700; opacity: .75; }
.duel-radar { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(42,28,14,.1); color: #8a2e1e; }
.duel-radar .ic { width: 24px; height: 24px; }
.duel-radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(138,46,30,.5); animation: radar 1.8s ease-out infinite; }
.duel-radar i + i { animation-delay: .9s; }
@keyframes radar { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .duel-radar i { animation: none; opacity: .4; } }
.home-duel .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.home-duel .row-btns .btn { flex: 1; }
.duel-vs { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 6px 0; }
.dv-p { display: grid; justify-items: center; gap: 4px; padding: 10px 16px; border-radius: 12px; min-width: 120px; background: rgba(42,28,14,.07); box-shadow: inset 0 -4px 0 var(--c); }
.dv-p b { font: 900 18px 'Cinzel', serif; } .dv-p small { font-weight: 800; opacity: .7; }
.dv-p .ic { width: 36px; height: 36px; color: #6b4421; }
.duel-vs em { font: 900 26px 'Cinzel', serif; font-style: normal; color: #8a2e1e; }
.lb .maps.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lb .maps.four .mapprev { width: 60px; height: 52px; }
.mp-duel circle { filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.lb .slot-name .flag { margin-right: 5px; }
.lb .slot-tit { opacity: .75; font-weight: 800; }

/* ---------- medalla nueva (aparece abajo al centro) ---------- */
.medal-pop { position: fixed; left: 50%; bottom: 110px; z-index: 300; display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 14px; border-radius: 16px; max-width: min(92vw, 420px);
  color: var(--ink2); background: linear-gradient(170deg, var(--p1), var(--p2)); border: 1px solid var(--g1);
  box-shadow: inset 0 0 0 3px var(--p1), inset 0 0 0 4px rgba(138,106,46,.35), 0 18px 40px rgba(0,0,0,.5);
  transform: translate(-50%, 30px) scale(.9); opacity: 0; transition: transform .45s cubic-bezier(.2,1.4,.4,1), opacity .3s; pointer-events: none; }
.medal-pop.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.medal-pop small { display: block; font: 800 11px 'Nunito', sans-serif; text-transform: uppercase; letter-spacing: 1px; color: #8a4f12; }
.medal-pop b { display: block; font: 900 19px/1.1 'Cinzel', serif; }
.medal-pop span { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; }
.medal-pop em { display: inline-block; margin-top: 4px; font: 900 12.5px 'Nunito', sans-serif; font-style: normal; color: #5a3a0a; background: #f6d873; padding: 1px 8px; border-radius: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) and (min-width: 861px) { .rk-layout { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .rk-layout { grid-template-columns: 1fr; gap: 10px; }
  .rk-col { gap: 10px; }
  .sub-tab { padding: 7px 11px; font-size: 12.5px; }
  .sub-tab span { white-space: nowrap; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .sh-prev { height: 78px; }
  .sh-die { width: 40px; height: 40px; }
  .lb .maps.four { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .lb .maps.four .mapprev { width: 46px; height: 40px; }
  .medal-pop { bottom: 84px; }
  .rk-ver { margin-left: 0; width: 100%; }
  .rk-ver .seg-b { flex: 1; justify-content: center; }
}
@media (max-width: 520px) {
  .rk-t .hide-s { display: none; }
  .rk-t td, .rk-t th { padding-left: 5px; padding-right: 5px; }
  .rk-t .who b, .rk-t .who small { max-width: 130px; }
  .pf-name b { font-size: 18px; }
  .medal-grid { grid-template-columns: repeat(4, 1fr); }
  .sub-tab .ic { display: none; }
  .lb .maps.four .mapcard b { font-size: 13px; }
  .lb .maps.four .mapcard span { font-size: 10px; }
}
@media (max-width: 380px) { .rk-t .hide-xs { display: none; } .medal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-height: 520px) and (orientation: landscape) {
  .rk-layout { grid-template-columns: 1fr 1.3fr; }
  .medal-pop { bottom: 16px; }
}
.cfg-grid > .lb-card { min-width: 0; }
.cfg-grid .fld { display: grid; min-width: 0; }
.cfg-grid .fld input, .cfg-grid .fld select { width: 100%; min-width: 0; box-sizing: border-box; }
.sh-prev.title small, .sh-prev.title b { letter-spacing: normal; }

/* ---------- 🎨 skins ---------- */
.sk-top { padding: 10px; }
.sk-stage { position: relative; height: 180px; border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2.5vw, 26px); padding: 0 16px 22px;
  background: radial-gradient(120% 90% at 50% 100%, #e2c07c 0 34%, #c9a35c 35% 40%, transparent 41%),
    radial-gradient(circle at 50% 30%, #2f7fb8, #154a75 75%);
  box-shadow: inset 0 0 0 3px #7a4f23, inset 0 4px 14px rgba(0,0,0,.45); overflow: hidden; }
.sk-p svg { display: block; width: 84px; height: 78px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.4)); }
.sk-p.big svg { width: 104px; height: 96px; }
.sk-p.road svg { width: 96px; height: 62px; }
.sk-p.rob svg { width: 76px; height: 92px; }
.sk-dice { display: flex; gap: 6px; margin-left: 6px; }
.sk-dice .sh-die { width: 46px; height: 46px; padding: 6px; }
.sk-dice .sh-die i.p::after { width: 7px; height: 7px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.sk-item { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink2);
  background: linear-gradient(170deg, var(--p1), var(--p2)); border: 1px solid var(--g1); box-shadow: inset 0 0 0 2px var(--p1), 0 6px 14px rgba(0,0,0,.28); transition: transform .12s; }
.sk-item:hover { transform: translateY(-2px); }
.sk-item.sel { box-shadow: inset 0 0 0 2px var(--p1), inset 0 0 0 4px #3d8a2e, 0 6px 14px rgba(0,0,0,.28); }
.sk-art { height: 72px; display: grid; place-items: center; overflow: hidden; }
.sk-art svg { width: 70px; height: 64px; }
.sk-grid.sk-g-robber .sk-art svg { height: 70px; }
.sk-item small { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; }
.sk-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: #3d8a2e; color: #fff; }
.sk-item.sel .sk-check { display: grid; }
.sk-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.sk-dpair { display: flex; gap: 6px; } .sk-dpair .sh-die { width: 40px; height: 40px; }
.style-card .sk-go { margin-top: 10px; }
.shop-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 20px; max-width: 560px; }
.shop-empty .se-ico .ic { width: 54px; height: 54px; color: #8a5a0a; }
.shop-empty b { font: 900 22px 'Cinzel', serif; }
.shop-empty p { margin: 0; font-weight: 700; }
@media (max-width: 520px) {
  .sk-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .sk-art { height: 58px; } .sk-art svg, .sk-grid.sk-g-robber .sk-art svg { width: 54px; height: 54px; }
  .sk-stage { height: 120px; gap: 6px; padding-bottom: 16px; }
  .sk-p svg { width: 44px; height: 42px; } .sk-p.big svg { width: 56px; height: 52px; } .sk-p.road svg { width: 52px; height: 34px; } .sk-p.rob svg { width: 42px; height: 52px; }
  .sk-dice .sh-die { width: 30px; height: 30px; padding: 4px; } .sk-dice .sh-die i.p::after { width: 5px; height: 5px; }
}
