/* ================================================================
   Файл: css/style.css
   Назначение: все стили игры (старые + новые блоки)
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #0b0e17;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #d0d9f0;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 900px;
    background: linear-gradient(145deg, #0e121f, #161c2e);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 20, 80, 0.5);
    position: relative;
    transition: all 0.2s;
}

/* ----- Верхняя панель (увеличенная) ----- */
#top-bar {
    background: rgba(20, 30, 55, 0.85);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid #2a3a5a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 112px;
    overflow: hidden;
    transition: height 0.2s ease;
}
#top-bar.has-advanced {
    height: 132px;
}

.top-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    height: 52px;
    box-sizing: border-box;
}

.boost-row {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    box-sizing: border-box;
}

/* ---- БОНУСНАЯ СТРОКА (компактная) ---- */
.bonus-row {
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(42, 58, 90, 0.3);
    overflow: hidden;
    white-space: nowrap;
}
.bonus-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
}
.bonus-item {
    color: #a0b8d8;
    background: rgba(20, 30, 55, 0.5);
    padding: 0 6px;
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 500;
    font-size: 11px;
    line-height: 20px;
}
.bonus-item.active {
    color: #ffd966;
    border: 1px solid #ffd966;
}

.advanced-row {
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: nowrap;
    gap: 6px;
}
#advanced-resource-container {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ----- Анимация кнопки подарка (когда доступен) ----- */
@keyframes pulse-gift {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#giftBtn {
    transition: all 0.3s ease;
}

/* ============================================================
   ПОДСКАЗКИ ВЕРХНЕЙ ПАНЕЛИ
   ============================================================ */
.resource-tooltip,
.bonus-tooltip {
    background: #0e1a2a !important;
    border: 1px solid #2a3a5a !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    pointer-events: none !important;
    transition: none !important;
}

.resource-tooltip {
    max-width: 280px !important;
}

.bonus-tooltip {
    max-width: 320px !important;
}

/* Подсветка активных бонусов */
.bonus-item.active {
    color: #ffd966;
    border: 1px solid #ffd966;
    background: rgba(255, 215, 0, 0.15);
}

/* Обновлённый стиль для бонусных элементов */
.bonus-item {
    cursor: help;
    transition: all 0.2s ease;
}

.bonus-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

/* ----- Кнопки верхней панели ----- */
.top-btn {
    background: #1f2b44;
    border: none;
    color: #ffd966;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}
.top-btn:active {
    transform: scale(0.92);
    background: #2e3f66;
}

.res-spacer {
    flex: 1;
    min-width: 6px;
}

#resource-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.resource-chip {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #192237;
    padding: 2px 6px 2px 2px;
    border-radius: 16px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}
.resource-chip .icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 9px;
    color: #fff;
}
.resource-chip .value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
    min-width: 36px;
}

.icon-Fe { background: #b0a090; }
.icon-Qz { background: #7a9eb3; }
.icon-Cb { background: #4a4a4a; }
.icon-Ti { background: #8c9aa8; }
.icon-Cu { background: #c67b3c; }
.icon-Nf { background: #6a5a4a; }
.icon-Cr { background: #7a6a8a; }
.icon-As { background: #5a6a7a; }
.icon-Qn { background: #4a6a8a; }
.icon-En { background: #8a6a3a; }
.icon-Ex { background: #a040a0; }
.icon-Nv { background: #4a8a6a; }

/* ----- Индикатор рекламных бустов ----- */
.boost-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 11px;
    background: rgba(255, 215, 0, 0.15);
    padding: 0 8px;
    border-radius: 10px;
}
.boost-indicator-item {
    color: #ffd966;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}
.boost-indicator-item.inactive {
    opacity: 0.4;
    color: #6a7f9f;
}

/* ----- Основной контент ----- */
#main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #2a3a5a transparent;
}
#main-content::-webkit-scrollbar {
    width: 4px;
}
#main-content::-webkit-scrollbar-thumb {
    background: #3a4a6a;
    border-radius: 4px;
}

.planet-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.planet-title h2 {
    font-size: 20px;
    font-weight: 500;
    color: #b8ccf0;
}
.planet-title .local-res {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #8aa0c8;
}
.planet-title .local-res span {
    background: #1b253b;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ---- ЭПОХИ ---- */
.era-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 2px 4px;
    margin-top: 10px;
    border-bottom: 2px solid #2a3a5a;
    font-size: 13px;
    color: #6a7f9f;
}

.era-header:first-of-type {
    margin-top: 0;
}

.era-header.unlocked {
    border-bottom-color: #4a6a8a;
    color: #ffd966;
}

.era-header.locked {
    border-bottom-color: #2a3a5a;
    color: #6a7f9f;
}

.era-header .era-status {
    font-size: 16px;
    margin-right: 6px;
}

.era-header .era-name {
    font-weight: 600;
    flex: 1;
}

.era-header .era-desc {
    font-size: 11px;
    color: #8aa0c8;
}

/* Анимация открытия новой эпохи */
.era-header.era-new {
    animation: eraFlash 1.5s ease-in-out;
}

@keyframes eraFlash {
    0% { color: #ffd966; border-bottom-color: #ffd966; }
    50% { color: #ffffff; border-bottom-color: #ffffff; }
    100% { color: #ffd966; border-bottom-color: #4a6a8a; }
}

.building-card.era-new {
    animation: buildingFlash 1.5s ease-in-out;
}

@keyframes buildingFlash {
    0% { border-left-color: #ffd966; box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    100% { border-left-color: #3a5a8a; box-shadow: none; }
}

/* ----- Кнопка добычи + всплывающие цифры ----- */
.mine-btn {
    background: linear-gradient(180deg, #ffb347 0%, #e07b00 100%);
    border: none;
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 5px 0 #b85e00, 0 8px 16px rgba(255, 180, 0, 0.3);
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 8px;
    align-self: stretch;
    position: relative;
    overflow: visible;
}
.mine-btn::before {
    content: '';
    position: absolute;
    top: 2px; left: 8px; right: 8px;
    height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    border-radius: 30px 30px 50% 50%;
    pointer-events: none;
}
.mine-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #b85e00, 0 4px 8px rgba(255, 180, 0, 0.3);
    background: linear-gradient(180deg, #f5a623 0%, #c96b00 100%);
}
@media (hover: hover) and (pointer: fine) {
    .mine-btn::after {
        content: "  (Пробел)";
        font-size: 12px;
        opacity: 0.7;
        font-weight: 400;
        letter-spacing: 0;
    }
}

.floating-number {
    position: fixed;
    pointer-events: none;
    font-weight: 700;
    font-size: 18px;
    color: #ffd966;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 3000;
    animation: floatUp 1.2s ease-out forwards;
}
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-70px) scale(1.2);
    }
}

/* ----- ТОСТ-УВЕДОМЛЕНИЯ ----- */
#toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}
.toast {
    background: rgba(20, 30, 55, 0.95);
    backdrop-filter: blur(6px);
    border: 1px solid #4a6a8a;
    border-radius: 10px;
    padding: 10px 16px;
    color: #d0d9f0;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    text-align: center;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    width: 100%;
}
.toast.success { border-color: #4a8a6a; }
.toast.info { border-color: #c8a060; }
.toast.warning { border-color: #8a6a4a; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

/* ----- Здания ----- */
.buildings-section h3 {
    font-size: 16px;
    font-weight: 400;
    color: #8a9fc0;
    border-bottom: 1px solid #1f2b44;
    padding-bottom: 4px;
    margin-bottom: 8px;
}
#buildings-list,
#lab-content,
#shipyard-content,
#colony-content,
#tech-content,
#rings-content,
#achievements-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.building-card {
    background: #141d30;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #3a5a8a;
    transition: border-color 0.3s ease;
}
.building-card.building-constructing {
    border-left-color: #c8a060;
    background: #1a253b;
}
.building-card .b-icon {
    width: 44px;
    height: 44px;
    background: #1f2b44;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.building-card .b-info {
    flex: 1;
    min-width: 0;
}
.building-card .b-info .b-name {
    font-weight: 500;
    font-size: 16px;
}
.building-card .b-info .b-level {
    font-size: 13px;
    color: #8aa0c8;
}
.building-card .b-info .b-cost {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.building-card .b-info .b-progress {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.building-card .upgrade-btn {
    background: #2a4a7a;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}
.building-card .upgrade-btn:active {
    transform: scale(0.94);
    background: #3a5a8a;
}
.building-card .upgrade-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.building-card .upgrade-btn.constructing {
    background: #6a4a2a;
    cursor: wait;
}

/* ---- Прогресс-бар строительства (в карточке здания) ---- */
.building-progress-container {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}
.building-progress-bar {
    flex: 1;
    height: 6px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.building-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c8a060, #ffd966);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}
.building-progress-text {
    font-size: 11px;
    color: #c8a060;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

/* ----- Подсказки (tooltip) ----- */
.custom-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a2a3a;
    color: #d0d9f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: pre-line;
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
    border: 1px solid #3a5a7a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .custom-tooltip {
        font-size: 14px;
        min-width: 250px;
        padding: 10px 14px;
    }
}

/* ============================================================
   ЛАБОРАТОРИЯ
   ============================================================ */
.lab-stats-panel {
    background: #0e1a2a;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #2a3a5a;
    margin-bottom: 10px;
}
.lab-stats-title {
    font-size: 15px;
    font-weight: 600;
    color: #c8a060;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 0.5px;
}
.lab-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.lab-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(42, 58, 90, 0.3);
}
.lab-stat-item:last-child {
    border-bottom: none;
}
.lab-stat-label {
    color: #8aa0c8;
}
.lab-stat-value {
    color: #d0d9f0;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}
.lab-recipes-title {
    font-size: 16px;
    font-weight: 400;
    color: #8a9fc0;
    border-bottom: 1px solid #1f2b44;
    padding-bottom: 4px;
    margin-top: 4px;
    margin-bottom: 8px;
}
.recipe-card {
    background: #141d30;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 4px solid #6a4a8a;
    transition: border-color 0.3s;
}
.recipe-card.crafting {
    border-left-color: #c8a060;
}
.recipe-info {
    flex: 1;
}
.recipe-name {
    font-weight: 500;
    font-size: 16px;
}
.recipe-desc {
    font-size: 13px;
    color: #8aa0c8;
}
.recipe-cost {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.recipe-result {
    font-size: 12px;
    color: #6aaa8a;
    margin-top: 2px;
}
.recipe-time {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.craft-btn {
    background: #4a3a6a;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    align-self: flex-start;
    position: relative;
}
.craft-btn:active {
    transform: scale(0.94);
    background: #5a4a8a;
}
.craft-btn.disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}
.craft-progress-container {
    display: none;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}
.craft-progress-bar {
    flex: 1;
    height: 8px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.craft-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a4a8a, #c8a060);
    border-radius: 4px;
    transition: width 0.1s ease;
    width: 0%;
}
.craft-progress-text {
    font-size: 12px;
    color: #a0b8d8;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}
.craft-result-msg {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #4a8a6a;
    padding: 6px 10px;
    background: #1a2a1a;
    border-radius: 6px;
    border-left: 3px solid #4a8a6a;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.craft-amount-input {
    width: 60px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #2a3a5a;
    background: #141d30;
    color: #d0d9f0;
    font-size: 14px;
    text-align: center;
}
.craft-stop-btn {
    background: #6a3a4a;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* ============================================================
   ВЕРФЬ
   ============================================================ */
.ship-card {
    background: #141d30;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 4px solid #3a7a5a;
    margin-bottom: 10px;
    transition: 0.2s;
}
.ship-card.ship-locked {
    border-left-color: #6a4a4a;
    opacity: 0.7;
}
.ship-card.ship-constructing {
    border-left-color: #c8a060;
    background: #1a253b;
}
.ship-info {
    flex: 1;
}
.ship-name {
    font-weight: 600;
    font-size: 16px;
    color: #b8ccf0;
}
.ship-desc {
    font-size: 13px;
    color: #8aa0c8;
    margin-top: 2px;
}
.ship-cost {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.ship-count {
    font-size: 13px;
    color: #6aaa8a;
    margin-top: 2px;
}
.ship-progress {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.ship-lock-reason {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.build-btn {
    background: #2a6a4a;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    position: relative;
}
.build-btn:active {
    transform: scale(0.94);
    background: #3a8a5a;
}
.build-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.build-btn.constructing {
    background: #6a4a2a;
    cursor: wait;
}

/* ---- Прогресс-бар строительства корабля ---- */
.ship-progress-container {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}
.ship-progress-bar {
    flex: 1;
    height: 6px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.ship-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c8a060, #ffd966);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}
.ship-progress-text {
    font-size: 11px;
    color: #c8a060;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

/* ============================================================
   КОЛОНИИ
   ============================================================ */
.planet-card {
    background: #141d30;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid #5a7a9a;
    margin-bottom: 10px;
}
.planet-info {
    flex: 1;
}
.planet-name {
    font-weight: 500;
    font-size: 16px;
}
.planet-type {
    font-size: 13px;
    color: #8aa0c8;
}
.planet-resources {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.planet-status {
    font-size: 12px;
    color: #8aa0c8;
    margin-top: 2px;
}
.planet-progress {
    margin-top: 4px;
    width: 100%;
}
.progress-bar {
    height: 6px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: #c8a060;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.planet-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.colony-btn {
    background: #3a5a7a;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    position: relative;
}
.colony-btn:active {
    transform: scale(0.94);
    background: #4a7a9a;
}
.colony-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.cargo-btn {
    background: #5a6a4a;
}
.cargo-btn:active {
    background: #6a7a5a;
}
.planet-storage {
    font-size: 12px;
    color: #c8a060;
    background: #1a1a2a;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 4px;
}

/* ============================================================
   ТЕХНОЛОГИИ
   ============================================================ */
.tech-card {
    background: #141d30;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #6a4a8a;
    margin-bottom: 10px;
    transition: 0.2s;
}
.tech-card.tech-researched {
    border-left-color: #4a8a6a;
    opacity: 0.7;
}
.tech-card.tech-hidden {
    border-left-color: #4a4a4a;
    opacity: 0.5;
}
.tech-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    background: #1f2b44;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tech-info {
    flex: 1;
}
.tech-name {
    font-weight: 500;
    font-size: 16px;
}
.tech-desc {
    font-size: 13px;
    color: #8aa0c8;
}
.tech-cost {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.tech-status {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.tech-block-reason {
    font-size: 12px;
    color: #c8a060;
    margin-top: 4px;
    padding: 4px 8px;
    background: #1a1a2a;
    border-radius: 4px;
    border-left: 2px solid #c8a060;
    display: block;
}
.research-btn {
    background: #4a3a6a;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    position: relative;
}
.research-btn:active {
    transform: scale(0.94);
    background: #5a4a8a;
}
.research-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   КОЛЬЦА
   ============================================================ */
.ring-card {
    background: #141d30;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid #c8a060;
    margin-bottom: 14px;
    transition: 0.3s;
}
.ring-card.ring-built {
    border-left-color: #4a8a6a;
    opacity: 0.8;
}
.ring-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    background: #1f2b44;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ring-info {
    flex: 1;
}
.ring-name {
    font-weight: 600;
    font-size: 18px;
    color: #ffd966;
}
.ring-desc {
    font-size: 13px;
    color: #8aa0c8;
    margin-top: 2px;
}
.ring-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.ring-progress-bar {
    flex: 1;
    height: 8px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.ring-progress-fill {
    height: 100%;
    background: #c8a060;
    border-radius: 4px;
    transition: width 0.3s;
}
.ring-progress-text {
    font-size: 12px;
    color: #c8a060;
    min-width: 40px;
    text-align: right;
}
.ring-cost {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 4px;
}
.ring-requirements {
    font-size: 12px;
    color: #8aa0c8;
    margin-top: 2px;
}
.ring-status {
    font-size: 14px;
    color: #4a8a6a;
    margin-top: 4px;
    font-weight: 600;
}
.ring-unlocks {
    font-size: 12px;
    color: #a0b8d8;
    margin-top: 2px;
}
.build-ring-btn {
    background: #c8a060;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    color: #0b0e17;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    position: relative;
}
.build-ring-btn:active {
    transform: scale(0.94);
    background: #d8b070;
}
.build-ring-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   ДОСТИЖЕНИЯ
   ============================================================ */
.achievements-stats {
    background: #0e1a2a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #2a3a5a;
}
.achievements-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}
.achievements-progress-bar {
    flex: 1;
    height: 8px;
    background: #1f2b44;
    border-radius: 4px;
    overflow: hidden;
}
.achievements-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd966, #c8a060);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.achievements-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #c8a060;
    min-width: 60px;
    text-align: right;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.achievement-card {
    background: #141d30;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #3a4a5a;
    transition: all 0.3s ease;
}
.achievement-card.unlocked {
    border-left-color: #c8a060;
    background: #1a253b;
}
.achievement-card.locked {
    opacity: 0.7;
}
.achievement-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    background: #1f2b44;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.achievement-card.unlocked .achievement-icon {
    background: #2a3a5a;
    box-shadow: 0 0 15px rgba(200, 160, 96, 0.3);
}
.achievement-info {
    flex: 1;
}
.achievement-name {
    font-weight: 600;
    font-size: 15px;
    color: #d0d9f0;
}
.achievement-desc {
    font-size: 12px;
    color: #8aa0c8;
}
.achievement-reward {
    font-size: 12px;
    color: #c8a060;
    margin-top: 2px;
}
.achievement-status {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

/* ============================================================
   НИЖНЯЯ НАВИГАЦИЯ
   ============================================================ */
#bottom-nav {
    background: rgba(14, 20, 36, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 10px;
    border-top: 1px solid #1f2b44;
    flex-shrink: 0;
    overflow-x: auto;
    gap: 2px;
}
.nav-btn {
    background: transparent;
    border: none;
    color: #6a7f9f;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: pointer;
    padding: 4px 4px;
    transition: 0.2s;
    flex: 1;
    min-width: 44px;
    max-width: 70px;
}
.nav-btn .nav-icon {
    font-size: 20px;
    line-height: 1;
}
.nav-btn.active {
    color: #ffd966;
}
.nav-btn:active {
    transform: scale(0.92);
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal-content {
    background: #141d30;
    border-radius: 16px;
    padding: 20px 16px;
    max-width: 380px;
    width: 100%;
    border: 1px solid #2a3a5a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: fadeIn 0.2s ease;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #8aa0c8;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: 0.15s;
}
.modal-close:hover {
    color: #fff;
}
.modal-content h2 {
    font-size: 22px;
    color: #ffd966;
    margin-bottom: 6px;
    text-align: center;
}
.modal-content > p {
    font-size: 14px;
    color: #8aa0c8;
    text-align: center;
    margin-bottom: 18px;
}
.boost-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.boost-card {
    background: #192237;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #2a3a5a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color 0.3s;
}
.boost-card.active {
    border-color: #4a8a6a;
}
.boost-icon {
    font-size: 32px;
}
.boost-name {
    font-weight: 600;
    font-size: 18px;
    color: #d0d9f0;
}
.boost-desc {
    font-size: 13px;
    color: #8aa0c8;
    text-align: center;
}
.boost-status {
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    color: #c8a060;
}
.boost-btn {
    background: #2a4a7a;
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
    width: 100%;
    text-align: center;
}
.boost-btn:active {
    transform: scale(0.95);
    background: #3a5a8a;
}
.boost-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   НАСТРОЙКИ
   ============================================================ */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    color: #d0d9f0;
    cursor: pointer;
}
.settings-toggle input[type="checkbox"] {
    display: none;
}
.toggle-slider {
    width: 48px;
    height: 26px;
    background: #2a3a5a;
    border-radius: 13px;
    position: relative;
    transition: 0.2s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    width: 20px;
    height: 20px;
    background: #d0d9f0;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.2s;
}
.settings-toggle input:checked + .toggle-slider {
    background: #4a8a6a;
}
.settings-toggle input:checked + .toggle-slider::after {
    left: 25px;
}
.settings-volume {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #d0d9f0;
    margin-top: 8px;
}
.settings-volume input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    background: #2a3a5a;
    height: 4px;
    border-radius: 2px;
    outline: none;
}
.settings-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #ffd966;
    border-radius: 50%;
    cursor: pointer;
}
.settings-volume input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffd966;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
#volumeValue {
    min-width: 44px;
    text-align: center;
    font-weight: 600;
}
.danger-btn {
    background: #6a3a3a;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.15s;
    width: 100%;
}
.danger-btn:active {
    transform: scale(0.95);
    background: #8a4a4a;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 500px) {
    #top-bar {
        height: 102px;
    }
    #top-bar.has-advanced {
        height: 120px;
    }
    .top-row {
        height: 44px;
        padding: 2px 6px;
    }
    .boost-row {
        height: 18px;
        padding: 0 6px;
    }
    .bonus-row {
        height: 18px;
        padding: 0 6px;
    }
    .bonus-item {
        font-size: 9px;
        padding: 0 3px;
        line-height: 16px;
    }
    .advanced-row {
        height: 24px;
        padding: 0 6px;
    }
    .top-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .resource-chip {
        font-size: 10px;
        padding: 1px 4px 1px 1px;
    }
    .resource-chip .icon {
        width: 18px;
        height: 18px;
        font-size: 8px;
    }
    .resource-chip .value {
        font-size: 10px;
        min-width: 30px;
    }
    #main-content {
        padding: 8px 6px 4px;
        gap: 6px;
    }
    #resource-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    #resource-container::-webkit-scrollbar {
        display: none;
    }
    .floating-number {
        font-size: 14px;
    }
    .toast {
        font-size: 12px;
        padding: 8px 12px;
    }
    .nav-btn {
        font-size: 9px;
        min-width: 36px;
        max-width: 56px;
    }
    .nav-btn .nav-icon {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .bonus-item {
        font-size: 8px;
        padding: 0 2px;
    }
    .resource-chip .value {
        font-size: 9px;
        min-width: 26px;
    }
    .nav-btn {
        font-size: 8px;
        min-width: 30px;
        max-width: 44px;
        padding: 2px 2px;
    }
    .nav-btn .nav-icon {
        font-size: 14px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        justify-content: center;
    }
    #app {
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    #top-bar {
        height: 56px;
    }
    #top-bar.has-advanced {
        height: 74px;
    }
    .top-row {
        height: 38px;
        padding: 2px 12px;
    }
    .boost-row {
        height: 12px;
        padding: 0 12px;
    }
    .bonus-row {
        height: 18px;
        padding: 0 12px;
    }
    .advanced-row {
        height: 24px;
        padding: 0 12px;
    }
    .top-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .resource-chip {
        font-size: 12px;
        padding: 2px 8px 2px 3px;
    }
    .resource-chip .icon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .resource-chip .value {
        font-size: 12px;
        min-width: 36px;
    }
    .boost-indicator {
        font-size: 11px;
        padding: 2px 8px;
    }
    #main-content {
        padding: 8px 14px 4px;
        gap: 8px;
    }
    #bottom-nav {
        padding: 4px 0 6px;
    }
    .nav-btn {
        font-size: 10px;
        min-width: 44px;
        max-width: 70px;
    }
    .nav-btn .nav-icon {
        font-size: 20px;
    }
}

@media (min-width: 700px) {
    #app {
        max-width: 650px;
        max-height: 800px;
        border-radius: 16px;
        margin-top: 20px;
        margin-bottom: 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    }
    .building-card {
        padding: 14px 18px;
    }
    .mine-btn {
        padding: 14px 36px;
        font-size: 20px;
    }
    .resource-chip {
        padding: 2px 6px 2px 2px;
    }
    .resource-chip .value {
        min-width: 40px;
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    #app {
        max-width: 750px;
        max-height: 850px;
    }
    .resource-chip {
        font-size: 15px;
    }
    .resource-chip .value {
        font-size: 15px;
        min-width: 54px;
    }
    .nav-btn {
        font-size: 13px;
        min-width: 60px;
        max-width: 90px;
    }
    .nav-btn .nav-icon {
        font-size: 28px;
    }
}

/* ============================================================
   БЛОК "ОБ ИГРЕ" В НАСТРОЙКАХ
   ============================================================ */
.settings-about {
    text-align: center;
    padding: 12px 0 4px 0;
}

.settings-about .game-icon {
    font-size: 36px;
    margin-bottom: 4px;
}

.settings-about .game-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffd966;
}

.settings-about .game-subtitle {
    font-size: 12px;
    color: #8aa0c8;
    margin-top: 2px;
}

.settings-about .game-details {
    font-size: 11px;
    color: #6a7f9f;
    margin-top: 8px;
    line-height: 1.6;
}

.settings-about .game-details span {
    color: #b8ccf0;
}

.settings-about .game-footer {
    font-size: 10px;
    color: #4a5a6a;
    margin-top: 8px;
    border-top: 1px solid #1f2b44;
    padding-top: 8px;
}

.settings-about .game-footer .heart {
    color: #ff6b6b;
}