@font-face { font-family: "Yeseva One"; src: url(/static/fonts/Yeseva_One/YesevaOne-Regular.woff) format("woff"); font-display: swap; }
@font-face { font-family: "Poiret One"; src: url(/static/fonts/Poiret_One/PoiretOne-Regular.woff) format("woff"); font-display: swap; }
:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e3e1dc;
  --accent: #d6452f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9e5;
  --ok: #2f8f4e;
  --warn: #b7791f;
  --info: #2f6fb3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
  --logo-ink: #12283e;
  --logo-green: #3f8a52;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
body.admin .wrap { max-width: 1040px; }

.topbar { border-bottom: 1px solid var(--line); background: var(--card); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.toplink { color: var(--muted); text-decoration: none; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 14px; }

main { padding: 28px 0 8px; }
main.wrap { padding-top: 36px; padding-bottom: 8px; }
body.admin main.wrap { padding-top: 24px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 14px; }
.lead { font-size: 17px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
em.muted { font-style: normal; font-weight: 400; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 20px 0;
}

.hero { margin-bottom: 8px; }
.platform-title { margin: 32px 0 12px; font-family: "Yeseva One", Georgia, serif; font-weight: 400; font-size: 26px; letter-spacing: .01em; color: var(--logo-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card { display: flex; gap: 12px; align-items: center; margin: 0; padding: 14px; text-decoration: none; color: var(--text); transition: border-color .15s; }
.game-card:hover { border-color: var(--accent); }
.game-card img { width: 52px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; }
.game-card div { display: flex; flex-direction: column; gap: 2px; }
.badge { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; width: fit-content; }

.project-head { display: flex; gap: 20px; align-items: flex-start; margin-top: -20px; }
.project-head .cover { width: 120px; border-radius: 10px; flex: none; box-shadow: var(--shadow); }
.project-info { min-width: 0; flex: 1; }
h1.logo { margin: 10px 0 14px; line-height: 0; }
h1.logo img { display: block; margin: 0 auto; max-width: min(100%, 520px); max-height: 200px; width: auto; height: auto; }
.game-card.with-logo { justify-content: center; text-align: center; }
.game-card.with-logo > div { align-items: center; width: 100%; }
.game-card .card-logo { width: auto; height: auto; max-width: 100%; max-height: 72px; object-fit: contain; border-radius: 0; margin: 0 auto 8px; }
/* одинаковые плитки: логотип сверху, название прижато к коду, код внизу по центру */
.game-card.tile { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0; height: 170px; padding: 12px 14px 14px; text-align: center; }
.tile-logo { height: 68px; display: flex; align-items: center; justify-content: center; flex: none; }
.game-card.tile .card-logo { margin: 0; max-height: 68px; }
.tile-text { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-height: 0; }
.tile-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; line-height: 1.35; }
.tile-sub { min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.game-card.tile .badge { margin-top: 2px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; }
.project-head.has-logo .crumbs { justify-content: center; }
.crumb-back { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
              background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none;
              font-weight: 600; box-shadow: var(--shadow); transition: border-color .15s, color .15s; }
.crumb-back:hover { border-color: var(--accent); color: var(--accent); }
.crumb-back span { transition: transform .15s; }
.crumb-back:hover span { transform: translateX(-3px); }
.crumb-platform { padding: 5px 12px; border-radius: 999px; background: #e7f1e9; color: var(--logo-green); font-weight: 600; }
.links { list-style: none; margin: 12px 0 0; padding: 0; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.links li { line-height: 1.45; }
.link-note { color: var(--muted); }
.link-text { color: var(--text); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace; font-size: .9em;
       background: var(--accent-soft); border-radius: 4px; padding: 1px 5px; }
a code { color: inherit; }
@media (max-width: 560px) {
  .project-head { flex-direction: column; }
  .project-head .cover { width: 96px; }
  h1 { font-size: 26px; }
}

.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: 15px; }
.hint { align-self: flex-end; font-size: 12px; color: var(--muted); font-weight: 400 !important; }
input[type=text], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 90px; padding: 16px; border: 2px dashed var(--line); border-radius: 12px;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.preview { position: relative; width: 120px; }
.preview img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.preview button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 24px; padding: 0;
}
.preview .name { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.actions p { margin: 0; flex: 1 1 260px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 10px; padding: 11px 22px;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; padding: 0; }

.alert { background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.notice { color: var(--muted); }

.donate-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; max-width: 680px; margin: 16px auto 0; }
@media (max-width: 560px) { .donate-links { grid-template-columns: 1fr 1fr; } }
.donate p { margin: 0; }
.donate-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; min-width: 0; white-space: nowrap; }
.donate-icon { width: 20px; height: 20px; object-fit: contain; flex: none; }
.donate-net { font-size: 12px; font-weight: 500; opacity: .75; }
.donate-btn[aria-expanded="true"] { background: var(--accent-soft); }
.wallet { display: flex; gap: 20px; align-items: center; margin: 16px auto 0; padding: 16px; max-width: 600px;
          border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.wallet[hidden] { display: none; }
.wallet-qr { width: 168px; height: 168px; flex: none; image-rendering: pixelated; border-radius: 8px; background: #fff; }
.wallet-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; align-items: flex-start; }
.wallet-addr { display: block; font-size: 13px; line-height: 1.5; word-break: break-all; user-select: all;
               background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; box-sizing: border-box; }
.wallet-copy { padding: 8px 16px; }
.wallet-note { margin: 0; }
@media (max-width: 560px) {
  .wallet { flex-direction: column; text-align: center; }
  .wallet-info { align-items: center; width: 100%; }
}

.thanks { text-align: center; padding: 40px 22px; }
.thanks .big { font-size: 44px; width: 76px; height: 76px; line-height: 76px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.thanks p { margin: 12px 0 0; }

.footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; text-align: center; }
.footer-links { margin-top: -4px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* --- админка --- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.filters select { flex: 1 1 260px; width: auto; }
.filters input { flex: 2 1 220px; width: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tabs a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.tabs a.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs b { font-weight: 600; margin-left: 4px; }
.report { margin: 14px 0; padding: 16px 18px; border-left: 4px solid var(--line); }
.report.st-new { border-left-color: var(--accent); }
.report.st-accepted { border-left-color: var(--info); }
.report.st-fixed { border-left-color: var(--ok); opacity: .85; }
.report.st-rejected { opacity: .6; }
.report-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rid { font-weight: 700; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.tag.cat { background: var(--bg); }
.push { margin-left: auto; }
.where { margin: 10px 0 0; font-size: 14px; }
.msg { white-space: pre-wrap; word-wrap: break-word; margin: 10px 0; }
.shots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.shots img { height: 140px; width: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-actions select { width: auto; padding: 6px 10px; }
.report-actions input { flex: 1 1 200px; width: auto; padding: 6px 10px; }
.del { margin-top: 6px; text-align: right; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0 40px; }
.config-problems { border-left: 4px solid var(--warn); padding: 14px 18px; }
.config-problems ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.config-problems li { margin: 4px 0; word-break: break-word; }
.md p { margin: 0 0 10px; }
.md > :last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md h3, .md h4, .md h5, .md h6 { color: var(--text); font-size: 17px; margin: 14px 0 6px; }
.md strong { color: var(--text); }
.form > h2, .donate > h2 { text-align: center; }
.actions { align-items: center; gap: 20px; }
.actions .btn { order: -1; flex: none; }
.consent { flex: 1 1 300px; margin: 0; }
.consent p { margin: 0 0 8px; }
@media (max-width: 560px) {
  .actions .btn { order: 0; width: 100%; }
}
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
/* логотип сайта на главной: светлый и тёмный варианты */
.hero.has-logo { text-align: center; margin: 4px 0 12px; }
.site-logo { margin: 0 0 14px; line-height: 0; }
.site-logo img { display: block; margin: 0 auto; width: 100%; max-width: 440px; height: auto; }
.logo-dark { display: none !important; }
.hero.has-logo .lead { max-width: 600px; margin: 0 auto; }
/* надпись к логотипу: Yeseva One + Poiret One */
.site-logo img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.site-logo.with-title img { width: 190px; max-width: 48vw; }
.logo-title { display: block; margin-top: 14px; font-family: "Yeseva One", Georgia, serif; font-weight: 400;
  font-size: clamp(32px, 8.5vw, 48px); line-height: 1.05; color: var(--logo-ink); letter-spacing: .005em; }
.logo-subtitle { display: block; margin-top: 8px; font-family: "Poiret One", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(17px, 4.6vw, 26px); line-height: 1.2; letter-spacing: .18em; text-transform: uppercase; color: var(--logo-green); }
.logo-subtitle::before, .logo-subtitle::after { content: "✦"; font-family: system-ui, sans-serif; font-size: .6em; margin: 0 .55em; vertical-align: .25em; }
.site-logo { line-height: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* текст под логотипом: Poiret One, выделенное (**...**) - красная плашка */
.hero.has-logo .lead { font-family: "Poiret One", system-ui, sans-serif; font-weight: 700; font-size: 20px;
  line-height: 1.5; letter-spacing: .01em; color: var(--text); max-width: 560px; margin: 14px auto 0; }
.hero.has-logo .lead strong { display: table; margin: 14px auto 0; font-weight: 700; font-size: 19px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  border: 1.5px solid currentColor; border-radius: 999px; padding: 3px 18px; }
/* голосование за следующий перевод */
.poll { padding: 0; margin: 22px 0 8px; overflow: hidden; }
.poll summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; }
.poll summary::-webkit-details-marker { display: none; }
.poll summary:hover .poll-title { color: var(--accent); }
.poll-icon { font-size: 26px; line-height: 1; }
.poll-head { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.poll-title { font-family: "Yeseva One", Georgia, serif; font-size: 21px; line-height: 1.2; color: var(--logo-ink); transition: color .15s; }
.poll-hint { font-size: 13px; color: var(--muted); }
.poll-arrow { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin: 0 4px 4px 0; flex: none; }
.poll[open] .poll-arrow { transform: rotate(-135deg); margin-bottom: -4px; }
.poll-body { padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.poll-desc { margin: 14px 0 4px; color: var(--muted); }
.poll-ok { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #e5f4e4; color: #23602f; font-weight: 600; }
.poll-body .alert { margin: 14px 0 0; }
.poll-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.poll-option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.poll-option:hover { border-color: var(--accent); }
.poll-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.poll-option input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.poll-option-text { display: flex; flex-direction: column; }
.poll-note { margin-top: 2px; }
.poll-actions { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.poll-results { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.poll-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.poll-bar { height: 8px; border-radius: 99px; background: var(--bg); margin-top: 5px; overflow: hidden; }
.poll-bar span { display: block; height: 100%; border-radius: 99px; background: var(--logo-green); }
.poll-results li.mine .poll-bar span { background: var(--accent); }
.poll-mark { font-size: 12px; color: var(--accent); border: 1px solid currentColor; border-radius: 99px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.poll-footer { margin-top: 14px; }
.admin-poll { padding: 14px 18px; }
.admin-poll summary { cursor: pointer; }
.poll-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.poll-table td { padding: 6px 4px; border-top: 1px solid var(--line); }
.poll-table .num { text-align: right; width: 60px; white-space: nowrap; }
