/* CricIQ, the daily grid (templates/iq.html, static/iq.js). The board is the page: kits, flags and medals on the
   headers, a mown outfield under the squares, nine red balls for nine guesses. Everything around it stays quiet:
   the site's grey, maroon for the brand, gold only for what is rare. */
/* the tokens: on the page, and on what opens over it (the search sheet, a header's rule, a toast) */
.iq, .iq-modal, .iq-tip, .iq-toast { --m: #5C0F24; --m2: #8A1B33; --m3: #3E0A18; --g: #F5C451; --g2: #C99A2E; --g3: #FFF4D2; --ink: #141920;
  --sub: #4A5361; --mu: #667080; --ln: #DCE1E8; --ok: #11804A; --ok2: #E4F3EA; --no: #B3271F; --no2: #FCEBE9; --card: #FFFFFF;
  --p1: #F4F8F2; --p2: #EAF1E6; --pl: #D8E3D3; }
.iq { max-width: 1000px; margin: 0 auto; }
main.wrap:has(> .iq) { padding-top: 22px; }
.iq-load { padding: 72px 0; text-align: center; color: var(--mu); }
html.iq-lock { overflow: hidden; }
.iq h1, .iq h2, .iq h3 { margin: 0; }

/* ---------- the play area: the board, and beside it (below it on a phone) the grid's name and the clock */
.iq-play { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "board" "bar"; gap: 14px; }
.iq-title { grid-area: title; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.iq-title h1 { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: .9; color: var(--m); letter-spacing: 0; }
.iq-day { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.iq-count { flex-basis: 100%; margin: 0; font-size: 13.5px; color: var(--mu); }
.iq-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #EEF1F5; color: var(--sub); }
.iq-pill.easy { background: var(--ok2); color: var(--ok); }
.iq-pill.medium { background: var(--g3); color: #855F00; }
.iq-pill.hard { background: var(--no2); color: var(--no); }

/* ---------- the board: a mown outfield under the grid */
.iq-board { grid-area: board; position: relative; padding: 14px; border-radius: 22px; border: 1px solid var(--pl);
  background: repeating-linear-gradient(90deg, var(--p1) 0 44px, var(--p2) 44px 88px);
  box-shadow: 0 1px 0 rgba(20, 25, 32, .04), 0 22px 44px -30px rgba(62, 10, 24, .5); }
.iq-grid { display: grid; grid-template-columns: 124px repeat(3, minmax(0, 1fr)); gap: 10px; }

/* the corner: nine balls, a 3 by 3 like the grid, red leather while they last */
.iq-corner { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; padding: 4px 4px 10px; }
.iq-corner small { font-size: 12.5px; font-weight: 700; color: var(--sub); }
.iq-balls { display: grid; grid-template-columns: repeat(3, 18px); gap: 6px; }
.iq-ball { position: relative; width: 18px; height: 18px; border-radius: 50%; transition: transform .3s, filter .3s, opacity .3s;
  background: radial-gradient(circle at 34% 30%, #E9645A 0%, #B3271F 50%, #7A150F 100%); box-shadow: inset -1px -2px 2px rgba(0, 0, 0, .22); }
.iq-ball::after { content: ""; position: absolute; top: 2px; bottom: 2px; left: 7px; right: 7px; border-left: 1px dashed rgba(255, 255, 255, .72); border-right: 1px dashed rgba(255, 255, 255, .72); }
.iq-ball.used { filter: grayscale(1) brightness(1.6); opacity: .45; transform: scale(.8); }
.iq-ball.just { animation: iqball .55s ease-out both; }
@keyframes iqball { 0% { transform: scale(1.25); filter: none; opacity: 1; } 100% { transform: scale(.8); filter: grayscale(1) brightness(1.6); opacity: .45; } }

/* the headers: a kit, a flag, a medal or a legend's shirt, and what it asks. Tap one for exactly what it asks */
.iq-head { min-width: 0; display: flex; }
.iq-why { all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  padding: 4px 2px 8px; text-align: center; border-radius: 12px; cursor: help; }
button.iq-why:hover .iq-hl b { color: var(--m); }
button.iq-why:focus-visible { outline: 2px solid var(--m); outline-offset: 1px; }
.iq-head.row .iq-why { justify-content: center; padding: 2px 0; }
.iq-ic { flex: none; display: grid; place-items: center; width: 60px; height: 60px; }
.iq-ic > svg, .iq-ic > .iq-leg > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.iq-ic img.iq-flag { width: 54px; height: 36px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(20, 25, 32, .14), 0 6px 12px -8px rgba(20, 25, 32, .55); }
.iq-leg { position: relative; display: block; width: 100%; height: 100%; }
.iq-out { position: absolute; right: -3px; bottom: 1px; width: 38%; height: 38%; filter: drop-shadow(0 2px 3px rgba(20, 25, 32, .3)); }
.iq-hl { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.iq-hl b { font-size: 14px; font-weight: 750; line-height: 1.18; color: var(--ink); overflow-wrap: break-word; transition: color .15s; }
.iq-hl b .sm { display: none; }
.iq-hl small { font-size: 12px; font-weight: 600; color: var(--mu); line-height: 1.2; }
/* the headers under the cover: shapes only, the engine has not said what they are yet */
.iq-head.iq-ph .iq-hl b { display: block; width: 74px; height: 12px; border-radius: 6px; background: #CBD3C8; }
.iq-head.row.iq-ph .iq-hl b { width: 56px; }
.iq-phflag { display: block; width: 52px; height: 34px; border-radius: 6px; background: linear-gradient(180deg, #D6A15A 0 33%, #F3F1EC 33% 66%, #5C9C6A 66%); }
.iq-phbadge { display: block; width: 56px; height: 56px; border-radius: 50%; background: #84203A; box-shadow: inset 0 0 0 3px #4A0B1C, inset 0 0 0 5px rgba(245, 196, 81, .5); }
/* Play: the headers turn over one by one */
.iq-board.reveal .iq-head .iq-why { animation: iqturn .5s cubic-bezier(.2, .8, .25, 1) both; }
.iq-board.reveal .iq-head:nth-child(3) .iq-why { animation-delay: .07s; }
.iq-board.reveal .iq-head:nth-child(4) .iq-why { animation-delay: .14s; }
.iq-board.reveal .iq-head:nth-child(5) .iq-why { animation-delay: .21s; }
.iq-board.reveal .iq-head:nth-child(9) .iq-why { animation-delay: .28s; }
.iq-board.reveal .iq-head:nth-child(13) .iq-why { animation-delay: .35s; }
@keyframes iqturn { 0% { transform: perspective(500px) rotateY(80deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* the squares */
.iq-cell { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; overflow: hidden; display: grid; place-items: center; cursor: pointer;
  border-radius: 16px; border: 1.5px solid #D0DACB; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.iq-cell .plus { width: 30px; height: 30px; fill: none; stroke: #B5C1B0; stroke-width: 2; stroke-linecap: round; transition: stroke .15s, transform .15s; }
.iq-cell:hover:not(.fill):not(.closed):not([aria-disabled]) { border-color: var(--m); box-shadow: 0 0 0 3px rgba(92, 15, 36, .1); }
.iq-cell:hover:not(.fill):not(.closed):not([aria-disabled]) .plus { stroke: var(--m); transform: scale(1.12); }
.iq-cell:focus-visible { outline: 3px solid var(--m); outline-offset: 2px; }
.iq-cell[aria-disabled] { cursor: default; }
.iq-cell.closed { background: rgba(255, 255, 255, .6); border-style: dashed; cursor: default; }
.iq-cell.closed.tap { cursor: pointer; }
.iq-cell.closed.tap:hover { border-color: var(--m); }
.iq-cell .miss { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--mu); text-align: center; }
.iq-cell.closed.tap .miss { color: var(--m); }
.iq-cell.fill { cursor: default; border-color: color-mix(in srgb, var(--kc, #5C0F24) 50%, #FFFFFF);
  background: linear-gradient(180deg, color-mix(in srgb, var(--kc, #5C0F24) 15%, #FFFFFF) 0%, #FFFFFF 72%); }
.iq-cell.fill.tap { cursor: pointer; }
.iq-ans { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 100%; padding: 8px 6px 32px; }
.iq-ans > svg { flex: none; width: 46px; height: 46px; }
.iq-apic { position: relative; flex: none; display: block; width: 50px; height: 46px; }
.iq-apic > svg { display: block; width: 46px; height: 46px; margin: 0 auto; }
.iq-pflag { position: absolute; right: -2px; bottom: 1px; width: 21px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1.5px #FFFFFF, 0 2px 4px rgba(20, 25, 32, .3); }
.iq-ans > img.iq-flag { flex: none; width: 46px; height: 30px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(20, 25, 32, .14); }
.iq-ans b { font-size: 14px; font-weight: 750; line-height: 1.15; text-align: center; color: var(--ink); overflow-wrap: break-word; }
.iq-rar { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--sub); background: rgba(255, 255, 255, .82); border-top: 1px solid rgba(20, 25, 32, .07); font-variant-numeric: tabular-nums; }
.iq-rar i { font-style: normal; color: var(--ok); }
.iq-cell.rare { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(245, 196, 81, .4); }
.iq-cell.rare .iq-rar { background: var(--g); color: #3A2A00; border-top-color: var(--g2); }
.iq-cell.rare .iq-rar i { color: #3A2A00; }
.iq-cell.land { animation: iqland .55s cubic-bezier(.2, .9, .25, 1.15) both; }
.iq-cell.land .iq-ans > :first-child { animation: iqdrop .6s cubic-bezier(.2, .9, .25, 1.15) .05s both; }
@keyframes iqland { 0% { transform: scale(.9); filter: brightness(1.2); } 60% { transform: scale(1.03); } 100% { transform: none; filter: none; } }
@keyframes iqdrop { 0% { transform: translateY(-14px) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* before Play: the headers under cover */
.iq-board.cover .iq-head, .iq-board.cover .iq-cell, .iq-board.cover .iq-corner { filter: blur(6px) saturate(.7); pointer-events: none; user-select: none; }
.iq-cover { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 18px; border-radius: inherit;
  background: linear-gradient(180deg, rgba(244, 248, 242, .3), rgba(244, 248, 242, .72)); }
.iq-coverbox { width: min(400px, 100%); padding: 24px 24px 20px; border-radius: 20px; background: var(--card); text-align: center;
  box-shadow: 0 1px 0 rgba(20, 25, 32, .04), 0 26px 52px -24px rgba(62, 10, 24, .55); }
.iq-coverbox h2 { margin: 0 0 8px; font-family: var(--display); font-size: 38px; font-weight: 900; line-height: 1; color: var(--m); }
.iq-coverbox p { margin: 0 auto 16px; max-width: 32ch; font-size: 15px; line-height: 1.5; color: var(--sub); }
.iq-coverbox .iq-btn { width: 100%; height: 52px; font-size: 17px; }
.iq-coverbox small { display: block; margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--mu); }
.iq-coverbox small a, .iq-coverbox small .iq-link { color: var(--m); font-weight: 700; }

/* ---------- the clock, the score so far, Give up; and once finished, the IQ score and Share */
.iq-bar { grid-area: bar; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 0 2px; }
.iq-stat { display: flex; flex-direction: column; line-height: 1.1; }
.iq-stat span { font-size: 12.5px; font-weight: 650; color: var(--mu); }
.iq-stat b { font-family: var(--display); font-size: 30px; font-weight: 850; color: var(--ink); font-variant-numeric: tabular-nums; }
.iq-stat.lead b { font-size: 40px; color: var(--m); }
.iq-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.iq-confirm span { flex-basis: 100%; font-size: 13.5px; font-weight: 650; color: var(--sub); }
.iq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 750; text-decoration: none; white-space: nowrap; transition: filter .15s, border-color .15s; }
.iq-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.iq-btn.gold { background: linear-gradient(180deg, #FFD978 0%, var(--g) 100%); color: #2A1E00; box-shadow: 0 2px 0 var(--g2), 0 10px 20px -12px rgba(201, 154, 46, .9); }
.iq-btn.gold:hover { filter: brightness(1.04); }
.iq-btn.plain { background: var(--card); color: var(--ink); border: 1px solid var(--ln); }
.iq-btn.plain:hover { border-color: var(--ink); }
.iq-btn.maroon { background: var(--m); color: #FFFFFF; }
.iq-btn.maroon:hover { background: var(--m2); }
.iq-btn[disabled] { opacity: .6; cursor: default; }
.iq-btn:focus-visible { outline: 3px solid var(--m); outline-offset: 2px; }
.iq-link { all: unset; cursor: pointer; color: var(--m); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.iq-link:focus-visible { outline: 2px solid var(--m); outline-offset: 2px; border-radius: 3px; }

/* ---------- naming a player: the sheet over the board */
.iq-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding: 8vh 14px 14px; }
.iq-shade { position: absolute; inset: 0; background: rgba(20, 25, 32, .56); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: iqfade .16s ease-out both; }
.iq-sheet { position: relative; width: min(560px, 100%); max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--card);
  box-shadow: 0 30px 70px -24px rgba(20, 25, 32, .6); animation: iqpop .2s cubic-bezier(.2, .9, .25, 1.1) both; }
.iq-sheet.busy .iq-res, .iq-sheet.busy .iq-input { opacity: .55; pointer-events: none; }
.iq-sheet.nope .iq-input { animation: iqnope .42s ease-in-out both; border-color: var(--no); }
@keyframes iqfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes iqpop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes iqnope { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.iq-sq { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--ln); }
.iq-sqh { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.iq-sqrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.iq-sqrow .iq-ic { width: 44px; height: 44px; }
.iq-sqrow .iq-ic img.iq-flag { width: 40px; height: 27px; border-radius: 4px; }
.iq-sqrow .t { min-width: 0; display: flex; flex-direction: column; }
.iq-sqrow .t b { font-size: 15px; font-weight: 750; line-height: 1.2; }
.iq-sqrow .t small { font-size: 13px; line-height: 1.3; color: var(--mu); }
.iq-close { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; border: 1px solid var(--ln); background: var(--card); cursor: pointer; color: var(--sub); }
.iq-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.iq-close:hover { border-color: var(--ink); color: var(--ink); }
.iq-input { display: flex; align-items: center; gap: 10px; height: 52px; margin: 12px 14px 8px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--m); background: #FFFFFF; }
.iq-input svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--m); stroke-width: 2.2; stroke-linecap: round; }
.iq-input input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 17px; font-weight: 600; }
.iq-input input::placeholder { color: #98A1AE; font-weight: 500; }
.iq-res { list-style: none; margin: 0; padding: 0 8px 4px; overflow-y: auto; }
.iq-res li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.iq-res li[aria-selected="true"], .iq-res li[role=option]:hover { background: #F5F0F1; }
.iq-res li.used { opacity: .5; cursor: not-allowed; }
.iq-res li.none { cursor: default; padding: 14px 10px; font-size: 14px; color: var(--mu); }
.iq-res .k { flex: none; width: 34px; display: grid; place-items: center; }
.iq-res .k img.iq-flag { width: 32px; height: 21px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(20, 25, 32, .14); }
.iq-noflag { display: block; width: 32px; height: 21px; border-radius: 4px; background: #E6E9EE; }
.iq-res .nm { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.iq-res .nm b { font-size: 15.5px; font-weight: 650; }
.iq-res .nm b mark { background: none; color: var(--m); font-weight: 800; }
.iq-res .nm small { font-size: 12.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-res .iq-tag { flex: none; font-size: 12px; font-weight: 700; color: var(--mu); }
.iq-hint { margin: 0; padding: 8px 18px 16px; font-size: 13.5px; color: var(--mu); }
.iq-hint.bad { color: var(--no); font-weight: 650; }
/* a finished square's answers */
.iq-ansl { padding: 6px 18px 18px; overflow-y: auto; }
.iq-ansl h3 { margin: 12px 0 6px; font-family: var(--body); font-size: 13.5px; font-weight: 750; color: var(--sub); }
.iq-top { margin: 0; padding: 0; list-style: none; }
.iq-top li, .iq-sqa li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14.5px; border-bottom: 1px solid #F0F2F5; }
.iq-top li:last-child, .iq-sqa li:last-child { border-bottom: 0; }
.iq-top li span, .iq-sqa li span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-top li b, .iq-sqa li b { flex: none; font-weight: 650; color: var(--mu); font-variant-numeric: tabular-nums; }
.iq-top li.mine span, .iq-sqa li.mine span { color: var(--m); font-weight: 800; }
.iq-all { margin: 0; font-size: 14px; line-height: 1.65; color: var(--sub); }
.iq-all b { color: var(--m); }

/* ---------- after the grid: your score, the leaderboard, every square */
.iq-after { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.iq-panel { padding: 18px 18px 16px; border-radius: 18px; border: 1px solid var(--ln); background: var(--card); }
.iq-panel h2 { margin: 0 0 10px; font-family: var(--display); font-size: 27px; font-weight: 850; line-height: 1; color: var(--ink); }
.iq-score { display: flex; align-items: flex-end; gap: 12px; }
.iq-score .iqn { font-family: var(--display); font-weight: 900; font-size: 88px; line-height: .8; color: var(--m); font-variant-numeric: tabular-nums; }
.iq-score .of { display: flex; flex-direction: column; gap: 4px; padding-bottom: 2px; font-family: var(--display); font-size: 28px; font-weight: 850; line-height: 1; color: var(--g2); }
.iq-score .of em { font-family: var(--body); font-style: normal; font-size: 13.5px; font-weight: 750; color: var(--sub); }
.iq-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.iq-parts div { padding: 10px 12px; border-radius: 12px; background: #F5F6F8; }
.iq-parts span { display: block; font-size: 12.5px; font-weight: 650; color: var(--mu); }
.iq-parts b { font-family: var(--display); font-size: 26px; font-weight: 850; }
.iq-you .iq-acts { margin: 16px 0 0; }
.iq-note { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--sub); }
.iq-note a { color: var(--m); font-weight: 700; }
.iq-sub { margin: -4px 0 12px; font-size: 13.5px; color: var(--mu); }
.iq-empty { margin: 0; font-size: 14px; color: var(--mu); }
.iq-lb { list-style: none; margin: 0; padding: 0; }
.iq-lb li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 56px; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #EEF1F4; font-size: 14.5px; }
.iq-lb li:last-child { border-bottom: 0; }
.iq-lb li.me { border-radius: 10px; background: var(--g3); border-bottom-color: transparent; }
.iq-lb li.gap { display: block; padding: 0; text-align: center; color: var(--mu); border-bottom: 0; }
.iq-lb .r { font-family: var(--display); font-size: 20px; font-weight: 850; color: var(--mu); text-align: center; font-variant-numeric: tabular-nums; }
.iq-lb li:nth-child(-n+3):not(.gap) .r { color: var(--m); }
.iq-lb .w { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-lb .w em { margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--m); color: #FFFFFF; font-style: normal; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.iq-lb .d { font-size: 13px; color: var(--mu); white-space: nowrap; font-variant-numeric: tabular-nums; }
.iq-lb .s { font-family: var(--display); font-size: 22px; font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.iq-lb + .iq-sub { margin: 10px 0 0; }
.iq-sqs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.iq-sqa { min-width: 0; padding: 12px 14px; border-radius: 14px; background: #F6F7F9; }
.iq-sqa h3 { margin: 0 0 6px; font-family: var(--body); font-size: 14px; font-weight: 800; line-height: 1.25; }
.iq-sqa h3 small { display: block; font-size: 13px; font-weight: 600; color: var(--mu); }
.iq-sqa ol { margin: 0 0 6px; padding: 0; list-style: none; }
.iq-sqa li { font-size: 13.5px; }
.iq-sqa .iq-link { font-size: 13px; }

/* ---------- the other tabs: the leaderboard, earlier grids, your stats, how to play */
.iq-view { max-width: 720px; margin: 0 auto; }
.iq-vh { margin-bottom: 16px; }
.iq-vh h1 { font-family: var(--display); font-weight: 900; font-size: 44px; line-height: .95; color: var(--m); }
.iq-vh p { margin: 8px 0 0; max-width: 62ch; font-size: 15px; color: var(--sub); }
.iq-vh p a { color: var(--m); font-weight: 700; }
.iq-daynav { display: flex; justify-content: space-between; margin-top: 12px; }
.iq-daynav a { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ln); background: var(--card); font-size: 14px; font-weight: 700; text-decoration: none; }
.iq-daynav a:hover { border-color: var(--ink); }
.iq-daynav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.iq-view .iq-panel + .iq-panel { margin-top: 14px; }
.iq-glist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.iq-glist a { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 14px;
  border: 1px solid var(--ln); background: var(--card); text-decoration: none; transition: border-color .15s; }
.iq-glist a:hover { border-color: var(--m); }
.iq-glist .no { display: grid; place-items: center; height: 44px; border-radius: 10px; background: var(--m); color: #FFFFFF; font-family: var(--display); font-size: 24px; font-weight: 900; }
.iq-glist .dt { display: flex; align-items: center; gap: 10px; min-width: 0; }
.iq-glist .dt b { font-size: 15px; }
.iq-glist .res { font-size: 14px; color: var(--mu); white-space: nowrap; }
.iq-glist .res b { color: var(--ink); }
.iq-st { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.iq-st div { padding: 14px 6px 12px; border-radius: 14px; border: 1px solid var(--ln); background: var(--card); text-align: center; }
.iq-st b { display: block; font-family: var(--display); font-size: 36px; font-weight: 900; line-height: 1; color: var(--m); }
.iq-st span { font-size: 12.5px; font-weight: 650; color: var(--mu); }
.iq-hist { display: grid; gap: 5px; }
.iq-hist div { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; font-weight: 750; color: var(--sub); }
.iq-hist i { display: block; height: 20px; min-width: 24px; padding: 0 7px; border-radius: 5px; background: #D5DBE3; color: #3B4250; font-style: normal; font-size: 12px; line-height: 20px; text-align: right; }
.iq-hist div.top i { background: var(--m); color: #FFFFFF; }
.iq-how ul { margin: 0; padding-left: 20px; }
.iq-how li { margin: 0 0 8px; font-size: 15px; line-height: 1.55; color: var(--sub); }
.iq-how li b { color: var(--ink); }
.iq-how .iq-panel p { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--sub); }
.iq-how .iq-note { margin-top: 18px; }
.iq-how .iq-note .iq-btn { color: #2A1E00; }
.iq-msg { max-width: 520px; margin: 40px auto; text-align: center; }
.iq-msg h1 { font-family: var(--display); font-weight: 900; font-size: 40px; color: var(--m); }
.iq-msg p { margin: 10px 0 18px; color: var(--sub); }

/* a header's rule, on tap */
.iq-tip { position: absolute; z-index: 60; max-width: min(300px, calc(100vw - 20px)); padding: 10px 12px; border-radius: 12px; background: #141920; color: #FFFFFF;
  font: 500 13.5px/1.45 var(--body); box-shadow: 0 14px 30px -12px rgba(20, 25, 32, .6); animation: iqfade .12s ease-out both; }
.iq-tip b { display: block; margin-bottom: 2px; font-weight: 750; }
.iq-toast { position: fixed; left: 50%; bottom: 26px; z-index: 80; max-width: calc(100% - 28px); padding: 12px 18px; border-radius: 12px; transform: translateX(-50%);
  background: #141920; color: #FFFFFF; font-size: 14.5px; font-weight: 600; box-shadow: 0 16px 34px -14px rgba(20, 25, 32, .6); }

/* ---------- a wide screen: the board on the left, the grid's name and the clock beside it */
@media (min-width: 980px) {
  .iq-play { grid-template-columns: minmax(0, 600px) 280px; grid-template-rows: auto 1fr; grid-template-areas: "board title" "board bar";
    justify-content: center; column-gap: 34px; row-gap: 22px; }
  .iq-title { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 10px; }
  .iq-title h1 { font-size: 56px; }
  .iq-count { flex-basis: auto; }
  .iq-bar { flex-direction: column; align-items: stretch; align-content: flex-start; gap: 16px; padding: 18px 0 0; border-top: 1px solid var(--ln); }
  .iq-bar .iq-acts { margin: 4px 0 0; }
  .iq-bar .iq-acts .iq-btn { flex: 1; }
  .iq-stat b { font-size: 36px; }
  .iq-stat.lead b { font-size: 64px; line-height: .9; }
  .iq-after { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 964px; margin-inline: auto; }
  .iq-answers { grid-column: 1 / -1; }
}

/* ---------- a phone: everything smaller, the headers' short names */
@media (max-width: 640px) {
  main.wrap:has(> .iq) { padding-top: 14px; }
  .iq-title h1 { font-size: 38px; }
  .iq-board { padding: 8px; border-radius: 16px; background: repeating-linear-gradient(90deg, var(--p1) 0 30px, var(--p2) 30px 60px); }
  .iq-grid { grid-template-columns: 60px repeat(3, minmax(0, 1fr)); gap: 5px; }
  .iq-corner { padding: 2px 0 6px 2px; gap: 4px; }
  .iq-corner small { font-size: 10.5px; }
  .iq-balls { grid-template-columns: repeat(3, 13px); gap: 3px; }
  .iq-ball { width: 13px; height: 13px; }
  .iq-ball::after { top: 1.5px; bottom: 1.5px; left: 5px; right: 5px; }
  .iq-why { gap: 3px; padding: 2px 0 5px; }
  .iq-head.row .iq-why { gap: 3px; padding: 0; }
  .iq-ic { width: 38px; height: 38px; }
  .iq-ic img.iq-flag { width: 34px; height: 23px; border-radius: 4px; }
  .iq-hl b { font-size: 11px; line-height: 1.12; }
  .iq-hl b .lg { display: none; }
  .iq-hl b .sm { display: inline; }
  .iq-hl small { display: none; }
  .iq-head[data-k=nat] .iq-hl small, .iq-head[data-k=team] .iq-hl small { display: block; font-size: 9.5px; }
  .iq-head.iq-ph .iq-hl b { width: 40px; height: 8px; }
  .iq-phflag { width: 34px; height: 23px; }
  .iq-phbadge { width: 34px; height: 34px; }
  .iq-cell { border-radius: 11px; }
  .iq-cell .plus { width: 22px; height: 22px; }
  .iq-cell .miss { font-size: 11px; padding: 0 3px; }
  .iq-ans { gap: 2px; padding: 4px 3px 21px; }
  .iq-ans > svg { width: 30px; height: 30px; }
  .iq-apic { width: 36px; height: 30px; }
  .iq-apic > svg { width: 30px; height: 30px; }
  .iq-pflag { right: -1px; bottom: 0; width: 15px; height: 10px; border-radius: 2px; box-shadow: 0 0 0 1px #FFFFFF, 0 1px 3px rgba(20, 25, 32, .3); }
  .iq-ans > img.iq-flag { width: 30px; height: 20px; border-radius: 3px; }
  .iq-ans b { font-size: 10.5px; line-height: 1.1; }
  .iq-rar { height: 19px; gap: 4px; font-size: 10px; }
  .iq-coverbox { padding: 20px 18px 16px; }
  .iq-coverbox h2 { font-size: 32px; }
  .iq-bar { gap: 8px 18px; }
  .iq-stat b { font-size: 26px; }
  .iq-stat.lead b { font-size: 34px; }
  .iq-acts { margin-left: 0; width: 100%; }
  .iq-acts .iq-btn { flex: 1; }
  .iq-bar:not(.done) .iq-acts:not(.iq-confirm) { width: auto; margin-left: auto; }
  .iq-bar:not(.done) .iq-acts:not(.iq-confirm) .iq-btn { flex: none; height: 40px; }
  .iq-modal { padding: 8px 8px 0; }
  .iq-sheet { max-height: calc(100dvh - 16px); border-radius: 18px; }
  .iq-score .iqn { font-size: 72px; }
  .iq-sqs { grid-template-columns: minmax(0, 1fr); }
  .iq-lb li { grid-template-columns: 28px minmax(0, 1fr) auto 48px; gap: 8px; padding: 8px 4px; font-size: 14px; }
  .iq-lb .d { font-size: 12px; }
  .iq-st { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iq-glist a { grid-template-columns: 44px minmax(0, 1fr); }
  .iq-glist .res { grid-column: 2; }
  .iq-vh h1 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .iq-cell.land, .iq-cell.land .iq-ans > :first-child, .iq-sheet.nope .iq-input, .iq-ball.just, .iq-sheet, .iq-shade, .iq-board.reveal .iq-head .iq-why, .iq-tip { animation: none; }
}
