/* Olympiad practice pages. Uses the site's tokens from global.css. */
.ol-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 1.4rem; font-size: 0.95rem; align-items: center; }
.ol-nav a { color: var(--ink-soft); text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.ol-nav a.on { color: var(--ink); border-bottom-color: var(--blue); font-weight: 700; }
.ol-nav .who { margin-left: auto; color: var(--graphite); font-size: 0.85rem; }
.ol-nav button { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; text-decoration: underline; }
.ol-card { background: var(--card); border: 1px solid var(--hair); border-radius: 12px; padding: 1rem 1.1rem; margin: 0.8rem 0; }
.ol-note { color: var(--ink-soft); font-size: 0.92rem; }
.ol-err { color: var(--red); font-weight: 600; }
.ol-ok { color: var(--green); font-weight: 600; }
.ol-grade { margin-top: 1.6rem; }
.ol-papers { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.7rem; }
.ol-paper { background: var(--card); border: 1px solid var(--hair); border-radius: 12px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.ol-paper strong { font-size: 1.05rem; }
.ol-paper .meta { color: var(--graphite); font-size: 0.85rem; }
.ol-tag { display: inline-block; font: 700 0.72rem/1 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; padding: 0.3rem 0.5rem; border-radius: 6px; width: fit-content; }
.ol-tag.free { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.ol-tag.open { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.ol-tag.locked { background: var(--hair); color: var(--graphite); }
.ol-tag.draft { background: color-mix(in srgb, var(--yellow) 25%, transparent); color: var(--amber-text); }
.ol-btn { display: inline-block; background: var(--blue); color: #fff; font: 700 0.95rem/1 var(--sans); padding: 0.75rem 1.1rem; border-radius: 10px; border: 0; cursor: pointer; text-decoration: none; min-height: 44px; }
.ol-btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--faint); }
.ol-btn.green { background: var(--green); }
.ol-btn.red { background: var(--red); }
.ol-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ol-btn.sm { padding: 0.5rem 0.8rem; font-size: 0.85rem; min-height: 36px; }

/* attempt runner */
.ol-bar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--hair); padding: 0.55rem 0; display: flex; gap: 0.4rem 0.8rem; align-items: center; flex-wrap: wrap; }
/* Title may wrap to its own line below; timer and Finish stay together on the first row (order puts them first). */
.ol-bar .title { font-weight: 700; flex: 1 0 100%; order: 3; min-width: 0; line-height: 1.25; }
.ol-bar .ol-timer, .ol-bar .ol-note { order: 1; flex: none; white-space: nowrap; }
.ol-bar .ol-btn { order: 2; flex: none; white-space: nowrap; margin-left: auto; }
@media (min-width: 560px) { .ol-bar .title { flex: 1 1 10rem; order: 0; } .ol-bar .ol-timer, .ol-bar .ol-note, .ol-bar .ol-btn { order: 0; } }
.ol-timer { font: 700 1.2rem/1 var(--mono); }
.ol-timer.low { color: var(--red); }
.ol-navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 0.35rem; margin: 0.8rem 0; }
.ol-navgrid button { min-height: 44px; border-radius: 8px; border: 2px solid var(--faint); background: transparent; color: var(--ink); font: 700 0.9rem var(--sans); cursor: pointer; }
.ol-navgrid button.done { background: color-mix(in srgb, var(--blue) 18%, transparent); border-color: var(--blue); }
.ol-navgrid button.cur { outline: 3px solid var(--yellow); outline-offset: 1px; }
.ol-q { margin: 0.6rem 0; }
.ol-q .qhead { color: var(--graphite); font-size: 0.85rem; margin-bottom: 0.4rem; }
.ol-q .qtext { font-size: 1.1rem; line-height: 1.55; white-space: pre-wrap; }
.ol-q .qmono { font: 1.15rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0.5rem 0; white-space: pre; overflow-x: auto; }
.ol-q img { max-width: 100%; height: auto; display: block; margin: 0.6rem 0; background: #fff; border-radius: 8px; border: 1px solid var(--hair); }
.ol-opts { list-style: none; padding: 0; margin: 0.6rem 0; }
.ol-opts li { padding: 0.15rem 0; }
.ol-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.ol-choices button { min-width: 3.4rem; min-height: 48px; border-radius: 10px; border: 2px solid var(--faint); background: transparent; color: var(--ink); font: 700 1.1rem var(--sans); cursor: pointer; }
.ol-choices button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ol-num { font: 700 1.3rem var(--mono); padding: 0.6rem 0.8rem; width: 11rem; max-width: 100%; border-radius: 10px; border: 2px solid var(--faint); background: var(--card); color: var(--ink); }
.ol-num.wide { width: 22rem; flex: 1 1 auto; min-width: 0; max-width: min(320px, 100%); }
.ol-num.sm { width: 7rem; font-size: 1.1rem; padding: 0.4rem 0.6rem; }
.ol-num.sm.txt { width: 100%; min-width: 0; box-sizing: border-box; }
.ol-part.stack { display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; max-width: 32rem; }
.ol-part.stack .ol-plabel { max-width: none; }
.ol-answer { display: flex; align-items: center; gap: 0.6rem; flex-wrap: nowrap; }
.ol-unit { font: 600 1rem var(--sans); color: var(--ink); opacity: 0.75; flex: none; }
.ol-parts { display: grid; grid-template-columns: max-content auto 1fr; gap: 0.6rem; margin: 0.8rem 0; align-items: center; }
.ol-part { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.ol-plabel { font: 700 1.1rem var(--sans); min-width: 1.6rem; max-width: 9em; }
.ol-choices.sm { margin: 0; gap: 0.4rem; }
.ol-choices.sm button { min-width: 2.6rem; min-height: 40px; padding: 0 0.7rem; font-size: 1rem; }
.ol-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.ol-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ol-table th, .ol-table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.ol-table .r { text-align: right; }
.ol-scroll { overflow-x: auto; }
.ol-right { color: var(--green); font-weight: 700; }
.ol-wrong { color: var(--red); font-weight: 700; }
.ol-score { font: 700 2rem/1.1 var(--serif); }
.ol-bar2 { height: 0.55rem; background: var(--hair); border-radius: 5px; overflow: hidden; min-width: 6rem; }
.ol-bar2 i { display: block; height: 100%; background: var(--green); }
.ol-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.ol-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--graphite); gap: 0.2rem; }
.ol-form input, .ol-form select { font: inherit; padding: 0.55rem; border-radius: 8px; border: 2px solid var(--faint); background: var(--card); color: var(--ink); min-height: 40px; }
details.ol-zh { margin: 0.4rem 0; color: var(--ink-soft); }
@media (max-width: 520px) { .ol-score { font-size: 1.6rem; } }

/* A question whose answer is still being checked: notice above the question, no answer box. */
.ol-review { background: #fff6dd; border: 2px solid #e0a82e; border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0 0 0.8rem; color: #4a3500; }
.ol-review b { display: block; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ol-review p { margin: 0.25rem 0 0; font-size: 1rem; line-height: 1.45; }

/* grade mascots: band and stars */
.olm-face { display: inline-block; width: 56px; height: 56px; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; flex: none; vertical-align: middle; }
.olm-face svg { display: block; width: 100%; height: 100%; }
.olm-face.sm { width: 36px; height: 36px; border-width: 2px; border-radius: 10px; }
.olm-slot { position: relative; display: inline-flex; animation: olm-idle 5s ease-in-out infinite; }
.olm-say { position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; width: max-content; max-width: 11rem; background: var(--card); border: 1px solid var(--hair); border-radius: 10px; padding: 0.35rem 0.6rem; font-size: 0.82rem; color: var(--ink-soft); pointer-events: none; box-shadow: 0 2px 8px rgb(0 0 0 / 0.08); }
.olm-say[hidden] { display: none; }
@keyframes olm-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .olm-slot { animation: none; } }
.olm-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.6rem; margin: 0.6rem 0 1rem; }
.olm-mascot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.25rem; padding: 0.8rem 0.5rem; background: var(--card); border: 1px solid var(--hair); border-radius: 12px; }
.olm-mascot small { color: var(--graphite); font-size: 0.74rem; line-height: 1.3; }
.olm-mascot .olm-mod { font-weight: 700; }
.olm-ringwrap { position: relative; display: inline-block; width: 120px; height: 120px; margin-bottom: 0.2rem; }
.olm-bandsvg { position: absolute; inset: 0; width: 100%; height: 100%; }
.olm-ringwrap .olm-face { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; }
.olm-band { fill: none; stroke-width: 14; stroke: var(--faint); }
.olm-band.bronze { stroke: #b87333; }
.olm-band.silver { stroke: #9fa9b9; }
.olm-band.gold { stroke: #e8ab00; }
.olm-band.none { stroke: var(--hair); stroke-width: 3; } /* below 60%: no colour band, only a thin line for the stars to sit on */
.olm-band.locked { stroke: var(--faint); stroke-dasharray: 3 5; }
.olm-star { fill: #ffd93b; stroke: #6b4a00; stroke-width: 1.1; stroke-linejoin: round; }
.olm-mascot.locked .olm-face { filter: grayscale(1) brightness(0.55) contrast(0.6); opacity: 0.45; border-color: var(--faint); }
.olm-mascot.locked b { color: var(--graphite); }
.olm-result { display: flex; gap: 0.8rem; align-items: center; margin: 0.4rem 0 0.8rem; }
.olm-result .olm-mascot { border: 0; background: none; padding: 0; width: 11rem; flex: none; }
.olm-result p { margin: 0; }
.olm-result.new .olm-ringwrap { animation: olm-pop 0.6s ease-out; }
.olm-new { font: 700 1.2rem var(--serif); color: var(--blue); }
@keyframes olm-pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .olm-result.new .olm-ringwrap { animation: none; } }
@media (max-width: 480px) { .olm-result { flex-direction: column; text-align: center; } }
