/* =========================================================================
   Lobby (main menu), leaderboard, level selection states, challenge results.
   Same dark laboratory base as styles.css with brighter casual-game accents.
   ========================================================================= */
:root { --gold: #f5c451; --coral: #ff8a65; --lime: #8ee66b; --rose: #ff6b8b; }

/* ---------------------------------------------------------------- lobby */
.lobby-screen .lobby-shell { padding: 26px 4.5vw 70px; background:
  radial-gradient(circle at 12% 18%, rgba(122, 102, 255, .28), transparent 32%),
  radial-gradient(circle at 88% 12%, rgba(84, 223, 215, .22), transparent 30%),
  radial-gradient(circle at 70% 92%, rgba(245, 196, 81, .16), transparent 30%),
  radial-gradient(circle at 20% 90%, rgba(255, 107, 139, .14), transparent 28%),
  linear-gradient(140deg, #071321, #0a1d33 55%, #10183a); }
.lobby-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lobby-bubbles i { position: absolute; bottom: -60px; width: var(--s, 18px); height: var(--s, 18px); border-radius: 50%; border: 2px solid rgba(180, 249, 220, .35); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), rgba(84, 223, 215, .08)); animation: bubble var(--d, 14s) linear infinite; animation-delay: var(--delay, 0s); }
.lobby-bubbles i:nth-child(1) { left: 6%; --s: 22px; --d: 16s; }
.lobby-bubbles i:nth-child(2) { left: 18%; --s: 12px; --d: 11s; --delay: -4s; }
.lobby-bubbles i:nth-child(3) { left: 33%; --s: 28px; --d: 19s; --delay: -9s; }
.lobby-bubbles i:nth-child(4) { left: 49%; --s: 14px; --d: 13s; --delay: -2s; }
.lobby-bubbles i:nth-child(5) { left: 63%; --s: 20px; --d: 17s; --delay: -11s; }
.lobby-bubbles i:nth-child(6) { left: 76%; --s: 10px; --d: 10s; --delay: -6s; }
.lobby-bubbles i:nth-child(7) { left: 88%; --s: 26px; --d: 21s; --delay: -14s; }
.lobby-bubbles i:nth-child(8) { left: 95%; --s: 16px; --d: 15s; --delay: -8s; }
@keyframes bubble { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateY(-55vh) translateX(18px); } 100% { transform: translateY(-110vh) translateX(-12px); opacity: 0; } }

.lobby-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lobby-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(245, 196, 81, .45); background: rgba(245, 196, 81, .08); color: #f8dc94; font: 500 11px DM Mono, monospace; letter-spacing: .14em; }
.lobby-grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .95fr); gap: 26px; align-items: start; margin-top: 26px; }
.lobby-main { display: grid; gap: 18px; min-width: 0; }
.lobby-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; margin: 4px 0 0; font-size: clamp(56px, 8.4vw, 128px); line-height: .9; letter-spacing: -.06em; }
.lobby-title__a { color: #fff; text-shadow: 0 6px 0 rgba(84, 223, 215, .35); }
.lobby-title__b { background: linear-gradient(100deg, var(--cyan) 0%, var(--mint) 35%, var(--gold) 70%, var(--coral) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: title-shine 6s ease-in-out infinite; filter: drop-shadow(0 6px 18px rgba(84, 223, 215, .25)); }
@keyframes title-shine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.lobby-lead { margin: 0; max-width: 620px; font-size: 17px; }
.lobby-lead em { color: var(--cyan); font-style: normal; font-weight: 700; }
.lobby-card { position: relative; padding: 20px 22px; border-radius: 20px; border: 1px solid rgba(150, 206, 212, .2); background: linear-gradient(160deg, rgba(14, 36, 58, .88), rgba(8, 21, 36, .88)); box-shadow: 0 24px 60px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05); backdrop-filter: blur(8px); }
.lobby-card h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -.01em; }
.player-card { border-color: rgba(84, 223, 215, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .3), 0 0 0 4px rgba(84, 223, 215, .06); }
.player-card .login-form { margin: 0; max-width: none; }
.player-card .login-form[hidden] { display: none; }
.player-card label { display: block; margin-bottom: 10px; color: var(--mint); font: 800 13px Manrope, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.player-card .name-row { display: flex; gap: 10px; }
.player-card input { flex: 1; min-width: 0; height: 58px; padding: 0 18px; border-radius: 14px; border: 2px solid rgba(150, 206, 212, .3); background: rgba(3, 14, 24, .7); color: #fff; font-size: 19px; font-weight: 700; }
.player-card input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(84, 223, 215, .18); }
.player-card input.is-invalid { border-color: #ff6b6b; animation: lobby-shake .4s ease; }
.start-button { position: relative; min-width: 190px; height: 58px; padding: 0 26px !important; border-radius: 14px !important; background: linear-gradient(135deg, #5cf0e2, #54dfd7 40%, #8ee66b) !important; color: #05211d !important; font-size: 18px !important; font-weight: 900 !important; letter-spacing: .02em; box-shadow: 0 6px 0 #1f9c8f, 0 16px 34px rgba(84, 223, 215, .35) !important; animation: start-pulse 2.4s ease-in-out infinite; transition: transform .12s, box-shadow .12s !important; }
.start-button span { float: none !important; margin-left: 10px !important; }
.start-button:hover { transform: translateY(-2px) scale(1.02) !important; }
.start-button:active { transform: translateY(4px) !important; box-shadow: 0 2px 0 #1f9c8f, 0 8px 18px rgba(84, 223, 215, .3) !important; }
.start-button:disabled { animation: none; opacity: .7; cursor: progress; }
@keyframes start-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12) drop-shadow(0 0 14px rgba(84, 223, 215, .55)); } }
@keyframes lobby-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.player-card .form-error { min-height: 20px; margin: 8px 0 0; color: #ff9e98; font-weight: 700; }
.lobby-continue { display: grid; gap: 16px; }
.lobby-continue[hidden] { display: none; }
.lobby-continue__who { display: flex; gap: 14px; align-items: center; }
.lobby-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; font-size: 26px; font-weight: 900; box-shadow: 0 0 0 4px rgba(122, 102, 255, .25); }
.lobby-continue small { color: var(--cyan); font: 500 11px DM Mono, monospace; letter-spacing: .16em; }
.lobby-continue strong { display: block; font-size: 24px; }
.lobby-continue span { color: #9fb2bb; font-size: 14px; }
.lobby-continue__actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lobby-link { padding: 6px 2px; border: 0; background: none; color: #9fb2bb; font: 700 13.5px Manrope, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lobby-link:hover { color: var(--cyan); }
.lobby-profiles { margin-top: 14px; }
.lobby-profiles[hidden] { display: none; }
.lobby-profiles small { display: block; margin-bottom: 8px; color: #7f939c; font: 500 10.5px DM Mono, monospace; letter-spacing: .14em; text-transform: uppercase; }
.lobby-profiles div { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid rgba(150, 206, 212, .3); background: rgba(12, 33, 50, .9); color: #e6f6f6; font: 700 14px Manrope, sans-serif; cursor: pointer; transition: transform .15s, border-color .15s; }
.profile-chip span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; font-size: 13px; }
.profile-chip:hover { transform: translateY(-2px); border-color: var(--cyan); }

.level-path { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.level-path::before { content: ""; position: absolute; left: 8%; right: 8%; top: 22px; height: 4px; border-radius: 4px; background: rgba(150, 206, 212, .16); }
.level-node { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.level-node__dot { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(150, 206, 212, .3); background: #0b1f30; color: #8da1aa; font-weight: 900; font-size: 16px; z-index: 1; transition: transform .2s; }
.level-node__name { color: #8da1aa; font-size: 11px; line-height: 1.25; }
.level-node.is-unlocked .level-node__dot { border-color: var(--cyan); color: #fff; box-shadow: 0 0 0 5px rgba(84, 223, 215, .14); animation: node-pulse 2s ease-in-out infinite; }
.level-node.is-in-progress .level-node__dot { border-color: var(--gold); color: #fff; background: rgba(245, 196, 81, .16); }
.level-node.is-completed .level-node__dot { border-color: var(--lime); background: linear-gradient(135deg, #3fbf6b, #8ee66b); color: #06210f; }
.level-node.is-completed .level-node__name, .level-node.is-unlocked .level-node__name, .level-node.is-in-progress .level-node__name { color: #dceef0; }
.level-node.is-locked .level-node__dot { font-size: 15px; opacity: .7; }
@keyframes node-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.how-to ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.how-to li { display: flex; gap: 12px; align-items: flex-start; color: #c3d2d8; font-size: 14.5px; line-height: 1.5; }
.how-to li b { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--gold), var(--coral)); color: #2a1500; font-weight: 900; box-shadow: 0 3px 0 #a8641f; }
.how-to kbd, .board-hint kbd { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; background: rgba(12, 33, 50, .9); font: 700 12px DM Mono, monospace; }

.leaderboard-card { position: sticky; top: 20px; border-color: rgba(245, 196, 81, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 0 4px rgba(245, 196, 81, .05); }
.leaderboard-card__head, .board-panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.leaderboard-card__head > span, .board-panel__trophy { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, #ffe08a, var(--gold) 50%, #e09a2d); font-size: 28px; box-shadow: 0 4px 0 #a8761f, 0 10px 24px rgba(245, 196, 81, .3); animation: trophy-bob 3s ease-in-out infinite; }
@keyframes trophy-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
.leaderboard-card__head small, .board-panel__head small { color: var(--gold); font: 500 10.5px DM Mono, monospace; letter-spacing: .16em; }
.leaderboard-card__head h2, .board-panel__head h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.02em; }
.board-rule { margin: 12px 0 0; color: #7f939c; font-size: 12px; }

/* ------------------------------------------------------------ the table */
.board-scroll { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scroll-behavior: smooth; border-radius: 14px; border: 1px solid rgba(150, 206, 212, .14); scrollbar-color: rgba(245, 196, 81, .5) rgba(150, 206, 212, .08); }
.board-scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.board-table thead th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; text-align: left; background: #0d2539; color: #8da1aa; font: 500 10.5px DM Mono, monospace; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid rgba(150, 206, 212, .18); }
.board-table th:nth-child(3), .board-table th:nth-child(4), .board-table td:nth-child(3), .board-table td:nth-child(4) { text-align: right; }
.board-table td { padding: 11px 12px; border-bottom: 1px solid rgba(150, 206, 212, .08); }
.board-table tbody tr { transition: background .2s; animation: board-row .4s ease both; }
.board-table tbody tr:nth-child(n) { animation-delay: calc(min(var(--row, 0), 10) * 40ms); }
.board-table tbody tr:hover { background: rgba(84, 223, 215, .05); }
.board-rank { white-space: nowrap; }
.board-rank b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: rgba(150, 206, 212, .1); font-size: 13px; }
.board-medal { margin-right: 4px; font-size: 18px; }
.is-top1 .board-rank b { background: linear-gradient(135deg, #ffe08a, #e0a52d); color: #2a1a00; }
.is-top2 .board-rank b { background: linear-gradient(135deg, #f2f4f7, #a9b3bd); color: #1d232a; }
.is-top3 .board-rank b { background: linear-gradient(135deg, #f0b98a, #b5713d); color: #2b1606; }
.board-name { font-weight: 800; overflow-wrap: anywhere; }
.board-name small { color: #7f939c; font: 500 11px DM Mono, monospace; }
.board-name em { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--cyan); color: #04211d; font: 900 10px Manrope, sans-serif; font-style: normal; letter-spacing: .08em; }
.board-passed { font-weight: 900; font-size: 16px; }
.board-passed small, .board-score small { display: block; color: #7f939c; font: 500 10.5px DM Mono, monospace; font-weight: 400; }
.board-passed small { display: inline; }
.board-score { font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.board-table tr.is-you td { background: rgba(84, 223, 215, .12); }
.board-table tr.is-you td:first-child { box-shadow: inset 4px 0 0 var(--cyan); }
.board-empty { margin: 0; padding: 30px 16px; text-align: center; color: #b7c6cc; font-size: 15px; font-weight: 700; border: 1px dashed rgba(245, 196, 81, .4); border-radius: 14px; background: rgba(245, 196, 81, .04); }
.board-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 138, 101, .1); color: #ffcbb8; font-size: 12.5px; }
@keyframes board-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- overlay & 🏆 */
.board-overlay { position: fixed; z-index: 140; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(2, 8, 14, .72); backdrop-filter: blur(4px); animation: overlay-in .2s ease both; }
.board-overlay[hidden] { display: none; }
.board-panel { width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; padding: 22px; border-radius: 22px; border: 1px solid rgba(245, 196, 81, .45); background: linear-gradient(165deg, #10294a, #081626); box-shadow: 0 40px 100px rgba(0, 0, 0, .6); animation: panel-in .35s cubic-bezier(.2, 1.3, .4, 1) both; }
.board-panel__head h2 { flex: 1; }
.board-panel__head > div { flex: 1; }
.board-close { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(150, 206, 212, .3); background: rgba(12, 33, 50, .9); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: transform .15s, border-color .15s; }
.board-close:hover { transform: rotate(90deg); border-color: var(--gold); }
.board-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.board-you { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(84, 223, 215, .08); color: #cfe2e6; font-size: 14px; }
.board-you:empty { display: none; }
.board-overlay .board { min-height: 0; display: flex; flex-direction: column; }
.board-overlay .board-scroll { max-height: calc(88vh - 230px); }
.board-hint { margin: 12px 0 0; text-align: center; color: #7f939c; font-size: 12.5px; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }

.board-button { position: fixed; z-index: 94; right: 16px; bottom: 16px; display: grid; place-items: center; width: 58px; height: 58px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #ffe08a, var(--gold) 50%, #e09a2d); box-shadow: 0 5px 0 #a8761f, 0 14px 30px rgba(0, 0, 0, .4); font-size: 27px; cursor: pointer; transition: transform .15s; }
.board-button[hidden] { display: none; }
.board-button:hover { transform: translateY(-3px) rotate(-6deg); }
.board-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #a8761f, 0 6px 14px rgba(0, 0, 0, .4); }
.board-button kbd { position: absolute; right: -4px; bottom: -4px; padding: 1px 6px; border-radius: 6px; background: #0b1f30; color: var(--gold); border: 1px solid rgba(245, 196, 81, .5); font: 800 11px DM Mono, monospace; }
.board-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
body.board-open .board-button { box-shadow: 0 0 0 4px rgba(245, 196, 81, .4), 0 14px 30px rgba(0, 0, 0, .4); }
@media (pointer: coarse) { .board-button kbd { display: none; } }

.admin-badge { position: fixed; z-index: 94; right: 16px; bottom: 86px; padding: 7px 12px; border-radius: 999px; background: linear-gradient(135deg, #ff6b6b, #f5b84b); color: #2a0b05; font: 900 11px Manrope, sans-serif; letter-spacing: .12em; box-shadow: 0 8px 22px rgba(255, 107, 107, .35); pointer-events: none; }
.admin-badge[hidden] { display: none; }
.admin-chip { display: inline-block; margin-right: 6px; padding: 3px 9px; border-radius: 999px; background: linear-gradient(135deg, #ff6b6b, #f5b84b); color: #2a0b05; font: 900 10.5px Manrope, sans-serif; letter-spacing: .1em; }
.admin-banner { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 107, 107, .45); background: linear-gradient(135deg, rgba(255, 107, 107, .14), rgba(245, 184, 75, .12)); color: #ffd9c7; font-size: 14px; }
.admin-banner[hidden] { display: none; }
.dashboard-rank { margin: 8px 0 0; color: var(--gold); font-weight: 800; font-size: 14px; }
.dashboard-rank:empty { display: none; }

.lobby-toast { position: fixed; z-index: 150; left: 50%; top: 18px; max-width: min(620px, calc(100vw - 24px)); padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(245, 196, 81, .5); background: rgba(8, 22, 36, .97); color: #f6e7c4; font-weight: 700; font-size: 14.5px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transform: translate(-50%, -140%); transition: transform .3s cubic-bezier(.2, 1.2, .4, 1); pointer-events: none; }
.lobby-toast.is-show { transform: translate(-50%, 0); }

/* ---------------------------------------------- level selection states */
#dashboard-screen .level-card { transition: transform .25s, box-shadow .25s, border-color .25s, filter .25s; }
#dashboard-screen .level-card.is-locked { filter: grayscale(.85) brightness(.72); cursor: not-allowed; }
#dashboard-screen .level-card.is-locked:hover { transform: none; }
#dashboard-screen .level-card.is-unlocked { border-color: rgba(84, 223, 215, .55); box-shadow: 0 0 0 3px rgba(84, 223, 215, .08); }
#dashboard-screen .level-card.is-in-progress { border-color: rgba(245, 196, 81, .7); box-shadow: 0 0 0 3px rgba(245, 196, 81, .1); }
#dashboard-screen .level-card.is-completed { border-color: rgba(142, 230, 107, .75); box-shadow: 0 0 0 3px rgba(142, 230, 107, .12), 0 0 30px rgba(142, 230, 107, .12); }
#dashboard-screen .level-card.is-completed::after { content: "✓ PASSED"; position: absolute; top: 12px; right: -34px; padding: 4px 38px; transform: rotate(35deg); background: linear-gradient(135deg, #3fbf6b, #8ee66b); color: #06210f; font: 900 10px Manrope, sans-serif; letter-spacing: .12em; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
#dashboard-screen .level-card.is-in-progress .card-state { color: var(--gold); }
#dashboard-screen .level-card.is-completed .card-state { color: var(--lime); }
/* Over the card's picture, above the name and the status. */
.card-lock { position: absolute; z-index: 3; left: 50%; top: 48px; transform: translateX(-50%); display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(4, 12, 20, .82); border: 2px solid rgba(150, 206, 212, .35); font-size: 26px; filter: none; }
#dashboard-screen .level-card.is-locked .level-visual { opacity: .25; }
.card-meta { position: relative; display: grid; gap: 4px; margin: 10px 0 8px; font-size: 11.5px; color: #9fb2bb; }
.card-stars { display: flex; gap: 2px; font-size: 15px; }
.card-stars i { font-style: normal; color: rgba(255, 255, 255, .16); }
.card-stars i.is-on { color: var(--gold); text-shadow: 0 0 10px rgba(245, 196, 81, .6); }
.card-score { color: #e3eff2; font-weight: 800; }
.card-pass { color: #8da1aa; }
.card-bar { display: block; height: 5px; margin-top: 2px; border-radius: 5px; background: rgba(150, 206, 212, .14); overflow: hidden; }
.card-bar b { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--cyan), var(--lime)); transition: width .6s ease; }
.level-card.is-denied { animation: lobby-shake .45s ease; }
.level-card.just-completed { animation: card-complete 1.4s ease; }
.level-card.just-unlocked { animation: card-unlock 1.4s ease; }
@keyframes card-complete { 0% { transform: scale(1); } 30% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(142, 230, 107, .4), 0 0 60px rgba(142, 230, 107, .5); } 100% { transform: scale(1); } }
@keyframes card-unlock { 0% { transform: scale(.96); filter: brightness(.6); } 40% { transform: scale(1.05); filter: brightness(1.3); } 100% { transform: scale(1); filter: none; } }
/* The course progress as a ring around the percentage (the number stays readable). */
#dashboard-screen .progress-dial::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--cyan) calc(var(--pct, 0) * 1%), rgba(150, 206, 212, .12) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }

/* ------------------------------------------------------ challenge results */
.result-card--challenge { max-width: 760px; }
.result-badge { display: grid; place-items: center; width: 96px; height: 96px; margin: -6px auto 6px; border-radius: 50%; font-size: 50px; animation: badge-in .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.is-pass .result-badge { background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, #c98a1d); box-shadow: 0 0 0 8px rgba(245, 196, 81, .18), 0 0 50px rgba(245, 196, 81, .45); }
.is-fail .result-badge { background: radial-gradient(circle at 35% 30%, #ffc6c2, #ff6b6b 55%, #a8323a); box-shadow: 0 0 0 8px rgba(255, 107, 107, .16); animation: badge-in .7s cubic-bezier(.2, 1.6, .4, 1) both, lobby-shake .5s .7s ease; }
.result-status { margin: 4px 0 2px; font-size: clamp(34px, 5vw, 52px) !important; }
.is-pass .result-status { color: var(--lime); }
.is-fail .result-status { color: #ff9e98; }
.result-player { margin: 0 0 6px; color: #9fb2bb; }
.result-score { margin: 6px 0; font-size: clamp(54px, 7vw, 84px); font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.result-score .result-count { color: var(--accent, var(--cyan)); font-variant-numeric: tabular-nums; }
.is-fail .result-score .result-count { color: #ff9e98; }
.result-score span { color: #8da1aa; font-size: .55em; }
.result-stats--six { grid-template-columns: repeat(3, 1fr) !important; }
.result-stats .is-good strong { color: var(--lime); }
.result-stats .is-bad strong { color: #ff9e98; }
.result-rank { margin: 6px 0 12px; color: #dfeaec; font-size: 15px; }
.result-rank b { color: var(--gold); font-size: 20px; }
.result-rank.is-bad { color: #ff9e98; }
.result-board { margin: 6px 0 14px; text-align: left; }
.result-board h3 { margin: 0 0 8px; font-size: 16px; }
.result-board .board-scroll { max-height: 260px; }
.result-card--challenge.is-fail { border-color: rgba(255, 107, 107, .5); background: radial-gradient(circle at 50% 0%, rgba(255, 107, 107, .16), transparent 60%), rgba(6, 22, 33, .96); }
.intro-card__pass { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 14px; padding: 8px 14px; border-radius: 999px; background: rgba(245, 196, 81, .1); border: 1px solid rgba(245, 196, 81, .4); color: #f8dc94; font-weight: 700; font-size: 14px; }
.chip--pass { background: rgba(245, 196, 81, .14) !important; border-color: rgba(245, 196, 81, .5) !important; color: #f8dc94 !important; }
.chip--status { background: rgba(150, 206, 212, .08) !important; border-color: rgba(150, 206, 212, .3) !important; color: #cfe2e6 !important; }
.challenge-card.is-completed .chip--status { background: rgba(142, 230, 107, .14) !important; border-color: rgba(142, 230, 107, .5) !important; color: #c6f5b4 !important; }
.games-stat--admin strong { color: #ffb38a; }
@keyframes badge-in { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .leaderboard-card { position: relative; top: 0; }
}
@media (max-width: 620px) {
  .lobby-screen .lobby-shell { padding: 18px 14px 90px; }
  .player-card .name-row { flex-direction: column; }
  .start-button { width: 100%; }
  .level-path { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .level-path::before { display: none; }
  .board-table { font-size: 13px; }
  .board-table td, .board-table thead th { padding: 9px 8px; }
  .board-scroll { max-height: 340px; }
  .result-stats--six { grid-template-columns: repeat(2, 1fr) !important; }
  .board-button { width: 52px; height: 52px; right: 12px; bottom: 12px; }
  .admin-badge { right: 12px; bottom: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  .lobby-bubbles, .lobby-title__b, .start-button, .leaderboard-card__head > span, .board-panel__trophy, .level-node.is-unlocked .level-node__dot { animation: none !important; }
}

/* Knowledge Check opened again after a failed attempt. */
.intro-card__retry { display: grid; gap: 4px; margin: 0 auto 14px; max-width: 520px; padding: 12px 16px; border-radius: 10px; background: rgba(120, 28, 24, .35); border: 1px solid rgba(255, 120, 104, .7); color: #f3c2ba; font-size: 14px; }
.intro-card__retry strong { color: #fff; font-size: 20px; }
