/* Тема взята у TERRON (terron-theme.css): жёлтый лист карты в клетку, белые
   листы, чернильные квадратные кнопки с жёсткой тенью, Oswald/Plex Mono/Golos. */
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("fonts/oswald-500.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("fonts/oswald-600.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("fonts/oswald-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url("fonts/golos-text-400.woff2") format("woff2"); }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url("fonts/golos-text-500.woff2") format("woff2"); }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url("fonts/golos-text-600.woff2") format("woff2"); }
@font-face { font-family: "Golos Text"; font-weight: 700; font-display: swap; src: url("fonts/golos-text-700.woff2") format("woff2"); }

:root {
  --t-bg: #efe6c8;
  --t-parchment: #ffffff;
  --t-sheet: #fdfcf7;
  --t-ink: #2b2a24;
  --t-ink-soft: rgba(43, 42, 36, 0.6);
  --t-line: rgba(43, 42, 36, 0.18);
  --t-red: #a8432b;
  --t-green: #3f7a4a;
  --t-gold: #b8860b;
  --t-shadow: 3px 3px 0 0 rgba(43, 42, 36, 0.22);
  --t-shadow-sm: 2px 2px 0 0 rgba(43, 42, 36, 0.22);
  --t-display: "Oswald", sans-serif;
  --t-mono: "IBM Plex Mono", monospace;
  --t-body: "Golos Text", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background-color: var(--t-bg);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 119px, var(--t-line) 119px 120px),
    repeating-linear-gradient(90deg, transparent 0 119px, var(--t-line) 119px 120px);
  color: var(--t-ink);
  font-family: var(--t-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }

/* ── шапка ── */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.brand {
  font-family: var(--t-display); font-weight: 700; font-size: 22px; letter-spacing: .04em;
  text-transform: uppercase; text-decoration: none; background: var(--t-ink); color: var(--t-parchment);
  padding: 4px 12px; box-shadow: var(--t-shadow);
}
.top .grow { flex: 1; min-width: 0; }

/* ── базовые элементы TERRON ── */
.t-h1 { font-family: var(--t-display); font-weight: 700; text-transform: uppercase; font-size: 38px; line-height: 1.05; margin: 0 0 10px; letter-spacing: .01em; }
.t-h2 { font-family: var(--t-display); font-weight: 700; text-transform: uppercase; font-size: 22px; margin: 0 0 12px; }
.t-h3 { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; font-size: 17px; margin: 0 0 10px; }
.t-muted { font-family: var(--t-mono); font-size: 12px; color: var(--t-ink-soft); }
.t-label { font-family: var(--t-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--t-ink-soft); }
.t-input {
  width: 100%; background: var(--t-parchment); border: 1px solid var(--t-ink); border-radius: 0;
  padding: 10px 12px; font-family: var(--t-display); color: var(--t-ink); outline: none;
}
textarea.t-input { font-family: var(--t-body); resize: vertical; min-height: 44px; line-height: 1.45; }
.t-input:focus { box-shadow: var(--t-shadow-sm); }
.t-btn {
  font-family: var(--t-display); text-transform: uppercase; letter-spacing: .04em; font-weight: 500;
  padding: 10px 18px; border: 1px solid var(--t-ink); border-radius: 0; background: var(--t-ink);
  color: var(--t-parchment); box-shadow: var(--t-shadow); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.t-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 rgba(43,42,36,.22); }
.t-btn.ghost { background: var(--t-parchment); color: var(--t-ink); }
.t-btn.danger { background: var(--t-red); border-color: var(--t-red); color: #fff; }
.t-btn.green { background: var(--t-green); border-color: var(--t-green); color: #fff; }
.t-btn.sm { padding: 6px 12px; font-size: 13px; box-shadow: var(--t-shadow-sm); }
.t-btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  cursor: pointer; height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border: 1px solid var(--t-line); background: transparent; color: var(--t-ink); font-size: 14px;
  border-radius: 0;
}
.icon-btn:hover { border-color: var(--t-ink); }
.icon-btn.on { background: var(--t-ink); color: var(--t-parchment); border-color: var(--t-ink); }
.t-err { font-family: var(--t-mono); font-size: 13px; color: var(--t-red); }
.t-ok { font-family: var(--t-mono); font-size: 12px; color: var(--t-green); }

.sheet { background: var(--t-sheet); border: 1px solid var(--t-ink); box-shadow: var(--t-shadow); padding: 18px; }
.sheet + .sheet { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 10px; }
.check input { margin-top: 3px; accent-color: var(--t-ink); width: 16px; height: 16px; }
.check b { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }

/* ── зона загрузки: как у скинов TERRON ── */
.drop {
  min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px; border: 2px dashed var(--t-line); background: var(--t-sheet);
  transition: border-color .1s, background .1s;
}
.drop.over { border-color: var(--t-ink); background: rgba(0,0,0,.04); }
.drop.compact { min-height: 150px; }
.drop .big { font-weight: 700; color: var(--t-ink); }
.drop .urlrow { display: flex; gap: 6px; width: 100%; max-width: 360px; margin-top: 4px; }
.drop .urlrow .t-input { flex: 1; }
.drop .formats { max-width: 440px; }

.progress { height: 8px; background: var(--t-line); margin-top: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--t-ink); width: 0; transition: width .2s; }

/* ── вкладки ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--t-ink); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--t-display); text-transform: uppercase; letter-spacing: .04em; font-weight: 500;
  padding: 10px 16px; border: 1px solid transparent; border-bottom: 0; background: transparent; cursor: pointer;
  color: var(--t-ink-soft); white-space: nowrap; margin-bottom: -1px;
}
.tab.on { background: var(--t-sheet); border-color: var(--t-ink); color: var(--t-ink); }

/* ── ссылки ── */
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 18px; }
.linkbox { background: var(--t-parchment); border: 1px solid var(--t-ink); padding: 10px 12px; min-width: 0; }
.linkbox .url { font-family: var(--t-mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 4px 0 8px; }
.linkbox.secret { border-style: dashed; }

/* ── сетка превью ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { position: relative; background: var(--t-parchment); border: 1px solid var(--t-line); line-height: 0; }
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #e8e2cc; cursor: zoom-in; }
.thumb .cap { line-height: 1.3; font-family: var(--t-mono); font-size: 11px; padding: 5px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-ink-soft); }
.thumb .x {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 1px solid var(--t-ink);
  background: var(--t-parchment); cursor: pointer; line-height: 1; font-size: 13px; opacity: 0; transition: opacity .1s;
}
.thumb:hover .x, .thumb .x:focus { opacity: 1; }
@media (hover: none) { .thumb .x { opacity: 1; } }

/* ── статистика ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--t-parchment); border: 1px solid var(--t-ink); padding: 10px 12px; }
.tile .v { font-family: var(--t-display); font-weight: 700; font-size: 28px; line-height: 1.1; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.scard { background: var(--t-parchment); border: 1px solid var(--t-ink); display: flex; flex-direction: column; min-width: 0; }
.scard.top1 { box-shadow: 4px 4px 0 0 var(--t-gold); border-color: var(--t-gold); }
.scard .pic { position: relative; line-height: 0; }
.scard .pic img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #e8e2cc; cursor: zoom-in; }
.scard .rank {
  position: absolute; top: 8px; left: 8px; background: var(--t-ink); color: var(--t-parchment);
  font-family: var(--t-display); font-weight: 700; padding: 2px 9px; line-height: 1.4; font-size: 15px;
}
.scard .score {
  position: absolute; top: 8px; right: 8px; background: var(--t-parchment); border: 1px solid var(--t-ink);
  font-family: var(--t-display); font-weight: 700; padding: 1px 8px; line-height: 1.4; font-size: 15px;
}
.scard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.scard .name { font-family: var(--t-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: var(--t-line); }
.bar > i { display: block; height: 100%; background: var(--t-ink); }
.metrics { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-family: var(--t-mono); font-size: 11.5px; border: 1px solid var(--t-line); padding: 2px 6px; white-space: nowrap; }
.chip.g { color: var(--t-green); border-color: rgba(63,122,74,.4); }
.chip.r { color: var(--t-red); border-color: rgba(168,67,43,.4); }
.chip.y { color: var(--t-gold); border-color: rgba(184,134,11,.45); }
.comments { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--t-line); padding-top: 7px; }
.comment { font-size: 13.5px; line-height: 1.4; }
.comment .who { font-family: var(--t-mono); font-size: 11px; color: var(--t-ink-soft); margin-right: 5px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-family: var(--t-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--t-ink-soft); font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--t-ink); }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--t-line); vertical-align: middle; }
table.t td img { width: 56px; height: 40px; object-fit: cover; display: block; }
.scroll-x { overflow-x: auto; }

/* ── редактор вступления ── */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.blk { border: 1px solid var(--t-line); background: var(--t-parchment); padding: 8px; margin-bottom: 8px; }
.blk .head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.blk .head .t-label { flex: 1; }
.blk .icon-btn { height: 28px; min-width: 28px; padding: 0 6px; }
.blk input.t-input.h { font-family: var(--t-display); font-weight: 700; text-transform: uppercase; font-size: 18px; }
.blk img { max-height: 160px; display: block; margin-bottom: 6px; border: 1px solid var(--t-line); }

/* ── вступление для голосующего ── */
.onb { max-width: 720px; margin: 0 auto; }
.onb h2 { font-family: var(--t-display); font-weight: 700; text-transform: uppercase; font-size: 26px; line-height: 1.1; margin: 22px 0 8px; }
.onb h2:first-child { margin-top: 0; }
.onb p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; white-space: pre-wrap; }
.onb figure { margin: 6px 0 16px; }
.onb figure img { display: block; width: 100%; border: 1px solid var(--t-ink); }
.onb figcaption { margin-top: 6px; }
.onb .end { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--t-ink); }
.howto { display: grid; gap: 8px; margin: 10px 0 16px; }
.howto div { font-size: 14px; }
.howto b { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; }

/* ── голосование ── */
.vote-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.vote-top .title { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--t-ink); background: var(--t-parchment); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-family: var(--t-display); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--t-ink); }
.seg button.on { background: var(--t-ink); color: var(--t-parchment); }
.meter { font-family: var(--t-mono); font-size: 12px; color: var(--t-ink-soft); display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.meter { flex-wrap: wrap; }
.meter .progress { flex: 1 1 160px; margin: 0; }

.stage { position: relative; background: var(--t-sheet); border: 1px solid var(--t-ink); box-shadow: var(--t-shadow); height: calc(100dvh - 330px); min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y; user-select: none; }
.stage img.main { max-width: 100%; max-height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; pointer-events: none; }
.stage .zoom { position: absolute; bottom: 8px; right: 8px; }
.stage .fname { position: absolute; left: 8px; bottom: 8px; background: rgba(253,252,247,.9); padding: 2px 6px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.swipe-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--t-sheet); will-change: transform; cursor: grab; touch-action: none; }
.swipe-card.dragging { cursor: grabbing; }
.swipe-card.fly { transition: transform .28s ease-in, opacity .28s ease-in; }
.swipe-card.back { transition: transform .2s ease-out; }
.stamp {
  position: absolute; top: 18px; font-family: var(--t-display); font-weight: 700; font-size: 34px; text-transform: uppercase;
  padding: 2px 14px; border: 4px solid; opacity: 0; pointer-events: none; background: rgba(253,252,247,.85);
}
.stamp.yes { left: 18px; color: var(--t-green); transform: rotate(-12deg); }
.stamp.no { right: 18px; color: var(--t-red); transform: rotate(12deg); }

.controls { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: transparent; cursor: pointer; font-size: 40px; line-height: 1; padding: 0 2px; color: rgba(43,42,36,.22); transition: transform .08s, color .08s; }
.stars button.lit { color: #d9a21b; }
.stars button:hover { transform: scale(1.12); }
.bigbtn { width: 68px; height: 68px; border-radius: 0; font-size: 30px; padding: 0; }
.comment-box { margin-top: 10px; }
.kbd { font-family: var(--t-mono); font-size: 11px; color: var(--t-ink-soft); text-align: center; margin-top: 8px; }

.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: calc(100dvh - 260px); min-height: 260px; }
.duel .side { position: relative; background: var(--t-sheet); border: 1px solid var(--t-ink); box-shadow: var(--t-shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: transform .08s; }
.duel .side:hover { outline: 3px solid var(--t-ink); outline-offset: -3px; }
.duel .side img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.duel .side .key { position: absolute; top: 8px; left: 8px; background: var(--t-ink); color: var(--t-parchment); font-family: var(--t-display); padding: 1px 8px; }
.duel .side.burn { animation: burn .35s forwards; }
.duel .side.win { outline: 4px solid var(--t-green); outline-offset: -4px; }
@keyframes burn { to { opacity: 0; transform: scale(.92); filter: grayscale(1) blur(2px); } }

.done { text-align: center; max-width: 640px; margin: 20px auto; }
.done img { max-height: 55dvh; border: 1px solid var(--t-ink); box-shadow: var(--t-shadow); background: var(--t-sheet); }

.notice {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 50; background: var(--t-ink); color: var(--t-parchment);
  font-family: var(--t-display); text-transform: uppercase; letter-spacing: .04em; padding: 10px 18px; box-shadow: var(--t-shadow);
  max-width: calc(100vw - 32px); text-align: center; pointer-events: none; transition: opacity .3s;
}

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(20,19,15,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .cap { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #efe6c8; font-family: var(--t-mono); font-size: 12px; }

.center { text-align: center; }
.mt { margin-top: 14px; }
.hide { display: none !important; }
.spin { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--t-ink); border-right-color: transparent; animation: spin .8s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: stretch; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; }
.steps li::before { content: counter(s); font-family: var(--t-display); font-weight: 700; background: var(--t-ink); color: var(--t-parchment); min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.plist .item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--t-line); }
.plist .item a { font-family: var(--t-display); text-transform: uppercase; font-weight: 600; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .t-h1 { font-size: 30px; }
  .hero, .editor, .links { grid-template-columns: 1fr; }
  .stage { height: calc(100dvh - 360px); }
  .duel { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; height: calc(100dvh - 190px); }
  .stars button { font-size: 36px; }
  .sgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .scard .body { padding: 8px; }
}
@media (max-width: 420px) { .sgrid { grid-template-columns: 1fr; } }

/* ── версии, карточки картинок, воронка ── */
.verbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--t-parchment); border: 1px solid var(--t-ink); padding: 8px 12px; margin-bottom: 16px; }
.verbar select { min-width: 0; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.icard { background: var(--t-parchment); border: 1px solid var(--t-line); display: flex; flex-direction: column; min-width: 0; }
.icard .pic { position: relative; line-height: 0; }
.icard .pic img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #e8e2cc; cursor: zoom-in; }
.icard .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 1px solid var(--t-ink); background: var(--t-parchment); cursor: pointer; font-size: 13px; line-height: 1; }
.icard .ibody { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.trow { display: flex; }
.trow .t-input { flex: 1; min-width: 0; padding: 6px 8px; font-weight: 600; }
.iclear { border: 1px solid var(--t-ink); border-left: 0; background: var(--t-parchment); cursor: pointer; width: 32px; flex: none; }
.iclear:hover { background: var(--t-ink); color: var(--t-parchment); }
.idesc { padding: 6px 8px; font-size: 13.5px; min-height: 36px; }
.icard .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.scard .stitle { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .sdesc { font-size: 13px; color: var(--t-ink-soft); line-height: 1.35; }

.caption { margin-top: 8px; text-align: center; }
.caption .ctitle { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; font-size: 18px; line-height: 1.2; }
.caption .cdesc { font-size: 14px; color: var(--t-ink-soft); margin-top: 2px; }
.stage.with-cap { height: calc(100dvh - 390px); }
.duel .side .dcap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(253,252,247,.93); border-top: 1px solid var(--t-ink); padding: 6px 10px; line-height: 1.3; display: flex; flex-direction: column; }
.duel .side .dcap b { font-family: var(--t-display); font-weight: 600; text-transform: uppercase; }
.duel .side .dcap span { font-size: 13px; color: var(--t-ink-soft); }

.modal { position: fixed; inset: 0; z-index: 55; background: rgba(20,19,15,.55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; }
.modal-sheet { position: relative; width: 100%; max-width: 760px; }
.modal-x { position: absolute; top: 8px; right: 8px; background: var(--t-parchment); }
.detail .big { display: block; max-width: 100%; max-height: 50dvh; margin: 0 auto; border: 1px solid var(--t-ink); cursor: zoom-in; }

.fun { display: flex; flex-direction: column; gap: 8px; }
.fun-row { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; align-items: center; }
.fun-row .t-muted { grid-column: 2; }
.fun-bar { position: relative; height: 18px; }
.fun-bar i, .fun-bar b { position: absolute; left: 0; top: 0; bottom: 0; }
.fun-bar i { background: var(--t-line); }
.fun-bar b { background: var(--t-ink); }
.run { border-top: 1px solid var(--t-line); padding: 10px 0; }
.run-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.run-head b { font-family: var(--t-display); text-transform: uppercase; }
.circles { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.circle { flex: 0 0 auto; max-width: 290px; border-left: 2px solid var(--t-ink); padding-left: 8px; }
.minis { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
img.mini { width: 44px; height: 32px; object-fit: cover; border: 1px solid var(--t-line); cursor: pointer; display: block; background: #e8e2cc; }
img.mini:hover { border-color: var(--t-ink); }
img.mini.out { opacity: .35; border-color: var(--t-red); filter: grayscale(.7); }
img.mini.gold { outline: 3px solid var(--t-gold); outline-offset: -1px; }
.duels { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dstep { display: flex; gap: 6px; align-items: center; }
.dstep .k { width: 54px; }
.dstep .gt { font-family: var(--t-display); font-size: 18px; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.pair { display: flex; gap: 6px; align-items: center; border: 1px solid var(--t-line); padding: 4px 6px; background: var(--t-parchment); }
.pair b { font-family: var(--t-display); min-width: 40px; text-align: center; }
table.t td.bad { color: var(--t-red); font-weight: 600; }
table.t td.good { color: var(--t-green); font-weight: 600; }
table.t .cut { max-width: 220px; min-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
table.t td img.mini { width: 44px; height: 32px; }
@media (max-width: 760px) {
  .stage.with-cap { height: calc(100dvh - 420px); }
  .fun-row { grid-template-columns: 56px 1fr; }
}
.icard .x.del { right: auto; left: 6px; font-size: 12px; }
.linkbox.share { border-color: var(--t-green); }

/* выбор с клавиатуры: заливка снизу вверх за 0.6 с (HOLD в app.js) */
.swipe-card.lean { transition: transform .15s ease-out; }
.stamp::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: currentColor; opacity: .3; z-index: -1; }
.stamp.filling::before { height: 100%; transition: height .6s linear; }
.duel .side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--t-green); opacity: .22; pointer-events: none; }
.duel .side.filling::after { height: 100%; transition: height .6s linear; }
.duel .side.filling { outline: 3px solid var(--t-green); outline-offset: -3px; }

/* огонь — суперлайк */
.stamp.fire { left: 50%; top: 14px; transform: translateX(-50%); color: #d9621b; white-space: nowrap; }
.t-btn.fire { background: #d9621b; border-color: #d9621b; color: #fff; position: relative; }
.t-btn.fire small { position: absolute; right: 4px; bottom: 2px; font-size: 11px; font-family: var(--t-mono); }
.chip.o { color: #d9621b; border-color: rgba(217,98,27,.45); }
img.mini.fire { outline: 3px solid #d9621b; outline-offset: -1px; }

/* смена круга — карточка в той же стопке */
.banner { text-align: center; padding: 24px; max-width: 520px; }
.banner .bh { font-family: var(--t-display); font-weight: 700; text-transform: uppercase; font-size: 54px; line-height: 1; margin: 8px 0 12px; }
.banner p { font-size: 17px; margin: 0 0 18px; }

/* полный экран голосования: картинка на весь экран, кнопки — полосой снизу, не поверх */
:root { --fsbar: 100px; }
.fs-exit { display: none; }
body.vfs { overflow: hidden; }
body.vfs .stage { position: fixed; left: 0; right: 0; top: 0; bottom: var(--fsbar); height: auto !important; min-height: 0; z-index: 40; border: 0; box-shadow: none; background: #14130f; }
body.vfs .swipe-card { background: #14130f; }
body.vfs .stage .zoom { display: none; }
body.vfs .fs-exit { display: inline-flex; position: fixed; top: 10px; right: 10px; z-index: 43; }
body.vfs .controls { position: fixed; left: 0; right: 0; bottom: 0; height: var(--fsbar); margin: 0; z-index: 41; background: var(--t-sheet); border-top: 1px solid var(--t-ink); }
body.vfs .caption { position: fixed; left: 16px; bottom: 0; height: var(--fsbar); margin: 0; z-index: 42; display: flex; flex-direction: column; justify-content: center; text-align: left; max-width: calc(50vw - 190px); pointer-events: none; overflow: hidden; }
body.vfs .comment-box, body.vfs .kbd { display: none; }
body.vfs .duel { position: fixed; inset: 0; height: auto; z-index: 40; padding: 6px; gap: 6px; background: #14130f; }
body.vfs .duel .side { background: #14130f; }
@media (max-width: 760px) { body.vfs .caption { display: none; } .banner .bh { font-size: 40px; } }

/* анкета */
.qform { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 14px; max-width: 520px; }
.qfield .qlabel { font-weight: 600; }
.qfield .req { color: var(--t-red); }
.qfield .t-input { font-family: var(--t-body); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--t-line); background: var(--t-parchment); padding: 6px 10px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--t-ink); box-shadow: var(--t-shadow-sm); }
.opt input { accent-color: var(--t-ink); margin: 0; }
.ferr:empty { display: none; }
.mini-sel { width: auto; padding: 4px 8px; font-size: 13px; }
.dists { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dist-row { display: grid; grid-template-columns: 110px 1fr 30px; gap: 8px; align-items: center; margin-top: 5px; font-size: 13.5px; }
.dist-row .bar { height: 10px; }
.dist-row .cut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.end-form { text-align: left; margin: 16px auto 0; max-width: 560px; box-shadow: none; }
.final-text p { font-size: 16px; }
.author-note { text-align: left; border-left: 3px solid var(--t-ink); padding: 4px 0 4px 12px; margin: 0 0 16px; }
.author-note p { margin: 4px 0 0; font-size: 15px; white-space: pre-wrap; }
.banner .field textarea { font-family: var(--t-body); }
