:root {
  --bg: #15110e;
  --bg-soft: #1d1814;
  --panel: rgba(42, 34, 28, .88);
  --panel-strong: #2b231d;
  --paper: #d8c4a3;
  --paper-light: #ead9bb;
  --ink: #241d18;
  --text: #f0e5d4;
  --muted: #aa9c8d;
  --line: rgba(234, 217, 187, .14);
  --red: #b94b43;
  --red-light: #dc6a5f;
  --green: #7f9d64;
  --gold: #c8a45f;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 10% 0%, #30231c 0, transparent 35%), var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-noise { position: fixed; inset: 0; pointer-events: none; opacity: .065; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 74px; padding: 12px clamp(18px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(21,17,14,.88); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 45px; height: 45px; color: var(--paper); }
.brand-mark svg { width: 100%; height: 100%; fill: currentColor; stroke: #120f0d; stroke-width: 1.5; }
.brand-mark .brand-eye { fill: #171310; stroke: none; }
.brand-mark .brand-mouth { fill: none; }
.brand strong { display: block; letter-spacing: .09em; font-size: 14px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.local-badge { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.local-badge i { width: 7px; height: 7px; border-radius: 99px; background: var(--green); box-shadow: 0 0 0 4px rgba(127,157,100,.13); }
.header-load-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--text); padding: 10px 14px; border-radius: 10px; }
.header-load-button:hover { border-color: rgba(234,217,187,.32); }

main { width: min(1420px, calc(100% - 32px)); margin: 0 auto; }
.hero { min-height: 520px; padding: clamp(58px, 9vw, 110px) clamp(0px, 2vw, 30px) 70px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); align-items: center; gap: clamp(34px, 7vw, 100px); }
.eyebrow, .modal-eyebrow { display: inline-block; color: var(--gold); letter-spacing: .19em; font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 850px; margin: 16px 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 6.1vw, 92px); line-height: .93; letter-spacing: -.045em; font-weight: 800; }
h1 em { color: var(--paper); font-weight: 500; }
.hero-copy > p { max-width: 710px; color: #c0b3a5; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.65; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.primary-button, .steam-button, .cancel-button { min-height: 48px; border-radius: 12px; border: 0; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; }
.primary-button { color: #fff8ee; background: linear-gradient(135deg, var(--red-light), var(--red)); box-shadow: 0 12px 30px rgba(185,75,67,.22); }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button svg, .steam-button svg { width: 21px; height: 21px; }
.steam-button { color: #c9beb0; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.steam-button span { padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.07); color: var(--muted); font-size: 10px; text-transform: uppercase; }
.privacy-line { margin: 18px 0 0 !important; display: flex; align-items: center; gap: 8px; color: var(--muted) !important; font-size: 12px !important; }
.privacy-line svg { width: 16px; height: 16px; }

.progress-card { padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(51,41,33,.95), rgba(32,26,22,.95)); box-shadow: var(--shadow); }
.progress-card__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.progress-kicker { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.progress-card__top strong { font-family: Georgia, serif; font-size: clamp(37px, 5vw, 61px); }
.progress-ring { --p: calc(var(--progress) * 1%); width: 90px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) var(--p), rgba(255,255,255,.08) 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 8px; border-radius: inherit; background: #2a221c; }
.progress-ring span { position: relative; font-weight: 800; font-size: 15px; }
.progress-bar { height: 8px; margin: 24px 0 14px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green), #afc78f); transition: width .4s ease; }
.progress-counts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; color: var(--muted); font-size: 11px; }
.progress-counts span { padding: 9px; text-align: center; border-radius: 9px; background: rgba(255,255,255,.03); }
.progress-counts b { display: block; color: var(--text); font-size: 18px; }
.save-state { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.save-state__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--muted); font-weight: 800; }
.save-state.is-loaded .save-state__icon { background: rgba(127,157,100,.16); color: #b4cf9f; }
.save-state strong, .save-state small { display: block; }
.save-state strong { font-size: 13px; }
.save-state small { color: var(--muted); margin-top: 3px; font-size: 11px; word-break: break-all; }
.text-button { border: 0; background: transparent; color: #c88d87; padding: 12px 0 0; font-size: 11px; text-decoration: underline; }

.edition-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 70px; }
.edition-stat { padding: 18px 20px; border-radius: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.edition-stat__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.edition-stat strong { font-size: 14px; }
.edition-stat span { color: var(--muted); font-size: 11px; }
.edition-stat .mini-bar { height: 5px; margin-top: 13px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.edition-stat .mini-bar i { display: block; height: 100%; background: var(--gold); }

.catalog-section { padding-bottom: 90px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.catalog-heading h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 62px); }
.catalog-heading p { color: var(--muted); font-size: 13px; }
.filters { position: sticky; top: 74px; z-index: 15; display: grid; grid-template-columns: minmax(230px, 1fr) auto repeat(3, minmax(145px, auto)); gap: 10px; padding: 12px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(29,24,20,.94); backdrop-filter: blur(16px); box-shadow: 0 14px 40px rgba(0,0,0,.22); }
.search-box { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 0 11px; border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid transparent; }
.search-box:focus-within { border-color: rgba(200,164,95,.45); }
.search-box svg { width: 18px; color: var(--muted); }
.search-box input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #74695f; }
kbd { color: #766c63; border: 1px solid var(--line); padding: 3px 5px; border-radius: 5px; font-size: 9px; white-space: nowrap; }
.segmented { display: flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.045); }
.segment { border: 0; border-radius: 8px; background: transparent; color: var(--muted); padding: 0 12px; }
.segment.is-active { background: var(--paper); color: var(--ink); font-weight: 750; }
select { min-width: 0; height: 44px; padding: 0 31px 0 11px; border-radius: 10px; border: 1px solid var(--line); background: #28211c; color: var(--text); outline: 0; }
.active-save-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid rgba(127,157,100,.28); border-radius: 13px; background: rgba(127,157,100,.08); }
.active-save-notice > span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(127,157,100,.18); color: #c4d9b4; }
.active-save-notice div { flex: 1; }
.active-save-notice strong, .active-save-notice small { display: block; }
.active-save-notice small { color: var(--muted); margin-top: 2px; }
.active-save-notice button { border: 0; background: transparent; color: #cedcc3; text-decoration: underline; }

.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 13px; }
.achievement-card { position: relative; min-height: 188px; padding: 17px; display: grid; grid-template-columns: 76px 1fr; gap: 15px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(48,39,32,.86), rgba(34,28,23,.86)); color: inherit; text-align: left; overflow: hidden; transition: transform .18s ease, border-color .18s ease, opacity .18s ease; }
.achievement-card:hover { transform: translateY(-3px); border-color: rgba(234,217,187,.3); }
.achievement-card.is-locked { opacity: .63; }
.achievement-card.is-locked .achievement-icon img { filter: grayscale(1) brightness(.55); }
.achievement-card.is-locked:hover { opacity: .86; }
.achievement-number { position: absolute; top: 10px; right: 12px; color: #75695f; font: 700 11px/1 ui-monospace, monospace; }
.achievement-icon { width: 76px; height: 76px; border-radius: 12px; display: grid; place-items: center; background: #171310; border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.achievement-icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.achievement-copy { min-width: 0; }
.achievement-copy h3 { padding-right: 30px; margin: 3px 0 3px; font-family: Georgia, serif; font-size: 18px; line-height: 1.1; }
.achievement-copy .english-name { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.card-tag { max-width: 100%; padding: 4px 6px; border-radius: 5px; background: rgba(255,255,255,.045); color: #b4a799; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tag.edition { color: #d1b77e; background: rgba(200,164,95,.09); }
.card-condition { grid-column: 1 / -1; min-height: 36px; margin: 0; color: #baaea0; font-size: 12px; line-height: 1.48; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status-pill { position: absolute; left: 17px; bottom: 14px; display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #b7d2a5; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--green); }
.is-locked .status-pill { color: #9d9084; }
.is-locked .status-pill::before { background: #71655c; }
.card-open-hint { position: absolute; right: 14px; bottom: 12px; color: #796d63; font-size: 10px; }
.empty-state { padding: 70px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--text); font-size: 22px; }
.empty-state span { margin-top: 7px; }
.empty-state button { margin-top: 18px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.04); color: var(--text); padding: 10px 14px; }

.modal[hidden], .toast[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(7,5,4,.78); backdrop-filter: blur(8px); }
.modal__dialog { position: relative; width: min(720px, 100%); max-height: min(860px, calc(100vh - 36px)); overflow: auto; padding: clamp(24px,5vw,42px); border: 1px solid rgba(234,217,187,.18); border-radius: 20px; background: linear-gradient(145deg, #332921, #211b17); box-shadow: 0 35px 100px rgba(0,0,0,.55); }
.modal__close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--text); font-size: 23px; line-height: 1; }
.modal__dialog h2 { margin: 8px 45px 11px 0; font-family: Georgia, serif; font-size: clamp(31px,5vw,48px); }
.modal-lead { color: #c1b4a5; line-height: 1.6; }
.privacy-card { display: flex; gap: 13px; margin: 22px 0; padding: 15px; border-radius: 13px; background: rgba(127,157,100,.1); border: 1px solid rgba(127,157,100,.2); }
.privacy-card > span { font-size: 20px; }
.privacy-card strong { font-size: 13px; }
.privacy-card p { margin: 4px 0 0; color: #aebba5; font-size: 11px; line-height: 1.5; }
.guide-steps { display: grid; gap: 10px; padding: 0; list-style: none; counter-reset: step; }
.guide-steps li { display: flex; gap: 13px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.035); }
.guide-steps li > span { flex: 0 0 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--paper); color: var(--ink); font-weight: 800; }
.guide-steps strong { font-size: 13px; }
.guide-steps p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
code { display: block; max-width: 100%; margin-top: 8px; padding: 8px 9px; border-radius: 7px; background: #171310; color: #dcc9aa; font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
details { margin-top: 12px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; color: #c9bcad; }
.file-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.cancel-button { color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); }

.achievement-dialog { width: min(800px,100%); }
.detail-head { display: grid; grid-template-columns: 126px 1fr; gap: 24px; align-items: center; }
.detail-icon { width: 126px; height: 126px; border-radius: 17px; overflow: hidden; background: #171310; border: 1px solid var(--line); }
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.detail-id { color: var(--gold); font: 750 11px ui-monospace, monospace; }
.detail-head h2 { margin: 7px 38px 3px 0; }
.detail-en { color: var(--muted); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.detail-tag { padding: 6px 8px; border-radius: 7px; background: rgba(255,255,255,.05); color: #c4b7a8; font-size: 10px; }
.detail-tag.status-unlocked { color: #c1d9b0; background: rgba(127,157,100,.13); }
.detail-tag.status-locked { color: #b7aaa0; }
.detail-section { margin-top: 28px; padding-top: 23px; border-top: 1px solid var(--line); }
.detail-section h3 { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: 10px; }
.rich-condition { font-size: 17px; line-height: 1.8; color: #e0d3c2; }
.rich-condition a { color: #78aee1; text-decoration: underline; text-decoration-color: rgba(120,174,225,.35); text-underline-offset: 3px; }
.rich-condition img { width: auto; height: 30px; max-width: 46px; object-fit: contain; vertical-align: middle; margin: 0 3px; image-rendering: auto; }
.wiki-button { margin-top: 24px; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 800; text-decoration: none; }

.toast { position: fixed; z-index: 150; right: 20px; bottom: 20px; width: min(390px, calc(100% - 40px)); padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #302720; box-shadow: var(--shadow); }
.toast strong, .toast span { display: block; }
.toast span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.toast.is-error { border-color: rgba(220,106,95,.4); }
.site-footer { width: min(1420px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 40px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #786c62; font-size: 10px; }
.site-footer p { margin: 0; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .search-box { grid-column: span 2; }
  .segmented { order: 5; }
}
@media (max-width: 850px) {
  .local-badge { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }
  .progress-card { max-width: 560px; }
  .edition-stats { grid-template-columns: 1fr 1fr; }
  .filters { position: static; grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .segmented { order: 0; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 590px) {
  .site-header { min-height: 64px; padding-inline: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 12px; }
  .header-load-button { font-size: 11px; padding: 9px 10px; }
  main { width: min(100% - 22px, 1420px); }
  h1 { font-size: 43px; }
  .hero { padding: 52px 0 48px; }
  .hero-buttons { display: grid; }
  .primary-button, .steam-button { width: 100%; }
  .progress-card { padding: 20px; }
  .progress-ring { width: 76px; }
  .edition-stats { grid-template-columns: 1fr; margin-bottom: 52px; }
  .catalog-heading { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .segmented { min-height: 44px; }
  .segment { flex: 1; }
  .active-save-notice { align-items: flex-start; flex-wrap: wrap; }
  .active-save-notice button { width: 100%; text-align: left; padding-left: 42px; }
  .achievement-grid { grid-template-columns: 1fr; }
  .modal { padding: 8px; }
  .modal__dialog { max-height: calc(100vh - 16px); border-radius: 15px; }
  .modal-actions { flex-direction: column-reverse; }
  .detail-head { grid-template-columns: 82px 1fr; gap: 15px; }
  .detail-icon { width: 82px; height: 82px; }
  .detail-head h2 { font-size: 28px; }
  .file-examples { grid-template-columns: 1fr; }
}

.hero { position: relative; }
.hero.is-dragging::after { content: "Отпустите файл persistentgamedata здесь"; position: absolute; inset: 22px 0; z-index: 8; display: grid; place-items: center; border: 2px dashed rgba(200,164,95,.65); border-radius: 22px; background: rgba(21,17,14,.92); color: var(--paper); font-weight: 800; letter-spacing: .03em; }
