/* =====================================================
   WORLD PREDICTION GAME — Stylesheet 2026
   Dark glassmorphism + neon accents + responsive
   ===================================================== */

:root {
    --bg-0:      #070a13;
    --bg-1:      #0d1322;
    --bg-2:      #131a2e;
    --glass:     rgba(20, 28, 48, 0.55);
    --glass-bd:  rgba(120, 145, 200, 0.18);
    --text:      #e8eef9;
    --text-dim:  #93a1bd;
    --accent:    #3aa0ff;
    --accent-2:  #6c5cff;
    --danger:    #ff4d6d;
    --warn:      #ffb14d;
    --ok:        #4dffa6;
    --shadow:    0 8px 32px rgba(0, 0, 0, 0.35);
    --radius:    14px;
    --radius-sm: 8px;
    --mono:      'JetBrains Mono', ui-monospace, monospace;
    --sans:      'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(108, 92, 255, 0.18), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(58, 160, 255, 0.15), transparent 60%),
        var(--bg-0);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-bd);
    box-shadow: var(--shadow);
}

/* ============ HEADER ============ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar__brand { display: flex; gap: 14px; align-items: center; }
.topbar__logo  { font-size: 32px; filter: drop-shadow(0 0 12px rgba(58, 160, 255, 0.5)); }
.topbar__title { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.3px; }
.topbar__sub   { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.topbar__nav   { display: flex; gap: 8px; align-items: center; }
.topbar__user  { color: var(--text-dim); font-size: 13px; padding: 6px 10px;
                 background: rgba(58, 160, 255, 0.1); border-radius: var(--radius-sm); }

/* ============ BUTTONS ============ */
.btn {
    cursor: pointer;
    border: 1px solid var(--glass-bd);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s ease;
}
.btn:hover:not(:disabled) {
    background: rgba(58, 160, 255, 0.14);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost  { background: transparent; }
.btn--danger { background: linear-gradient(135deg, #ff4d6d, #c73650); border-color: transparent; color: #fff; }
.btn--danger:hover:not(:disabled) { box-shadow: 0 4px 18px rgba(255, 77, 109, 0.45); }
.btn--ok     { background: linear-gradient(135deg, var(--ok), #2bc77f); color: #061a0e; border-color: transparent; }
.btn--sm     { padding: 4px 10px; font-size: 12px; }

/* ============ AI STATUS ============ */
.ai-status { padding: 10px 24px; border-radius: 0; border-left:none; border-right:none;
             font-size: 13px; color: var(--text-dim); font-family: var(--mono); }
.ai-status__row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ai-status__pulse {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(77, 255, 166, 0.7);
    animation: pulse 2s infinite;
}
.ai-status__pulse.off { background: var(--danger); animation: none; box-shadow: 0 0 8px var(--danger); }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(77, 255, 166, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(77, 255, 166, 0); }
    100% { box-shadow: 0 0 0 0 rgba(77, 255, 166, 0); }
}

/* ============ LAYOUT ============ */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
    padding: 18px;
    max-width: 1700px;
    margin: 0 auto;
}
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

.panel { border-radius: var(--radius); padding: 16px; margin-bottom: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline;
               margin-bottom: 12px; padding-bottom: 10px;
               border-bottom: 1px solid var(--glass-bd); }
.panel__head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.panel__body  { font-size: 14px; }
.hint { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

/* ============ MAP — Military Tactical Display ============ */
.map-wrap { position: relative; width: 100%; aspect-ratio: 7/4; overflow: hidden;
            border-radius: var(--radius-sm);
            background: #070d08;
            border: 1px solid rgba(120, 180, 100, 0.2); }
#world-map { width: 100%; height: 100%; display: block; cursor: crosshair; }
.map-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(10, 18, 12, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(120, 255, 120, 0.3);
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: #d4e8b8;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    max-width: 260px;
    line-height: 1.5;
}
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
               background: rgba(120, 180, 100, 0.05); border-radius: 3px;
               font-family: 'JetBrains Mono', monospace; border: 1px solid rgba(120,180,100,0.1); }
.legend-dot { width: 8px; height: 8px; border-radius: 1px; }

/* ============ FORMS ============ */
.select, input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
}
.select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(58, 160, 255, 0.18);
}
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.battle-config { display: flex; flex-direction: column; gap: 12px; }

/* ============ CONTINENT PANEL ============ */
.continent-head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.continent-head__name { font-size: 22px; font-weight: 800; margin: 0; }
.continent-head__code {
    font-family: var(--mono); font-size: 11px; padding: 3px 8px;
    background: rgba(255,255,255,0.06); border-radius: 4px;
}

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.metric {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius-sm);
    padding: 10px;
}
.metric__label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.metric__value { font-size: 18px; font-weight: 700; font-family: var(--mono); }
.metric__bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.metric__bar > div { height: 100%; border-radius: 2px; transition: width 0.5s; }

.metric--satisfaction .metric__bar > div { background: var(--ok); }
.metric--tension      .metric__bar > div { background: var(--danger); }
.metric--technology   .metric__bar > div { background: var(--accent); }
.metric--military     .metric__bar > div { background: var(--warn); }

.muted { color: var(--text-dim); font-style: italic; }

/* ============ NEWS LIST ============ */
.news-list { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.news-list li {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent);
    font-size: 13px;
}
.news-list__title { font-weight: 600; line-height: 1.3; }
.news-list__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 10px;
                   color: var(--text-dim); font-family: var(--mono); align-items: center; }
.tag { padding: 2px 6px; border-radius: 3px; font-size: 10px; background: rgba(255,255,255,0.08); }
.tag--newsapi      { background: rgba(58, 160, 255, 0.18); color: #7cb7ff; }
.tag--wikipedia    { background: rgba(200, 200, 200, 0.15); color: #c5c5c5; }
.tag--ai_generated { background: rgba(108, 92, 255, 0.22); color: #a596ff; }

/* ============ MODAL ============ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.modal__content {
    position: relative;
    z-index: 1;
    width: 92%; max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: var(--radius);
    padding: 22px;
}
.modal__content--xl { max-width: 1180px; }
.modal__close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: none; color: var(--text-dim);
    font-size: 24px; cursor: pointer; line-height: 1;
}
.modal__close:hover { color: var(--text); }
.modal__head { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--glass-bd);
               display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal__head h2 { margin: 0; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px;
               border-top: 1px solid var(--glass-bd); }
.modal__body { font-size: 13px; }

.battle-controls {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* ============ BATTLE ============ */
#battle-canvas {
    width: 100%; height: auto; display: block;
    background: radial-gradient(ellipse at 50% 50%, #0a1a3a 0%, #050a18 70%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-bd);
}
.battle-hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius-sm);
}
.battle-hud__side { font-size: 13px; }
.battle-hud__side--right { text-align: right; }
.battle-hud__center {
    font-family: var(--mono); font-size: 14px;
    color: var(--warn);
    text-align: center;
    padding: 4px 10px;
    background: rgba(255, 177, 77, 0.1);
    border-radius: 4px;
}
.battle-narrative {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

/* Battle log — HTML outside canvas */
.battle-log {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(10, 20, 8, 0.85);
    border: 1px solid rgba(120, 180, 100, 0.15);
    border-radius: var(--radius-sm);
    max-height: 100px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.battle-log__entry {
    padding: 2px 0;
    color: #d4e8b8;
    line-height: 1.4;
}
.battle-log__entry:first-child {
    color: #a3c585;
}

/* HP bars for battle */
.hp-bar {
    position: relative;
    width: 100%;
    height: 18px;
    background: rgba(0,0,0,0.6);
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
}
.hp-bar__fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 2px;
}
.hp-bar__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* Battle results */
.battle-results {
    margin-top: 12px;
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 700px) {
    .results-grid { grid-template-columns: 1fr; }
}
.results-card {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-bd);
}
.results-card--winner {
    background: rgba(77, 255, 166, 0.06);
    border-color: rgba(77, 255, 166, 0.25);
}
.results-card--loser {
    background: rgba(255, 77, 109, 0.06);
    border-color: rgba(255, 77, 109, 0.25);
}
.results-card__title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-bd);
}
.results-card__row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}
.results-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.battle-actions {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 177, 77, 0.05);
    border: 1px solid rgba(255, 177, 77, 0.2);
    border-radius: var(--radius-sm);
}
.battle-actions__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--warn);
    margin-bottom: 8px;
    text-align: center;
}
.battle-actions__buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.battle-actions__buttons .battle-action {
    flex: 1 1 auto;
    min-width: 120px;
    background: rgba(255, 177, 77, 0.1);
    border-color: rgba(255, 177, 77, 0.3);
    color: var(--warn);
}
.battle-actions__buttons .battle-action:hover:not(:disabled) {
    background: rgba(255, 177, 77, 0.25);
    border-color: var(--warn);
}
.battle-actions__buttons .battle-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}
.battle-actions__hint {
    text-align: center;
    margin-top: 6px;
}

/* ============ NEWS PAGES ============ */
.news-article {
    max-width: 820px;
    margin: 24px auto;
    padding: 0 16px;
}
.article-card {
    padding: 32px;
    border-radius: var(--radius);
}
.breadcrumbs {
    margin-bottom: 16px;
    font-family: var(--mono);
}
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.article-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.25;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}
.article-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}
.article-image-wrap {
    margin: 24px -32px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.3);
    text-align: center;
}
.article-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    /* БЕЗ object-fit и max-height — показываем картинку целиком с пропорциями */
}
.article-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(58,160,255,0.05), rgba(108,92,255,0.05));
}
.article-content {
    font-size: 17px;
    line-height: 1.7;
}
.article-lead {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 20px;
    line-height: 1.5;
}
.article-body {
    color: var(--text);
}
.article-body p { margin: 0 0 16px; }
.article-source {
    margin: 24px 0;
    padding: 16px;
    background: rgba(58, 160, 255, 0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.article-votes, .article-share {
    margin: 24px 0;
    padding: 20px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius-sm);
}
.votes-title {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 14px;
}
.votes-buttons {
    display: flex;
    gap: 12px;
}
.vote-btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-bd);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.vote-btn:hover:not(.voted) {
    background: rgba(58, 160, 255, 0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.vote-btn.voted {
    cursor: default;
}
.vote-like.voted {
    background: rgba(77, 255, 166, 0.25);
    border-color: var(--ok);
    color: var(--ok);
}
.vote-dislike.voted {
    background: rgba(255, 77, 109, 0.25);
    border-color: var(--danger);
    color: var(--danger);
}
.votes-status { margin-top: 8px; min-height: 16px; }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.related-news {
    max-width: 820px;
    margin: 32px auto;
    padding: 0 16px;
}
.related-title {
    font-size: 22px;
    margin-bottom: 16px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.related-card {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-2px); }
.related-image-wrap {
    height: 100px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.related-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-content { padding: 10px; }
.related-title-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* ============ NEWS LIST ============ */
.news-list-page {
    max-width: 1500px;
    margin: 24px auto;
    padding: 0 16px;
}
.page-title {
    font-size: 28px;
    margin-bottom: 8px;
}
.filter-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}
.news-card {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.news-card__image-wrap {
    height: 200px;
    overflow: hidden;
    background: #0a0f0a;  /* тёмный фон для letterboxing при contain */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-card__image-wrap--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-card__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;  /* показываем картинку ЦЕЛИКОМ с сохранением пропорций */
    transition: transform 0.3s;
    display: block;
}
.news-card:hover .news-card__image {
    transform: scale(1.03);
}
.news-card__body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-card__meta {
    font-size: 11px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.news-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}
.news-card__summary {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
    margin: 0 0 12px;
    flex: 1;
}
.news-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-top: auto;
}
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}
.empty-state h2 { margin: 16px 0 8px; }

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .article-card { padding: 20px; }
    .article-title { font-size: 24px; }
    .article-image-wrap { margin: 16px -20px; }
    .article-content { font-size: 15px; }
    .article-lead { font-size: 16px; }
}

/* ============ YOUTUBE EMBED ============ */
.youtube-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    margin: 16px 0;
    background: #000;
    border: 1px solid var(--glass-bd);
}
.youtube-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.youtube-embed--card {
    margin: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: none;
    border-bottom: 1px solid var(--glass-bd);
}

/* Бейдж видео на карточке */
.news-card__video-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}
.news-card__video-badge::before {
    content: '▶';
    font-size: 9px;
}
/* Превью YouTube на карточке */
.news-card__video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-card__video-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.news-card__video-play::after {
    content: '';
    border-left: 18px solid #fff;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 4px;
}
.news-card__video-play:hover {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Секция видео в статье */
.article-video {
    margin: 20px 0;
}
.article-video__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============ CONTINENTS NEWS GRID ============ */
.continents-news {
    margin: 32px 0;
}
.continents-news .continents-grid {
    /* внутри .news-list-page, дополнительный max-width не нужен */
}
.continents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.continent-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}
.continent-card:hover { transform: translateY(-3px); }
.continent-card__image {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.continent-card__image img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.6) saturate(1.2);
}
.continent-card__overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(7,13,8,0.95), transparent);
}
.continent-card__capital {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px;
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--glass-bd);
}
.continent-card__news { padding: 6px; }
.continent-news-item {
    display: flex; gap: 8px; padding: 8px;
    border-radius: 6px; text-decoration: none; color: inherit;
    transition: background 0.15s;
}
.continent-news-item:hover { background: rgba(255,255,255,0.04); }
.continent-news-item__img {
    width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.continent-news-item__img-placeholder {
    width: 40px; height: 40px; border-radius: 4px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); font-size: 18px; opacity: 0.4;
}
.continent-news-item__body { flex: 1; min-width: 0; }
.continent-news-item__title {
    font-size: 12px; font-weight: 600; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.continent-news-item__meta { font-size: 10px; margin-top: 2px; }
.continent-card__link {
    display: block; padding: 8px 14px; text-align: center;
    font-size: 12px; font-weight: 700; text-decoration: none;
    border-top: 1px solid var(--glass-bd);
    transition: background 0.15s;
}
.continent-card__link:hover { background: rgba(255,255,255,0.05); }

/* Контейнер с двумя ссылками: континент + все новости */
.continent-card__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--glass-bd);
}
.continent-card__links .continent-card__link {
    border-top: none;
    border-left: 1px solid var(--glass-bd);
}
.continent-card__links .continent-card__link:first-child {
    border-left: none;
}

/* Заголовок секции */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}

/* ============ FOOTER ============ */
.footer {
    padding: 14px 24px;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-dim);
    border-radius: 0;
    border-left: none; border-right: none; border-bottom: none;
    user-select: none;
    cursor: default;
}
.footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer__hint { font-family: var(--mono); }
.footer__secret-flash {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff;
    padding: 6px 14px; border-radius: 4px; font-family: var(--mono); font-size: 12px;
    opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 200;
}
.footer__secret-flash.show { opacity: 1; }

/* ============ ADMIN ============ */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar { background: rgba(10, 15, 28, 0.8); padding: 20px 12px; border-right: 1px solid var(--glass-bd); }
.admin-sidebar h3 { font-size: 13px; color: var(--text-dim); margin: 0 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.admin-sidebar a {
    display: block; padding: 8px 12px; margin-bottom: 4px; border-radius: 6px;
    color: var(--text); text-decoration: none; font-size: 13px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(58, 160, 255, 0.18); color: var(--accent); }
.admin-content { padding: 24px; overflow-y: auto; }
.admin-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-bd);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.admin-card h2 { margin: 0 0 14px; font-size: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--glass-bd); }
.admin-table th { color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:hover td { background: rgba(255,255,255,0.03); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: rgba(0,0,0,0.25); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-bd); }
.kpi__label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.kpi__value { font-size: 22px; font-weight: 700; font-family: var(--mono); margin-top: 4px; }

/* ============ TOAST ============ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: rgba(20, 28, 48, 0.95);
    backdrop-filter: blur(10px);
    border-left: 3px solid var(--accent);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3s forwards;
    max-width: 340px;
}
.toast--error { border-left-color: var(--danger); }
.toast--ok    { border-left-color: var(--ok); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes fadeOut  { to { opacity: 0; transform: translateX(120%); } }

/* ============ LOGIN ============ */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card { width: 100%; max-width: 360px; padding: 28px; border-radius: var(--radius); }
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-card p  { margin: 0 0 20px; color: var(--text-dim); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }

/* ============ UTILITY ============ */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.text-dim { color: var(--text-dim); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-mono { font-family: var(--mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.scroll-y { overflow-y: auto; }
.max-h-300 { max-height: 300px; }
.max-h-500 { max-height: 500px; }

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 768px) {
    /* Topbar — компактный */
    .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
    .topbar__title { font-size: 16px; }
    .topbar__sub { font-size: 10px; }
    .topbar__nav { gap: 4px; flex-wrap: wrap; }
    .topbar__nav .btn { padding: 6px 10px; font-size: 11px; }
    .topbar__logo { font-size: 24px; }

    /* Layout — одна колонка */
    .layout { grid-template-columns: 1fr !important; gap: 10px; padding: 8px; }
    .layout__sidebar { max-height: none !important; overflow-y: visible !important; }
    .layout__map { min-height: 320px; height: 50vh; }

    /* Карта мира — меньше */
    #world-map { touch-action: none; }

    /* Метрики континента — 2 колонки */
    .metric-grid { grid-template-columns: 1fr 1fr !important; gap: 6px; }
    .metric { padding: 6px 8px; }
    .metric__value { font-size: 14px; }
    .metric__label { font-size: 9px; }

    /* Боевые селекты — вертикально */
    .battle-controls { flex-direction: column; gap: 8px; }
    .battle-controls select { width: 100%; font-size: 14px; padding: 10px; }

    /* Кнопки — крупнее для пальцев */
    .btn { padding: 10px 16px; font-size: 13px; min-height: 40px; }
    .btn--sm { padding: 8px 12px; font-size: 12px; min-height: 36px; }

    /* Новости — одна колонка */
    .news-list { max-height: 250px; }
    .news-list__title { font-size: 13px; }

    /* Админка */
    .admin-layout { grid-template-columns: 1fr !important; }
    .admin-sidebar { position: static; max-height: 200px; overflow-y: auto; }
    .admin-content { padding: 10px; }
    .kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 6px; }
    .kpi { padding: 8px; }
    .kpi__value { font-size: 18px; }
    .kpi__label { font-size: 10px; }
    .admin-table { font-size: 11px; }
    .admin-table th, .admin-table td { padding: 4px 6px; }

    /* Игра Поселенцы */
    .sg-page { padding: 8px; }
    .sg-main { grid-template-columns: 1fr !important; }
    .sg-map { height: 360px !important; }
    .sg-sidebar { max-height: none !important; overflow-y: visible !important; }
    .sg-controls { max-width: 160px; padding: 4px; right: 6px; top: 6px; }
    .sg-ctrl-btn { font-size: 14px; padding: 4px 6px; min-width: 28px; }
    .sg-collect { width: 56px; height: 56px; font-size: 20px; bottom: 10px; right: 10px; }
    .sg-collect__label { font-size: 8px; }
    .sg-resources { gap: 4px; }
    .sg-res { padding: 4px 8px; font-size: 12px; }
    .sg-res__val { font-size: 14px; }
    .sg-info-bar { flex-direction: column; align-items: stretch; gap: 8px; }
    .sg-info-bar__stats { flex-wrap: wrap; gap: 8px; }
    .sg-header h1 { font-size: 16px; }

    /* Континент лендинг */
    .landing-hero { height: 180px; }
    .landing-hero__title { font-size: 22px; }
    .landing-grid { grid-template-columns: 1fr !important; }

    /* Эфиры */
    .bc-page { padding: 10px; }
    .bc-hero { padding: 16px; }
    .bc-hero h1 { font-size: 20px; }
    .bc-nav { gap: 4px; }
    .bc-nav a { padding: 6px 10px; font-size: 11px; }
    .bc-item { flex-direction: column; gap: 6px; }
    .bc-item__player audio { width: 100% !important; height: 36px; }

    /* Модалки */
    .modal__content { max-width: 95% !important; padding: 16px; }

    /* Таблицы — горизонтальный скролл */
    .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-table { min-width: 500px; }
}
