:root {
    color-scheme: light;
    --background: #ffdc9d;
    --surface: #fff3da;
    --border: #dcac68;
    --text: #37220d;
    --muted: #6f492b;
    --gold: #8b3f0b;
    --radius: .7rem;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: #fff; line-height: 1.5; }
.site-frame { width: min(100%, 70rem); min-height: 100vh; margin-inline: auto; display: flex; flex-direction: column; background: var(--background); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #632900; }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.shell { width: min(100% - 3rem, 74rem); margin-inline: auto; }
.site-header { background: #ffbe64; border-bottom: 1px solid #ce8d42; }
.header-inner { display: flex; align-items: center; min-height: 5rem; gap: clamp(1rem, 3vw, 2.7rem); }
.brand { flex: none; display: flex; align-items: center; }
.brand img { display: block; object-fit: contain; }
.main-nav, .auth-links, .actions, .site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.main-nav { gap: clamp(.8rem, 2vw, 1.6rem); flex: 1; }
.main-nav a { color: var(--text); padding: .4rem 0; font-weight: 650; white-space: nowrap; }
.main-nav a[aria-current], .main-nav a:hover { color: var(--gold); }
.auth-links { margin-left: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .55rem .95rem; border: 1px solid transparent; border-radius: .55rem; color: var(--text); background: transparent; font-weight: 700; white-space: nowrap; cursor: pointer; }
.button.gold { color: #fffaf1; background: #9c4513; border-color: #89380d; }
.button.gold:hover { background: #7c320e; color: #fffaf1; }
.button.outline, .button.ghost { border-color: #c78745; color: var(--text); background: #fff3d5; }
.button.outline:hover, .button.ghost:hover { background: #ffe3a8; }
.content { flex: 1; padding-block: 2rem 3.5rem; }
.portal-header { background: linear-gradient(165deg, #ffc764 0%, #f7a037 67%, #ffb74d 100%); }
.portal-top, .portal-bar, .portal-content { max-width: 64rem; }
.portal-top { display: grid; justify-items: center; gap: .55rem; padding-block: .3rem 1.15rem; }
.portal-logo a { display: block; }
.portal-logo img { display: block; width: clamp(13.5rem, 38vw, 19rem); height: auto; }
.downloads { width: min(100%, 28.5rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.portal-download { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.2rem; gap: .12rem; padding: .4rem .2rem; color: #fffaf1; text-align: center; line-height: 1.2; font-weight: 750; border: 1px solid #813707; border-radius: .5rem; background: #9c4513; }
.portal-download:hover { color: #fffaf1; background: #7c320e; }
.portal-download:disabled { opacity: 1; color: var(--text); border-color: #c48735; background: #ffdf9a; }
.portal-download small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.portal-top .play-button { min-width: 9rem; justify-content: center; }
.header-inner.portal-bar { min-height: 3.7rem; border-top: 1px solid #9e4b243d; }
.portal-content { padding-top: 1.15rem; }
.news-avatar { flex: none; width: 2.75rem; height: 2.75rem; padding: .15rem; object-fit: contain; background: #ffe3aa; border: 1px solid #e5bc7c; border-radius: .55rem; }
.muted { color: var(--muted); }
.overview { display: grid; gap: 1rem; align-items: start; }
.card { min-width: 0; padding: 1.35rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.section-heading h1, .form-card h1, .article h1 { font-size: clamp(1.8rem, 4vw, 2.55rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.news-list { display: grid; gap: .4rem; }
.news-row, .article-author { display: flex; gap: .75rem; align-items: center; }
.news-row { padding: .45rem .6rem; color: var(--text); background: #ffedc8; border: 1px solid #eac690; border-radius: .5rem; }
.news-row:hover { color: var(--gold); background: #ffe4ad; }
.news-row small, .article-author small { display: block; font-size: .875rem; color: var(--muted); }
.news-row strong { display: block; overflow-wrap: anywhere; }
.tag { color: var(--gold); font-size: .875rem; font-weight: 700; border: 1px solid #dfb777; background: #ffe4ac; border-radius: 2rem; padding: .22rem .65rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.tabs a { padding: .42rem .7rem; font-size: .9rem; font-weight: 650; color: var(--muted); border: 1px solid transparent; border-radius: .45rem; }
.tabs a[aria-current], .tabs a:hover { color: #6b2d04; background: #ffdc96; border-color: #d8994a; }
.table-scroll { overflow: auto; max-height: 24rem; border: 1px solid var(--border); border-radius: .55rem; }
table { width: 100%; min-width: 22rem; border-spacing: 0; text-align: left; font-variant-numeric: tabular-nums; }
thead th { position: sticky; top: 0; background: #ffc977; color: var(--text); font-size: .875rem; }
th, td { padding: .6rem .7rem; border-bottom: 1px solid #e6c595; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:nth-child(even) { background: #ffedce; }
th:last-child, td:last-child, .score-value { text-align: right; }
.place { display: inline-grid; place-items: center; min-width: 1.65rem; min-height: 1.65rem; padding-inline: .22rem; border-radius: .35rem; background: #ffe6b8; color: var(--text); font-size: .875rem; }
.place.podium { color: #5c2904; background: #ffcf75; }
.empty { padding: 1.2rem .8rem; background: #ffebc5; border-radius: .5rem; color: var(--muted); }
.form-card { max-width: 31rem; margin-inline: auto; }
.form-card > p, .article > p { margin-block: .7rem 1rem; }
.stack { display: grid; gap: .85rem; }
.stack label { display: grid; gap: .3rem; font-weight: 600; }
.stack .check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
input:not([type=checkbox]) { width: 100%; min-width: 0; min-height: 2.7rem; border: 1px solid #c18c50; border-radius: .45rem; padding: .55rem .7rem; color: var(--text); background: #fffaf0; }
input[type=checkbox] { accent-color: var(--gold); margin-top: .35rem; }
.form-note { text-align: center; }
.article { max-width: 53rem; margin-inline: auto; }
.article h1 { margin-top: .45rem; }
.article-author { margin-block: .85rem 1.2rem; }
.guide-section { margin-block-start: 1.25rem; }
.guide-section h2 { font-size: 1.2rem; }
.guide-section p { margin-block: .55rem; }
.guide-section ul { padding-inline-start: 1.25rem; }
.guide-section li + li { margin-block-start: .45rem; }
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; }
.profile div { border: 1px solid var(--border); padding: .65rem; border-radius: .5rem; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 700; }
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.alert { max-width: 53rem; margin: 0 auto 1rem; padding: .7rem .9rem; border: 1px solid #c87464; border-radius: .5rem; color: #732619; background: #ffe9dc; overflow-wrap: anywhere; }
.alert.good { color: #2b542b; border-color: #82a36c; background: #f0f7db; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); background: #ffce80; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; justify-content: space-between; padding-block: 1rem; }
.site-footer nav { gap: 1rem; }
@media (max-width: 59rem) {
    .header-inner { flex-wrap: wrap; row-gap: 0; padding: .25rem 0 .6rem; }
    .main-nav { order: 3; flex-basis: 100%; }
    .portal-bar .main-nav { order: 0; flex-basis: auto; }
}
@media (max-width: 43rem) {
    .shell { width: calc(100% - 1.5rem); }
    .content { padding-block: 1rem 2.5rem; }
    .downloads { gap: .4rem; }
    .portal-download { font-size: .875rem; }
    .portal-bar .main-nav, .portal-bar .auth-links { justify-content: center; }
    .portal-bar .main-nav { order: 3; flex-basis: 100%; }
    .portal-bar .auth-links { flex: 1 0 100%; margin-left: 0; }
    .ranking table { min-width: 0; font-size: .875rem; }
    .ranking th, .ranking td { padding: .55rem .4rem; white-space: normal; overflow-wrap: anywhere; }
    .ranking th:first-child, .ranking tbody th, .ranking tbody td:nth-child(3) { overflow-wrap: normal; }
    .card { padding: 1rem; }
    .main-nav { gap: .85rem; font-size: .9rem; }
    .auth-links { gap: .25rem; }
    .auth-links .button { padding: .45rem .55rem; font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
