/* ===== ГЛОБАЛЬНЫЙ СТИЛЬ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    background: #0b0e14;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    image-rendering: pixelated;
    padding: 16px;
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
#app {
    width: 820px;
    min-height: 700px;
    max-height: 98vh;
    background: #131a24;
    border: 4px solid #2e3f54;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 0 60px rgba(0, 180, 255, 0.06), inset 0 0 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== МЕНЮ ===== */
.menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 12px;
}

.menu-title {
    font-size: 44px;
    font-weight: bold;
    color: #a8d8ff;
    text-shadow: 0 0 20px rgba(80, 200, 255, 0.2);
    letter-spacing: 6px;
    border-bottom: 3px solid #2e405a;
    padding-bottom: 14px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    width: 260px;
}

.menu-btn {
    background: #1b2638;
    border: 2px solid #3a506e;
    color: #c4dfff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 14px;
    padding: 14px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
    letter-spacing: 2px;
}
.menu-btn:hover {
    background: #283954;
    border-color: #6db3ff;
    box-shadow: 0 0 24px rgba(70, 170, 255, 0.12);
}

/* ===== ИГРОВОЙ ЭКРАН ===== */
.game-screen {
    display: none;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    min-height: 0;
}

/* ---- Верхняя панель ---- */
.top-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0e151f;
    border: 2px solid #1f2d40;
    border-radius: 10px;
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 4px 12px;
    flex-shrink: 0;
}

.player-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-name {
    color: #b0d0f0;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    border-right: 2px solid #26384f;
    padding-right: 10px;
}

.exp-block {
    display: flex;
    align-items: center;
    gap: 6px;
}

.exp-block .lvl-label {
    color: #6f8fb0;
    font-size: 12px;
    font-weight: bold;
}

.exp-block .lvl-value {
    color: #d4ecff;
    font-size: 16px;
    font-weight: bold;
}

.exp-bar-bg {
    width: 100px;
    height: 14px;
    background: #0a111c;
    border: 2px solid #1f2d40;
    border-radius: 10px;
    overflow: hidden;
}

.exp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3a8f6a, #5fd4a0);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.stat-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #97b3d4;
    font-size: 13px;
}

.stat-item .label {
    color: #5d789b;
    font-size: 11px;
}

.stat-item .value {
    color: #d4ecff;
    font-weight: bold;
    font-size: 16px;
    min-width: 20px;
}

.stat-item .value.gold {
    color: #f7d44a;
}
.stat-item .value.purple {
    color: #b88aff;
}

/* ---- Слайдер с ресурсами ---- */
.resource-slider {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid #1b283b;
    background: #0e141e;
}

.slider-track {
    display: flex;
    transition: transform 0.4s ease;
    height: 100%;
}

.resource-zone {
    min-width: 100%;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.resource-zone .zone-title {
    color: #8aaccf;
    text-align: center;
    border-bottom: 1px solid #1f3045;
    padding-bottom: 6px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    flex-shrink: 0;
}

/* ---- СЕТКА: 4 КАРТОЧКИ В РЯД ---- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
    align-content: start;
}

/* ---- КАРТОЧКА РЕСУРСА ---- */
.resource-slot {
    background: #121b28;
    border: 2px solid #25344a;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    min-height: 120px;
}
.resource-slot:hover {
    border-color: #5f8fc7;
    background: #182433;
}
.resource-slot:active {
    transform: scale(0.94);
}

.resource-slot .res-badge {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #7e9ac2;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 0 8px;
    border-radius: 4px;
}

.resource-slot .sprite-placeholder {
    width: 60px;
    height: 60px;
    background: #1a2638;
    border: 2px solid #2f405a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #4b6382;
    transition: 0.1s;
    font-family: 'Courier New', monospace;
}
.resource-slot:hover .sprite-placeholder {
    border-color: #6db3ff;
}

.resource-slot .res-name {
    color: #aec6e8;
    font-size: 13px;
    font-weight: bold;
    margin-top: 2px;
}

.resource-slot .res-progress-vertical {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 6px;
    background: #0a111c;
    border-radius: 4px;
    overflow: hidden;
}

.resource-slot .res-progress-fill-vertical {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #5f8fc7;
    transition: height 0.08s ease-out;
    border-radius: 4px;
}

.resource-slot .res-timer {
    position: absolute;
    top: 4px;
    right: 14px;
    font-size: 10px;
    color: #d45a5a;
    display: none;
    font-family: 'Courier New', monospace;
}

/* ---- Кнопки слайдера ---- */
.slider-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    padding: 2px 0;
}

.slider-btn {
    background: #1b2638;
    border: 2px solid #2a3d56;
    color: #b8d6f5;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 14px;
    padding: 2px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.1s;
}
.slider-btn:hover {
    background: #283954;
    border-color: #5f8fc7;
}
.slider-btn:active {
    transform: scale(0.94);
}

.slider-dots {
    display: flex;
    gap: 6px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1f2d40;
    border: 1px solid #2a3d56;
    transition: 0.2s;
}
.slider-dot.active {
    background: #5f8fc7;
    border-color: #6db3ff;
}

/* ---- Нижние кнопки ---- */
.action-bar {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    background: #15202f;
    border: 2px solid #2a3d56;
    color: #b8d6f5;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    padding: 12px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.12s;
    text-align: center;
    letter-spacing: 1px;
}
.action-btn:hover {
    background: #1f3048;
    border-color: #5f8fc7;
}
.action-btn:active {
    transform: scale(0.96);
}

.action-btn.action-icon {
    flex: 0 0 48px;
    font-size: 20px;
    padding: 12px 0;
    line-height: 1;
}
.action-btn.action-icon:hover {
    background: #1f3048;
    border-color: #5f8fc7;
}

.action-bar-icons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.action-bar-icons .action-btn {
    flex: 0 0 48px;
    font-size: 18px;
    padding: 8px 0;
    line-height: 1;
}
.action-bar-icons .action-btn:hover {
    background: #1f3048;
    border-color: #5f8fc7;
}

/* ---- Бейджи на кнопках ---- */
.action-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d45a5a;
    color: #fff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 9px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #131a24;
    padding: 0 4px;
}

.badge.green {
    background: #3aaf6a;
}
.badge.gold {
    background: #f7d44a;
    color: #0b0e14;
}
.badge.purple {
    background: #b88aff;
    color: #0b0e14;
}
.badge.blue {
    background: #5f8fc7;
}
.badge.hidden {
    display: none;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: #141d2a;
    border: 3px solid #2f4a66;
    border-radius: 16px;
    padding: 20px 22px;
    min-width: 420px;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
    width: 100%;
}

.modal-window h2 {
    color: #b0d4ff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 15px;
    border-bottom: 2px solid #263e58;
    padding-bottom: 10px;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 2px;
    flex-shrink: 0;
}

/* ---- ФИКСИРОВАННАЯ ВЕРХНЯЯ ЧАСТЬ ---- */
.modal-fixed-top {
    flex-shrink: 0;
}

/* ---- СКРОЛЛИНГОВАЯ ЧАСТЬ ---- */
.modal-scrollable {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 4px;
}

.modal-scrollable::-webkit-scrollbar {
    width: 4px;
}
.modal-scrollable::-webkit-scrollbar-track {
    background: #0e151f;
}
.modal-scrollable::-webkit-scrollbar-thumb {
    background: #2f4a66;
    border-radius: 4px;
}

/* ---- УБИРАЕМ СКРОЛЛ У .modal-content ---- */
.modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-right: 0;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-close-btn {
    margin-top: 12px;
    background: #1f3048;
    border: 2px solid #3f5a7a;
    color: #c4dfff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: 0.1s;
    flex-shrink: 0;
}
.modal-close-btn:hover {
    background: #2c4160;
    border-color: #6db3ff;
}

/* ---- Очередь карточками ---- */
.queue-container {
    background: #0a111c;
    border: 1px solid #2a3d56;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.queue-container .queue-title {
    color: #6f8fb0;
    font-size: 13px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.queue-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 60px;
}

.queue-card {
    width: 80px;
    min-width: 70px;
    max-width: 100px;
    flex: 0 0 auto;
    background: #121b28;
    border: 2px solid #25344a;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    position: relative;
}

.queue-badge {
    position: absolute;
    bottom: -6px;
    left: -6px;
    background: #d45a5a;
    color: #fff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 8px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #131a24;
    box-shadow: 0 0 12px rgba(212, 90, 90, 0.4);
    padding: 0 4px;
    z-index: 5;
}

.queue-card .queue-card-name {
    color: #b0d0f0;
    font-size: 10px;
    font-weight: bold;
    word-break: break-word;
}

.queue-card .queue-card-time {
    color: #5fd4a0;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.queue-empty {
    color: #5d789b;
    font-size: 11px;
    padding: 8px 0;
    text-align: center;
    width: 100%;
}

/* ---- Категории кнопками ---- */
.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    flex-shrink: 0;
    padding-top: 4px;
}

.category-tab {
    background: #1b2638;
    border: 2px solid #2a3d56;
    color: #8aa9ce;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.1s;
    letter-spacing: 1px;
}
.category-tab:hover {
    background: #283954;
    border-color: #5f8fc7;
    color: #b8d6f5;
}
.category-tab.active {
    background: #1f3048;
    border-color: #6db3ff;
    color: #d4ecff;
    box-shadow: 0 0 16px rgba(60, 160, 255, 0.08);
}

/* ---- Карточки крафтов/изучений ---- */
.craft-item {
    background: #121b28;
    border: 2px solid #25344a;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: 0.1s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.craft-item:hover {
    border-color: #3a5a7a;
}

.craft-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.craft-item-name {
    color: #b0d0f0;
    font-size: 18px;
    font-weight: bold;
}

.craft-item-time {
    color: #5fd4a0;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.craft-item-cost {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #7e9ac2;
    font-size: 13px;
    margin: 4px 0;
}

.craft-item-cost .cost-item {
    padding: 1px 0;
    font-family: 'Courier New', monospace;
}

.craft-item-cost .cost-item.missing {
    color: #d45a5a;
}

.craft-item-unlocks {
    color: #7e9ac2;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ---- ДЕЙСТВИЯ (СЧЁТЧИК + КНОПКА) ---- */
.craft-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-top: 2px;
}

/* ---- Бейдж в очереди (справа сверху) ---- */
.queue-badge-top {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d45a5a;
    color: #fff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 8px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #131a24;
    box-shadow: 0 0 12px rgba(212, 90, 90, 0.4);
    padding: 0 4px;
    z-index: 5;
}

/* ---- Ряд: счётчик + кнопка (впритык) ---- */
.action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.counter-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.counter-btn {
    background: #1f3048;
    border: 2px solid #2a3d56;
    color: #b8d6f5;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-btn:hover:not(:disabled) {
    background: #283954;
    border-color: #5f8fc7;
}

.counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.counter-display {
    color: #d4ecff;
    font-size: 14px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.craft-item-actions .card-btn {
    background: #1f3048;
    border: 2px solid #3f5a7a;
    color: #c4dfff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 9px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 4px;
}

.craft-item-actions .status-done {
    background: #1a3a2a;
    border: 2px solid #3a8f6a;
    color: #5fd4a0;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    padding: 8px 18px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-block;
    box-shadow: 0 0 16px rgba(60, 255, 120, 0.1);
}

.craft-item-actions .card-btn:hover:not(:disabled) {
    background: #2c4160;
    border-color: #6db3ff;
}

.craft-item-actions .card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.craft-item-actions .card-btn.ready {
    background: #1a5a2a;
    border-color: #3aaf6a;
    color: #7fffb0;
    box-shadow: 0 0 20px rgba(60, 255, 120, 0.15);
}

.craft-item-actions .card-btn.ready:hover:not(:disabled) {
    background: #2a7a3a;
    border-color: #5fdf8a;
    box-shadow: 0 0 30px rgba(60, 255, 120, 0.25);
}

.craft-item-actions .status-locked {
    background: #2a1a1a;
    border: 2px solid #5a2a2a;
    color: #d45a5a;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    padding: 8px 18px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0.8;
    display: inline-block;
}

.craft-item-requires {
    color: #f7d44a;
    font-size: 11px;
    margin-bottom: 2px;
    font-family: 'Courier New', monospace;
}

.craft-item-actions .status-queue {
    background: #1a2a3a;
    border: 2px solid #2a4a6a;
    color: #5f8fc7;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    padding: 8px 18px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-block;
}

/* ---- Квесты ---- */
.task-card {
    background: #121b28;
    border: 2px solid #25344a;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.task-card .task-info {
    flex: 1;
}

.task-card .task-name {
    color: #b0d0f0;
    font-size: 13px;
    font-weight: bold;
}

.task-card .task-progress {
    color: #7e9ac2;
    font-size: 11px;
}

.task-card .task-reward {
    font-size: 11px;
    display: flex;
    gap: 12px;
    margin-top: 2px;
}
.task-card .task-reward .coins {
    color: #f7d44a;
}
.task-card .task-reward .exp {
    color: #5fd4a0;
}
.task-card .task-reward .study {
    color: #b88aff;
}

.task-card .task-btn {
    background: #1f3048;
    border: 2px solid #3f5a7a;
    color: #c4dfff;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 9px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.1s;
    white-space: nowrap;
}
.task-card .task-btn:hover:not(:disabled) {
    background: #2c4160;
    border-color: #6db3ff;
}
.task-card .task-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.task-card .task-btn.done {
    background: #1a3a2a;
    border-color: #3a8f6a;
    color: #5fd4a0;
}
.task-card .task-btn.ready {
    background: #1a5a2a;
    border-color: #3aaf6a;
    color: #7fffb0;
    box-shadow: 0 0 20px rgba(60, 255, 120, 0.15);
}
.task-card .task-btn.ready:hover {
    background: #2a7a3a;
    border-color: #5fdf8a;
    box-shadow: 0 0 30px rgba(60, 255, 120, 0.25);
}

/* ---- СКЛАД ---- */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.inventory-card {
    background: #121b28;
    border: 2px solid #25344a;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    transition: 0.1s;
}
.inventory-card:hover {
    border-color: #5f8fc7;
    background: #182433;
}

.inventory-card .inv-sprite {
    font-size: 18px;
    color: #4b6382;
    font-family: 'Courier New', monospace;
    margin-bottom: 2px;
}
.inventory-card .inv-name {
    color: #aec6e8;
    font-size: 11px;
    font-weight: bold;
}
.inventory-card .inv-amount {
    color: #7e9ac2;
    font-size: 16px;
    font-weight: bold;
    margin-top: 2px;
}

.category {
    color: #b0d4ff;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    letter-spacing: 1px;
    margin: 10px 0 6px 0;
    border-bottom: 1px solid #1f3045;
    padding-bottom: 4px;
}

.category-badge.blue {
    background: #5f8fc7;
    color: #fff;
}

.category-tab:hover {
    background: #283954;
    border-color: #5f8fc7;
    color: #b8d6f5;
}

.category-tab.active {
    background: #1f3048;
    border-color: #6db3ff;
    color: #d4ecff;
    box-shadow: 0 0 16px rgba(60, 160, 255, 0.08);
}

/* ---- Бейджи на категориях (в модалках) ---- */
.category-tab {
    position: relative;
    background: #1b2638;
    border: 2px solid #2a3d56;
    color: #8aa9ce;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 11px;
    padding: 8px 16px;
    padding-top: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.1s;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-tab:hover {
    background: #283954;
    border-color: #5f8fc7;
    color: #b8d6f5;
}

.category-tab.active {
    background: #1f3048;
    border-color: #6db3ff;
    color: #d4ecff;
    box-shadow: 0 0 16px rgba(60, 160, 255, 0.08);
}

/* ---- Бейджик на категории (справа сверху) ---- */
.category-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 8px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #131a24;
    padding: 0 4px;
    line-height: 1;
}

.category-badge.gold {
    background: #f7d44a;
    color: #0b0e14;
}

.category-badge.purple {
    background: #b88aff;
    color: #0b0e14;
}