/* Rewards layer pages: profile, style shop, events, and the results reward
   block. Built from the parts in ui.css (the credits chip lives there). */

/* shared */
.pf-cred { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; justify-items: start; flex: none; padding: 8px 14px 8px 10px; border-radius: 12px; background: rgba(245, 197, 66, 0.07); border: 1px solid rgba(245, 197, 66, 0.3); }
.pf-cred svg { width: 30px; height: 30px; grid-row: span 2; }
.pf-cred b { font: 800 22px/1 var(--f-display); }
.pf-cred small { font-size: 11px; letter-spacing: 0.14em; color: var(--dim); font-weight: 800; }
.mbar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--acc); border-radius: 3px; }
.mbar.xp i { background: linear-gradient(90deg, #f5c542, #ffcc00); box-shadow: 0 0 8px rgba(255, 204, 0, 0.5); }

/* profile */
.meta-page .pg-title h1 .helm, .meta-page .pg-title h1 .helm svg { width: 44px; height: 44px; display: inline-block; }
.pf-level { display: flex; align-items: center; gap: var(--s4); }
.lv-badge { width: 60px; height: 60px; border-radius: 14px; background: linear-gradient(160deg, rgba(255, 204, 0, 0.24), rgba(255, 204, 0, 0.05)); border: 1px solid var(--acc-line); display: grid; place-items: center; align-content: center; flex: none; }
.lv-badge small { font-size: 11px; letter-spacing: 0.16em; color: var(--acc); font-weight: 800; }
.lv-badge b { font: 800 28px/1 var(--f-display); }
.lv-bar { flex: 1; display: grid; gap: 7px; }
.lv-bar .mbar { height: 9px; }
.lv-bar small { color: var(--dim); font-size: 12px; font-weight: 700; }
.pf-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-scores .sc { display: grid; gap: 7px; align-content: start; }
.pf-scores .sc small { font: 700 12px var(--f-display); letter-spacing: 0.14em; color: var(--dim); }
.pf-scores .sc b { font: 800 34px/1 var(--f-display); }
.pf-scores .sc span { color: var(--txt-2); font-size: 12px; line-height: 1.4; }
.pf-stats { margin-top: 4px; }
.card .empty { margin-top: var(--s3); }
.pf-look { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px; }
.pf-look > div { display: grid; justify-items: center; gap: 4px; text-align: center; }
.pf-look b { font-size: 12.5px; }
.pf-look small { font-size: 11px; color: var(--dim); font-weight: 700; }

/* item previews: colour swatches or our own icons */
.pv { width: 50px; height: 50px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; flex: none; }
.pv-icon svg { width: 28px; height: 28px; color: #e6eaf0; }
.pv-smoke i { position: absolute; border-radius: 50%; background: var(--bg); filter: blur(3px); opacity: 0.85; }
.pv-smoke i:nth-child(1) { width: 22px; height: 22px; left: 6px; bottom: 6px; }
.pv-smoke i:nth-child(2) { width: 18px; height: 18px; left: 20px; bottom: 16px; }
.pv-smoke i:nth-child(3) { width: 14px; height: 14px; left: 29px; bottom: 28px; }
.pv-light i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px 3px var(--c); }
.pv-board b { font: 900 11px var(--mono); letter-spacing: 0.08em; padding: 3px 6px; border-radius: 5px; background: #111827; border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: 0 0 9px 2px var(--c); }
.pv-board.flicker b { animation: pvflick 1.1s infinite; }
@keyframes pvflick { 0%, 100% { box-shadow: 0 0 9px 2px var(--c); } 45% { box-shadow: 0 0 4px 1px var(--c); } 60% { box-shadow: 0 0 12px 3px var(--c); } }

/* style shop */
.slot-text { margin: 0; color: var(--txt-2); font-size: 13.5px; }
.shop-msg { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #ffb4b4; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; font-weight: 700; animation: scr-in .25s ease both; }
.shop-msg.ok { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #9ff0bd; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 10px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .15s; }
.item:hover { border-color: var(--line-2); }
.item .it-t { display: grid; gap: 3px; min-width: 0; }
.item .it-t b { font-size: 15px; }
.item .it-t small { color: #aeb6c3; font-size: 12px; line-height: 1.35; }
.item > button:last-child { grid-column: 1 / -1; padding: 9px; }
.item > button svg { width: 16px; height: 16px; }
.item.equipped { border-color: var(--acc-line); background: rgba(255, 204, 0, 0.06); }
.item .ghost.on { color: var(--acc); border-color: rgba(255, 204, 0, 0.4); cursor: default; }
.item.locked { opacity: 0.6; }
.item.short > button:last-child { color: var(--dim); }
.pv-try { background: none; border: 0; padding: 0; border-radius: 12px; }
.pv-try .pv { transition: border-color .15s, transform .15s; }
.pv-try:hover .pv { border-color: var(--acc); transform: scale(1.05); }

/* events */
.ev-list { display: grid; gap: 10px; }
.ev { display: grid; gap: 10px; }
.ev.gold { border-color: rgba(245, 197, 24, 0.55); background: linear-gradient(160deg, rgba(245, 197, 24, 0.08), rgba(255, 255, 255, 0.02) 60%); }
.ev-top { display: flex; align-items: center; gap: 12px; }
.ev-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; flex: none; }
.ev-ic svg { width: 26px; height: 26px; }
.ev-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ev-t b { font: 800 20px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; }
.ev-t small { color: var(--dim); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ev-t .flagchip { width: 20px; height: 13px; }
.ev p { margin: 0; color: var(--txt-2); font-size: 13px; }
.ev-tiers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ev-tiers li { display: grid; grid-template-columns: 20px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: start; font-size: 12px; line-height: 1.35; color: #aeb6c3; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.ev-tiers li svg { width: 20px; height: 20px; opacity: 0.35; grid-row: span 2; }
.ev-tiers li span { display: grid; gap: 1px; }
.ev-tiers li b { color: #e6eaf0; font-size: 12.5px; }
.ev-tiers li em { grid-column: 2; font-style: normal; font-family: var(--mono); font-weight: 700; color: var(--dim); margin-top: 3px; }
.ev-tiers li.won { background: rgba(255, 255, 255, 0.06); color: #e6eaf0; border-color: var(--line-2); }
.ev-tiers li.won svg { opacity: 1; }
.ev-tiers li.won em { color: var(--good); }
/* the Online events card, coming soon */
.ev-soon { display: flex; align-items: center; gap: 12px; opacity: 0.6; cursor: not-allowed; background: transparent; border: 1px dashed rgba(255, 255, 255, 0.2); border-radius: var(--radius); padding: 14px 16px; color: #d6dbe4; text-align: left; }
.ev-soon .ev-ic { background: var(--surface-2); color: var(--dim); }

/* results: what you earned */
.reward { display: grid; gap: 8px; border-color: rgba(245, 197, 66, 0.45); background: linear-gradient(160deg, rgba(245, 197, 66, 0.1), rgba(255, 255, 255, 0.02) 60%); }
.rw-head { display: flex; align-items: center; gap: 10px; }
.rw-head svg { width: 30px; height: 30px; flex: none; }
.rw-head b { font: 800 22px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; flex: 1; }
.rw-head b span { color: #f5c542; }
.rw-head em { font-style: normal; font-weight: 800; color: var(--acc); font-family: var(--mono); }
.rw-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rw-lines li { display: grid; grid-template-columns: 1fr auto 64px; gap: 10px; font-size: 13px; color: var(--txt-2); padding: 3px 4px; }
.rw-lines li b { font-family: var(--mono); color: #f5c542; }
.rw-lines li small { color: var(--dim); font-family: var(--mono); text-align: right; }
.rw-lines li.ad b { color: var(--good); }
.rw-scores { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 8px; }
.rw-scores b { color: #fff; font-family: var(--mono); }
.rw-scores em { font-style: normal; font-weight: 800; font-family: var(--mono); }
.rw-scores em.up { color: var(--good); }
.rw-scores em.down { color: var(--bad); }
.rw-level { color: var(--acc); font-weight: 800; font-size: 13.5px; }
.rw-ad { justify-self: start; border-color: rgba(34, 197, 94, 0.45); color: #9ff0bd; }
.rw-ad:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 1366px) {
  .ev-tiers { grid-template-columns: 1fr; }
  .ev-tiers li { grid-template-columns: 20px 1fr auto; grid-template-rows: auto; align-items: center; }
  .ev-tiers li svg { grid-row: auto; }
  .ev-tiers li span { display: block; }
  .ev-tiers li b { margin-right: 6px; }
  .ev-tiers li em { grid-column: auto; margin: 0; }
}
@media (max-width: 900px) {
  .pf-scores { grid-template-columns: 1fr; }
  .pf-look { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: 1fr; }
  .cred-chip small { display: none; }
}

/* leaderboards (round 5) */
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.lb li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); font-size: 13px; }
.lb li em { font: 800 13px var(--f-display); color: var(--dim); font-style: normal; text-align: right; }
.lb li b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li span { font: 600 12.5px var(--f-mono, monospace); color: var(--txt-2); font-variant-numeric: tabular-nums; }
.lb li:nth-child(1) em { color: #f5c518; } .lb li:nth-child(2) em { color: #cfd6df; } .lb li:nth-child(3) em { color: #d98c4a; }
.lb li.me { background: var(--acc-soft); outline: 1px solid rgba(255, 204, 0, 0.45); }
.lb li.me b { color: var(--acc); }
.lb li.gap { margin-top: 6px; }
.lb-of { color: var(--dim); font-size: 12px; }
.lb-login { justify-self: start; }
/* sized by the panel, not the window: the menus live in a ~590 px side panel on a desktop */
.ev-list, .pf-tops { container-type: inline-size; }
.ev .ev-board { display: grid; gap: 6px; align-content: start; }
@container (min-width: 760px) {
  .ev.has-board { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 18px; }
  .ev.has-board > :not(.ev-board) { grid-column: 1; }
  .ev.has-board .ev-board { grid-column: 2; grid-row: 1 / span 3; }
}
.pf-tops .tops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
@container (min-width: 880px) { .pf-tops .tops { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pf-tops .top { display: grid; gap: 6px; align-content: start; }
.pf-tops .top > small { font: 700 12px var(--f-display); letter-spacing: 0.14em; color: var(--dim); }
.pf-tops .lb-login { margin-top: 10px; }
.rw-board { display: block; margin-top: 6px; color: var(--acc); font-weight: 700; }

/* v0.9.27 the driver card on the profile: the car number, and where the name comes from */
.pf-driver .pf-drv { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pf-driver label { font-weight: 700; font-size: 14px; }
.pf-driver input { width: 74px; padding: 7px 10px; font: 800 16px var(--mono); text-align: center; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; color: var(--txt); }
.pf-driver input:focus { border-color: var(--acc); outline: none; }
.pf-nmsg { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.pf-nmsg.good { color: #6ee79a; } .pf-nmsg.bad { color: #ff8b8b; }
.pf-namehint { margin: 6px 0 0; font-size: 12.5px; color: var(--dim); line-height: 1.4; }
/* v0.9.27 a guest's sign-in prompt in place of a leaderboard (src/ui/screens.js signInBoards) */
.lb-signin { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(255, 204, 0, 0.07); border: 1px solid rgba(255, 204, 0, 0.35); }
.lb-signin .lb-lock { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 204, 0, 0.16); color: var(--acc); }
.lb-signin .lb-lock svg { width: 20px; height: 20px; }
.lb-signin b { display: block; font-size: 15px; font-weight: 800; }
.lb-signin small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: #c9cfda; }
.lb-signin .lb-login { margin-top: 9px; padding: 8px 14px; font-size: 13.5px; }
/* v0.9.28 rewarded ads in the Style shop and on the hub: free credits, free items */
.ad-credits { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 0 0 12px; border-radius: 12px; background: linear-gradient(110deg, rgba(255, 204, 0, 0.16), rgba(255, 140, 0, 0.06)); border: 1px solid rgba(255, 204, 0, 0.4); }
.ad-credits > span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 0; }
.ad-credits > span svg { grid-row: span 2; width: 26px; height: 26px; }
.ad-credits b { font-size: 15px; } .ad-credits small { font-size: 12.5px; color: #dfe4ec; }
.ad-credits .primary { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; }
.it-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-free { display: inline-flex; align-items: center; gap: 5px; border-color: rgba(255, 204, 0, 0.5) !important; color: var(--acc) !important; }
