/* OshSU Olymp: visual refresh on top of the DMOJ styles.
 * Loaded after style.css / dark style; plain CSS so it needs no build step. */

:root {
    --ui-bg: #f5f7fa;
    --ui-surface: #ffffff;
    --ui-surface-2: #f0f3f7;
    --ui-border: #e1e6ed;
    --ui-text: #1b2430;
    --ui-muted: #667085;
    --ui-primary: #1e3a5f;
    --ui-primary-2: #2a4f82;
    --ui-accent: #4c8dff;
    --ui-radius: 12px;
    --ui-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

html[data-theme="dark"] {
    --ui-bg: #16181c;
    --ui-surface: #1f2227;
    --ui-surface-2: #262a30;
    --ui-border: #33383f;
    --ui-text: #e3e6ea;
    --ui-muted: #9aa3ae;
    --ui-primary: #3d6aa3;
    --ui-primary-2: #4b7cbb;
    --ui-shadow: none;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"], html:not([data-theme]) {
        --ui-bg: #16181c;
        --ui-surface: #1f2227;
        --ui-surface-2: #262a30;
        --ui-border: #33383f;
        --ui-text: #e3e6ea;
        --ui-muted: #9aa3ae;
        --ui-primary: #3d6aa3;
        --ui-primary-2: #4b7cbb;
        --ui-shadow: none;
    }
}

body { background: var(--ui-bg); }

/* ---------- navigation ---------- */

nav ul li { text-transform: none; }
nav ul li a, nav ul li button { font-weight: 500; letter-spacing: .01em; }
#nav-list > li > a { border-radius: 8px; margin: 4px 1px !important; padding: 9px 11px !important; height: auto; }
#nav-list > li > a.active { box-shadow: inset 0 -2px 0 var(--ui-accent); background: rgba(255, 255, 255, .08); }
#nav-list > li > a:hover { background: rgba(255, 255, 255, .1); }
/* With Compiler and Typing the menu is long: on narrower screens it gets tighter
   and the greeting shows only the avatar, so nothing overlaps. */
@media (min-width: 800px) and (max-width: 1440px) {
    #nav-list > li > a { padding: 9px 8px !important; font-size: 14px; }
    #user-links > ul > li > a > span > span { display: none; }
}
/* Kyrgyz menu items are longer: tighten them more so «Биз жөнүндө» does not run under the avatar. */
@media (min-width: 800px) and (max-width: 1500px) {
    html[lang="ky"] #nav-list > li > a { padding: 9px 6px !important; font-size: 13px; }
}
/* Just above the hamburger breakpoint the logo keeps only the badge. */
@media (min-width: 1151px) and (max-width: 1300px) {
    #nav-list .brand-wordmark { display: none; }
}
#nav-list > li.home-nav-element > a { margin: 0 !important; padding: 0 !important; height: 44px; }
#nav-shadow { display: none; }
#nav-container { box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 2px 10px rgba(0, 0, 0, .12); }

/* ---------- page titles ---------- */

#content > h2, .tabs h2 {
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ui-text);
}

#content > hr { border: 0; border-top: 1px solid var(--ui-border); }

/* ---------- tabs ---------- */

.tabs { border-bottom-color: var(--ui-border); }
.tabs > ul > li > a, .tabs > ul > li > span {
    border: 0 !important;
    border-radius: 8px 8px 0 0;
    color: var(--ui-muted);
    font-weight: 500;
}
.tabs > ul > li > a:hover { background: var(--ui-surface-2); color: var(--ui-text); }
.tabs > ul > li.active > a, .tabs > ul > li.active > span {
    background: transparent !important;
    color: var(--ui-text) !important;
    box-shadow: inset 0 -2px 0 var(--ui-accent);
}
.tabs .tab.active .tab-icon { color: var(--ui-accent); }

/* ---------- cards and side boxes ---------- */

.sidebox { padding: 0 !important; padding-bottom: 1.2em !important; }
.sidebox h3 {
    margin: 0;
    padding: 12px 14px;
    background: var(--ui-surface);
    color: var(--ui-text);
    font-size: 1.05em;
    font-weight: 700;
    border: 1px solid var(--ui-border);
    border-bottom: 0;
    border-radius: var(--ui-radius) var(--ui-radius) 0 0;
}
.sidebox h3 .fa { color: var(--ui-accent); }
.sidebox-content {
    margin: 0;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-top: 1px solid var(--ui-border);
    border-radius: 0 0 var(--ui-radius) var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.blog-content .post, #common-content .content-description.screen {
    border-radius: var(--ui-radius);
}

/* ---------- tables ---------- */

.table {
    border-radius: var(--ui-radius);
    overflow: hidden;
    box-shadow: var(--ui-shadow);
}
.table th {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ui-muted);
    font-weight: 600;
}
.table tbody tr:hover > td { background-color: rgba(42, 79, 130, .04); }

/* ---------- buttons and inputs ---------- */

.button, button, input[type=submit] { border-radius: 8px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
    border-radius: 8px;
}

/* Contest list: the join button used to be cut off. */
input.participate-button { width: auto !important; min-width: 9em; white-space: nowrap; padding: 8px 14px !important; }

/* ---------- problem page ---------- */

.info-float .solve-button { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600;
    box-sizing: border-box; width: 100%; }
.info-float .solve-button .fa { font-size: .95em; color: inherit !important; }
.problem-title h2, #content > h2 { font-weight: 700; }
.info-float .submit-button { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600;
    box-sizing: border-box; width: 100%; margin-bottom: 8px; }
.info-float .submit-button .fa { font-size: .95em; color: inherit !important; }
.info-float .submit-button + .solve-button { background: transparent !important; color: inherit !important;
    border: 1px solid currentColor !important; opacity: .9; }

/* ---------- submissions: my rows ---------- */

.submissions-list-table tr.submission-mine > td { background: rgba(76, 141, 255, .12); }
.submissions-list-table tr.submission-mine > td:first-child { box-shadow: inset 3px 0 0 #4c8dff; }
.submissions-list-table tr.submission-just-sent > td { background: rgba(76, 141, 255, .26); }

/* ---------- quick submit ---------- */

.quick-submit { max-width: 900px; }
.quick-submit .qs-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.quick-submit select { min-width: 220px; height: 36px; }
.quick-submit textarea { width: 100%; box-sizing: border-box; min-height: 420px; padding: 10px 12px; resize: vertical;
    font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; font-size: 14px; line-height: 1.45; tab-size: 4; }
.quick-submit .qs-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }


/* ---------- small screens ---------- */

@media (max-width: 799px) {
    #nav-list > li > a { margin: 0 !important; border-radius: 0; }
}

/* ---------- pagination: our own look, not the DMOJ grey bar ---------- */

.bottom-pagination-bar { background: none !important; border: 0 !important; }
ul.pagination { display: flex; flex-wrap: wrap; gap: 6px; background: none !important; border: 0 !important;
    box-shadow: none !important; padding: 0; margin: 0; }
ul.pagination > li > a, ul.pagination > li > span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 10px; box-sizing: border-box; border-radius: 10px !important; border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface) !important; color: var(--ui-text) !important; font-weight: 600;
    text-decoration: none; box-shadow: var(--ui-shadow); transition: background .15s, border-color .15s; }
ul.pagination > li > a:hover { border-color: var(--ui-primary-2) !important; color: var(--ui-primary-2) !important; }
ul.pagination > .active-page > a, ul.pagination > .active-page > span {
    background: var(--ui-primary) !important; border-color: var(--ui-primary) !important; color: #fff !important; }
ul.pagination > .disabled-page > a, ul.pagination > .disabled-page > span { opacity: .45; box-shadow: none; }

/* ---------- home: section tiles ---------- */

.oshsu-hero::before { background: radial-gradient(circle, rgba(120, 170, 255, .25) 0%, transparent 70%) !important; }
.hero-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.hero-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: #fff !important;
    text-decoration: none !important; transition: transform .15s, background .15s, border-color .15s; }
.hero-tile:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); }
.hero-tile .tile-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 20px; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.hero-tile .tile-text { display: flex; flex-direction: column; min-width: 0; }
.hero-tile b { font-size: 16px; line-height: 1.2; }
.hero-tile small { font-size: 12.5px; opacity: .8; line-height: 1.3; margin-top: 2px; }
.tile-problems .tile-icon { background: linear-gradient(135deg, #4c8dff, #2f5fd0); }
.tile-contests .tile-icon { background: linear-gradient(135deg, #ff8a5c, #e0533a); }
.tile-compiler .tile-icon { background: linear-gradient(135deg, #34c38f, #1c8f68); }
.tile-typing .tile-icon { background: linear-gradient(135deg, #b07cff, #7b4fe0); }
.tile-quiz .tile-icon { background: linear-gradient(135deg, #ff6b9a, #c4366a); }
/* Five tiles: one row on wide screens, 3 + 2 on medium ones, pairs on tablets. */
@media (min-width: 1281px) {
    .hero-tile { padding: 12px 12px; gap: 10px; }
    .hero-tile .tile-icon { width: 38px; height: 38px; font-size: 18px; }
}
@media (max-width: 1280px) {
    .hero-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .hero-tile { grid-column: span 2; }
    .hero-tile:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 1000px) {
    .hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-tile, .hero-tile:nth-child(n+4) { grid-column: auto; }
    .hero-tile:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .hero-tiles { grid-template-columns: 1fr; } .hero-tile:last-child { grid-column: auto; } }

/* ---------- footer ---------- */

/* The credit line («ОшГУ · МФТИТ …») was too faint, especially in the dark theme. */
footer #footer-content .footer-credit { opacity: 1; color: var(--ui-muted); }
/* The university name is dark blue: on the dark footer it needs a light shade. */
html[data-theme="dark"] footer #footer-content .footer-brand-block .footer-brand { color: #8fb6ec; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] footer #footer-content .footer-brand-block .footer-brand,
    html:not([data-theme]) footer #footer-content .footer-brand-block .footer-brand { color: #8fb6ec; }
}

/* Tab bar without any tabs (guests on list pages) shows no stray line. */
.tabs:not(:has(li)) { display: none; }

/* Footer padding must not push it wider than the screen on phones. */
footer { box-sizing: border-box; max-width: 100%; }

/* Section headings inside pages (comments, contest problems) match the other headings. */
#comment-section > h2, #content-body > h2, #comment-announcement + h2,
.comment-area > h2, #comments > h2, h2.section-h2 {
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ui-text);
}
#comments h3 { font-weight: 700; font-size: 1.1em; }

.empty-note { color: var(--ui-muted); padding: 12px 4px; }
@media (max-width: 520px) {
    table.contest-list { display: block; max-width: 100%; overflow-x: auto; }
}

/* ---------- design pass 2026-11-15 ---------- */
/* Unrated names were #999 on white (about 2.6:1): use the muted text colour of the theme. */
.rate-none, .rate-none a, .rate-newbie, .rate-newbie a { color: var(--ui-muted); }
/* A red "no" icon in every row of the problem list is noise: show absence quietly. */
.no-editorial-color { color: var(--ui-border) !important; opacity: .9; }
/* Visible keyboard focus everywhere. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
/* Comfortable tap targets for list links on phones. */
@media (max-width: 700px) {
    table.table td a, table.table th a { padding-block: 4px; display: inline-block; }
    #nav-list > li > a { min-height: 44px; }
}
/* Respect reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- design pass 2026-11-15, batch 1 ---------- */
/* Phone gutter: the page content sat 5px from the screen edge. */
@media (max-width: 700px) {
    #content { padding-left: 14px; padding-right: 14px; }
    .theme-toggle, #nav-lang.lang-switch > button, #user-links > ul > li > a { min-height: 40px; }
    #nav-lang.lang-switch > button, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; }
}
/* A strip with a single tab ("Все") is only noise. */
.tabs > ul > li:only-child { display: none; }
.tabs:has(> ul > li:only-child) { border-bottom: 0; }
/* Text never below 12px. */
.lang-code, .footer-sub, .footer-links, small { font-size: 12px; }
/* Real checkboxes, easy to hit. */
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; accent-color: var(--ui-primary-2); }
/* Selects look like the text inputs. */
select, .select2-container--default .select2-selection--single { border: 1px solid var(--ui-border); border-radius: 8px; background-color: var(--ui-surface); color: var(--ui-text); min-height: 38px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ui-text); line-height: 36px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
/* The login box was near-black in the dark theme. */
form.form-area { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); }
/* Phone tables: wider touch rows and no clipped text. */
@media (max-width: 700px) {
    table.table td, table.table th { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 700px) {
    .sidebox { padding-left: 0; }
    .problems .problem-code, .problems .editorial { display: none; }
    table.table td, table.table th { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 700px) {
    .info-float { padding-left: 0; padding-right: 0; }
    .problems .category { display: none; }
}
.select2-container--default .select2-selection--single, select { background: var(--ui-surface) !important; }

/* ---------- design pass 2026-11-15, batch 2 ---------- */
/* Problem page on phones: the info panel was 188px wide and clipped its buttons. */
@media (max-width: 700px) {
    #content-right:not(.problems), #content-right:not(.problems) .info-float { width: auto; max-width: none; float: none; }
    #content-right .info-float a.button, #content-right .info-float .button, #content-right .info-float .ui.button { box-sizing: border-box; width: 100%; justify-content: center; text-align: center; }
    #content-right .info-float a { min-height: 32px; }
}

/* Header sign-in link: a real tap target. */
#user-links .anon > a { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 6px; }

/* ---------- design pass 2026-11-15, batch 4 ---------- */
footer #footer-content .footer-sub, footer #footer-content .footer-links, footer #footer-content .footer-links a { font-size: 12px; }
.select2-container--dmoj .select2-selection--single { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 8px; min-height: 38px; }
.select2-container--dmoj .select2-selection--single .select2-selection__rendered { color: var(--ui-text); line-height: 36px; }
.select2-container--dmoj .select2-selection--single .select2-selection__arrow { height: 36px; }
/* Section tabs wrap on phones instead of running off the screen (all links stay reachable). */
@media (max-width: 700px) {
    .tabs > ul { display: flex; flex-wrap: wrap; gap: 2px 4px; overflow: visible; white-space: normal; }
    .tabs > ul > li { float: none; flex: 0 0 auto; }
    .tabs > ul > li > a, .tabs > ul > li > span { padding: 8px 10px; }
}

footer #footer-content .footer-credit, footer #footer-content .footer-year { font-size: 12px; }
