/* ===== Rodina Glory: каркас ===== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  --paper: #f3e9d2; --ink: #2b2116; --accent: #8a1c1c; --border: #3a2a18; --sea: #cdbf9f;
  --font: Georgia, serif; --body: Georgia, serif;
  --panel-bg: color-mix(in srgb, var(--paper) 94%, transparent);
  --line: color-mix(in srgb, var(--ink) 18%, transparent);
  --muted: color-mix(in srgb, var(--ink) 62%, transparent);
  font-family: var(--body); color: var(--ink); background: #111;
}
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
[hidden] { display: none !important; }

button.primary { background: var(--accent); color: #fff; border: 0; padding: 9px 16px; border-radius: 4px; font-weight: 600; letter-spacing: .02em; }
button.primary:hover:not(:disabled) { filter: brightness(1.12); }
button.ghost { background: transparent; color: inherit; border: 1px solid currentColor; padding: 9px 18px; border-radius: 4px; }
button.icon { background: transparent; border: 0; color: inherit; font-size: 20px; padding: 4px 8px; }

/* ===== Главное меню ===== */
#menu { background: #0d0b09; color: #efe6d2; overflow-y: auto; }
.menu-bg { position: fixed; inset: -4%; background: url('../img/menu.jpg') center/cover no-repeat; opacity: .42; filter: saturate(.8); animation: kenburns 38s ease-in-out infinite alternate; }
.menu-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 18%, rgba(255,200,120,.08) 0, transparent 35%), radial-gradient(ellipse at 50% 20%, transparent 0, rgba(10,8,6,.88) 75%); }
@keyframes kenburns { from { transform: scale(1) translate(0,0); } to { transform: scale(1.12) translate(-2%, 1.5%); } }
.dust { position: fixed; inset: 0; pointer-events: none; }
.menu-head { position: relative; text-align: center; padding: 46px 20px 10px; animation: rise .9s ease both; }
.menu-head h1 { font-family: Bahnschrift, 'Arial Narrow', sans-serif; font-weight: 300; font-size: clamp(42px, 7vw, 86px); letter-spacing: .32em; margin: 0 0 8px; text-indent: .32em;
  background: linear-gradient(100deg, #c9a35a 0%, #fff3d6 30%, #c9a35a 45%, #8f6d32 60%, #fff3d6 80%, #c9a35a 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s linear infinite; filter: drop-shadow(0 4px 18px rgba(201,163,90,.25)); }
@keyframes shimmer { to { background-position: -250% 0; } }
.menu-head p { max-width: 640px; margin: 0 auto 18px; color: #cdbfa3; font-size: 17px; line-height: 1.5; }
.menu-actions { display: flex; gap: 12px; justify-content: center; }
.menu-actions .ghost { color: #f3e3bd; border-color: rgba(243,227,189,.5); backdrop-filter: blur(3px); background: rgba(0,0,0,.25); transition: background .2s, transform .2s; }
.menu-actions .ghost:hover { background: rgba(201,163,90,.25); transform: translateY(-2px); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* лента времени */
.timeline { position: relative; height: 62px; max-width: 1100px; margin: 8px auto 0; }
.tl-line { position: absolute; left: 0; right: 0; top: 26px; height: 2px; background: linear-gradient(90deg, transparent, rgba(201,163,90,.7) 8%, rgba(201,163,90,.7) 92%, transparent); }
.tl-tick { position: absolute; top: 34px; transform: translateX(-50%); font-size: 11px; color: rgba(205,191,163,.45); letter-spacing: .1em; }
.tl-tick::before { content: ''; position: absolute; left: 50%; top: -11px; width: 1px; height: 7px; background: rgba(205,191,163,.4); }
.tl-dot { position: absolute; top: 0; transform: translateX(-50%); background: none; border: 0; color: #e9dcc0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: rise .6s ease both; }
.tl-dot b { font-size: 12px; font-weight: 600; opacity: .8; order: -1; transition: transform .2s, opacity .2s; }
.tl-dot i { width: 13px; height: 13px; border-radius: 50%; background: var(--acc); border: 2px solid #f3e3bd; box-shadow: 0 0 0 0 var(--acc); transition: transform .2s; animation: ping 2.8s ease-out infinite; }
.tl-dot:hover i { transform: scale(1.5); }
.tl-dot:hover b { transform: translateY(-3px); opacity: 1; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }

.era-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding: 14px 40px 30px; max-width: 1500px; margin: 0 auto; }
.era-card { position: relative; height: 250px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid rgba(255,255,255,.12);
  background: #222; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s; box-shadow: 0 6px 24px rgba(0,0,0,.5);
  animation: cardIn .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d); }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
.era-card .ec-img { position: absolute; inset: 0; background: center/cover no-repeat; transition: transform 1.2s cubic-bezier(.2,.8,.2,1), filter .5s; filter: saturate(.85); }
.era-card:hover, .era-card.hl { transform: translateY(-6px); box-shadow: 0 18px 46px rgba(0,0,0,.75), 0 0 0 2px var(--acc); border-color: transparent; }
.era-card:hover .ec-img, .era-card.hl .ec-img { transform: scale(1.09); filter: saturate(1.1); }
.era-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 25%, rgba(0,0,0,.9)); transition: background .4s; }
.era-card:hover::after { background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.93) 70%); }
.era-card .ec-badge { position: absolute; top: 12px; left: 12px; z-index: 2; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; background: var(--acc); color: #fff; padding: 3px 9px; border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.era-card .ec-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; z-index: 1; color: #fff; }
.era-card .ec-year { font-size: 46px; line-height: 1; font-weight: 700; opacity: .95; text-shadow: 0 3px 14px rgba(0,0,0,.6); }
.era-card .ec-title { font-size: 20px; margin-top: 4px; }
.era-card .ec-sub { font-size: 13px; opacity: .75; margin-top: 2px; }
.era-card .ec-desc { font-family: Georgia, serif; font-size: 13px; line-height: 1.4; opacity: 0; max-height: 0; overflow: hidden; transition: opacity .4s, max-height .5s, margin .4s; color: #eee; }
.era-card:hover .ec-desc { opacity: .92; max-height: 90px; margin-top: 7px; }
.menu-foot { position: relative; text-align: center; color: #7d725f; font-size: 12px; padding: 0 0 24px; }

/* ===== Игра ===== */
#game { background: var(--sea); }
#mapWrap { position: absolute; inset: 0; }
#map { display: block; touch-action: none; }
#topbar { position: absolute; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: var(--panel-bg); border-bottom: 2px solid var(--border); font-family: var(--font); z-index: 5; backdrop-filter: blur(4px); }
.tb-era { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.tb-player span { white-space: nowrap; }
.tb-era span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tb-era b { font-size: 17px; }
.tb-player { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; padding-left: 12px; border-left: 1px solid var(--line); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); flex: none; }
.tb-stats { display: flex; gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: center; padding: 2px 9px; border: 1px solid var(--line); border-radius: 4px; line-height: 1.1; min-width: 58px; }
.chip small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chip b { font-size: 15px; }
.chip.div b { color: var(--accent); }
.tb-spacer { flex: 1; }
.tb-turn { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tb-turn select { font: inherit; padding: 4px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }

.panel { position: absolute; top: 52px; right: 0; bottom: 0; width: 420px; background: var(--panel-bg); border-left: 2px solid var(--border);
  display: flex; flex-direction: column; z-index: 4; backdrop-filter: blur(4px); }
.panel-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.panel-body h2 { font-family: var(--font); margin: 2px 0 2px; font-size: 26px; }
.panel-body h3 { font-family: var(--font); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.panel-body p { line-height: 1.5; margin: 6px 0; }
.sub { color: var(--muted); font-style: italic; }
.hint { color: var(--muted); font-size: 13px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.pick-info { flex: 1; font-weight: 600; }
.cover { height: 190px; background: #333 center/cover no-repeat; flex: none; border-bottom: 2px solid var(--border); position: relative; }
.featured { display: flex; flex-direction: column; gap: 6px; }
.feat { display: flex; gap: 10px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; background: transparent; text-align: left; color: inherit; }
.feat:hover, .feat.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.feat b { display: block; font-family: var(--font); }
.feat small { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }
.feat .sw { margin-top: 3px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; background: transparent; border: 0; padding: 11px 4px; color: var(--muted); font-family: var(--font); font-size: 14px; border-bottom: 3px solid transparent; position: relative; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tabs em { font-style: normal; background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 6px; margin-left: 3px; }
.tab { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tab.on { display: flex; }
#chron { overflow-y: auto; flex: 1; padding: 0 0 20px; }
#orders, #chatText, #treatyCustom { width: 100%; font: inherit; font-size: 14px; background: color-mix(in srgb, var(--paper) 70%, white 30%); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 8px; resize: vertical; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { background: transparent; border: 1px solid var(--line); color: inherit; padding: 7px 12px; border-radius: 4px; }
.quick button:hover { border-color: var(--accent); }
.act-msg { margin-top: 10px; color: var(--accent); font-weight: 600; }

/* Хроника: базовая газетная полоса */
.issue { margin: 14px 14px 4px; padding: 0 0 12px; border-bottom: 3px double var(--line); }
.masthead { text-align: center; font-family: var(--font); border-bottom: 2px solid var(--ink); padding: 6px 0 4px; margin-bottom: 8px; }
.masthead .mh-name { font-size: 26px; letter-spacing: .06em; text-transform: uppercase; }
.masthead .mh-date { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 2px; }
.issue-img { height: 120px; background: center/cover no-repeat; margin: 6px 0 10px; filter: var(--img-filter, none); border: 1px solid var(--line); }
.hl { margin: 10px 0; }
.hl h4 { font-family: var(--font); margin: 0 0 3px; font-size: 18px; line-height: 1.2; }
.hl p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.hl:first-of-type h4 { font-size: 23px; }
.report { background: color-mix(in srgb, var(--accent) 9%, transparent); border-left: 3px solid var(--accent); padding: 8px 10px; margin: 10px 0; font-size: 14px; line-height: 1.45; }
.report b { display: block; font-family: var(--font); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.evlist { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.evlist li { margin: 2px 0; }
.diverge { font-size: 12.5px; font-style: italic; color: var(--muted); margin-top: 8px; }

/* Дипломатия */
.diplo-list { overflow-y: auto; flex: 1; padding: 6px 0; }
.dl-group { font-family: var(--font); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 16px 4px; }
.dl-item { display: flex; align-items: center; gap: 9px; padding: 7px 16px; cursor: pointer; border: 0; background: transparent; width: 100%; color: inherit; text-align: left; }
.dl-item:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.dl-item .nm { flex: 1; }
.dl-item .tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--line); }
.dl-item .tag.war { background: #b3261e; color: #fff; }
.dl-item .tag.ally { background: #2e7d32; color: #fff; }
.dl-item .new { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.relbar { width: 54px; height: 6px; background: var(--line); border-radius: 3px; position: relative; overflow: hidden; }
.relbar i { position: absolute; top: 0; bottom: 0; left: 50%; }
.diplo-room { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.room-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--font); }
.room-head b { flex: 1; font-size: 17px; }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 8px 11px; border-radius: 6px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.msg.them { align-self: flex-start; background: color-mix(in srgb, var(--ink) 7%, transparent); border-left: 3px solid var(--border); }
.msg small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.chat-input { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; }
.treaty { border-top: 1px solid var(--line); padding: 8px 12px 12px; font-size: 14px; max-height: 45%; overflow-y: auto; }
.treaty summary { cursor: pointer; font-weight: 700; font-family: var(--font); }
.clauses { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin: 8px 0; font-size: 13px; }
.cede { display: grid; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.cede select { width: 100%; background: transparent; color: inherit; border: 1px solid var(--line); font: inherit; font-size: 13px; }
.treaty .primary { margin-top: 8px; width: 100%; }

/* Карточка страны */
.card { position: absolute; left: 14px; bottom: 14px; width: 330px; background: var(--panel-bg); border: 2px solid var(--border); border-radius: 6px; padding: 12px 14px; z-index: 6; box-shadow: 0 8px 30px rgba(0,0,0,.35); backdrop-filter: blur(4px); }
.card h3 { font-family: var(--font); margin: 0 0 2px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.card .prov { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0; }
.card .row { font-size: 13px; margin: 3px 0; }
.card .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card .btns button { background: transparent; border: 1px solid var(--line); color: inherit; padding: 6px 10px; border-radius: 4px; font-size: 13px; }
.card .btns button.war { border-color: #b3261e; color: #b3261e; }
.card .btns button:hover { border-color: var(--accent); }
.card .x { position: absolute; top: 6px; right: 8px; }

#tooltip { position: fixed; pointer-events: none; z-index: 20; background: var(--panel-bg); border: 1px solid var(--border); padding: 5px 9px; font-size: 13px; border-radius: 3px; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
#tooltip b { display: block; font-family: var(--font); }

#busy { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.busy-box { background: var(--paper); color: var(--ink); border: 2px solid var(--border); padding: 24px 34px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; font-family: var(--font); border-radius: 6px; }
.busy-box small { color: var(--muted); font-family: var(--body); }
.spinner { width: 46px; height: 46px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#modal { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--paper); color: var(--ink); border: 2px solid var(--border); padding: 20px 24px; min-width: 340px; max-width: 520px; border-radius: 6px; }
.modal-box h3 { font-family: var(--font); margin-top: 0; }
.modal-box .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.modal-box input { font: inherit; padding: 6px; width: 100%; }
.state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.meter { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* ===== Темы эпох ===== */
/* 1933 — ар-деко, газета */
body[data-theme=deco] .masthead .mh-name { font-family: 'Old English Text MT', 'Engravers MT', Georgia, serif; font-size: 30px; text-transform: none; letter-spacing: .02em; }
body[data-theme=deco] #topbar { background: linear-gradient(180deg, #f6edd7, #e9dcbc); border-bottom: 3px double #3a2a18; }
body[data-theme=deco] .panel { background-image: repeating-linear-gradient(0deg, rgba(60,40,10,.025) 0 1px, transparent 1px 3px); }
body[data-theme=deco] .hl p { text-align: justify; columns: 1; }
body[data-theme=deco] { --img-filter: sepia(.8) contrast(1.05); }

/* 1939 — штабная сводка, машинопись */
body[data-theme=war] .masthead { border: 2px solid var(--ink); padding: 6px; }
body[data-theme=war] .masthead .mh-name::before { content: '★ '; color: var(--accent); }
body[data-theme=war] .masthead .mh-name::after { content: ' ★'; color: var(--accent); }
body[data-theme=war] .hl h4 { font-family: 'Courier New', monospace; text-transform: uppercase; font-size: 15px; }
body[data-theme=war] .hl:first-of-type h4 { font-size: 18px; }
body[data-theme=war] .issue { background: repeating-linear-gradient(0deg, transparent 0 23px, rgba(0,0,0,.04) 23px 24px); }
body[data-theme=war] { --img-filter: grayscale(.9) contrast(1.15); }

/* 1945 — послевоенный */
body[data-theme=ruins] { --img-filter: grayscale(1) contrast(1.1); }
body[data-theme=ruins] .masthead .mh-name { letter-spacing: .2em; }

/* 1962 — атомный век, телетайп */
body[data-theme=atomic] .masthead { background: var(--accent); color: #fff; border: 0; padding: 8px; }
body[data-theme=atomic] .masthead .mh-date { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.4); }
body[data-theme=atomic] .hl h4 { text-transform: uppercase; }
body[data-theme=atomic] .report { font-family: 'Courier New', monospace; background: #fffbe8; border: 1px dashed #1a2a33; }
body[data-theme=atomic] { --img-filter: saturate(.7) contrast(1.1); }

/* 1973 — семидесятые */
body[data-theme=seventies] .masthead { border: 0; background: linear-gradient(90deg, #d26a1b, #e8a33d, #b5541c); color: #fff8e6; border-radius: 22px; }
body[data-theme=seventies] .masthead .mh-date { color: #fff3d6; border-color: rgba(255,255,255,.4); }
body[data-theme=seventies] .tabs button.on { border-bottom-width: 5px; }
body[data-theme=seventies] { --img-filter: sepia(.35) saturate(1.3) hue-rotate(-8deg); }

/* 1985 — восьмидесятые, неон/ЭЛТ */
body[data-theme=eighties] .masthead { border: 0; color: #ff3d7f; text-shadow: 0 0 8px #ff3d7f, 0 0 18px rgba(255,61,127,.5); }
body[data-theme=eighties] .masthead .mh-date { color: #8ad7ff; border-color: rgba(138,215,255,.3); }
body[data-theme=eighties] .hl h4 { color: #8ad7ff; text-shadow: 0 0 6px rgba(138,215,255,.5); }
body[data-theme=eighties] .panel, body[data-theme=eighties] #topbar { background: rgba(14,18,40,.93); border-color: #ff3d7f; }
body[data-theme=eighties] .panel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); }
body[data-theme=eighties] { --img-filter: saturate(1.4) contrast(1.1); }

/* 1991 — девяностые, классический интерфейс */
body[data-theme=nineties] #topbar { background: #d4d0c8; border-bottom: 2px solid #808080; box-shadow: inset 0 1px #fff; }
body[data-theme=nineties] .panel { background: #d4d0c8; border-left: 2px solid #808080; }
body[data-theme=nineties] button.primary { background: #d4d0c8; color: #000; border: 2px outset #fff; border-radius: 0; }
body[data-theme=nineties] button.primary:active { border-style: inset; }
body[data-theme=nineties] .masthead { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; border: 0; text-align: left; padding: 4px 8px; }
body[data-theme=nineties] .masthead .mh-name { font-size: 16px; font-weight: 700; }
body[data-theme=nineties] .masthead .mh-date { color: #dfe8ff; border: 0; }
body[data-theme=nineties] .issue { background: #fff; border: 2px inset #fff; padding: 0 8px 8px; }
body[data-theme=nineties] .tabs button.on { background: #fff; }

/* 2008 — нулевые, глянец */
body[data-theme=modern] .masthead { background: linear-gradient(180deg, #4a9be8, #1f6fc6); color: #fff; border: 0; border-radius: 6px; box-shadow: inset 0 1px rgba(255,255,255,.5); }
body[data-theme=modern] .masthead .mh-date { color: #e0eeff; border-color: rgba(255,255,255,.35); }
body[data-theme=modern] button.primary { background: linear-gradient(180deg, #5ab0ff, #1f6fc6); border-radius: 14px; box-shadow: inset 0 1px rgba(255,255,255,.6); }
body[data-theme=modern] .issue { border: 1px solid #d5e3f0; border-radius: 8px; padding: 8px 10px; background: #fff; }

/* 2026 — наши дни */
body[data-theme=today] .masthead { text-align: left; border: 0; border-left: 4px solid var(--accent); padding-left: 10px; }
body[data-theme=today] .masthead .mh-name { font-size: 20px; font-weight: 700; text-transform: none; letter-spacing: 0; }
body[data-theme=today] .masthead .mh-date { border: 0; }
body[data-theme=today] .issue { border: 1px solid #30363d; border-radius: 10px; padding: 10px 12px; background: #0d1117; }
body[data-theme=today] .hl h4 { font-weight: 600; }
body[data-theme=today] button.primary { border-radius: 8px; }

body.dark #orders, body.dark #chatText, body.dark #treatyCustom, body.dark .tb-turn select { background: rgba(255,255,255,.06); color: var(--ink); }
body.dark .msg.them { background: rgba(255,255,255,.06); }


/* ===== Живость: анимации и эффекты ===== */
.map-fx { position: absolute; left: 0; top: 0; pointer-events: none; }
.map-veil { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 40% 50%, transparent 55%, rgba(0,0,0,.28) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.12 0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.35'/></svg>");
  mix-blend-mode: multiply; opacity: .55; }
body.dark .map-veil { mix-blend-mode: screen; opacity: .25; background: radial-gradient(ellipse at 40% 50%, transparent 50%, rgba(0,0,0,.6) 100%); }
#game.active #topbar { animation: dropIn .6s cubic-bezier(.2,.8,.2,1) both; }
#game.active .panel { animation: slideIn .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes dropIn { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes slideIn { from { transform: translateX(105%); } to { transform: none; } }
button.primary { transition: transform .15s, box-shadow .2s, filter .2s; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent); }
button.primary:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
#btnTurn { position: relative; overflow: hidden; padding: 10px 20px; font-size: 15px; }
#btnTurn::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); animation: sheen 3.6s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* показатели в шапке */
.chip { position: relative; transition: background .3s; }
.chip small i { font-style: normal; margin-right: 3px; opacity: .8; }
.chip .delta { position: absolute; right: -6px; top: -9px; font-style: normal; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 8px; background: #777; color: #fff; animation: pop 2.8s ease forwards; }
.chip .delta.up { background: #2e7d32; } .chip .delta.down { background: #b3261e; }
@keyframes pop { 0% { transform: scale(0) translateY(6px); opacity: 0; } 12% { transform: scale(1.25); opacity: 1; } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.flip { animation: flipIn .7s cubic-bezier(.2,.8,.2,1); display: inline-block; }
@keyframes flipIn { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* вкладки */
.tabs button { transition: color .2s, border-color .25s; }
.tabs button:hover { color: var(--ink); }
.tab.on { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* свежий выпуск хроники */
.issue { position: relative; }
.issue.fresh { animation: paperIn .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: top center; }
@keyframes paperIn { 0% { opacity: 0; transform: translateY(-30px) rotate(-1.5deg) scale(.97); } 100% { opacity: 1; transform: none; } }
.issue.fresh .hl { animation: fadeUp .6s ease both; animation-delay: var(--d); }
.stamp { position: absolute; right: 8px; top: 54px; z-index: 2; font-family: var(--font); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent);
  border: 3px double var(--accent); padding: 3px 9px; transform: rotate(8deg); opacity: .85; animation: stampIn .5s .5s cubic-bezier(.3,1.6,.5,1) both; background: color-mix(in srgb, var(--paper) 70%, transparent); }
@keyframes stampIn { from { transform: rotate(8deg) scale(2.4); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: .85; } }
.issue-img { transition: transform 6s ease; border-radius: 2px; }
.issue:hover .issue-img { transform: scale(1.02); }
.hl h4 { transition: color .2s; }
.dl-item { transition: background .15s, padding .2s; }
.dl-item:hover { padding-left: 20px; }
.feat { transition: transform .2s, border-color .2s, background .2s; }
.feat:hover { transform: translateX(-3px); }
.msg { animation: fadeUp .35s ease both; }
.card:not([hidden]) { animation: cardPop .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cardPop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
#tooltip { transition: opacity .1s; }

/* бегущая строка */
.ticker { position: absolute; left: 0; right: 420px; bottom: 0; height: 32px; z-index: 3; display: flex; align-items: stretch; overflow: hidden;
  background: color-mix(in srgb, var(--paper) 92%, transparent); border-top: 2px solid var(--border); font-family: var(--font); font-size: 14px; backdrop-filter: blur(4px); }
.tk-label { flex: none; background: var(--accent); color: #fff; display: flex; align-items: center; padding: 0 14px 0 12px; text-transform: uppercase; letter-spacing: .1em; font-size: 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); position: relative; z-index: 1; }
.tk-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 8px; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.tk-track { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.tk-run { position: absolute; white-space: nowrap; top: 0; bottom: 0; display: flex; align-items: center; gap: 16px; padding-left: 16px; animation: tick 60s linear infinite; }
.tk-run i { font-style: normal; color: var(--accent); font-size: 10px; }
.ticker:hover .tk-run { animation-play-state: paused; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.card { bottom: 46px; }

/* заставка эпохи */
#intro { position: absolute; inset: 0; z-index: 45; background: #000; cursor: pointer; overflow: hidden; }
#intro .intro-img { position: absolute; inset: -5%; background: center/cover no-repeat; opacity: 0; transform: scale(1.15); filter: var(--img-filter, none); }
#intro.in .intro-img { animation: introImg 3.6s ease forwards; }
@keyframes introImg { 0% { opacity: 0; transform: scale(1.15); } 25% { opacity: .75; } 100% { opacity: .62; transform: scale(1); } }
#intro::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 20%, rgba(0,0,0,.75) 100%), linear-gradient(180deg, transparent 40%, rgba(0,0,0,.7)); }
.intro-txt { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; color: #fff; z-index: 1; font-family: var(--font); }
.intro-year { font-size: clamp(80px, 14vw, 180px); font-weight: 800; line-height: .9; letter-spacing: .04em; text-shadow: 0 8px 40px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; }
.intro-title { font-size: clamp(24px, 3.4vw, 44px); margin-top: 10px; opacity: 0; animation: rise .8s .7s ease forwards; text-shadow: 0 3px 16px rgba(0,0,0,.8); }
.intro-sub { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; opacity: 0; margin-top: 8px; animation: rise .8s 1s ease forwards; color: color-mix(in srgb, var(--accent) 40%, white); }
.intro-hint { font-family: var(--body); font-size: 12px; opacity: 0; margin-top: 26px; animation: rise .8s 2s ease forwards; color: rgba(255,255,255,.55); }
.intro-title, .intro-sub { position: relative; }
.intro-sub::before, .intro-sub::after { content: '—'; margin: 0 .8em; opacity: .6; }
#intro.out { animation: introOut .65s ease forwards; }
@keyframes introOut { to { opacity: 0; transform: scale(1.04); } }

/* ожидание хода */
#busy { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.busy-bg { position: absolute; inset: 0; background: center/cover no-repeat; opacity: .22; filter: blur(6px) var(--img-filter, none); animation: kenburns 20s ease-in-out infinite alternate; }
.busy-box { position: relative; min-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: cardPop .4s cubic-bezier(.2,.8,.2,1) both; }
.busy-box b { font-size: 20px; }
.busy-line { min-height: 20px; font-family: var(--body); font-size: 14px; font-style: italic; color: var(--muted); }
.busy-line.show { animation: fadeUp .4s ease both; }
.busy-box small { font-variant-numeric: tabular-nums; }
.spinner { width: 58px; height: 58px; border-width: 3px; position: relative; }
.spinner::after { content: ''; position: absolute; inset: 6px; border: 3px solid transparent; border-bottom-color: var(--accent); border-radius: 50%; animation: spin 1.6s linear infinite reverse; opacity: .6; }

/* уведомления */
#toasts { position: absolute; top: 64px; left: calc(50% - 210px); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--paper); color: var(--ink); border: 2px solid var(--border); border-left: 6px solid var(--accent); padding: 9px 16px 9px 12px; border-radius: 6px;
  font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: toastIn .45s cubic-bezier(.2,1.4,.4,1) both; font-family: var(--font); }
.toast i { font-style: normal; color: var(--accent); font-size: 18px; }
.toast.out { animation: toastOut .45s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }
#modal { animation: fadeIn .25s ease both; }
.modal-box { animation: cardPop .35s cubic-bezier(.2,.8,.2,1) both; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.cover { overflow: hidden; }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--paper) 85%, transparent)); }
#setup .cover { animation: coverZoom 14s ease-in-out infinite alternate; background-size: 110%; }
@keyframes coverZoom { from { background-size: 110%; background-position: 40% 50%; } to { background-size: 125%; background-position: 60% 40%; } }

/* 1936 — агитплакат */
body[data-theme=agitprop] #topbar { background: #efe6d0; border-bottom: 4px solid #1a1512; box-shadow: 0 4px 0 #c41e1e; }
body[data-theme=agitprop] .panel { border-left: 4px solid #1a1512; box-shadow: inset 6px 0 0 #c41e1e; }
body[data-theme=agitprop] .masthead { background: #c41e1e; color: #efe6d0; border: 0; transform: skewY(-2deg); margin: 6px 0 14px; padding: 8px 6px 6px; box-shadow: 6px 6px 0 #1a1512; }
body[data-theme=agitprop] .masthead .mh-name { font-size: 28px; letter-spacing: .12em; }
body[data-theme=agitprop] .masthead .mh-date { color: #f6e5c8; border-color: rgba(255,255,255,.35); }
body[data-theme=agitprop] .hl h4 { text-transform: uppercase; letter-spacing: .02em; }
body[data-theme=agitprop] .hl:first-of-type h4 { font-size: 24px; color: #c41e1e; }
body[data-theme=agitprop] .report { background: #1a1512; color: #efe6d0; border-left-color: #c41e1e; }
body[data-theme=agitprop] .report b { color: #ff6a5a; }
body[data-theme=agitprop] button.primary { border-radius: 0; box-shadow: 4px 4px 0 #1a1512; text-transform: uppercase; letter-spacing: .06em; }
body[data-theme=agitprop] button.primary:hover:not(:disabled) { box-shadow: 6px 6px 0 #1a1512; }
body[data-theme=agitprop] .tabs button.on { background: #1a1512; color: #efe6d0; border-bottom-color: #c41e1e; }
body[data-theme=agitprop] .tk-label { background: #1a1512; }
body[data-theme=agitprop] { --img-filter: sepia(.25) contrast(1.1); }

/* штрихи для других эпох */
body[data-theme=deco] .masthead { position: relative; }
body[data-theme=deco] .masthead::before, body[data-theme=deco] .masthead::after { content: '◆'; position: absolute; top: 10px; color: var(--accent); font-size: 14px; }
body[data-theme=deco] .masthead::before { left: 8px; } body[data-theme=deco] .masthead::after { right: 8px; }
body[data-theme=war] .tk-label { background: #1d1d17; }
body[data-theme=war] .stamp { content: ''; }
body[data-theme=eighties] .ticker { background: rgba(14,18,40,.93); color: #8ad7ff; border-top-color: #ff3d7f; text-shadow: 0 0 6px rgba(138,215,255,.6); }
body[data-theme=eighties] #btnTurn { box-shadow: 0 0 14px #ff3d7f; }
body[data-theme=nineties] .ticker { background: #d4d0c8; border-top: 2px solid #fff; font-family: Tahoma, sans-serif; }
body[data-theme=nineties] .tk-label { background: #000080; clip-path: none; }
body[data-theme=today] .ticker { background: rgba(13,17,23,.92); border-top: 1px solid #30363d; }
body[data-theme=today] .tk-label { background: #da3633; }
body[data-theme=modern] .tk-label { background: linear-gradient(180deg, #ff6a5a, #c4302b); }
body.dark .toast { background: #161b22; }
.tl-dot { top: 7px; } .tl-dot.lo { top: 25px; } .tl-dot.lo b { order: 1; }
.tl-line { top: 32px; } .tl-tick { top: 28px; height: 9px; width: 1px; background: rgba(205,191,163,.35); } .tl-tick::before { display: none; }
.timeline { height: 70px; }

#btnTurn { white-space: nowrap; }
#topbar { gap: 10px; }
.tb-era { min-width: 0; max-width: 240px; }
.tb-era span, .tb-era b { overflow: hidden; text-overflow: ellipsis; }
.tb-player { min-width: 0; }
.tb-player span { overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.chip { min-width: 0; padding: 2px 7px; }
.chip small { font-size: 9.5px; white-space: nowrap; }
.tb-turn { gap: 8px; flex: none; }
.tb-turn label { white-space: nowrap; }
@media (max-width: 1250px) { .chip small i + * { display: none; } .tb-stats .chip small { font-size: 0; } .tb-stats .chip small i { font-size: 13px; } }

/* ===== Rodina Glory: реальное время ===== */
.brand-kicker { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: #c9a35a; margin-bottom: 8px; }
.menu-head h1 span { font-weight: 700; }
.menu-modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.menu-modes button { color: #f3e3bd; border: 1px solid rgba(243,227,189,.45); background: rgba(0,0,0,.3); backdrop-filter: blur(3px); padding: 10px 18px; border-radius: 6px; transition: background .2s, transform .2s, border-color .2s; }
.menu-modes button:hover { background: rgba(201,163,90,.22); transform: translateY(-2px); }
.menu-modes .mode-btn { font-size: 16px; font-weight: 600; }
.menu-modes .mode-btn small { font-weight: 400; opacity: .7; font-size: 12px; margin-left: 4px; }
.menu-modes .mode-btn.on { background: linear-gradient(180deg, #c9a35a, #8f6d32); color: #1a130a; border-color: #e7cf98; box-shadow: 0 6px 22px rgba(201,163,90,.35); }
.menu-modes .sm { font-size: 13px; padding: 7px 12px; opacity: .85; }
.ai-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #777; margin-right: 6px; vertical-align: middle; }
.ai-dot.ok { background: #5fd17a; box-shadow: 0 0 8px #5fd17a; }
.menu-view { display: none; position: relative; }
.menu-view.on { display: block; animation: rise .5s ease both; }
.online-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(300px, 1fr); gap: 20px; max-width: 1200px; margin: 18px auto 30px; padding: 0 30px; }
.online-card { background: rgba(20,16,11,.78); border: 1px solid rgba(201,163,90,.35); border-radius: 10px; padding: 18px 20px; backdrop-filter: blur(6px); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.online-card h3 { font-family: Bahnschrift, 'Arial Narrow', sans-serif; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; color: #c9a35a; margin: 16px 0 8px; border-bottom: 1px solid rgba(201,163,90,.25); padding-bottom: 5px; }
.online-card h3:first-child { margin-top: 0; }
.online-card .hint { color: #a99c84; }
.online-card button.primary { background: linear-gradient(180deg, #b8323a, #7d1820); }
.online-card button.big { width: 100%; font-size: 18px; padding: 14px; letter-spacing: .04em; }
.online-card .ghost { color: #f3e3bd; border-color: rgba(243,227,189,.45); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 8px 0; color: inherit; opacity: .95; }
.fld select, .fld input, .code-in, #modal input, #modal select { font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 5px; border: 1px solid rgba(128,110,80,.5); background: rgba(255,255,255,.92); color: #1d160e; width: 100%; }
.chk { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; font-size: 14px; }
.code-in { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; }
.online-card .row { display: flex; gap: 8px; }
.room-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.room-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid rgba(201,163,90,.22); border-radius: 8px; background: rgba(0,0,0,.25); transition: border-color .2s, background .2s; }
.room-item:hover { border-color: #c9a35a; background: rgba(201,163,90,.08); }
.ri-img { width: 92px; height: 56px; border-radius: 5px; background: center/cover; flex: none; }
.ri-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ri-txt small { color: #a99c84; }
.ri-n { font-weight: 700; font-size: 18px; color: #e7cf98; }
.toasts-menu { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }

/* верхняя панель */
.tb-speed { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.tb-speed button { background: transparent; border: 0; border-right: 1px solid var(--line); color: var(--ink); padding: 6px 9px; font-size: 12px; letter-spacing: -2px; min-width: 34px; }
.tb-speed button:last-child { border-right: 0; }
.tb-speed button.on { background: var(--accent); color: #fff; }
body.paused .tb-speed button[data-s="0"] { animation: pulsePause 1.4s ease-in-out infinite; }
@keyframes pulsePause { 50% { filter: brightness(1.5); } }
body.paused #tbDate::after { content: ' · пауза'; font-size: 12px; color: var(--accent); font-weight: 400; }
.chip .delta { font-style: normal; font-size: 10px; color: var(--muted); }
.chip .delta.up { color: #2e7d32; } .chip .delta.down { color: #c62828; }
.chip small i { font-style: normal; margin-right: 3px; }
.tb-stats .chip { min-width: 64px; }
.tb-players { display: flex; gap: 6px; flex-wrap: wrap; }
.tb-players .pl { display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 12px; }
.tb-players .pl.off { opacity: .45; } .tb-players .pl.code { font-weight: 700; letter-spacing: .15em; }
@media (max-width: 1500px) { .tb-stats .chip small { font-size: 0; } .tb-stats .chip small i { font-size: 12px; } }
@media (max-width: 1100px) { .tb-stats .chip:nth-child(n+5) { display: none; } .tb-player span { display: none; } }

/* лента и газета */
.feed { flex: none; max-height: 38%; overflow-y: auto; border-bottom: 2px solid var(--line); padding: 0 12px 8px; }
.feed-h { position: sticky; top: 0; background: var(--panel-bg); font-family: var(--font); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; padding: 8px 0 5px; color: var(--muted); z-index: 1; }
.fd { padding: 5px 0 5px 10px; border-left: 3px solid var(--line); margin: 3px 0; cursor: pointer; font-size: 13px; line-height: 1.35; animation: fdIn .4s ease both; }
.fd:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.fd time { display: block; font-size: 10.5px; color: var(--muted); }
.fd p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.fd.imp3 b { font-size: 14px; }
.fd.k-war, .fd.k-capital, .fd.k-pocket { border-left-color: #c62828; }
.fd.k-peace, .fd.k-pact { border-left-color: #2e7d32; }
.fd.k-alliance { border-left-color: #1565c0; }
.fd.k-annex, .fd.k-revolution, .fd.k-fallen { border-left-color: #6a1b9a; }
.fd.k-industry { border-left-color: #ef6c00; } .fd.k-crisis { border-left-color: #795548; }
@keyframes fdIn { from { opacity: 0; transform: translateX(10px); } }
.hl-img { height: 130px; background: center/cover no-repeat; margin: 4px 0 8px; border: 1px solid var(--line); filter: var(--img-filter, none); }

/* карточка срочной новости */
.news-flash { position: absolute; left: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); z-index: 7; background: var(--paper); color: var(--ink); border: 2px solid var(--border); border-radius: 6px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45); cursor: pointer; opacity: 0; transform: translateY(20px); }
.news-flash.in { animation: nfIn .6s cubic-bezier(.2,.8,.2,1) forwards; }
.news-flash.out { animation: nfOut .5s ease forwards; }
@keyframes nfIn { to { opacity: 1; transform: none; } } @keyframes nfOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }
.nf-img { height: 150px; background: center/cover no-repeat; filter: var(--img-filter, none); }
.nf-txt { padding: 10px 14px 12px; }
.nf-txt small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.nf-txt b { display: block; font-family: var(--font); font-size: 20px; line-height: 1.15; margin: 3px 0; }
.nf-txt p { margin: 0; font-size: 13.5px; line-height: 1.4; }

/* решение правительства */
.decision { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(8,6,4,.55); backdrop-filter: blur(2px); }
.dec-box { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 30px); overflow-y: auto; background: var(--paper); color: var(--ink); border: 2px solid var(--border); border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: decIn .5s cubic-bezier(.2,.8,.2,1); font-family: var(--body); }
@keyframes decIn { from { opacity: 0; transform: scale(.94) translateY(20px); } }
.dec-img { height: 240px; background: center/cover no-repeat; border-bottom: 2px solid var(--border); filter: var(--img-filter, none); }
.dec-body { padding: 16px 22px 18px; }
.dec-body > small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.dec-body h3 { font-family: var(--font); font-size: 28px; margin: 4px 0 8px; line-height: 1.1; }
.dec-body p { font-size: 16px; line-height: 1.5; margin: 0 0 14px; }
.dec-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dec-opts button { text-align: left; padding: 11px 14px; font-size: 15px; }
.dec-opts .ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* держава */
.econ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.econ-grid div { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; display: flex; flex-direction: column; }
.econ-grid small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.econ-grid b { font-size: 20px; font-family: var(--font); } .econ-grid em { font-size: 11px; color: var(--muted); font-style: normal; }
.policies { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pol { text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: inherit; display: flex; flex-direction: column; gap: 2px; transition: border-color .2s, background .2s; }
.pol:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pol b { font-size: 14px; } .pol small { color: var(--accent); font-size: 11.5px; } .pol span { font-size: 11px; color: var(--muted); line-height: 1.3; }
.res-list { display: flex; flex-wrap: wrap; gap: 6px; }
.res { border: 1px solid var(--line); border-radius: 12px; padding: 3px 9px; font-size: 13px; }
.res b { margin-left: 3px; } .res.none { opacity: .4; }
.war-t { color: #c62828; }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.lb { padding-left: 22px; margin: 0; }
.lb li { display: flex; align-items: center; gap: 7px; padding: 4px 0; cursor: pointer; border-bottom: 1px dashed var(--line); }
.lb li span { flex: 1; } .lb li em { font-size: 11px; color: var(--accent); font-style: normal; } .lb li small { color: var(--muted); width: 46px; text-align: right; }
.lb li.me { font-weight: 700; }
.war-row { font-size: 13.5px; margin: 3px 0; } .war-row b { color: #c62828; }

/* дипломатия */
.room-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.room-acts button { background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; color: inherit; font-size: 13px; }
.room-acts button:hover { border-color: var(--accent); }
.room-acts button.war { color: #c62828; border-color: color-mix(in srgb, #c62828 50%, transparent); }

/* карточка области */
.prov-res { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; font-size: 12.5px; }
.prov-res span { border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; } .prov-res .none { opacity: .5; }
.card .build { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 8px 0; }
.card .build button { background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; color: inherit; font-size: 13px; text-align: left; display: flex; flex-direction: column; }
.card .build button:hover:not(:disabled) { border-color: var(--accent); }
.card .build small { color: var(--accent); font-size: 11px; }

/* лобби */
.lobby-box { border: 2px solid var(--accent); border-radius: 8px; padding: 6px 12px 10px; margin: 10px 0; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.lobby-box h3 { margin-top: 6px; }
.lobby-box .tag { font-style: normal; font-size: 10px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 3px; vertical-align: middle; letter-spacing: .05em; }
.room-code { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.room-code span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.room-code b { font-size: 26px; letter-spacing: .25em; font-family: var(--font); }
.players { list-style: none; padding: 0; margin: 6px 0 0; }
.players li { display: flex; align-items: center; gap: 7px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.players li span { margin-left: auto; color: var(--muted); font-size: 13px; }
.players em { font-style: normal; font-size: 11px; color: var(--accent); }
.tut { padding-left: 18px; line-height: 1.5; } .tut li { margin: 6px 0; }
button.sm { padding: 5px 10px; font-size: 13px; }
.panel-toggle { position: absolute; left: -38px; top: 8px; background: var(--panel-bg) !important; border: 2px solid var(--border) !important; border-right: 0 !important; border-radius: 6px 0 0 6px; }
#play.collapsed { transform: translateX(100%); } #play { transition: transform .35s ease; }

@media (max-width: 760px) {
  .online-grid { grid-template-columns: 1fr; padding: 0 12px; }
  .policies, .econ-grid { grid-template-columns: 1fr; }
  .news-flash { bottom: auto; top: 60px; }
  .menu-head { padding-top: 24px; }
}
