/* Haystack Hare — новый дизайн «газета 1940-х». Светлая и тёмная темы: html[data-theme].
   Подключается после /style.css (тот нужен окнам входа и профиля) и перекрывает его глобальные правила. */

/* цвета и шрифты — в v2-base.css */


/* ---------- база (перекрываем style.css) ---------- */
html { font-size: 16px; height: auto; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
body { height: auto; min-height: 100%; overflow: visible; margin: 0; font-family: var(--n-serif); color: var(--n-ink);
  background: var(--n-bg) var(--n-paper) repeat; background-size: 512px; -webkit-font-smoothing: antialiased; transition: background-color .4s, color .4s; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.page { max-width: var(--n-wrap); margin: 0 auto; padding: 0 20px; overflow-x: clip; }
#accChip { display: none !important; } /* свой вход в шапке вместо плавающей плашки account.js */

/* гравюры одним цветом: на светлом — умножение, на тёмном — инверсия и «экран» */
.ink { mix-blend-mode: multiply; user-select: none; pointer-events: none; }
html[data-theme="dark"] .ink { filter: invert(1) sepia(.45) saturate(.8) brightness(.9); mix-blend-mode: screen; }
.rule { flex: 1; height: 0; border-top: 3px double var(--n-rule); }

/* ---------- шапка ---------- */
.mast { padding-top: 14px; }
.mast-top { display: flex; align-items: center; gap: 18px; }
.mast-top b { font-family: var(--n-cond); font-weight: 600; letter-spacing: .32em; text-transform: uppercase; font-size: .95rem; white-space: nowrap; }
.mast-main { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 4px 0 8px; border-bottom: 3px solid var(--n-rule); }
.mast-sky { width: 100%; max-width: 330px; height: auto; align-self: end; }
.logo { font-family: var(--n-cond); font-weight: 700; font-size: clamp(2.6rem, 7.4vw, 6.4rem); line-height: .9; letter-spacing: -.01em; text-decoration: none;
  transform: skewX(-8deg); padding: 14px 6px 4px; color: var(--n-ink); text-shadow: 2px 2px 0 var(--n-bg), 4px 4px 0 var(--n-rule-soft); }
.mast-club { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.mast-hare { width: clamp(80px, 11vw, 150px); height: auto; transform: translateY(-4px); }
html[data-theme="dark"] .mast-hare { filter: brightness(1.08); }
.mast-club span { font-family: var(--n-cond); font-weight: 600; text-transform: uppercase; text-align: center; line-height: 1.05; font-size: clamp(.85rem, 1.4vw, 1.3rem); }
.mast-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--n-rule); }
.issue { font-family: var(--n-cond); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.nav-links { display: flex; align-items: center; gap: 22px; font-family: var(--n-cond); font-weight: 500; font-size: 1.2rem; }
.nav-links a { text-decoration: none; background: linear-gradient(var(--n-accent), var(--n-accent)) 0 100% / 0 2px no-repeat; transition: background-size .25s; }
.nav-links a:hover { background-size: 100% 2px; }
.nav-acts { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.theme-btn, .login-btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--n-cond); font-weight: 600; font-size: 1.05rem; cursor: pointer;
  color: var(--n-red); background: transparent; border: 2px solid var(--n-red); border-radius: 6px; padding: 6px 16px; transition: background .2s, color .2s, transform .15s; }
.theme-btn { padding: 6px 9px; color: var(--n-ink); border-color: var(--n-rule-soft); }
.theme-btn svg, .login-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-btn:hover { border-color: var(--n-ink); }
.login-btn:hover { background: var(--n-red); color: #fff7ea; }
.theme-btn:active, .login-btn:active { transform: translateY(1px); }
html[data-theme="dark"] .i-sun, html:not([data-theme="dark"]) .i-moon { display: none; }
.login-btn .av { width: 26px; height: 26px; border-radius: 50%; background: center / cover; border: 1px solid currentColor; }
.login-btn .co { color: var(--n-accent); }

/* ---------- 1. баннер ---------- */
.hero { padding: 18px 0 8px; }
.hero-frame { position: relative; overflow: hidden; border: 3px solid var(--n-rule); border-radius: 4px; box-shadow: var(--n-shadow); aspect-ratio: 3 / 1; min-height: 300px; background: #1b1510; }
.hero-frame::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(255, 236, 200, .35); pointer-events: none; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transform: scale(1.04); transition: opacity .5s; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 10, 7, .78) 0%, rgba(14, 10, 7, .45) 38%, rgba(14, 10, 7, 0) 62%); }
.hero-text { position: absolute; left: 5%; top: 12%; max-width: 46%; color: #f6ead2; }
.kicker { font-family: var(--n-cond); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; font-size: .85rem; color: #f2b77e; }
.hero-text h2 { margin: 2px 0 0; font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: clamp(2.6rem, 6.6vw, 6rem); line-height: .95; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.swash { display: block; width: min(330px, 80%); height: 6px; margin: 8px 0 12px; background: var(--n-accent); border-radius: 50%; transform: rotate(-2.5deg); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.hero-text p { margin: 0; font-family: var(--n-display); font-style: italic; font-weight: 800; font-size: clamp(1.05rem, 2.1vw, 1.75rem); line-height: 1.2; text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
/* кнопка уезжает вправо по мере прокрутки: --p от 0 до 1 задаёт v2.js */
.hero-track { position: absolute; left: 5%; right: 4%; bottom: 11%; height: 64px; pointer-events: none; }
.hero-play { --p: 0; position: absolute; left: 0; bottom: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: clamp(1.3rem, 2.4vw, 2rem); color: #1d120a;
  padding: 10px 44px; border-radius: 999px; background: linear-gradient(180deg, #f59a4f, var(--n-accent) 55%, var(--n-accent-d)); border: 2px solid #7a3a10;
  box-shadow: 0 4px 0 #7a3a10, 0 12px 26px -8px rgba(0, 0, 0, .6);
  transform: translateX(calc(var(--p) * var(--run, 0px))); transition: box-shadow .2s, filter .2s; will-change: transform; }
.hero-play span { transition: transform .25s; }
.hero-play:hover { filter: brightness(1.07); }
.hero-play:hover span { transform: translateX(6px); }
.hero-play:active { box-shadow: 0 1px 0 #7a3a10, 0 6px 16px -8px rgba(0, 0, 0, .6); translate: 0 3px; }

/* ---------- заголовок секции ---------- */
.sec-title { display: flex; align-items: center; gap: 18px; margin: 30px 0 18px; }
.sec-title span { font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; white-space: nowrap; }
.sec-title .rule { border-top: 4px solid var(--n-accent); border-bottom: 1px solid var(--n-accent); height: 3px; }

/* ---------- 2. Топ-8: колесо ---------- */
.top-stage { position: relative; height: clamp(330px, 34vw, 430px); user-select: none; touch-action: pan-y; }
.gate { position: absolute; top: -18px; height: calc(100% + 30px); width: auto; opacity: .85; }
.gate-l { left: -14px; } .gate-r { right: -14px; transform: scaleX(-1); }
.ring { position: absolute; inset: 0 70px; perspective: 1300px; }
.tc { --o: 0; position: absolute; left: 50%; top: 50%; width: clamp(170px, 16.5vw, 215px); aspect-ratio: 2 / 3; margin: 0; text-decoration: none; color: #fff3df;
  border-radius: 10px; border: 3px solid #c9a35c; outline: 1px solid #5d4422; outline-offset: -8px; overflow: hidden; background: #241b13;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .55); cursor: pointer; will-change: transform, opacity; }
.tc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tc::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 50%, rgba(18, 11, 6, .88) 86%); }
.tc::after { content: ''; position: absolute; inset: -40% -60%; z-index: 2; background: linear-gradient(105deg, transparent 42%, rgba(255, 236, 200, .38) 50%, transparent 58%); transform: translateX(-70%); pointer-events: none; }
.tc-cap { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 3; display: grid; justify-items: center; gap: 6px; padding: 0 8px; text-align: center; }
.tc-cap b { font-family: var(--n-cond); font-weight: 700; text-transform: uppercase; font-size: clamp(1.2rem, 1.9vw, 1.7rem); line-height: 1; letter-spacing: .01em; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .8); }
.tc-cap span { font-family: var(--n-cond); font-weight: 600; font-size: .85rem; color: #2a170a; background: linear-gradient(180deg, #f6a25c, var(--n-accent)); padding: 3px 14px; border-radius: 999px; border: 1px solid #7a3a10; }
.tc.front { border-color: #f0c777; }
/* короткая анимация при наведении: подъём, наклон, блик и приближение картинки */
.tc:hover img { transform: scale(1.08); }
.tc:hover::after { transition: transform .75s ease; transform: translateX(70%); }
.tc:hover { animation: tcBob .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tcBob { 40% { margin-top: -14px; } 100% { margin-top: 0; } }
.top-arrow { position: absolute; top: 50%; z-index: 60; width: 50px; height: 50px; margin-top: -25px; display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 2px solid var(--n-rule); background: var(--n-card2); color: var(--n-ink); box-shadow: var(--n-shadow); transition: transform .15s, background .2s; }
.top-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.top-arrow:hover { background: var(--n-accent); color: var(--n-accent-ink); }
.top-arrow:active { transform: scale(.94); }
.top-arrow.prev { left: 58px; } .top-arrow.next { right: 58px; }
.top-dots { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
#dots { display: flex; gap: 7px; }
#dots button { width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid var(--n-rule); background: transparent; cursor: pointer; transition: background .2s, transform .2s; }
#dots button.on { background: var(--n-accent); border-color: var(--n-accent-d); transform: scale(1.15); }
.top-dots b { font-family: var(--n-cond); font-weight: 600; font-size: 1.05rem; min-width: 3.2em; }

/* ---------- 3. все игры ---------- */
.all { margin-top: 34px; padding-top: 16px; border-top: 3px double var(--n-rule); scroll-margin-top: 12px; }
.all-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 14px; }
.all-head h2 { margin: 0; font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters button, .we { display: inline-flex; align-items: center; gap: 7px; font-family: var(--n-cond); font-weight: 500; font-size: 1rem; cursor: pointer; color: var(--n-ink);
  background: var(--n-card2); border: 2px solid var(--n-rule); border-radius: 6px; padding: 5px 12px; transition: background .2s, color .2s; }
.filters svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.filters button em { font-style: normal; min-width: .6em; }
.filters button.on { background: var(--n-ink); color: var(--n-bg); }
.filters button:hover:not(.on) { background: var(--n-card); }
.we select { font-family: var(--n-cond); font-size: 1rem; color: var(--n-ink); background: transparent; border: 0; padding: 0 2px; border-radius: 0; box-shadow: none; cursor: pointer; }
.we select option { color: #1d1813; background: #f6ecd6; }
.we-note { margin: -4px 0 12px; font-style: italic; color: var(--n-muted); }
.all-body { display: grid; grid-template-columns: 1fr 290px; gap: 26px; align-items: start; }
.glist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gc { position: relative; display: grid; grid-template-columns: 1fr 132px; grid-template-rows: 1fr auto; gap: 8px 12px; padding: 14px 14px 10px; background: var(--n-card);
  border: 1px solid var(--n-rule); outline: 1px solid var(--n-rule-soft); outline-offset: 3px; border-radius: 3px; box-shadow: var(--n-shadow); transition: transform .2s, box-shadow .2s; }
.gc:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(42, 34, 27, .12), 0 18px 30px -16px rgba(42, 34, 27, .6); }
.gc[hidden] { display: none; }
.gc h3 { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: 1.55rem; line-height: 1.05; }
.gc p { margin: 0 0 10px; font-size: .95rem; line-height: 1.3; color: var(--n-ink2); }
.gc-thumb { width: 132px; height: 99px; object-fit: cover; border: 2px solid var(--n-rule); border-radius: 2px; box-shadow: 2px 2px 0 var(--n-rule-soft); transition: transform .3s; }
.gc:hover .gc-thumb { transform: rotate(-1.5deg) scale(1.03); }
.gc-play { display: inline-block; font-family: var(--n-display); font-style: italic; font-weight: 800; font-size: 1.02rem; text-decoration: none; color: #fff4e6;
  background: linear-gradient(180deg, #b93a30, var(--n-red) 60%, var(--n-red-d)); border: 1px solid #5a130f; border-radius: 4px; padding: 4px 16px; box-shadow: 0 2px 0 #5a130f; transition: filter .2s; }
.gc-play:hover { filter: brightness(1.12); }
.gc-play::after { content: ''; position: absolute; inset: 0; } /* вся карточка кликабельна */
.gc-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 7px; border-top: 1px solid var(--n-rule-soft); font-family: var(--n-cond); font-size: .9rem; color: var(--n-ink2); }
.gc-meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.gc-meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-meta .tables { margin-left: auto; }
.gc-meta .tables.live { color: var(--n-accent-d); font-weight: 600; }
.dots-d { letter-spacing: 1px; font-size: .78rem; }
.dots-d i { font-style: normal; opacity: .3; }
.tag { font-family: var(--n-cond); font-style: normal; font-weight: 500; font-size: .78rem; letter-spacing: .02em; color: #fff6e8; background: var(--t, #6a5442); padding: 2px 9px; border-radius: 3px; transform: rotate(-2deg); }
.t-ded { --t: #9b2a22; } .t-tac { --t: #3f6b3a; } .t-bluff { --t: #2f5d8a; } .t-card { --t: #5b3f7a; } .t-adv { --t: #3d6e2c; }
.t-duel { --t: #8a6a1e; } .t-classic { --t: #2f5d8a; } .t-strat { --t: #9b2a22; } .t-econ { --t: #6b4e1f; } .t-word { --t: #7a4b2a; }
.t-luck { --t: #1f6670; } .t-talk { --t: #5e5e5e; } .t-bet { --t: #3a3a3a; }
.locked-note { grid-column: 1 / -1; font-style: italic; color: var(--n-muted); }

/* ---------- боковая колонка ---------- */
.side { position: sticky; top: 14px; display: grid; gap: 18px; border-left: 3px double var(--n-rule); padding-left: 18px; }
.side-box h3 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--n-rule); font-family: var(--n-display); font-style: italic; font-weight: 900; font-size: 1.5rem; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side-box h3 small { font-family: var(--n-cond); font-style: normal; font-weight: 500; font-size: .85rem; color: var(--n-muted); }
#tables { scroll-margin-top: 14px; }
.t-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 0; border-bottom: 1px solid var(--n-rule-soft); }
.t-item b { font-family: var(--n-display); font-style: italic; font-weight: 800; font-size: 1.15rem; }
.t-item small { justify-self: end; font-style: italic; color: var(--n-muted); font-size: .85rem; }
.t-item .t-info { display: inline-flex; align-items: center; gap: 5px; font-family: var(--n-cond); font-size: .88rem; color: var(--n-ink2); }
.t-item .t-info svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.t-item a { justify-self: end; font-family: var(--n-cond); font-size: .82rem; font-weight: 600; text-decoration: none; color: #fff4e6; background: var(--n-red); border-radius: 3px; padding: 3px 9px; transition: filter .2s; }
.t-item a:hover { filter: brightness(1.15); }
.t-item.play a { background: var(--n-ink2); color: var(--n-bg); }
.t-empty { margin: 4px 0; font-style: italic; color: var(--n-muted); line-height: 1.35; }
.t-more { display: block; margin-top: 8px; font-family: var(--n-cond); color: var(--n-muted); cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; }
.minis a { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 2px; text-decoration: none; border-bottom: 1px solid var(--n-rule-soft); transition: padding .2s, color .2s; }
.minis a:hover { padding-left: 8px; color: var(--n-accent-d); }
.minis a[hidden] { display: none; }
.minis svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.minis span { font-family: var(--n-display); font-style: italic; font-weight: 800; font-size: 1.15rem; }
.minis i { font-style: normal; font-size: 1.6rem; line-height: 1; }

/* ---------- подвал ---------- */
.foot { margin-top: 40px; text-align: center; }
.harbor { height: clamp(110px, 16vw, 210px); background: url(/img/ink-harbor.webp) center bottom / auto 100% repeat-x; border-bottom: 3px solid var(--n-rule); }
.foot p { margin: 10px 0 26px; font-family: var(--n-cond); font-size: .95rem; color: var(--n-muted); }

/* ---------- окна входа и профиля из account.js: подстраиваем под газету ---------- */
/* окна пока в старом тёмном оформлении — возвращаем им светлый текст, который style.css задаёт через body */
.modal, .acc-gate, .acc-toast, #toasts { color: var(--paper); font-family: var(--sans); }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .all-body { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; border-left: 0; padding-left: 0; border-top: 3px double var(--n-rule); padding-top: 16px; }
}
@media (max-width: 860px) {
  .glist { grid-template-columns: 1fr; }
  .mast-main { display: flex; justify-content: center; align-items: center; gap: 4px; }
  .mast-sky { display: none; }
  .mast-club span { display: none; }
  .mast-hare { width: 74px; transform: none; }
  .hero-frame { aspect-ratio: 4 / 3; }
  .hero-img { object-position: 72% 50%; }
  .hero-shade { background: linear-gradient(180deg, rgba(14, 10, 7, .1) 30%, rgba(14, 10, 7, .85) 78%); }
  .hero-text { top: auto; bottom: 26%; max-width: 90%; }
  .hero-track { bottom: 7%; height: 54px; }
  .ring { inset: 0 10px; }
  .gate { display: none; }
  .top-arrow.prev { left: 0; } .top-arrow.next { right: 0; }
}
@media (max-width: 620px) {
  .page { padding: 0 12px; }
  .logo { font-size: clamp(2.1rem, 11vw, 3rem); padding-top: 10px; }
  .mast-club { display: none; }
  .mast-top b { letter-spacing: .14em; font-size: .78rem; }
  .mast-nav { grid-template-columns: 1fr auto; }
  .issue { display: none; }
  .nav-links { font-size: 1.05rem; gap: 14px; }
  .login-btn { padding: 5px 10px; font-size: .95rem; }
  .side { grid-template-columns: 1fr; }
  .gc { grid-template-columns: 1fr 96px; }
  .gc-thumb { width: 96px; height: 72px; }
  .gc-meta .tables { margin-left: 0; }
  .top-arrow { width: 40px; height: 40px; margin-top: -20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-play, .tc, .tc img, .gc, .gc-thumb { transition: none !important; animation: none !important; }
}
