/*
  Habibi League — design system.
  Built on the client's brand identity (Brand Identity & Student Website UI v1.0):
  Midnight Navy arena, Electric Blue actions, Championship Gold for achievements only,
  Teal for success and teams, Alexandria for Arabic, Inter for Latin text, Sora for numbers.
*/
/* The brand fonts are served by the platform itself, not by a font service: one variable file per script, and the
   browser fetches only the scripts a page uses. SIL Open Font License — the text is in wwwroot/fonts/OFL.txt. */
@font-face { font-family: "Alexandria"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/alexandria-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Alexandria"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/alexandria-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alexandria"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/alexandria-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("../fonts/sora-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("../fonts/sora-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;

  --navy: #0B1220;        /* the arena: page background */
  --navy-900: #080D19;
  --navy-800: #121B2E;    /* cards */
  --navy-700: #1A2540;    /* raised surfaces, hover */
  --line: #26324D;        /* borders, dividers */
  --blue: #315CFF;        /* primary actions, focus, active */
  --blue-600: #2449DB;
  --blue-300: #6F8DFF;    /* blue text and icons on navy */
  --gold: #F2BD55;        /* achievements only: XP, awards, rank 1–3 */
  --ice: #F5F7FC;         /* text on navy */
  --teal: #35C9C0;        /* success, correct, streak growth, teams */
  --slate: #8290A5;       /* secondary text, inactive */
  --mist: #AAB4C5;        /* labels on navy */
  --alert: #FF6B78;       /* errors, wrong answers */
  --ember: #FF8A4C;       /* the streak flame */

  --blue-soft: rgba(49, 92, 255, .16);
  --gold-soft: rgba(242, 189, 85, .14);
  --teal-soft: rgba(53, 201, 192, .14);
  --alert-soft: rgba(255, 107, 120, .13);
  --ember-soft: rgba(255, 138, 76, .15);
  --slate-soft: rgba(130, 144, 165, .16);

  /* names the pages already use */
  --bg: var(--navy);
  --surface: var(--navy-800);
  --ink: var(--ice);
  --muted: var(--mist);
  --brand: var(--blue);
  --ok: var(--teal);
  --bad: var(--alert);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --radius: var(--r-lg);

  --glow-blue: 0 10px 28px rgba(49, 92, 255, .35);
  --glow-gold: 0 0 0 1px rgba(242, 189, 85, .55), 0 10px 30px rgba(242, 189, 85, .18);
  --shadow: 0 14px 34px rgba(0, 0, 0, .35);

  --font: "Inter", "Alexandria", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-head: "Sora", "Alexandria", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-num: "Sora", "Inter", "Alexandria", system-ui, sans-serif;

  --shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 3 92 17v35c0 22-18 38-42 45C26 90 8 74 8 52V17Z'/%3E%3C/svg%3E");
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='50' viewBox='0 0 46 50'%3E%3Cpath d='M23 6 37 11v12c0 9-6 15-14 18-8-3-14-9-14-18V11Z' fill='none' stroke='%236F8DFF' stroke-opacity='.11' stroke-width='1.4'/%3E%3C/svg%3E");
  --chevrons: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='26' viewBox='0 0 44 26'%3E%3Cpath d='m4 19 18-11 18 11' fill='none' stroke='%23315CFF' stroke-opacity='.22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ice);
  background-color: var(--navy);
  /* the dot matrix: the brand's default background texture */
  background-image: radial-gradient(rgba(111, 141, 255, .10) 1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.35; margin: 0 0 .5em; font-weight: 700; letter-spacing: 0; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--blue-300); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: rgba(49, 92, 255, .45); color: #fff; }
[hidden] { display: none !important; }
.muted { color: var(--mist); }
.small { font-size: .875rem; line-height: 1.6; }
.center { text-align: center; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num, .ltr { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.22em; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 560px; }
main { padding: 28px 0 64px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(11, 18, 32, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ice); font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; letter-spacing: .06em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand i { font-style: normal; color: var(--blue-300); }
.brand .logo-mark { width: 30px; height: 36px; flex: none; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.brand:hover .logo-mark { transform: translateY(-2px) scale(1.05); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; color: var(--mist); font-weight: 500; font-size: .95rem; transition: background .15s, color .15s; }
.nav a:hover { background: var(--navy-700); color: var(--ice); text-decoration: none; }
.nav a.active { background: var(--blue-soft); color: var(--blue-300); font-weight: 700; }
.nav a.btn { color: #fff; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; color: inherit; }
.signout button.link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; color: var(--slate); font-weight: 500; font-size: .95rem; transition: background .15s, color .15s; }
.signout button.link:hover { background: var(--navy-700); color: var(--ice); }

/* small phones, signed out: the mark alone makes room for the three links */
@media (max-width: 520px) {
  .topbar.guest .brand span { display: none; }
  .topbar.guest .nav { gap: 2px; }
  .topbar.guest .nav a:not(.btn) { padding: 8px 10px; }
}
@media (max-width: 360px) {
  .topbar.guest .nav a { font-size: .85rem; }
  .topbar.guest .nav a:not(.btn) { padding: 8px 6px; }
  .topbar.guest .nav a.btn { padding: 7px 10px; }
}
/* the running exam: no links to wander off through */
.is-focus .topbar .nav { display: none; }
/* phones: the student's pages move to a bar at the bottom of the screen */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar .container { min-height: 58px; }
  .topbar .nav.for-student { display: none; }
  .signout .label { display: none; }
  .has-tabbar main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: rgba(11, 18, 32, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 4px 9px; color: var(--slate); font-size: .72rem; font-weight: 500; line-height: 1.3; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .icon { width: 22px; height: 22px; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
  .tabbar a.active { color: var(--blue-300); font-weight: 700; }
  .tabbar a.active .icon { transform: translateY(-1px) scale(1.08); }
  .tabbar a.active::before { content: ""; position: absolute; top: -1px; width: 30px; height: 3px; border-radius: 0 0 4px 4px; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-weight: 700; line-height: 1.3; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--blue); color: #fff; box-shadow: var(--glow-blue);
  transition: background .15s, box-shadow .2s, transform .12s, border-color .15s;
}
.btn:hover { background: #4068ff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(49, 92, 255, .45); }
.btn:active { transform: translateY(0) scale(.985); background: var(--blue-600); }
.btn:disabled, .btn[aria-disabled=true] { background: var(--navy-700); color: var(--slate); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--navy-700); color: var(--ice); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: #22304f; border-color: #36466b; box-shadow: none; }
.btn.gold { background: var(--gold); color: var(--navy); box-shadow: 0 10px 28px rgba(242, 189, 85, .28); }
.btn.gold:hover { background: #f6c96c; box-shadow: 0 14px 34px rgba(242, 189, 85, .36); }
.btn.danger { background: transparent; color: var(--alert); border-color: rgba(255, 107, 120, .45); box-shadow: none; }
.btn.danger:hover { background: var(--alert-soft); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 7px 14px; font-size: .875rem; border-radius: 11px; box-shadow: none; }
.btn.sm:hover { box-shadow: none; }
.btn.block { width: 100%; white-space: normal; text-align: center; }

/* ---------- cards, forms ---------- */
.card { background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .875rem; color: var(--mist); }
.field .hint { color: var(--slate); font-size: .8125rem; margin-top: 6px; line-height: 1.6; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  font: inherit; background: var(--navy-800); color: var(--ice);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--slate); }
input:hover, select:hover, textarea:hover { border-color: #36466b; }
select option { background: var(--navy-800); color: var(--ice); }
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(49, 92, 255, .25); background: #0f1830; }
.btn:focus-visible, .option:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid rgba(111, 141, 255, .65); outline-offset: 2px; }
input:-webkit-autofill { -webkit-text-fill-color: var(--ice); box-shadow: 0 0 0 1000px var(--navy-800) inset; caret-color: var(--ice); }
input[type=file] { font: inherit; width: 100%; }
/* File field: the real input stays in the page for the keyboard and screen readers, but out of sight. */
.file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.file input[type=file]:focus-visible + label { outline: 3px solid rgba(111, 141, 255, .65); outline-offset: 2px; }
.file-name { color: var(--slate); font-size: .875rem; overflow-wrap: anywhere; }
details > summary { cursor: pointer; }
.field-validation-error, .validation-summary-errors { color: var(--alert); font-size: .8125rem; }
.field-validation-error { display: block; margin-top: 6px; }
.validation-summary-errors ul { margin: 0 0 14px; padding: 12px 30px 12px 14px; background: var(--alert-soft); border: 1px solid rgba(255, 107, 120, .35); border-radius: var(--r-md); }
.validation-summary-valid { display: none; }
.input-validation-error { border-color: var(--alert) !important; }
.input-validation-error:focus { box-shadow: 0 0 0 4px rgba(255, 107, 120, .2) !important; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.alert { padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 16px; border: 1px solid transparent; animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.alert.ok { background: var(--teal-soft); color: #7fe3dc; border-color: rgba(53, 201, 192, .35); }
.alert.bad { background: var(--alert-soft); color: #ff98a1; border-color: rgba(255, 107, 120, .35); }
.alert.info { background: var(--blue-soft); color: #a9bbff; border-color: rgba(111, 141, 255, .35); }
.alert.warn { background: var(--gold-soft); color: var(--gold); border-color: rgba(242, 189, 85, .32); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.5; background: var(--blue-soft); color: #9db1ff; white-space: nowrap; }
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.badge.bad { background: var(--alert-soft); color: var(--alert); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.fire { background: var(--ember-soft); color: var(--ember); }
.badge.gray { background: var(--slate-soft); color: var(--mist); }

/* ---------- avatars ---------- */
.avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover; font-family: var(--font); font-weight: 700; font-size: .95rem; line-height: 1; color: var(--ice); background: var(--navy-700); box-shadow: inset 0 0 0 2px rgba(111, 141, 255, .55); }
img.avatar { box-shadow: 0 0 0 2px rgba(111, 141, 255, .55); }
/* a team wears the shield */
.avatar.team { border-radius: 0; box-shadow: none; color: #06221f; background: linear-gradient(160deg, #4fe0d6, #1f9d96); -webkit-mask: var(--shield) center / contain no-repeat; mask: var(--shield) center / contain no-repeat; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.avatar.sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.3rem; font-weight: 800; }
.avatar.xl .icon { width: 30px; height: 30px; }

/* ---------- landing ---------- */
.step-num { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-300); display: grid; place-items: center; font-family: var(--font-num); font-weight: 800; margin-bottom: 12px; }

/* ---------- lists ---------- */
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--r-lg); flex-wrap: wrap; transition: border-color .15s, transform .15s; }
.item:hover { border-color: #36466b; }
.item-main { flex: 1; min-width: 180px; }
.item-main strong { display: block; font-weight: 600; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--navy-800); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, transform .15s; }
.lb-row:hover { border-color: #36466b; }
.lb-row.me { border-color: var(--blue); background: linear-gradient(90deg, rgba(49, 92, 255, .22), rgba(49, 92, 255, .10)); box-shadow: 0 0 0 1px rgba(49, 92, 255, .35), 0 12px 30px rgba(49, 92, 255, .16); }
#my-place { scroll-margin-top: 90px; }
.my-rank { margin: 0 0 14px; }
.my-rank a { display: inline-flex; gap: 8px; align-items: baseline; padding: 9px 16px; border: 1px solid rgba(111, 141, 255, .55); border-radius: 999px; background: var(--blue-soft); color: #b6c5ff; font-weight: 700; transition: background .15s; }
.my-rank a:hover { text-decoration: none; background: rgba(49, 92, 255, .28); }
.lb-rank { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; font-family: var(--font-num); font-weight: 800; font-variant-numeric: tabular-nums; background: var(--navy-700); color: var(--mist); }
.lb-rank.r1 { background: var(--gold); color: var(--navy); box-shadow: 0 0 18px rgba(242, 189, 85, .45); }
.lb-rank.r2 { background: #cfd7e6; color: var(--navy); }
.lb-rank.r3 { background: #d99a6c; color: var(--navy); }
.lb-name { flex: 1; min-width: 0; }
.lb-name strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-xp { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gold); }
.lb-xp small { font-weight: 500; color: var(--slate); }

.tabs { display: inline-flex; background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; gap: 4px; margin-bottom: 16px; }
.tabs a { padding: 9px 20px; border-radius: 10px; color: var(--mist); font-weight: 600; font-size: .9rem; transition: background .15s, color .15s; }
.tabs a:hover { text-decoration: none; color: var(--ice); }
.tabs a.active { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(49, 92, 255, .35); }

.stat { background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat b { display: block; font-family: var(--font-num); font-size: 1.6rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat span { color: var(--mist); font-size: .8125rem; }

.code-box { display: inline-block; direction: ltr; font-family: var(--font-num); font-size: 1.9rem; font-weight: 800; letter-spacing: 6px; color: var(--ice); background: rgba(49, 92, 255, .10); border: 1.5px dashed rgba(111, 141, 255, .7); border-radius: var(--r-lg); padding: 10px 20px; }
.choice { display: block; text-align: start; }

/* ---------- quiz ---------- */
/* The running exam: the clock and the place in the exam stay in view, the question below them. */
.quiz { max-width: 680px; margin: 0 auto; display: grid; gap: 14px; }
.quiz-head { position: sticky; top: 58px; z-index: 5; display: flex; align-items: center; gap: 14px; margin: -8px -4px 0; padding: 10px 4px; background: linear-gradient(to bottom, rgba(11, 18, 32, .97) 75%, rgba(11, 18, 32, 0)); }
.quiz-ring { position: relative; flex: none; width: 68px; height: 68px; display: grid; place-items: center; --left: 0px; }
.quiz-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.quiz-ring circle { fill: none; stroke-width: 5; }
.quiz-ring .track { stroke: rgba(242, 189, 85, .16); }
.quiz-ring .fill { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 175.93px; stroke-dashoffset: var(--left); transition: stroke-dashoffset .3s linear, stroke .3s; }
.quiz-ring .timer { position: relative; padding: 0; border: 0; background: none; font-family: var(--font-num); font-size: .9rem; font-weight: 700; color: var(--gold); direction: ltr; font-variant-numeric: tabular-nums; }
.quiz-ring.low .fill { stroke: var(--alert); }
.quiz-ring.low .track { stroke: rgba(255, 107, 120, .18); }
.quiz-ring.low .timer { color: var(--alert); animation: pulse 1s ease-in-out infinite; }
.quiz-meta { flex: 1; min-width: 0; display: grid; gap: 4px; }
.quiz-title { font-size: .78rem; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-counter { font-family: var(--font); font-size: 1.02rem; font-weight: 700; }
.quiz-steps { display: flex; gap: 4px; margin-top: 2px; }
.quiz-steps span { flex: 1; max-width: 44px; height: 5px; border-radius: 999px; background: var(--navy-700); transition: background .3s, box-shadow .3s; }
.quiz-steps span.done { background: var(--teal); }
.quiz-steps span.now { background: var(--blue); box-shadow: 0 0 10px rgba(49, 92, 255, .8); }
.quiz-card { padding: 22px 20px; }
.quiz-card.is-entering { animation: question-in .4s cubic-bezier(.2, .8, .2, 1) both; }
.quiz-card.is-entering .option { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.quiz-card.is-entering .option:nth-child(2) { animation-delay: .05s; }
.quiz-card.is-entering .option:nth-child(3) { animation-delay: .1s; }
.quiz-card.is-entering .option:nth-child(4) { animation-delay: .15s; }
.quiz-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: .8rem; line-height: 1.6; color: var(--slate); }
.quiz-note .icon { width: 15px; height: 15px; margin-top: 3px; flex: none; }
.option-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.2, .8, .2, 1); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.option.selected .option-mark { opacity: 1; transform: scale(1); }
.option:disabled { cursor: default; opacity: .75; }
@media (min-width: 761px) { .quiz-head { top: 64px; } }
.question-text { font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; line-height: 1.6; margin: 6px 0 18px; }
.question-text, .option-text { white-space: pre-line; overflow-wrap: anywhere; }
.option-text { flex: 1; text-align: start; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 14px 16px; text-align: start; border-radius: 16px; border: 1.5px solid var(--line); background: var(--navy-800); color: var(--ice); font: inherit; font-size: 1.05rem; cursor: pointer; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s; }
.option:hover { border-color: rgba(111, 141, 255, .7); background: #151f38; }
.option:active { transform: scale(.99); }
.option.selected { border-color: var(--blue); background: rgba(49, 92, 255, .14); box-shadow: 0 0 0 3px rgba(49, 92, 255, .22); }
.option-key { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--navy-700); color: var(--mist); font-weight: 700; transition: background .15s, color .15s; }
.option.selected .option-key { background: var(--blue); color: #fff; }

.result-xp { font-family: var(--font-num); font-size: 3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--gold); text-shadow: 0 0 34px rgba(242, 189, 85, .35); }
.calc { width: 100%; border-collapse: collapse; }
.calc td { padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--mist); }
.calc td:last-child { text-align: end; white-space: nowrap; font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ice); }
.calc tr:last-child td { border-bottom: 0; font-size: 1.1rem; color: var(--ice); }
.calc tr:last-child td:last-child { color: var(--gold); }

/* ---------- tables (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--navy-800); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #0f1729; font-weight: 600; white-space: nowrap; color: var(--slate); font-size: .78rem; letter-spacing: .02em; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(111, 141, 255, .05); }
.table tr:last-child td { border-bottom: 0; }
.table td.ltr, .table td .ltr { white-space: nowrap; }
.table td.n, .table th.n { text-align: end; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 30px 16px; text-align: center; color: var(--mist); background: rgba(18, 27, 46, .6); border: 1px dashed #36466b; border-radius: var(--r-lg); }

/* ---------- admin shell ---------- */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.admin-side { background: var(--navy-900); border-inline-end: 1px solid var(--line); padding: 20px 12px; }
.admin-side .brand { margin-bottom: 20px; padding: 0 8px; letter-spacing: 0; font-family: var(--font); font-size: 1rem; }
.admin-side nav { display: grid; gap: 3px; }
.admin-side nav a, .admin-side button.link { display: block; width: 100%; text-align: start; color: var(--mist); padding: 9px 12px; border-radius: 11px; font-weight: 500; font-size: .93rem; transition: background .15s, color .15s; }
.admin-side nav a:hover, .admin-side button.link:hover { background: var(--navy-700); color: var(--ice); text-decoration: none; }
.admin-side nav a.active { background: var(--blue); color: #fff; font-weight: 700; box-shadow: 0 8px 20px rgba(49, 92, 255, .3); }
.admin-main { padding: 28px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.q-item { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; background: var(--navy-800); }
.q-item ol { margin: 6px 0 0; padding-inline-start: 22px; color: var(--mist); }
.q-item li.correct { color: var(--teal); font-weight: 700; }
.inline-form { display: inline; }

/* ---------- student home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.home-notes { max-width: 460px; margin: 14px auto 0; display: grid; gap: 8px; }
.home-notes p { margin: 0; }
.home-schedule { display: grid; gap: 24px; align-items: start; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head > .icon { color: var(--blue-300); width: 22px; height: 22px; }
.section-head a { font-size: .875rem; font-weight: 600; }
/* a phone opened for today's exam: the exam first, the card after it */
@media (max-width: 899px) { .home.has-mission .home-mission { order: -1; } }
@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .home-card, .home-schedule { grid-column: 1 / -1; }
  .home-notes { max-width: none; grid-auto-flow: column; justify-content: start; gap: 24px; }
  .home-schedule { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); column-gap: 32px; }
}

/* today's mission */
.mission { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 12px; padding: 20px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--navy-800); }
.mission.is-open { border-color: rgba(111, 141, 255, .65); background: linear-gradient(155deg, #17265a, #101a34 62%, #0d152b); box-shadow: 0 22px 48px -18px rgba(49, 92, 255, .55); }
.mission.is-open::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--chevrons); -webkit-mask-image: linear-gradient(to bottom left, #000, transparent 70%); mask-image: linear-gradient(to bottom left, #000, transparent 70%); }
.mission-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mission-kicker { font-size: .78rem; font-weight: 600; color: var(--blue-300); letter-spacing: .02em; }
.mission-title { margin: 0; font-family: var(--font); font-size: 1.45rem; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.mission-facts { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; color: var(--mist); }
.mission-facts li { display: inline-flex; align-items: center; gap: 6px; }
.mission-facts .icon { width: 16px; height: 16px; color: var(--slate); }
.mission-facts b { color: var(--ice); font-weight: 700; }
.mission-streak { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md); background: rgba(8, 13, 25, .55); border: 1px solid rgba(255, 138, 76, .28); font-size: .88rem; color: var(--mist); }
.mission-streak .icon { width: 18px; height: 18px; color: var(--ember); animation: flame 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.mission-streak b { margin-inline-start: auto; font-family: var(--font-num); font-size: 1.1rem; font-weight: 800; color: var(--gold); }
.mission .btn .icon { transition: transform .2s; }
.mission .btn:hover .icon { transform: translateX(-4px); }
.mission-done { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mission-xp { font-family: var(--font-num); font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.mission-foot { margin: 0; }

/* the exam's opening page */
.exam-intro h1 { margin: 6px 0 8px; font-family: var(--font); }
.exam-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.exam-facts .stat { background: rgba(8, 13, 25, .5); }
.exam-facts .stat b { font-size: 1.35rem; }
.exam-facts .stat.streak { grid-column: 1 / -1; display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; border-color: rgba(255, 138, 76, .35); }
.exam-facts .stat.streak b { color: var(--gold); }
.rules { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 10px; }
.rules li { position: relative; padding-inline-start: 30px; color: var(--mist); line-height: 1.7; }
.rules li::before { content: ""; position: absolute; inset-inline-start: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236F8DFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8.5'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* =====================================================================
   The player card (CRD-01..03)
   One markup, two shapes: a portrait trading card on phones and a wide
   arena banner on desktop. It tilts under the pointer, catches the light,
   and flips to show the streak ladder and the catch-up bank on its back.
   ===================================================================== */
.pcard {
  --rx: 0deg; --ry: 0deg; --flip: 0deg; --mx: 50%; --my: 0%;
  --edge: var(--blue); --edge-soft: rgba(111, 141, 255, .28); --aura: rgba(49, 92, 255, .30);
  position: relative; max-width: 460px; margin-inline: auto; perspective: 1500px;
  /* the entrance is played here, not on the turning part: an animated opacity there would flatten the two faces into one */
  animation: card-in .8s cubic-bezier(.2, .85, .25, 1) backwards;
}
/* gold belongs to the first three places */
.pcard.r1, .pcard.r2, .pcard.r3 { --edge: var(--gold); --edge-soft: rgba(242, 189, 85, .30); --aura: rgba(242, 189, 85, .20); }
.pcard-inner { display: grid; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip))); transition: transform .8s cubic-bezier(.2, .85, .25, 1); }
.pcard.is-tilting .pcard-inner { transition: transform .1s linear; }
.pcard[data-flipped=true] { --flip: 180deg; }

.pcard-face {
  grid-area: 1 / 1; position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: var(--r-xl); border: 1.5px solid transparent; color: var(--ice);
  background:
    linear-gradient(160deg, #15224a 0%, #0f1830 46%, #0a1122 100%) padding-box,
    linear-gradient(150deg, var(--edge) 0%, var(--edge-soft) 32%, rgba(38, 50, 77, .9) 60%, var(--edge) 100%) border-box;
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .7), 0 18px 50px -12px var(--aura);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
/* the two faces sit a hair apart so the one facing the viewer is also the one that takes the clicks */
.pcard-front { transform: translateZ(1px); }
.pcard-back { transform: rotateY(180deg) translateZ(1px); }
/* The face turned away is also switched off outright, at the moment the card stands edge-on (0.1s into the
   turn with this easing). Not every engine hides a turned-away face by itself: WebKit without full 3D
   drawing showed the back of the card, mirrored, where the front should be. */
.pcard-face { transition: visibility 0s .1s; }
.pcard[data-flipped=false] .pcard-back, .pcard[data-flipped=true] .pcard-front { visibility: hidden; pointer-events: none; }
.pcard-art { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(49, 92, 255, .42), transparent 62%),
    radial-gradient(70% 60% at 0% 100%, var(--aura), transparent 65%),
    var(--lattice);
}
.pcard-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 13, 25, .75), transparent 45%); }
/* the light that follows the pointer */
.pcard-sheen { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .35s; mix-blend-mode: screen;
  background:
    radial-gradient(42% 52% at var(--mx) var(--my), rgba(255, 255, 255, .22), transparent 70%),
    linear-gradient(115deg, transparent 32%, rgba(111, 141, 255, .22) 44%, rgba(242, 189, 85, .16) 50%, rgba(53, 201, 192, .18) 56%, transparent 68%);
  background-size: 100% 100%, 240% 100%; background-position: 0 0, var(--mx) 0;
}
.pcard.is-tilting .pcard-sheen { opacity: 1; }
.pcard-front::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .16) 50%, transparent 58%); transform: translateX(120%); animation: card-sweep 1.4s .55s ease-out both; }

.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pcard-brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-family: var(--font-head); font-weight: 800; font-size: .8rem; letter-spacing: .1em; }
.pcard-brand i { font-style: normal; color: var(--blue-300); }
.pcard-brand .logo-mark { width: 22px; height: 26px; }
.pcard-kind { white-space: nowrap; font-family: var(--font-head); font-weight: 700; font-size: .68rem; letter-spacing: .18em; color: var(--gold); }

.pcard-hero { display: flex; align-items: center; gap: 16px; }
.pcard-photo { position: relative; flex: none; width: 108px; aspect-ratio: 4 / 5; padding: 2px; border-radius: 24px; background: linear-gradient(160deg, var(--edge), rgba(111, 141, 255, .12) 55%, var(--edge)); box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 0 34px -6px var(--aura); }
.pcard-photo img, .pcard-initials { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 22px; object-fit: cover; background: radial-gradient(120% 90% at 50% 0%, #24356b, #111a33 70%); }
.pcard-initials { font-family: var(--font); font-weight: 800; font-size: 2.3rem; line-height: 1; color: var(--ice); text-shadow: 0 4px 18px rgba(49, 92, 255, .6); }
.pcard-id { min-width: 0; flex: 1; display: grid; gap: 4px; justify-items: start; }
.pcard-role { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; font-size: .7rem; font-weight: 700; background: var(--blue); color: #fff; }
.pcard-role.team { background: rgba(53, 201, 192, .16); color: var(--teal); box-shadow: inset 0 0 0 1px rgba(53, 201, 192, .45); }
.pcard-role .icon { width: 13px; height: 13px; }
.pcard-name { margin: 2px 0 0; font-family: var(--font); font-size: 1.45rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.pcard-nick { font-size: .9rem; font-weight: 600; color: var(--blue-300); }
.pcard-meta { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 1px; font-size: .8rem; color: var(--mist); }
.pcard-meta li { display: flex; align-items: baseline; gap: 6px; }
.pcard-meta .icon { width: 14px; height: 14px; color: var(--slate); position: relative; top: 2px; }

.pcard-team { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; background: rgba(53, 201, 192, .09); border: 1px solid rgba(53, 201, 192, .32); }
.pcard-team .avatar { width: 36px; height: 36px; font-size: .9rem; }
.pcard-team-name { flex: 1; min-width: 0; line-height: 1.35; }
.pcard-team-name small { display: block; font-size: .68rem; color: var(--teal); }
.pcard-team-name strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-team-xp { text-align: end; line-height: 1.3; }
.pcard-team-xp b { display: block; font-family: var(--font-num); font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.pcard-team-xp small { font-size: .68rem; color: var(--mist); }

.pcard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pcard-stat { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 96px; padding: 10px 6px; text-align: center; border-radius: 18px; background: rgba(8, 13, 25, .55); border: 1px solid rgba(111, 141, 255, .16); transition: border-color .3s, box-shadow .3s, transform .3s; }
.pcard-stat > .icon { width: 20px; height: 20px; color: var(--blue-300); }
.pcard-stat > b { font-family: var(--font-num); font-size: 1.5rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pcard-stat > span { font-size: .72rem; color: var(--mist); line-height: 1.4; }
.pcard-stat.xp > .icon, .pcard-stat.xp > b { color: var(--gold); }
.pcard.r1 .pcard-stat.rank > .icon, .pcard.r1 .pcard-stat.rank > b,
.pcard.r2 .pcard-stat.rank > .icon, .pcard.r2 .pcard-stat.rank > b,
.pcard.r3 .pcard-stat.rank > .icon, .pcard.r3 .pcard-stat.rank > b { color: var(--gold); }
.pcard-stat.is-bumped { border-color: rgba(242, 189, 85, .8); box-shadow: 0 0 26px rgba(242, 189, 85, .28); transform: translateY(-2px); }
/* the streak ring: how far the multiplier has climbed between its start and its cap */
.pcard-ring { position: relative; width: 54px; height: 54px; display: grid; place-items: center; }
.pcard-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pcard-ring circle { fill: none; stroke-width: 5; }
.pcard-ring .track { stroke: rgba(255, 138, 76, .18); }
.pcard-ring .fill { stroke: var(--ember); stroke-linecap: round; stroke-dasharray: 138.2px; stroke-dashoffset: calc(138.2px * (1 - var(--fill, 0))); transition: stroke-dashoffset .9s cubic-bezier(.2, .85, .25, 1); filter: drop-shadow(0 0 5px rgba(255, 138, 76, .6)); animation: ring-in 1.1s .3s cubic-bezier(.2, .85, .25, 1) both; }
.pcard-ring b { position: relative; font-family: var(--font-num); font-size: .92rem; font-weight: 800; color: var(--ice); }
/* the multiplier is written inside the ring on phones and beside it on desktop */
.pcard-stat.streak > b { display: none; }
/* the streak's flame: two tongues that never move together; it burns only while the streak is alive */
.fire { width: 1em; height: 1.17em; flex: none; overflow: visible; }
.fire-out { fill: var(--slate); transform-origin: 50% 100%; transform-box: fill-box; }
.fire-in { fill: var(--mist); transform-origin: 50% 100%; transform-box: fill-box; }
.is-streaking .fire-out, .fire.lit .fire-out { fill: var(--ember); animation: fire-out 1.15s ease-in-out infinite alternate; }
.is-streaking .fire-in, .fire.lit .fire-in { fill: #FFD166; animation: fire-in .8s ease-in-out infinite alternate; }
.is-streaking .fire, .fire.lit { filter: drop-shadow(0 0 5px rgba(255, 138, 76, .7)); }
.pcard-streak { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--mist); }
.pcard-streak .fire { font-size: 1.05rem; }
.pcard.is-streaking .pcard-streak { color: var(--ember); }
.pcard.is-streaking .pcard-stat.streak { border-color: rgba(255, 138, 76, .45); box-shadow: inset 0 -18px 26px -18px rgba(255, 138, 76, .35); }
.pcard-days { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--ember); background: var(--ember-soft); white-space: nowrap; }
.pcard-days .icon { width: 14px; height: 14px; }
.pcard-days .fire { font-size: .95rem; }
.pcard-days b { color: var(--ice); font-weight: 700; }
.pcard.is-streaking .pcard-days .icon { animation: flame 1.6s ease-in-out infinite; transform-origin: 50% 90%; }

.pcard-foot { margin-top: auto; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pcard-no { font-size: .7rem; color: var(--slate); line-height: 1.4; }
.pcard-no b { display: block; font-family: var(--font-num); font-size: .82rem; font-weight: 600; letter-spacing: .06em; color: var(--mist); }
.pcard [hidden] { display: none !important; }
.pcard-boost { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px; font-size: .8rem; font-weight: 700; line-height: 1.5; color: var(--navy); background: linear-gradient(100deg, #f8d993, var(--gold)); animation: boost 2.4s ease-in-out infinite; }
.pcard-boost .icon { width: 18px; height: 18px; }
.pcard-flip { margin-inline-start: auto; display: none; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 12px; border: 1px solid rgba(111, 141, 255, .35); background: rgba(8, 13, 25, .5); color: var(--mist); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.pcard.is-live .pcard-flip { display: inline-flex; }
.pcard-flip:hover { background: var(--blue-soft); color: var(--ice); border-color: var(--blue-300); }
.pcard-flip .icon { width: 16px; height: 16px; transition: transform .5s cubic-bezier(.2, .85, .25, 1); }
.pcard-flip:hover .icon { transform: rotate(180deg); }

/* the back */
.pcard-back h3 { margin: 0 0 8px; font-family: var(--font); font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pcard-back h3 .icon { width: 17px; height: 17px; color: var(--ember); }
.pcard-back h3 .fire { font-size: 1.05rem; }
.pcard-back h3 .icon.gold { color: var(--gold); }
.pcard-back p { margin: 8px 0 0; font-size: .76rem; line-height: 1.7; color: var(--mist); }
.pcard-panels { display: grid; gap: 12px; margin-block: auto; }
.pcard-panel { padding: 12px 14px; border-radius: 18px; background: rgba(8, 13, 25, .55); border: 1px solid rgba(111, 141, 255, .16); }
.pcard-ladder { display: flex; gap: 5px; }
.pcard-ladder span { flex: 1; direction: ltr; unicode-bidi: isolate; padding: 6px 0; text-align: center; border-radius: 9px; font-family: var(--font-num); font-size: .72rem; font-weight: 700; color: var(--slate); background: rgba(130, 144, 165, .12); transition: background .4s, color .4s, box-shadow .4s; }
.pcard-ladder span.done { color: var(--ember); background: var(--ember-soft); }
.pcard-ladder span.now { color: var(--navy); background: var(--ember); box-shadow: 0 0 18px rgba(255, 138, 76, .55); }
.pcard-meter { height: 8px; border-radius: 999px; background: rgba(242, 189, 85, .16); overflow: hidden; }
.pcard-meter div { height: 100%; width: calc(100% * var(--left, 0)); border-radius: 999px; background: linear-gradient(90deg, #f6d48a, var(--gold)); transition: width .8s cubic-bezier(.2, .85, .25, 1); }
.pcard-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: .8rem; }
.pcard-facts dt { color: var(--slate); }
.pcard-facts dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }

/* desktop: the wide arena banner */
@media (min-width: 900px) {
  .pcard { max-width: none; }
  .pcard-face { padding: 26px 34px 22px; gap: 0; min-height: 400px; }
  .pcard-front { display: grid; grid-template-columns: minmax(0, 1.25fr) 290px minmax(0, .85fr); grid-template-rows: auto 1fr auto auto auto; column-gap: 28px;
    grid-template-areas: "head head head" "id photo stats" "team photo stats" "boost photo stats" "foot foot foot"; }
  .pcard-boost { grid-area: boost; justify-self: start; margin-bottom: 16px; }
  .pcard-art { background:
    radial-gradient(46% 78% at 50% 46%, rgba(49, 92, 255, .50), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, var(--aura), transparent 70%),
    var(--lattice); }
  /* the shield standing behind the player */
  .pcard-front .pcard-art::before { content: ""; position: absolute; left: 50%; top: 52%; width: 330px; height: 330px; transform: translate(-50%, -50%); background: rgba(111, 141, 255, .13); -webkit-mask: var(--shield) center / contain no-repeat; mask: var(--shield) center / contain no-repeat; }
  .pcard-head { grid-area: head; margin-bottom: 8px; }
  .pcard-brand { font-size: .9rem; }
  .pcard-brand .logo-mark { width: 26px; height: 31px; }
  .pcard-hero { display: contents; }
  .pcard-photo { grid-area: photo; align-self: center; justify-self: center; width: 230px; border-radius: 30px; }
  .pcard-photo img, .pcard-initials { border-radius: 28px; }
  .pcard-initials { font-size: 5rem; }
  .pcard-id { grid-area: id; align-self: end; gap: 6px; padding-bottom: 14px; }
  .pcard-role { font-size: .75rem; padding: 4px 12px; }
  .pcard-name { font-size: 2.5rem; line-height: 1.25; }
  .pcard-nick { font-size: 1.05rem; }
  .pcard-meta { font-size: .9rem; gap: 3px; margin-top: 6px; }
  .pcard-team { grid-area: team; align-self: start; max-width: 380px; margin-bottom: 16px; }
  .pcard-stats { grid-area: stats; align-self: center; grid-template-columns: 1fr; gap: 0; }
  .pcard-stat { grid-template-columns: 1fr auto; justify-items: end; align-items: center; column-gap: 14px; min-height: 0; padding: 16px 4px; text-align: end; background: none; border: 0; border-bottom: 1px solid rgba(111, 141, 255, .2); border-radius: 0; }
  .pcard-stat:last-child { border-bottom: 0; }
  .pcard-stat > .icon, .pcard-stat > .pcard-ring { grid-column: 2; grid-row: 1 / span 2; }
  .pcard-stat > .icon { width: 30px; height: 30px; }
  .pcard-stat > b { grid-column: 1; grid-row: 2; font-size: 2rem; }
  .pcard-stat > span { grid-column: 1; grid-row: 1; font-size: .78rem; letter-spacing: .02em; }
  .pcard-stat.streak > b { display: block; }
  .pcard-stat.is-bumped { transform: none; box-shadow: none; border-color: var(--gold); }
  .pcard-foot { grid-area: foot; padding-top: 16px; border-top: 1px solid rgba(111, 141, 255, .2); }
  .pcard-back { justify-content: space-between; gap: 18px; }
  .pcard-panels { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; flex: 1; }
  .pcard-panel { padding: 18px 20px; }
  .pcard-back h3 { font-size: 1rem; }
  .pcard-back p { font-size: .82rem; }
  .pcard-facts { font-size: .88rem; gap: 8px 14px; }
  .pcard-ladder span { padding: 9px 0; font-size: .8rem; }
}
@media (min-width: 900px) { .pcard-ring b { display: none; } .pcard-ring { width: 46px; height: 46px; } .pcard-ring::after { content: ""; width: 18px; height: 18px; background: var(--ember); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3c.6 3 2.4 4.6 3.9 6.3A7 7 0 1 1 5 14c0-1.6.6-3 1.6-4 .2 1.7 1 2.7 2.2 3C8.4 9.4 9.6 5.6 12 3Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3c.6 3 2.4 4.6 3.9 6.3A7 7 0 1 1 5 14c0-1.6.6-3 1.6-4 .2 1.7 1 2.7 2.2 3C8.4 9.4 9.6 5.6 12 3Z'/%3E%3C/svg%3E") center / contain no-repeat; } }
@media (max-width: 380px) {
  .pcard-face { padding: 16px; }
  .pcard-brand { font-size: .72rem; letter-spacing: .08em; }
  .pcard-kind { font-size: .6rem; letter-spacing: .12em; }
  .pcard-photo { width: 92px; }
  .pcard-name { font-size: 1.25rem; }
  .pcard-stat > b { font-size: 1.3rem; }
}

/* ---------- fields with an icon, password eye, busy button ---------- */
.control { position: relative; }
.control > .icon { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--slate); pointer-events: none; transition: color .15s; }
.control:focus-within > .icon { color: var(--blue-300); }
.control > input, .control > select { padding-right: 46px; }
.control.has-toggle > input { padding-left: 50px; }
.pw-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--slate); cursor: pointer; transition: color .15s, background .15s; }
.pw-toggle:hover { color: var(--ice); background: var(--navy-700); }
.pw-toggle[aria-pressed=true] { color: var(--blue-300); }
.pw-toggle .icon { width: 20px; height: 20px; }
.hint.ok { color: var(--teal); }
.hint.bad { color: var(--alert); }
.btn .icon { width: 18px; height: 18px; }
.btn.is-busy { pointer-events: none; color: transparent; position: relative; }
.btn.is-busy .icon { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ---------- welcome ---------- */
.welcome { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 8px; align-items: center; padding: 36px 24px; border-radius: var(--r-xl); border: 1px solid rgba(111, 141, 255, .32); background: linear-gradient(150deg, #132047, #0e1730 55%, #0b1220); }
.welcome::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--chevrons); -webkit-mask-image: linear-gradient(to bottom right, #000, transparent 65%); mask-image: linear-gradient(to bottom right, #000, transparent 65%); }
.welcome-emblem { order: -1; position: relative; justify-self: center; width: min(230px, 62%); animation: float 6s ease-in-out infinite; }
.welcome-emblem::before { content: ""; position: absolute; inset: -18%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(49, 92, 255, .5), transparent); }
.emblem { display: block; width: 100%; height: auto; overflow: visible; }
.emblem-laurel { animation: laurel 1.1s .15s cubic-bezier(.2, .8, .2, 1) backwards; }
.welcome-text { text-align: center; }
.welcome-chips { justify-content: center; gap: 8px; margin-bottom: 14px; }
.welcome-chips .badge { padding: 5px 12px; font-size: .8rem; }
.welcome-chips .icon { width: 14px; height: 14px; }
.welcome h1 { font-family: var(--font); font-size: 2.5rem; font-weight: 800; line-height: 1.3; margin: 0 0 4px; }
.welcome-lead { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; color: var(--blue-300); margin: 0 0 12px; }
.welcome-body { color: var(--mist); max-width: 34em; margin: 0 auto 22px; }
.welcome-actions { justify-content: center; }
.welcome-actions .btn .icon { transition: transform .2s; }
.welcome-actions .btn:hover .icon { transform: translateX(-4px); }
.welcome-steps { margin-top: 20px; }
.step { position: relative; }
.step-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-300); }
.step-icon.fire { background: var(--ember-soft); color: var(--ember); }
.step-icon .icon { width: 24px; height: 24px; }
.step .step-num { position: absolute; top: 18px; left: 20px; width: auto; height: auto; margin: 0; background: none; font-size: 2.6rem; line-height: 1; color: rgba(111, 141, 255, .22); }
.welcome-board { margin-top: 32px; }
@media (min-width: 860px) {
  .welcome { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; padding: 56px; }
  .welcome-emblem { order: 0; width: min(340px, 100%); }
  .welcome-text { text-align: start; }
  .welcome-chips, .welcome-actions { justify-content: flex-start; }
  .welcome h1 { font-size: 3.6rem; }
  .welcome-lead { font-size: 1.4rem; }
  .welcome-body { margin-inline: 0; font-size: 1.05rem; }
}

/* ---------- sign in ---------- */
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head .emblem { width: 132px; margin: 0 auto 12px; }
.auth-head h1 { margin-bottom: 4px; }
.auth-head p { margin: 0; }

/* ---------- registration ---------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 560px; margin: 0 auto; }
.signup-head h1 { margin-bottom: 4px; }
.signup-head p { margin: 0; }
.steps { display: flex; gap: 6px; max-width: 200px; margin-bottom: 8px; }
.steps span { flex: 1; height: 4px; border-radius: 999px; background: var(--navy-700); }
.steps span.on { background: var(--blue); box-shadow: 0 0 10px rgba(49, 92, 255, .7); }
.steps-label { font-size: .8rem; color: var(--blue-300); font-weight: 600; margin: 0 0 14px; }
.signup-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 18px; color: var(--slate); font-size: .8125rem; line-height: 1.6; }
.signup-note .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--gold); }
.signup-preview-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .82rem; font-weight: 600; color: var(--mist); }
.signup-preview-title .icon { width: 17px; height: 17px; color: var(--blue-300); }
.mini-card { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 14px; padding: 18px; border-radius: 24px; border: 1.5px solid transparent;
  background: linear-gradient(160deg, #15224a, #0f1830 50%, #0a1122) padding-box, linear-gradient(150deg, var(--blue), rgba(111, 141, 255, .28) 32%, rgba(38, 50, 77, .9) 60%, var(--blue)) border-box;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .7), 0 16px 44px -14px rgba(49, 92, 255, .3); }
.mini-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 70% at 100% 0%, rgba(49, 92, 255, .4), transparent 62%), var(--lattice); }
.mini-card-head { display: none; align-items: center; justify-content: space-between; gap: 12px; }
.mini-card-body { display: flex; align-items: center; gap: 14px; }
.mini-card-photo { position: relative; flex: none; width: 84px; aspect-ratio: 4 / 5; padding: 2px; border-radius: 20px; cursor: pointer; background: linear-gradient(160deg, var(--blue), rgba(111, 141, 255, .12) 55%, var(--blue)); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.mini-card-photo:hover { transform: scale(1.04); }
.mini-card-photo img, .mini-card-initials { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 18px; object-fit: cover; background: radial-gradient(120% 90% at 50% 0%, #24356b, #111a33 70%); }
.mini-card-photo [hidden] { display: none; }
.mini-card-initials { font-weight: 800; font-size: 1.8rem; line-height: 1; }
.mini-card-pick { position: absolute; left: -6px; bottom: -6px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 0 0 3px #0f1830; }
.mini-card-pick .icon { width: 15px; height: 15px; }
.mini-card-id { min-width: 0; flex: 1; display: grid; gap: 3px; }
.mini-card-name { font-size: 1.25rem; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.mini-card .is-empty { color: var(--slate); }
.mini-card-nick { font-size: .88rem; font-weight: 600; color: var(--blue-300); }
.mini-card-stats { display: none; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-card-stats > div { display: grid; justify-items: center; gap: 3px; padding: 12px 6px; text-align: center; border-radius: 16px; background: rgba(8, 13, 25, .55); border: 1px solid rgba(111, 141, 255, .16); }
.mini-card-stats .icon { width: 18px; height: 18px; color: var(--blue-300); }
.mini-card-stats b { font-family: var(--font-num); font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.mini-card-stats span { font-size: .7rem; color: var(--mist); }
.mini-card-stats > div:first-child .icon, .mini-card-stats > div:first-child b { color: var(--gold); }
.mini-card-stats > div:nth-child(2) .icon { color: var(--ember); }
/* desktop: the form on one side, the whole card standing beside it */
@media (min-width: 900px) {
  .signup { max-width: 980px; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "head head" "form preview"; column-gap: 32px; align-items: start; }
  .signup-head { grid-area: head; }
  .signup-form { grid-area: form; }
  .signup-preview { grid-area: preview; position: sticky; top: 92px; }
  .mini-card { padding: 22px; gap: 18px; }
  .mini-card-head { display: flex; }
  .mini-card-stats { display: grid; }
  .mini-card-photo { width: 104px; border-radius: 24px; }
  .mini-card-photo img, .mini-card-initials { border-radius: 22px; }
  .mini-card-initials { font-size: 2.2rem; }
}

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: .82rem; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--slate-soft); color: var(--mist); }
.chip .icon { width: 15px; height: 15px; }
.chip strong { font-family: var(--font-num); font-weight: 700; color: var(--ice); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.gold strong { color: var(--gold); }
.chip.blue { background: var(--blue-soft); color: #9db1ff; }
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.chip.bad { background: var(--alert-soft); color: var(--alert); }

/* ---------- my team ---------- */
.team-page { display: grid; gap: 20px; max-width: 720px; margin: 0 auto; }
.team-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 6px; padding: 28px 20px 24px; text-align: center; border-radius: var(--r-xl); border: 1px solid rgba(53, 201, 192, .45); background: linear-gradient(160deg, #10323a, #0e1c2e 60%, #0b1220); box-shadow: 0 20px 50px -20px rgba(53, 201, 192, .35); }
.team-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .9; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='50' viewBox='0 0 46 50'%3E%3Cpath d='M23 6 37 11v12c0 9-6 15-14 18-8-3-14-9-14-18V11Z' fill='none' stroke='%2335C9C0' stroke-opacity='.16' stroke-width='1.4'/%3E%3C/svg%3E"); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%); }
.team-over { margin: 0 0 6px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--teal); }
.team-hero .avatar { filter: drop-shadow(0 10px 22px rgba(53, 201, 192, .35)); animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.team-hero h1 { margin: 10px 0 8px; font-family: var(--font); font-size: 1.7rem; overflow-wrap: anywhere; }
.team-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.team-invite h2 { font-size: 1.1rem; margin-bottom: 2px; }
.team-invite > p { margin-bottom: 14px; }
.team-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.is-done { color: var(--teal); border-color: rgba(53, 201, 192, .6); }
.member .item-main { min-width: 0; }
.member.me { border-color: rgba(111, 141, 255, .6); background: linear-gradient(90deg, rgba(49, 92, 255, .14), var(--navy-800) 70%); }
.member-bar { height: 5px; margin-top: 8px; border-radius: 999px; background: var(--navy-700); overflow: hidden; }
.member-bar div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #7fe3dc); animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: right; }
.member.me .member-bar div { background: linear-gradient(90deg, var(--blue), var(--blue-300)); }
.item.slot { border-style: dashed; background: transparent; }
.slot-plus { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed #46587f; color: var(--slate); }
.slot-plus .icon { width: 18px; height: 18px; }
.solo-locked { max-width: 560px; margin: 0 auto; }

/* ---------- solo, a new team, or a code ---------- */
.join { display: grid; gap: 18px; max-width: 720px; margin: 0 auto; }
.join-head h1 { margin: 0; }
.join-head .steps-label, .signup-head .steps-label { margin: 0 0 14px; }
.choice-hint { margin: 0; text-align: center; }
.choice-set { display: grid; gap: 16px; }
.choice-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice-tab { display: grid; justify-items: center; gap: 4px; padding: 16px 8px 14px; text-align: center; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--navy-800); color: var(--mist); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.choice-tab:hover { border-color: rgba(111, 141, 255, .7); transform: translateY(-2px); }
.choice-tab strong { color: var(--ice); font-size: .98rem; line-height: 1.4; }
.choice-tab > span:last-child { font-size: .74rem; line-height: 1.5; }
.choice-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 14px; background: var(--navy-700); color: var(--mist); transition: background .15s, color .15s; }
.choice-icon .icon { width: 22px; height: 22px; }
.choice-tab[aria-selected=true] { border-color: var(--blue); background: linear-gradient(160deg, #16234d, #101a34); box-shadow: 0 0 0 3px rgba(49, 92, 255, .22), 0 14px 34px -12px rgba(49, 92, 255, .5); }
.choice-tab[aria-selected=true] .choice-icon { background: var(--blue); color: #fff; }
.choice-set.is-live .choice-panel { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.choice-panel h2 { font-size: 1.2rem; }
.team-make { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 4px; }
.team-crest { flex: none; cursor: pointer; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.team-crest:hover { transform: scale(1.05); }
.team-make-fields { flex: 1; min-width: 0; }
.code-input { text-align: center; font-family: var(--font-num) !important; font-size: 1.6rem !important; font-weight: 800; letter-spacing: .35em; text-transform: uppercase; min-height: 64px !important; }
.code-input::placeholder { letter-spacing: .35em; font-weight: 600; opacity: .55; }
.join-preview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid rgba(53, 201, 192, .5); background: rgba(53, 201, 192, .08); animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.join-preview.is-full { border-color: rgba(255, 107, 120, .5); background: var(--alert-soft); }
.join-preview-main { flex: 1; min-width: 120px; line-height: 1.5; }
.join-preview-main strong { display: block; overflow-wrap: anywhere; }
#join-miss { margin: 0 0 16px; font-size: .8125rem; }
@media (max-width: 520px) {
  .choice-tabs { gap: 8px; }
  .choice-tab { padding: 12px 4px; }
  .choice-tab strong { font-size: .86rem; }
  .choice-tab > span:last-child { display: none; }
  .team-make { flex-direction: column; align-items: center; }
  .team-make-fields { width: 100%; }
  .team-code { justify-content: center; }
  .code-input { font-size: 1.35rem !important; letter-spacing: .28em; }
}

/* ---------- the result of an exam ---------- */
.result { display: grid; gap: 16px; }
.result-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 6px; padding: 26px 20px 22px; text-align: center; border-radius: var(--r-xl); border: 1px solid rgba(53, 201, 192, .4); background: linear-gradient(160deg, #10303a, #0e1a2e 58%, #0b1220); }
.result-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--chevrons); opacity: .7; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); mask-image: linear-gradient(to bottom, #000, transparent 70%); }
.result-hero h1 { margin: 2px 0 12px; font-family: var(--font); }
.score-ring { position: relative; width: 164px; height: 164px; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 9; }
.score-ring .track { stroke: rgba(53, 201, 192, .16); }
.score-ring .fill { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 326.7px; stroke-dashoffset: calc(326.7px * (1 - var(--fill, 0))); filter: drop-shadow(0 0 8px rgba(53, 201, 192, .55)); animation: score-in 1.2s .2s cubic-bezier(.2, .85, .25, 1) backwards; }
.score-ring-value { position: relative; display: inline-flex; align-items: baseline; gap: 2px; font-family: var(--font-num); }
.score-ring-value b { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.score-ring-value small { font-size: 1.3rem; font-weight: 600; color: var(--mist); }
/* a good day: a burst of gold around the ring, once */
.score-ring-sparks { position: absolute; inset: 0; display: none; }
.is-great .score-ring-sparks { display: block; }
.score-ring-sparks i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--gold); opacity: 0; animation: spark .9s 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.score-ring-sparks i:nth-child(1) { --dx: 0px; --dy: -104px; }
.score-ring-sparks i:nth-child(2) { --dx: 74px; --dy: -74px; }
.score-ring-sparks i:nth-child(3) { --dx: 104px; --dy: 0px; }
.score-ring-sparks i:nth-child(4) { --dx: 74px; --dy: 74px; }
.score-ring-sparks i:nth-child(5) { --dx: 0px; --dy: 104px; }
.score-ring-sparks i:nth-child(6) { --dx: -74px; --dy: 74px; }
.score-ring-sparks i:nth-child(7) { --dx: -104px; --dy: 0px; }
.score-ring-sparks i:nth-child(8) { --dx: -74px; --dy: -74px; }
.result-count { margin: 8px 0 10px; }
.result-split { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.result-points { border-color: rgba(242, 189, 85, .55); box-shadow: 0 0 0 1px rgba(242, 189, 85, .18), 0 18px 44px -20px rgba(242, 189, 85, .35); }
.result-points-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-points-head > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; }
.result-points-head .icon { width: 20px; height: 20px; color: var(--gold); }
.result-points .result-xp { font-size: 2.6rem; }
.result-badges { margin: 10px 0 18px; gap: 8px; }
.result-points h2 { font-size: 1.05rem; margin-bottom: 4px; color: var(--mist); font-weight: 600; }
.result-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.result-totals .stat { display: grid; gap: 2px; }
.result-totals .stat > .icon { width: 20px; height: 20px; color: var(--blue-300); margin-bottom: 4px; }
.result-totals .stat:first-child > .icon, .result-totals .stat:first-child b { color: var(--gold); }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.result-actions .btn { flex: 1; min-width: 150px; }
.result-late .step-icon { margin: 0 auto 12px; background: var(--alert-soft); color: var(--alert); }

/* ---------- the leaderboard ---------- */
.board { max-width: 760px; margin: 0 auto; }
.board-head h1 { display: flex; align-items: center; gap: 10px; }
.board-head h1 .icon { width: 28px; height: 28px; color: var(--gold); }
.board-tabs { display: flex; width: 100%; max-width: 420px; }
.board-tabs a { flex: 1; text-align: center; }
.board-tabs { margin-bottom: 10px; }
.board-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.board-kinds a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--mist); font-size: .86rem; font-weight: 600; transition: background .15s, color .15s, border-color .15s; }
.board-kinds a .icon { width: 15px; height: 15px; }
.board-kinds a:hover { text-decoration: none; color: var(--ice); border-color: rgba(111, 141, 255, .55); }
.board-kinds a.active { background: var(--blue-soft); border-color: rgba(111, 141, 255, .7); color: #b6c5ff; }
.board-scope { margin: 0 0 14px; }
.lb-below { text-align: center; }
.lb-below::before { content: "⋯"; display: block; font-size: 1.4rem; line-height: 1; margin-bottom: 8px; color: var(--slate); }

/* The first three places stand on a podium: first in the middle and highest, second on its right, third on its left.
   The markup is the same line as in the list, in rank order; only the drawing differs. */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 6px 0 14px; padding-top: 14px; }
.podium .lb-row { flex: 1 1 0; min-width: 0; max-width: 210px; display: grid; justify-items: center; gap: 0; padding: 0; border: 0; background: none; box-shadow: none; text-align: center; animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.podium .lb-row:nth-child(1) { order: 2; }
.podium .lb-row:nth-child(2) { order: 1; animation-delay: .1s; }
.podium .lb-row:nth-child(3) { order: 3; animation-delay: .2s; }
.podium .lb-row > .avatar { order: 1; width: 58px; height: 58px; font-size: 1.15rem; }
.podium .lb-row:nth-child(1) > .avatar { width: 72px; height: 72px; font-size: 1.4rem; }
.podium .lb-row > .avatar:not(.team) { box-shadow: inset 0 0 0 2px var(--tone); }
.podium .lb-row > img.avatar:not(.team) { box-shadow: 0 0 0 2.5px var(--tone); }
.podium .lb-name { order: 2; flex: none; width: 100%; padding: 8px 2px 10px; }
.podium .lb-name strong { font-size: .92rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.podium .lb-name .small { display: block; font-size: .72rem; line-height: 1.6; text-wrap: balance; }
.podium .lb-rank { order: 3; width: 100%; height: auto; padding: 14px 0 0; border-radius: 16px 16px 0 0; border: 1.5px solid var(--tone); border-bottom: 0; background: linear-gradient(to bottom, var(--tone-soft), rgba(18, 27, 46, .6)); color: var(--tone); font-size: 2rem; line-height: 1.1; box-shadow: none; }
.podium .lb-xp { order: 4; width: 100%; padding: 4px 4px 14px; border-radius: 0 0 16px 16px; border: 1.5px solid var(--tone); border-top: 0; background: rgba(18, 27, 46, .6); font-size: .9rem; }
.podium .lb-row { --tone: #cfd7e6; --tone-soft: rgba(207, 215, 230, .16); }
/* by position first (every browser), then by the real rank where two share a place */
.podium .lb-row:nth-child(1), .podium .lb-row:has(.lb-rank.r1) { --tone: var(--gold); --tone-soft: rgba(242, 189, 85, .22); }
.podium .lb-row:nth-child(3) { --tone: #d99a6c; --tone-soft: rgba(217, 154, 108, .18); }
.podium .lb-row:has(.lb-rank.r2) { --tone: #cfd7e6; --tone-soft: rgba(207, 215, 230, .16); }
.podium .lb-row:has(.lb-rank.r3) { --tone: #d99a6c; --tone-soft: rgba(217, 154, 108, .18); }
.podium .lb-rank.r1 { padding-top: 26px; box-shadow: 0 -14px 34px -14px rgba(242, 189, 85, .55); }
.podium .lb-rank.r3 { padding-top: 8px; }
.podium .lb-row.me .lb-name strong { color: var(--blue-300); }
.podium .lb-row.me .lb-xp { box-shadow: 0 10px 26px -10px rgba(49, 92, 255, .7); }
@media (max-width: 380px) {
  .podium { gap: 6px; }
  .podium .lb-rank { font-size: 1.6rem; }
  .podium .lb-name strong { font-size: .82rem; }
}

/* ---------- daily tasks ---------- */
.tasks { display: grid; gap: 10px; }
.task { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--navy-800); }
.task-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--gold-soft); color: var(--gold); }
.task-icon .icon { width: 22px; height: 22px; }
.task-main { flex: 1; min-width: 0; }
.task-main strong { display: block; font-weight: 700; overflow-wrap: anywhere; }
.task-main p { margin: 4px 0 0; font-size: .875rem; color: var(--mist); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.task .btn { flex: none; }
.task-day { margin: 18px 0 8px; font-size: .95rem; color: var(--mist); font-weight: 600; }
.task-day:first-child { margin-top: 0; }
@media (max-width: 520px) { .task { flex-wrap: wrap; } .task .btn { width: 100%; } }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
label.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--blue); }

/* ---------- the review of mistakes ---------- */
.review { display: grid; gap: 14px; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.review-head h1 { margin: 0; flex: 1; min-width: 200px; }
.review-q { padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--navy-800); }
.review-q.wrong { border-color: rgba(255, 107, 120, .5); }
.review-q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .8rem; color: var(--mist); }
.review-q .question-text { font-size: 1.1rem; margin: 0 0 12px; }
.review-opts { display: grid; gap: 8px; }
.review-opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.review-opt .option-key { width: 30px; height: 30px; font-size: .85rem; }
.review-opt span.text { flex: 1; white-space: pre-line; }
.review-opt.right { border-color: rgba(53, 201, 192, .7); background: var(--teal-soft); }
.review-opt.right .option-key { background: var(--teal); color: #06231f; }
.review-opt.picked { border-color: rgba(255, 107, 120, .7); background: var(--alert-soft); }
.review-opt.picked .option-key { background: var(--alert); color: #2b0509; }
.review-opt small { flex: none; font-size: .75rem; font-weight: 700; }
.review-opt.right small { color: var(--teal); }
.review-opt.picked small { color: var(--alert); }
.review details { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 16px; }
.review summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.review details > .review-q { margin-bottom: 12px; }

/* ---------- motion ---------- */
@keyframes grow { from { transform: scaleX(0); } }
@keyframes question-in { from { opacity: 0; transform: translateX(-18px); } }
@keyframes score-in { from { stroke-dashoffset: 326.7px; } }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@keyframes fire-out { 0% { transform: scale(1, .94) skewX(-2deg); } 50% { transform: scale(.97, 1.06) skewX(2.5deg); } 100% { transform: scale(1.03, .98) skewX(-1deg); } }
@keyframes fire-in { 0% { transform: scale(.92, 1.08) translateY(1px); } 100% { transform: scale(1.08, .9) translateY(-1px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes laurel { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 50% { opacity: .65; } }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes card-sweep { to { transform: translateX(-120%); } }
@keyframes ring-in { from { stroke-dashoffset: 138.2px; } }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.22) rotate(3deg); } }
@keyframes boost { 0%, 100% { box-shadow: 0 0 14px rgba(242, 189, 85, .35); } 50% { box-shadow: 0 0 30px rgba(242, 189, 85, .7); } }
main .list > *, main .grid > .card, main .grid > .stat { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
main .list > :nth-child(2) { animation-delay: .04s; }
main .list > :nth-child(3) { animation-delay: .08s; }
main .list > :nth-child(4) { animation-delay: .12s; }
main .list > :nth-child(5) { animation-delay: .16s; }
main .list > :nth-child(n+6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .pcard-sheen { display: none; }
}

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  main { padding-top: 20px; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { padding: 10px 12px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .admin-side .brand { margin-bottom: 8px; }
  .admin-side nav { display: flex; flex-wrap: wrap; }
  .admin-side nav a, .admin-side button.link { width: auto; }
  .admin-main { padding: 16px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .question-text { font-size: 1.15rem; }
  .card { padding: 18px; }
}
