/* ===== Haystack Hare v2 — общие токены газеты (главная и страницы игр) ===== */
:root {
  --n-bg: #efe2c4; --n-card: #f6ecd6; --n-card2: #fbf4e4;
  --n-ink: #1d1813; --n-ink2: #3a3027; --n-muted: #6b5d4c; --n-rule: #2a221b; --n-rule-soft: rgba(42, 34, 27, .28);
  --n-accent: #e8742a; --n-accent-d: #c45a17; --n-accent-ink: #fff8ec;
  --n-red: #9b2a22; --n-red-d: #7a1d17;
  --n-shadow: 0 2px 0 rgba(42, 34, 27, .12), 0 10px 26px -14px rgba(42, 34, 27, .45);
  --n-paper: url(/img/paper-light.webp);
  --n-serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --n-display: 'Playfair Display', 'PT Serif', Georgia, serif;
  --n-cond: 'Oswald', 'Arial Narrow', sans-serif;
  --n-wrap: 1280px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --n-bg: #1e1a16; --n-card: #29231d; --n-card2: #2f2821;
  --n-ink: #f0e5cf; --n-ink2: #d9cbb0; --n-muted: #ad9d84; --n-rule: #d8c7a6; --n-rule-soft: rgba(216, 199, 166, .22);
  --n-accent: #ef7f34; --n-accent-d: #d0631d; --n-accent-ink: #1b130b;
  --n-red: #b9372d; --n-red-d: #962a22;
  --n-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 14px 30px -16px rgba(0, 0, 0, .8);
  --n-paper: url(/img/paper-dark.webp);
  color-scheme: dark;
}
:root { --n-veil: rgba(255, 251, 240, .5); --n-sheet: linear-gradient(var(--n-veil), var(--n-veil)), var(--n-paper) 0 0 / 512px repeat, var(--n-card);
  --n-gold: linear-gradient(180deg, #f7c95a, #e9a13a 55%, #d98a2a); --n-gold-ink: #24170a; --n-dark-btn: linear-gradient(180deg, #4a3526, #2f2117); }
html[data-theme="dark"] { --n-veil: rgba(34, 29, 24, .55); }

/* общий лист бумаги */
.n-sheet { background: var(--n-sheet); color: var(--n-ink); border: 1.5px solid var(--n-rule); border-radius: 14px; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 24px 60px -18px rgba(0, 0, 0, .75); }

/* ===== окна аккаунта (вход, регистрация, свой профиль) ===== */
html[data-theme] #accModal .modal-box { background: var(--n-sheet); color: var(--n-ink); border: 1.5px solid var(--n-rule); border-radius: 14px;
  font-family: var(--n-serif); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
html[data-theme] #accModal .modal-box h2 { font: italic 900 2rem/1.1 var(--n-display); color: var(--n-ink); }
html[data-theme] #accModal .modal-x { color: var(--n-ink2); }
html[data-theme] #accModal .acc-tabs button { border: 1.5px solid var(--n-rule-soft); background: transparent; color: var(--n-ink2); font-family: var(--n-serif); border-radius: 8px; }
html[data-theme] #accModal .acc-tabs button.on { background: var(--n-gold); border-color: var(--n-rule); color: var(--n-gold-ink); }
html[data-theme] #accModal label { color: var(--n-ink); font-weight: 700; display: grid; gap: 6px; }
html[data-theme] #accModal input, html[data-theme] #accModal textarea { background: var(--n-card2); color: var(--n-ink); border: 1.5px solid var(--n-rule); border-radius: 8px; font-family: var(--n-serif); }
html[data-theme] #accModal input:focus, html[data-theme] #accModal textarea:focus { border-color: var(--n-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--n-accent) 25%, transparent); }
html[data-theme] #accModal .muted-note { color: var(--n-muted); }
html[data-theme] #accModal .err { color: var(--n-red); }
html[data-theme] #accModal .btn { font-family: var(--n-serif); }
html[data-theme] #accModal .btn-gold, html[data-theme] .hh-me .btn:not(.btn-ghost) { background: var(--n-gold); color: var(--n-gold-ink); border: 1.5px solid #8a5a17; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
html[data-theme] #accModal .btn-ghost { color: var(--n-ink); border: 1.5px solid var(--n-rule-soft); }

/* ===== карточка профиля (чужой — #hhModal, всплывашка, свой — #accModal .hh-me) ===== */
html[data-theme] .hh-card { position: relative; display: flex; flex-direction: column; width: 24rem; padding-bottom: 1rem; border-radius: 14px; overflow: hidden;
  background: var(--n-sheet); color: var(--n-ink); font-family: var(--n-serif); border: 1.5px solid var(--n-rule); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); }
html[data-theme] .hh-card.full { width: 26rem; }
html[data-theme] .hh-card .hh-top, html[data-theme] .hh-card .hh-body { display: contents; }
html[data-theme] .hh-card .hh-banner { --bh: 8rem; height: var(--bh); flex: 0 0 auto; border-bottom: 1.5px solid var(--n-rule); position: relative; overflow: hidden; background-color: #2a2018; }
html[data-theme] .hh-pop .hh-banner { --bh: 5.5rem; }
html[data-theme] .hh-card .hh-av { position: absolute; left: 50%; top: calc(8rem - 3.6rem); transform: translateX(-50%); width: 7.2rem; height: 7.2rem; padding: 5px; z-index: 6;
  background: var(--n-card); border-radius: 50%; box-shadow: 0 0 0 2px var(--n-rule), 0 6px 18px rgba(0, 0, 0, .35); }
html[data-theme] .hh-pop .hh-card .hh-av { top: calc(5.5rem - 2.8rem); width: 5.6rem; height: 5.6rem; }
html[data-theme] .hh-card .hh-pen { background: var(--n-ink); color: var(--n-card); border-color: var(--n-card); }
html[data-theme] .hh-card .hh-nrow { order: 2; margin: 3.9rem 1rem 0; justify-content: center; text-align: center; }
html[data-theme] .hh-pop .hh-card .hh-nrow { margin-top: 3.1rem; }
html[data-theme] .hh-card .hh-nrow .hh-name { flex: 0 1 auto; }
html[data-theme] .hh-card .hh-name { font: italic 900 2rem/1.1 var(--n-display); color: var(--n-ink); }
html[data-theme] .hh-pop .hh-card .hh-name { font-size: 1.5rem; }
html[data-theme] .hh-card .hh-roles { order: 3; justify-content: center; margin: .3rem 1rem 0; }
html[data-theme] .hh-card .hh-sub { order: 4; margin: .25rem 1rem 0; text-align: center; color: var(--n-ink2); font-size: .9rem; }
html[data-theme] .hh-card .hh-badges { order: 5; position: static; align-self: center; margin: .6rem 0 0; padding: .25rem .55rem; gap: .35rem; border-radius: 8px;
  background: #3b2a1d; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
html[data-theme] .hh-card .hh-sec { order: 6; margin: .9rem 1rem 0; padding: 0; border: 0; }
html[data-theme] .hh-card .hh-open { order: 7; margin: .9rem 1rem 0; color: var(--n-ink); border: 1.5px solid var(--n-rule); font-family: var(--n-serif); }
html[data-theme] .hh-card .hh-sec h4 { margin: 0 0 .45rem; padding-bottom: .2rem; border-bottom: 1.5px solid var(--n-rule-soft); font: 600 1rem/1.2 var(--n-cond); letter-spacing: .06em; color: var(--n-head); }
html[data-theme] .hh-card .hh-sec:has(.hh-nums) h4, html[data-theme] .hh-card.full .hh-sec:has(.hh-wear) { display: none; }
html[data-theme] .hh-card .hh-bio { color: var(--n-ink); font-size: .95rem; }
html[data-theme] .hh-card .hh-bio[style] { color: var(--n-muted) !important; font-style: italic; }
html[data-theme] .hh-card .hh-nums { gap: 0; border: 1.5px solid var(--n-rule); border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--n-card2) 70%, transparent); }
html[data-theme] .hh-card .hh-nums div { background: none; border-radius: 0; padding: .45rem .2rem .35rem; }
html[data-theme] .hh-card .hh-nums div + div { border-left: 1.5px solid var(--n-rule); }
html[data-theme] .hh-card .hh-nums b { font: 700 1.45rem/1.15 var(--n-serif); color: var(--n-ink); }
html[data-theme] .hh-card .hh-nums small { display: block; font-size: .8rem; color: var(--n-ink2); }
html[data-theme] .hh-card .hh-nums small::first-letter { text-transform: uppercase; }
html[data-theme] .hh-card .hh-games { gap: .45rem; }
html[data-theme] .hh-card .hh-game { font-size: .92rem; }
html[data-theme] .hh-card .hh-game span:first-child { font-weight: 700; }
html[data-theme] .hh-card .hh-game span:last-of-type { color: var(--n-ink2); }
html[data-theme] .hh-card .hh-game i { height: 4px; background: var(--n-rule-soft); border-radius: 2px; }
html[data-theme] .hh-card .hh-game i b { background: linear-gradient(90deg, var(--n-accent-d), var(--n-accent)); }
html[data-theme] .hh-card .hh-wear span { background: none; border: 1px solid var(--n-rule-soft); color: var(--n-ink2); }
html[data-theme] .hh-card .hh-loading { padding: 3rem 1rem; text-align: center; color: var(--n-muted); }
html[data-theme] #hhModal .modal-box { max-width: min(28rem, calc(100vw - 1.5rem)); min-width: 0; }
@media (max-width: 560px) { html[data-theme] .modal:has(.hh-card) { padding: .75rem; } html[data-theme] .hh-card.full { width: calc(100vw - 1.5rem); } }
html[data-theme] #hhModal .modal-x, html[data-theme] #accModal:has(.hh-me) .modal-x { z-index: 9; top: .55rem; right: .55rem; width: 2rem; height: 2rem; padding: 0; line-height: 1;
  border-radius: 6px; background: rgba(20, 15, 10, .75); border: 1px solid rgba(255, 255, 255, .35); color: #fff; font-size: 1.4rem; }

/* свой профиль: карточка, редактор «О себе» и кнопки внизу — один лист */
html[data-theme] #accModal:has(.hh-me) .modal-box { width: min(27rem, calc(100vw - 1.5rem)); min-width: 0; padding: 0; overflow: hidden auto; }
html[data-theme] .hh-me textarea { display: block; width: 100%; box-sizing: border-box; }
html[data-theme] #accModal:has(.v2-acts) .acc-head, html[data-theme] #accModal:has(.v2-acts) .acc-go { display: none; }
html[data-theme] .hh-me { gap: .7rem; padding-bottom: 1rem; justify-items: stretch; }
html[data-theme] .hh-me .hh-card { width: 100% !important; border: 0; border-radius: 0; box-shadow: none; background: none; padding-bottom: .2rem; }
html[data-theme] .hh-me > label, html[data-theme] .hh-me > .row, html[data-theme] .hh-me > .muted-note, html[data-theme] .hh-me > .v2-acts { margin: 0 1rem; width: auto !important; min-width: 0; }
html[data-theme] .hh-me > label { font-size: .9rem; }
html[data-theme] .hh-me .row small, html[data-theme] .hh-me .muted-note { color: var(--n-muted); }
html[data-theme] .hh-avbox { background: var(--n-sheet); color: var(--n-ink); border: 1.5px solid var(--n-rule); }
html[data-theme] .hh-avpick h4, html[data-theme] .hh-avx { color: var(--n-ink2); }
.v2-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; padding-top: .9rem; border-top: 1.5px solid var(--n-rule-soft); }
.v2-acts > * { display: grid; justify-items: center; gap: .2rem; padding: .55rem .4rem; border-radius: 10px; border: 1.5px solid var(--n-rule); cursor: pointer; text-decoration: none;
  font: 700 1rem/1.1 var(--n-serif); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); transition: transform .15s, filter .15s; }
.v2-acts > *:hover { transform: translateY(-1px); filter: brightness(1.06); }
.v2-acts svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v2-acts .a-cab { background: var(--n-card2); color: var(--n-ink); border-color: var(--n-rule); }
.v2-acts .a-adm { background: linear-gradient(180deg, var(--n-red), var(--n-red-d)); color: #fff4e6; border-color: #4a120e; }
.v2-acts .a-out { background: var(--n-dark-btn); color: #f6ead2; border-color: #1c130c; }
@media (max-width: 560px) { html[data-theme] .hh-card.full { width: 100%; } html[data-theme] .hh-card .hh-nums { grid-template-columns: repeat(4, 1fr); } }
:root { --n-head: var(--n-red-d); } html[data-theme="dark"] { --n-head: #e27a66; }

/* кнопки своего профиля — над «Обо мне» */
html[data-theme] .hh-card .v2-acts { order: 5; margin: .8rem 1rem 0; padding-top: 0; border-top: 0; }
/* карточка в цвет баннера (если оформление выбрано): градиент оформления, светлый текст, акцент --pa */
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)), html[data-theme] #accModal .modal-box.v2-tinted {
  --n-ink: #f6eedf; --n-ink2: #e2d6c2; --n-muted: #bfb3a2; --n-rule: color-mix(in srgb, var(--pa) 70%, #fff); --n-rule-soft: rgba(255, 255, 255, .2); --n-head: var(--pa);
  --n-card: var(--pb1); --n-card2: rgba(255, 255, 255, .06);
  background: linear-gradient(180deg, color-mix(in srgb, var(--pb1) 92%, #fff) 0%, var(--pb1) 35%, var(--pb2) 100%); color: var(--n-ink); border-color: color-mix(in srgb, var(--pa) 60%, #000); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-av { background: var(--pb1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pa) 70%, #000), 0 6px 18px rgba(0, 0, 0, .45); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-sub { color: color-mix(in srgb, var(--pa) 45%, #eee); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-badges { background: rgba(0, 0, 0, .35); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-nums { background: rgba(0, 0, 0, .18); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-game i b { background: linear-gradient(90deg, color-mix(in srgb, var(--pa) 70%, #000), var(--pa)); }
html[data-theme] .hh-card:has(.hh-banner:not(.pb-none)) .hh-pen { background: var(--pa); color: #120c08; }
html[data-theme] .v2-tinted .hh-me .hh-card { background: none; }
html[data-theme] #accModal .modal-box.v2-tinted textarea { background: rgba(0, 0, 0, .25); color: var(--n-ink); border-color: rgba(255, 255, 255, .3); }
html[data-theme] #accModal .modal-box.v2-tinted .v2-acts .a-cab { background: rgba(255, 255, 255, .1); color: var(--n-ink); border-color: rgba(255, 255, 255, .35); }
