/* Ranked ladder (ladder.js). Uses the pixel skin's tokens and frames from skin.css; .pf-bar / .pf-stats come from profile.css, .db-h from decks.css. */

.lg-emb { flex: none; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 var(--ink)); }
.lg-stars { display: inline-flex !important; flex-direction: row; gap: 2px; vertical-align: middle; white-space: nowrap; }
.lg-stars i { display: inline-block !important; position: static !important; font-style: normal; font-size: 16px; line-height: 1; color: #3a3f63; text-shadow: 2px 2px 0 var(--ink); }
.lg-stars i.on { color: var(--gold); }
.lg-stars i.pop { animation: lg-pop .7s steps(6) .25s both; }
@keyframes lg-pop { 0% { transform: scale(2.2); color: var(--cream); opacity: 0; } 60% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- title menu button ---------- */
#title .menu .lg-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 4px 12px 4px 6px; }
.lg-btn > span { display: grid; min-width: 0; line-height: 1.25; }
.lg-btn b { font-weight: 400; color: var(--cream); }
.lg-btn small { font-size: 12px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- screen ---------- */
#ladder { padding-inline: max(12px, calc((100% - 720px) / 2)); padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); gap: 10px; }
.lg-season { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lg-season b { font-weight: 400; color: var(--gold); font-size: var(--fs-m, 16px); }
.lg-season small { color: var(--dim); font-size: var(--fs-s, 14px); }
.lg-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 8px;
  border: 9px solid transparent; border-image: var(--win-dark) 3 fill / 9px / 0 stretch; }
.lg-id { display: grid; gap: 5px; min-width: 0; }
.lg-tier { font-weight: 400; font-size: 26px; line-height: 1.2; color: var(--tc); text-shadow: 3px 3px 0 var(--ink); }
.lg-id > span:not(.pf-bar) { display: flex; align-items: center; gap: 8px; font-size: var(--fs-m, 16px); color: var(--cream); }
.lg-id .lg-stars i { font-size: 20px; }
.lg-bar i { background: var(--tc); box-shadow: inset 0 2px 0 rgba(255,255,255,.45); }
.lg-id small { font-size: 12px; color: var(--dim); }
.lg-hint { margin: 0; padding: 6px 10px; font-size: var(--fs-s, 14px); color: var(--ink); background: var(--gold); box-shadow: var(--frame); }
.lg-note { margin: -2px 0 0; text-align: center; font-size: 12px; color: var(--dim); line-height: 1.5; }
.lg-stats b { font-size: 15px; line-height: 1.3; }

.lg-tiers { display: grid; gap: 4px; }
.lg-row { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 6px 10px 6px 6px;
  background: var(--panel); box-shadow: inset 0 0 0 2px var(--rimlo); }
.lg-row > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; min-width: 0; }
.lg-row b { font-weight: 400; font-size: 16px; color: var(--tc); }
.lg-row em { font-style: normal; font-size: 12px; color: var(--ink); background: var(--gold); padding: 0 6px; align-self: center; }
.lg-row em.ok { background: none; color: var(--teal); padding: 0; }
.lg-row small { grid-column: 1 / -1; font-size: 12px; color: var(--dim); line-height: 1.5; }
.lg-row.here { box-shadow: inset 0 0 0 3px var(--gold); }
.lg-row:not(.done) .lg-emb { filter: grayscale(.8) brightness(.6) drop-shadow(3px 3px 0 var(--ink)); }
.lg-rules { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: var(--fs-s, 14px); color: var(--dim); line-height: 1.55; }

/* ---------- result modal panel ---------- */
.lg-res { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; text-align: left; margin: 4px 0 8px; padding: 6px 8px;
  background: var(--panel); box-shadow: inset 0 0 0 2px var(--rimlo); }
.lg-res > div { display: grid; gap: 3px; min-width: 0; }
.lg-res b { font-weight: 400; font-size: 18px; color: var(--tc); }
.lg-res small { font-size: 12px; color: var(--dim); }
.lg-res em { font-style: normal; font-size: 14px; color: var(--ink); background: var(--gold); padding: 1px 6px; justify-self: start; }
.lg-res .lg-rw, .lg-rw { color: var(--teal); }
.lg-skip { margin: 4px 0 8px; font-size: 12px; color: var(--dim); }
.lg-res.up { box-shadow: inset 0 0 0 3px var(--gold); animation: lg-glow 1.2s steps(4) 2; }
@keyframes lg-glow { 50% { box-shadow: inset 0 0 0 3px var(--cream); } }
.lg-sum { display: flex; gap: 14px; align-items: center; justify-content: center; text-align: left; margin: 6px 0; }
.lg-sum > div { display: grid; gap: 2px; }
.lg-sum b { font-weight: 400; font-size: 20px; color: var(--gold); }
.lg-sum small { font-size: 12px; color: var(--dim); }

/* ---------- season cosmetics: tier rows and the season summary ---------- */
.lg-row small.lg-cos { color: var(--cream); }
.lg-row small.lg-cos.ok { color: var(--teal); }
.lg-frtag { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; white-space: nowrap; color: var(--gold); }
.lg-cos.ok .lg-frtag { color: var(--teal); }
.lg-fr { display: inline-block; flex: none; width: 8px; height: 8px; margin: 0 8px; background: var(--ink); }
.lg-newt { margin: 2px 0; }
.lg-frprev { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 10px 0 6px; }
.lg-frprev .pf-ava { width: 44px; height: 44px; }
.lg-frprev small { font-size: 13px; color: var(--teal); }

@media (prefers-reduced-motion: reduce) { .lg-stars i.pop, .lg-res.up { animation: none; } }
.lg-tag { font-size: 14px; vertical-align: middle; color: var(--ink); background: var(--gold); padding: 1px 6px; box-shadow: var(--frame); }
