/* Points, nicknames, leaderboard and the sign-in popup for Sudoku Án Mạng (sudoku-score.js, on /sudoku-an-mang/).
   Loaded after sudoku.css and built from its parts (.sdk-modal, .sdk-modal-card, .btn, .sdk-stamp, .sdk-link);
   only the new pieces live here, all prefixed sc-. */

/* ---------- badges in the catalog header ---------- */
.sc-badges { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.sc-badge { padding: 0.05rem 0.55rem; background: var(--panel); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: var(--fg); font: inherit; font-size: 1.1rem; white-space: nowrap; cursor: pointer; }
.sc-badge:hover { background: var(--panel-2); }
.sc-badge b { font-weight: 400; color: var(--yellow); }
.sc-badge--name { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 0.35rem; }
.sc-badge--name .sc-av { flex: none; border: 1px solid var(--ink); }
.sc-badge--pts { text-transform: uppercase; }
.sc-badge.is-bump { animation: sc-bump 0.45s steps(3); }
@keyframes sc-bump { 50% { transform: scale(1.25); } }
.sdk-cat-head .sdk-signin { padding: 0.05rem 0.55rem; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font: inherit; font-size: 1.1rem; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.sdk-cat-head .sdk-signin:active { transform: translate(2px, 2px); box-shadow: none; }

/* ---------- modals ---------- */
.sdk-modal.sc-modal { z-index: 20010; padding-top: calc(var(--site-nav-height, 56px) + 10px); }
.sdk-modal-card.sc-card { max-width: 520px; text-align: left; max-height: calc(100dvh - var(--site-nav-height, 56px) - 30px); overflow-y: auto; }
.sc-card h2 { margin-bottom: 0.3rem; }
.sc-close { position: absolute; top: 0.6rem; right: 0.6rem; width: 38px; height: 38px; padding: 0; background: var(--panel-2); color: var(--fg); border: var(--px) solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 1.3rem; cursor: pointer; }
.sc-lede { margin: 0 0 0.4rem; color: var(--muted); font-size: 1.15rem; }
.sc-msg { min-height: 1.2em; margin: 0.4rem 0 0; color: var(--yellow); font-size: 1.1rem; text-align: center; }
.sc-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin: 0.35rem 0 0.2rem; }
.sc-row input { min-width: 0; padding: 0.3rem 0.6rem; background: #111; color: var(--fg); border: var(--px) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: inherit; font-size: 1.4rem; }
.sc-row input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }
.sc-rule { margin: 0.9rem 0 0; padding: 0.35rem 0.6rem; background: #111; border: 2px solid #2a2a2a; border-left: 6px solid var(--yellow); font-size: 1.1rem; }
.sc-rule b { font-weight: 400; color: var(--yellow); }

/* the big sign-in popup */
.sdk-modal-card.sc-sign { max-width: 560px; padding-top: 1.4rem; }
.sc-sign h2 { font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1; margin: 0.4rem 0 0.5rem; }
.sc-perks { list-style: none; margin: 0.6rem 0 0.9rem; padding: 0; display: grid; gap: 0.35rem; font-size: 1.25rem; }
.sc-perks li { display: grid; grid-template-columns: 1.8rem 1fr; align-items: baseline; }
.sc-perks b { font-weight: 400; color: var(--yellow); }
.sc-sign label { font-size: 1.15rem; color: var(--muted); }
.sc-sign label b { font-weight: 400; color: var(--fg); }
.sc-fine { font-size: 1.05rem; margin-top: 0.3rem; }
.sc-later { display: block; margin: 0.6rem auto 0; color: var(--muted); font-size: 1.1rem; }

/* nickname */
.sc-name-input { font-size: 1.5rem !important; }
.sc-dice { font-size: 1.4rem; padding: 0 0.7rem; }
.sc-dice:active { transform: rotate(-12deg) translate(2px, 2px); }

/* leaderboard */
.sc-tabs { display: flex; align-items: center; gap: 0.4rem; margin: 0.4rem 0 0.6rem; }
.sc-tab { padding: 0.1rem 0.7rem; background: var(--panel-2); color: var(--fg); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font: inherit; font-size: 1.15rem; text-transform: uppercase; cursor: pointer; }
.sc-tab.is-on { background: var(--yellow); color: var(--ink); }
.sc-rename { margin-left: auto; font-size: 1.1rem; }
.sc-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 1.25rem; }
.sc-board li { display: grid; grid-template-columns: 2.2rem 28px 1fr 5.5rem; gap: 0.5rem; align-items: center; padding: 0.15rem 0.5rem; background: #111; border: 2px solid #2a2a2a; }
.sc-board li.is-top .sc-rank { color: var(--yellow); }
.sc-board li.is-me { border-color: var(--yellow); background: #1d1a0c; }
.sc-board li .sc-av { border: 2px solid var(--ink); box-sizing: content-box; }
.sc-board li.sc-gap { display: block; text-align: center; background: none; border: 0; color: var(--muted); }
.sc-board b { font-weight: 400; text-align: right; color: var(--yellow); }
.sc-rank { text-align: right; color: var(--muted); }
.sc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-name i { font-style: normal; color: var(--muted); }
.sc-unl { display: inline-block; margin-left: 0.25rem; padding: 0 0.35rem; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); font-size: 0.9rem; line-height: 1.2; text-transform: uppercase; vertical-align: 1px; }
.sc-board-sign { display: block; width: 100%; margin-top: 0.8rem; }

/* avatars */
.sc-av { display: block; image-rendering: pixelated; }
.sc-av-pick { display: flex; align-items: center; gap: 0.8rem; margin: 0.4rem 0 0.5rem; }
.sc-av-big .sc-av { border: var(--px) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.sc-av-label { font-size: 1.5rem; color: var(--yellow); }
.sc-av-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 0.7rem; }
.sc-av-opt { padding: 0; aspect-ratio: 1; background: none; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.sc-av-opt .sc-av { width: 100%; height: 100%; }
.sc-av-opt:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.sc-av-opt.is-on { outline: 3px solid var(--yellow); outline-offset: 1px; }
@media (max-width: 420px) { .sc-av-grid { grid-template-columns: repeat(4, 1fr); } }

/* podium: 2nd, 1st, 3rd on stepped blocks */
.sc-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 6px; margin: 0.6rem 0 0.5rem; }
.sc-pod { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; cursor: pointer; }
.sc-pod-av .sc-av { border: var(--px) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.sc-pod-name { max-width: 100%; margin-top: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.2rem; line-height: 1.05; }
.sc-pod .sc-unl { margin: 0.1rem 0 0; font-size: 0.8rem; }
.sc-pod-pts { font-size: 1.15rem; color: var(--yellow); }
.sc-pod-block { width: 100%; margin-top: 0.3rem; display: flex; align-items: flex-start; justify-content: center; padding-top: 0.2rem; border: var(--px) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); font-size: 2rem; line-height: 1; }
.sc-pod--1 .sc-pod-block { height: 78px; background: var(--yellow); background-image: repeating-linear-gradient(90deg, transparent 0 10px, rgba(255,255,255,0.25) 10px 12px); }
.sc-pod--2 .sc-pod-block { height: 54px; background: #c9ccd3; }
.sc-pod--3 .sc-pod-block { height: 38px; background: #c98a4e; }
.sc-pod.is-empty .sc-pod-block { background: var(--panel-2); color: var(--muted); }
.sc-pod.is-me .sc-pod-name { color: var(--yellow); }
.sc-crown { position: absolute; top: -1.5rem; font-size: 1.7rem; line-height: 1; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); animation: sc-crown 1.6s steps(2) infinite; }
@keyframes sc-crown { 50% { transform: translateY(-3px); } }
.sc-pod--1 .sc-pod-av { animation: sc-glow 1.6s steps(2) infinite; }
@keyframes sc-glow { 50% { filter: drop-shadow(0 0 6px rgba(255, 218, 61, 0.7)); } }
#scBoardModal .sc-podium { margin-top: 1.8rem; }

/* the weekly panel on the home page */
.sc-panel { margin: 1.6rem 0 1.4rem; padding: 1rem 1.1rem 0.9rem; background: var(--panel); border: var(--px) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background-image: radial-gradient(rgba(255, 218, 61, 0.08) 1px, transparent 1px); background-size: 8px 8px; }
.sc-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; }
.sc-panel-head h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1; color: var(--yellow); text-transform: uppercase; text-shadow: 3px 3px 0 var(--ink); }
.sc-panel-reset { color: var(--muted); font-size: 1.1rem; }
.sc-podium--panel { max-width: 520px; margin: 2.2rem auto 0.6rem; }
.sc-panel-wait { grid-column: 1 / -1; margin: 1rem 0; text-align: center; color: var(--muted); font-size: 1.25rem; }
.sc-board--panel { max-width: 520px; margin: 0 auto; }
.sc-panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 0.7rem; max-width: 520px; margin: 0.8rem auto 0; }
.sc-panel-me { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: auto; font-size: 1.25rem; }
.sc-panel-me:empty { display: none; }
.sc-panel-me .sc-av { border: 2px solid var(--ink); }
.sc-panel-me b { font-weight: 400; color: var(--yellow); }
.sc-panel-foot .btn { font-size: 1.2rem; }

/* the hero card: your detective + this week's top 3 (the same size signed in or out) */
.sc-hero-card { display: flex; flex-direction: column; gap: 0.55rem; align-self: stretch; min-height: 100%; padding: 0.9rem 1rem 0.8rem; background: var(--panel); border: var(--px) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); min-width: 0; }
.sc-hc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.1rem 0.6rem; font-size: 1.5rem; color: var(--yellow); text-transform: uppercase; }
.sc-hc-head small { color: var(--muted); font-size: 1rem; text-transform: none; }
.sc-hc-head span { white-space: nowrap; }
.sc-hc-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sc-hc-top li { display: grid; grid-template-columns: 1.6rem 32px minmax(0, 1fr) auto; gap: 0.45rem; align-items: center; min-height: 42px; padding: 0.15rem 0.4rem; background: #111; border: 2px solid #2a2a2a; font-size: 1.25rem; }
.sc-hc-top li.sc-hc-wait { display: block; color: var(--muted); text-align: center; }
.sc-hc-top .sc-av { border: 2px solid var(--ink); box-sizing: content-box; }
.sc-hc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-hc-top b { font-weight: 400; color: var(--yellow); }
.sc-hc-all { align-self: flex-end; font-size: 1.1rem; }
.sc-hc-you { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; min-height: 7.4rem; margin-top: auto; padding-top: 0.6rem; border-top: 2px dashed #333; }
.sc-hc-you p { margin: 0; font-size: 1.2rem; line-height: 1.2; }
.sc-hc-you p b { font-weight: 400; color: var(--yellow); }
.sc-hc-me { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.sc-hc-me .sc-av { flex: none; border: var(--px) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.sc-hc-me > div { display: grid; min-width: 0; }
.sc-hc-youname { font-size: 1.45rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-hc-youpts { color: var(--yellow); font-size: 1.3rem; }
.sc-hc-btn { width: 100%; font-size: 1.3rem; }
.sc-hc-sign, .sc-panel-sign { background: var(--yellow) !important; color: #000 !important; border-color: #000 !important; }
.sc-hc-wait { color: var(--muted); }
.sc-hc-rule { margin: 0; color: var(--muted); font-size: 1.05rem; }
.sc-hc-rule b { font-weight: 400; color: var(--fg); }

/* ---------- this solve's points, inside the page's result card ---------- */
.sc-outcome { margin: 0.9rem 0 0.2rem; padding: 0.55rem 0.8rem; background: #111; border: 2px solid #2a2a2a; border-left: 6px solid var(--yellow); text-align: left; }
.sc-out-main { margin: 0; font-size: 1.7rem; line-height: 1.05; color: var(--yellow); }
.sc-out-main.is-muted { font-size: 1.25rem; color: var(--muted); }
.sc-out-why { margin: 0.15rem 0 0; font-size: 1.1rem; color: var(--muted); }
.sc-out-sign { margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .sc-badge.is-bump, .sc-crown, .sc-pod--1 .sc-pod-av { animation: none !important; }
}
