/* css/style.css - MCGG BUILDER FULL VERSION - ALL IN ONE (CLEAN) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0e1a;
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

/* ==================== HEADER ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1a1f2f;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #2a3040;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    color: #ffd700;
    font-size: 22px;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
}

.version {
    background: #2a3040;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    color: #8e9cb5;
}

.share-btn button {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
    transition: all 0.3s;
}

.share-btn button:hover {
    background: #5f8ac7;
    transform: translateY(-2px);
}

/* ==================== LAYOUT SEDERHANA ==================== */
.container-simple {
    max-width: 100%;
    margin: 0;
    padding: 0 0.5cm;
}

.layout-simple {
    display: grid;
    grid-template-columns: 200px 1fr 400px; /* KIRI 200px, TENGAH FLEX, KANAN 400px */
    gap: 15px;
    min-height: calc(100vh - 100px);
}

/* ==================== LEFT PANEL ==================== */
.left-panel {
    background: #1a1f2f;
    border-radius: 10px;
    border: 1px solid #2a3040;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Tabs */
.panel-tabs {
    display: flex;
    background: #0f1322;
    border-bottom: 1px solid #2a3040;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-tabs .tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #8e9cb5;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.panel-tabs .tab-btn.active {
    color: #ffd700;
    border-bottom: 2px solid #ffd700;
    background: #1a1f2f;
}

/* Hero & Item Pools */
.hero-pool, .item-pool {
    padding: 12px;
}

/* Pool Header dengan Filter Icon */
.pool-header {
    margin-bottom: 12px;
    width: 100%;
}

.pool-header > div {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.pool-header h3 {
    color: #ffd700;
    font-size: 16px;
    margin: 0;
}

.pool-count {
    background: #2a3349;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    color: #8e9cb5;
}

/* Filter Icon */
.filter-icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    color: #8e9cb5;
    transition: all 0.2s;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-icon-btn:hover {
    background: #2a3349;
    color: #ffd700;
    transform: scale(1.1);
}

/* Filter Panel */
.hero-pool .filter-panel {
    background: #0f1322;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0 15px 0;
    border: 1px solid #2a3040;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.filter-header span {
    color: #ffd700;
    font-size: 13px;
    font-weight: bold;
}

.filter-section {
    margin-bottom: 15px;
}

.filter-label {
    color: #8e9cb5;
    font-size: 11px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Filter Chips */
.filter-chip {
    background: #1a1f2f;
    border: 1px solid #2a3040;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    color: #8e9cb5;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.filter-chip:hover {
    border-color: #ffd700;
    color: #ffd700;
    background: #252b3d;
}

.filter-chip.active {
    background: #ffd700;
    border-color: #ffd700;
    color: #1a1f2f;
    font-weight: bold;
}

/* ==================== HERO GRID 2 KOLOM DENGAN GAMBAR ==================== */
.hero-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 513px; /* BATAS MAKSIMAL HEIGHT */
    overflow-y: auto; /* BISA DI-SCROLL KALAU KELEBIHAN */
    overflow-x: hidden;
    padding-right: 5px; /* KASI RUANG BUAT SCROLLBAR */
    width: 100%;
    justify-content: space-between;
}

.hero-grid-2col .hero-card {
    display: flex;
    align-items: center;
	justify-content: center;
    gap: 8px;
    padding: 6px;
    background: #252b3d;
    border: 1px solid #353e54;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
}

.hero-grid-2col .hero-card:hover {
    border-color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.hero-grid-2col .hero-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Wrapper gambar bulat dengan border sesuai harga */
.hero-image-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1f2f;
    border: 2px solid;
    flex-shrink: 0;
}

.hero-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info hero di list */
.hero-list-info {
    flex: 1;
    min-width: 0;
}

.hero-list-info .hero-name {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-list-info .hero-sinergy {
    font-size: 8px;
    color: #8e9cb5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0;
}

.hero-list-info .hero-price {
    font-size: 10px;
    font-weight: bold;
}

/* ==================== PRICE COLORS ==================== */
.cost-1, .cost-border-1 { 
    color: #ffffff; 
    border-color: #ffffff;
}

.cost-2, .cost-border-2 { 
    color: #90EE90; 
    border-color: #90EE90;
}

.cost-3, .cost-border-3 { 
    color: #6CB4EE; 
    border-color: #6CB4EE;
}

.cost-4, .cost-border-4 { 
    color: #C77DFF; 
    border-color: #C77DFF;
}

.cost-5, .cost-border-5 { 
    color: #FFB347; 
    border-color: #FFB347;
}

/* Efek hover untuk price */
.hero-card:hover .hero-price {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* ==================== ITEMS GRID 2 KOLOM DENGAN GAMBAR ==================== */
.items-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 513px; /* BATAS MAKSIMAL HEIGHT */
    overflow-y: auto; /* BISA DI-SCROLL KALAU KELEBIHAN */
    overflow-x: hidden;
    padding-right: 5px; /* KASI RUANG BUAT SCROLLBAR */
}

.items-grid-2col .item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #252b3d;
    border: 1px solid #353e54;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
}

.items-grid-2col .item-card:hover {
    border-color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.items-grid-2col .item-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Wrapper gambar item dengan border kuning keemasan */
.item-image-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1f2f;
    border: 2px solid;
    flex-shrink: 0;
}

.item-border-gold {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    animation: itemGlow 2s infinite;
}

.item-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-list-name {
    font-size: 10px;
    color: #8e9cb5;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

@keyframes itemGlow {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
}

/* ==================== RIGHT PANEL ==================== */
.right-panel {
    background: #1a1f2f;
    border-radius: 10px;
    border: 1px solid #2a3040;
    padding: 15px;
    min-height: 620px; /* DIPERPANJANG */
    height: fit-content;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.right-panel h3 {
    color: #ffd700;
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid #2a3040;
    padding-bottom: 5px;
}

/* ==================== MIDDLE PANEL ==================== */
.middle-panel {
    background: transparent;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Board Container */
.board-container {
    background: #1a1f2f;
    border-radius: 10px;
    padding: 1px;
    border: 1px solid #2a3040;
    width: 100%;
}

.board-container h2 {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 12px;
    border-bottom: 1px solid #2a3040;
    padding-bottom: 5px;
}

.badge {
    background: #2a3040;
    color: #8e9cb5;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

/* Blessing Info */
.blessing-info {
    background: #0f1322;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.blessing-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blessing-display span:first-child {
    color: #8e9cb5;
    font-size: 14px;
}

.blessing-display span:last-child {
    background: #1a1f2f;
    padding: 3px 12px;
    border-radius: 12px;
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
    min-width: 35px;
    text-align: center;
}

/* Board Grid */
.board-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    background: #0f1322;
    padding: 12px;
    border-radius: 6px;
}

.board-cell {
    aspect-ratio: 1/1;
    background: #1e2538;
    border: 1px solid #2f3850;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.board-cell:hover {
    border-color: #ffd700;
    background: #252e45;
}

.board-cell.has-hero {
    background: #2a3349;
}

.board-cell[draggable="true"] {
    cursor: grab;
}

.board-cell[draggable="true"]:active {
    cursor: grabbing;
}

.cell-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
}

/* ==================== BOARD HERO DENGAN GAMBAR BULAT ==================== */
.board-hero-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.board-hero-container {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1f2f;
    border: 3px solid;
    box-sizing: border-box;
    z-index: 2;
}

.board-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
	border-radius: 50%;
}

/* Fallback jika gambar tidak ada */
.board-hero-container.no-image {
    background: #2a3349;
}

.board-hero-container.no-image::after {
    content: attr(data-initial);
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-transform: uppercase;
}

/* ===== BINTANG DI ATAS GAMBAR ===== */
.board-hero-stars {
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffd700;
    font-size: 18px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
    letter-spacing: 3px;
    z-index: 50;
    pointer-events: none;
    font-weight: bold;
    line-height: 1;
}

/* Efek khusus untuk star level 3 */
.board-hero-stars[data-stars="3"] {
    font-size: 20px;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffaa00;
    animation: starPulse 2s infinite;
    top: -17px;
}

@keyframes starPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* ===== BLESSING ICON DI TENGAH HERO ===== */
.board-bless-icon-center {
    position: absolute;
    top: 50%;
    left: 90%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    filter: drop-shadow(0 0 15px gold);
    z-index: 45;
    color: #ffd700;
    text-shadow: 0 0 15px #ffaa00, 0 0 30px #ffd700;
    animation: blessPulse 2s infinite;
    background: transparent;
    line-height: 1;
    pointer-events: none;
    opacity: 0.95;
}

@keyframes blessPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 20px gold) drop-shadow(0 0 40px #ffaa00);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
}

/* Sembunyikan blessing icon yang lama */
.board-bless-icon {
    display: none;
}

/* ==================== ITEMS DI BOARD - POSISI DI BAWAH TENGAH ==================== */
.board-items-container {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: auto;
    height: auto;
    z-index: 20;
    pointer-events: none;
}

.board-item-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(10, 14, 26, 0.85);
    border: 1.5px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    pointer-events: auto;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
}

.board-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-item-icon:hover {
    transform: scale(1.2);
    z-index: 25;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
}

/* Efek hover */
.board-cell:hover .board-hero-container {
    transform: scale(1.05);
    transition: transform 0.2s ease;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Efek untuk hero yang di-bless */
.board-hero-container.blessed {
    box-shadow: 0 0 15px gold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 10px gold; }
    50% { box-shadow: 0 0 20px gold; }
    100% { box-shadow: 0 0 10px gold; }
}

/* Efek saat hero di-drag */
.board-cell.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.2s ease;
}

.board-cell.dragging .board-hero-container {
    filter: brightness(0.8);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* Remove Hero Button */
.remove-hero-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}

.remove-hero-btn:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.board-cell.has-hero .remove-hero-btn {
    display: flex;
}

/* ==================== TRAITS LIST VERTICAL - DIUBAH JADI 2 KOLOM ==================== */
.traits-list-vertical {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 KOLOM */
    gap: 8px;
    max-height: 540px; /* BATAS MAKSIMAL HEIGHT */
    overflow-y: auto; /* BISA DI-SCROLL KALAU KELEBIHAN */
    overflow-x: hidden; /* SEMBUNYIKAN SCROLL HORIZONTAL */
    position: relative;
    padding-right: 5px; /* KASI RUANG BUAT SCROLLBAR */
    padding-bottom: 10px;
}

.traits-list-vertical .trait-badge {
    background: #0f1322;
    border: 1px solid #2a3040;
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    transition: all 0.2s;
}

.traits-list-vertical .trait-badge.active {
    border-color: #ffd700;
    background: #1a2538;
}

.traits-list-vertical .trait-name {
    font-weight: bold;
    color: #8e9cb5;
    font-size: 13px;
}

.traits-list-vertical .trait-badge.active .trait-name {
    color: #ffd700;
}

.traits-list-vertical .trait-count {
    background: #1a1f2f;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 12px;
    color: #8e9cb5;
    min-width: 30px;
    text-align: center;
}

.traits-list-vertical .trait-badge.active .trait-count {
    background: #ffd700;
    color: #1a1f2f;
    font-weight: bold;
}

.empty-trait {
    color: #4a5268;
    font-style: italic;
    font-size: 11px;
    text-align: center;
    padding: 15px 0;
    grid-column: span 2; /* MEMANJANG 2 KOLOM */
}

/* ==================== TRAIT WRAPPER & BLESSING ==================== */
.trait-wrapper {
    position: relative;
    display: block;
    margin-bottom: 0; /* HAPUS MARGIN BAWAH */
    width: 100%;
}

.bless-star-outside {
    position: absolute;
    top: -12px;
    right: -12px;
    color: #ffd700;
    font-size: 22px;
    filter: drop-shadow(0 0 5px #ffd700);
    animation: floatStar 2s ease-in-out infinite;
    z-index: 5;
    background: transparent;
    line-height: 1;
}

@keyframes floatStar {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.trait-wrapper:hover .bless-star-outside {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px #ffd700);
}

/* ==================== HERO DETAILS POPUP SEDERHANA ==================== */
.hero-details-popup {
    position: absolute;
    width: 280px;
    background: #1a1f2f;
    border: 2px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 10000;
    animation: popupSlide 0.2s ease;
    overflow: hidden;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.detail-content {
    padding: 15px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}

.detail-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid;
    flex-shrink: 0;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title {
    flex: 1;
}

.detail-title h2 {
    color: #ffd700;
    font-size: 16px;
    margin-bottom: 5px;
}

.detail-price {
    font-size: 14px;
    font-weight: bold;
}

.detail-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.detail-close:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.detail-synergy-section h3 {
    color: #ffd700;
    font-size: 13px;
    margin-bottom: 8px;
    border-bottom: 1px solid #2a3040;
    padding-bottom: 4px;
}

.detail-synergies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.detail-synergy-item {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffd700;
    background: #0f1322;
    transition: all 0.2s;
}

.detail-synergy-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.detail-synergy-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-description {
    background: #0f1322;
    border-radius: 6px;
    padding: 10px;
    color: #8e9cb5;
    font-size: 12px;
    line-height: 1.5;
    border-left: 3px solid #ffd700;
}

.detail-description p {
    margin: 0;
}

.no-data {
    color: #4a5268;
    font-style: italic;
    font-size: 11px;
    padding: 5px 0;
}

/* ==================== HERO POPUP ==================== */
.hero-popup {
    background: #1a1f2f;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 15px;
    width: 300px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    color: white;
    position: absolute;
    z-index: 1000;
    animation: popupFade 0.2s ease;
    font-size: 13px;
    overflow: visible !important;
}

@keyframes popupFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.right-panel {
    position: relative;
    overflow: visible;
}

.hero-popup .hero-name {
    font-size: 16px;
    color: #ffd700;
}

.hero-popup .star-rating {
    font-size: 18px;
    margin-top: 2px;
}

/* Item Slot di Popup */
.popup-item-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1322;
    border: 1px dashed #2f3850;
    transition: all 0.2s;
    margin: 5px;
}

.popup-item-slot:hover {
    border-color: #ffd700;
    transform: scale(1.05);
}

.popup-item-slot.empty {
    border: 1px dashed #2f3850;
    color: #4a5268;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}

.popup-item-slot.empty .empty-text {
    font-size: 6px;
    margin-top: 2px;
}

.popup-item-image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffd700;
    box-sizing: border-box;
}

.popup-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-item-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.popup-item-remove:hover {
    background: #ff6666;
    transform: scale(1.15);
}

.hero-popup input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ffd700;
}

/* ==================== DRAG PREVIEW ==================== */
.drag-preview-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1f2f;
    margin: 0 auto 5px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.drag-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drag-preview-name {
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 5px black;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 5px;
    border-radius: 10px;
    display: inline-block;
}

/* ==================== SCROLLBAR ==================== */
.hero-grid-2col::-webkit-scrollbar
.items-grid-2col::-webkit-scrollbar,
.traits-list-vertical::-webkit-scrollbar {
    width: 4px;
}

.hero-grid-2col::-webkit-scrollbar-track,
.items-grid-2col::-webkit-scrollbar-track,
.traits-list-vertical::-webkit-scrollbar-track {
    background: #0f1322;
	 border-radius: 4px;
}

.hero-grid-2col::-webkit-scrollbar-thumb,
.items-grid-2col::-webkit-scrollbar-thumb,
.traits-list-vertical::-webkit-scrollbar-thumb {
    background: #2f3850;
    border-radius: 4px;
}

.traits-list-vertical::-webkit-scrollbar-thumb:hover {
    background: #ffaa00;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0f1322;
}

::-webkit-scrollbar-thumb {
    background: #2f3850;
    border-radius: 3px;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 15px;
    color: #4a5268;
    font-size: 13px;
    border-top: 1px solid #2a3040;
    margin-top: 15px;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.debug-outline { outline: 1px solid red; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .layout-simple { 
        grid-template-columns: 200px 1fr 350px; /* KANAN DIKECILIN */
    }
    .hero-popup { width: 280px; }
}

@media (max-width: 1000px) {
    .layout-simple { 
        grid-template-columns: 1fr; /* STACK VERTICAL */
    }
    .left-panel, .middle-panel, .right-panel { 
        width: 100%; 
    }
    .hero-popup { width: 260px; }
    .traits-list-vertical {
        grid-template-columns: 1fr; /* JADI 1 KOLOM KALAU LAYAR KECIL */
    }
    .empty-trait {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .header { flex-direction: column; gap: 10px; text-align: center; }
    .logo { justify-content: center; }
    .hero-grid-2col { grid-template-columns: repeat(2, 1fr); }
    .items-grid-2col { grid-template-columns: repeat(2, 1fr); }
    .hero-popup { width: 240px; }
    .board-bless-icon-center { font-size: 24px; }
    .board-item-icon { width: 22px; height: 22px; }
}

/* ===== BLESSING ICON DENGAN PNG ===== */
.board-bless-icon-png {
    position: absolute;
    top: 50%;
    left: 95%;
    transform: translate(-50%, -50%);
    width: 30px; /* Sedikit lebih besar */
    height: 40px;
    z-index: 45;
    pointer-events: none;
    background: url('../images/blessing/bless.png') no-repeat center;
    background-size: contain;
    animation: blessFloat 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

/* Animasi lebih halus */
@keyframes blessFloat {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(-50%, -60%) scale(1.1) rotate(5deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
    }
    75% {
        transform: translate(-50%, -40%) scale(1.1) rotate(-5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

/* Hover effect biar lebih interaktif */
.board-cell:hover .board-bless-icon-png {
    animation: blessPulse 1s infinite;
    filter: drop-shadow(0 0 20px gold);
}

@keyframes blessPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Nama synergy di header */
.trait-name-display {
    font-size: 13px;
    font-weight: bold;
    color: #ffd700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.trait-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .trait-name-display {
        font-size: 11px;
        max-width: 80px;
    }
}

/* ==================== SYNERGIES DENGAN GAMBAR DAN PROGRESS BAR ==================== */
.trait-wrapper {
    margin-bottom: 12px;
    width: 100%;
}

.trait-wrapper.blessed {
    position: relative;
}

.trait-wrapper.blessed::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: url('../images/bless-icon.png') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 5px gold);
    z-index: 5;
}

.trait-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f1322;
    border: 1px solid #2a3040;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s;
}

.trait-item:hover {
    border-color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.trait-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1f2f;
    border: 2px solid #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trait-info {
    flex: 1;
    min-width: 0;
}

.trait-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.trait-count-text {
    font-size: 14px;
    font-weight: bold;
    color: #ffd700;
}

.trait-bless-star {
    font-size: 16px;
    color: #ffd700;
    filter: drop-shadow(0 0 5px gold);
    animation: starTwinkle 1.5s infinite;
}

@keyframes starTwinkle {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #1a1f2f;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid #2a3040;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Threshold dots */
.trait-thresholds {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    font-size: 9px;
}

.threshold-dot {
    display: inline-block;
    width: 22px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #1a1f2f;
    border: 1px solid #2a3040;
    border-radius: 10px;
    color: #8e9cb5;
    font-size: 8px;
}

.threshold-dot.reached {
    background: #ffd700;
    border-color: #ffd700;
    color: #1a1f2f;
    font-weight: bold;
}

/* Empty state */
.empty-trait {
    color: #4a5268;
    font-style: italic;
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .trait-icon {
        width: 35px;
        height: 35px;
    }
    
    .trait-count-text {
        font-size: 13px;
    }
    
    .threshold-dot {
        width: 20px;
        height: 14px;
        line-height: 14px;
        font-size: 7px;
    }
}

/* ==================== FILTER SYNERGY DENGAN GAMBAR ==================== */
.synergy-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 5px;
}

/* ==================== FILTER SYNERGY DENGAN GAMBAR - BULAT ==================== */
.synergy-image-chip {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0;
    border-radius: 50%;
    background: #1a1f2f;
    border: 2px solid #2a3040;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    aspect-ratio: 1/1;
    flex-shrink: 0;
    box-sizing: border-box;
}

.synergy-image-chip.active {
    border-color: #ffd700;
    box-shadow: 0 0 15px #ffd700;
}

.synergy-image-chip:hover {
    transform: scale(1.1);
    border-color: #ffd700;
}

.filter-synergy-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Tooltip untuk nama synergy */
.synergy-image-chip {
    position: relative;
}

.synergy-image-chip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1f2f;
    color: #ffd700;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid #ffd700;
    z-index: 10;
    pointer-events: none;
}

/* ALL Faction & Role - HANYA BORDER KUNING, BACKGROUND TETAP GELAP */
.synergy-image-chip[data-faction="all"].active,
.synergy-image-chip[data-role="all"].active {
    background: #1a1f2f !important;  /* BACKGROUND TETAP GELAP */
    border-color: #ffd700 !important; /* BORDER KUNING */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3) !important;
}

/* Tulisan ALL tetap warna abu-abu */
.synergy-image-chip[data-faction="all"].active span,
.synergy-image-chip[data-role="all"].active span {
    color: #8e9cb5 !important; /* ABU-ABU */
}

/* Responsive */
@media (max-width: 768px) {
    .synergy-image-chip {
        width: 35px;
        height: 35px;
    }
}

/* ==================== ITEM DETAILS POPUP ==================== */
.item-details-popup {
    position: absolute;
    width: 250px;
    background: #1a1f2f;
    border: 2px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 10000;
    animation: popupSlide 0.2s ease;
    overflow: hidden;
}

.item-detail-content {
    padding: 15px;
}

.item-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}

.item-detail-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffd700;
    flex-shrink: 0;
    background: #0f1322;
}

.item-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-detail-title {
    flex: 1;
}

.item-detail-title h2 {
    color: #ffd700;
    font-size: 16px;
    margin: 0;
    word-break: break-word;
}

.item-detail-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-detail-close:hover {
    background: #ff6666;
    transform: scale(1.1);
}

.item-detail-description {
    background: #0f1322;
    border-radius: 6px;
    padding: 12px;
    color: #8e9cb5;
    font-size: 12px;
    line-height: 1.5;
    border-left: 3px solid #ffd700;
}

.item-detail-description p {
    margin: 0;
}

/* ==================== BOARD FILTER PANEL - HORIZONTAL 2 BARIS ==================== */
.board-filter-panel {
    background: #1a1f2f;
    border-radius: 10px;
    border: 1px solid #2a3040;
    padding: 13px;
    margin-top: 15px;
    width: 100%;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row .filter-label {
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    min-width: 60px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

/* Synergy image grid horizontal */
.synergy-image-grid-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
	align-items: center;
}

/* Sesuaikan ukuran chip synergy */
.synergy-image-chip {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #1a1f2f;
    border: 2px solid #2a3040;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1200px) {
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-row .filter-label {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .synergy-image-chip {
        width: 35px;
        height: 35px;
    }
}

/* ==================== MOBILE LANDSCAPE OPTIMIZATION - FIXED ==================== */
@media (orientation: landscape) and (max-width: 1024px) {
    /* RESET TOTAL */
    html, body {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .container-simple {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        padding: 2px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    /* HEADER SUPER KECIL */
    .header {
        padding: 2px 5px !important;
        margin-bottom: 2px !important;
        min-height: 30px !important;
    }
    
    .logo h1 {
        font-size: 12px !important;
    }
    
    .version {
        font-size: 8px !important;
        padding: 1px 3px !important;
    }
    
    .share-btn button {
        padding: 2px 4px !important;
        font-size: 8px !important;
        margin-left: 2px !important;
    }
    
    /* LAYOUT 3 KOLOM PAKAI FLEX */
    .layout-simple {
        display: flex !important;
        flex: 1 !important;
        min-height: 0 !important;
        gap: 2px !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* LEFT PANEL - HEROES (15%) */
    .left-panel {
        width: 15% !important;
        min-width: 120px !important;
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        background: #1a1f2f;
        border-radius: 3px;
        padding: 2px !important;
    }
    
    .panel-tabs {
        display: flex !important;
        margin-bottom: 2px !important;
    }
    
    .panel-tabs .tab-btn {
        padding: 2px 0 !important;
        font-size: 8px !important;
        flex: 1;
    }
    
    .hero-pool, .item-pool {
        padding: 0 !important;
        flex: 1 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .pool-header h3 {
        font-size: 9px !important;
        margin: 0 !important;
    }
    
    .pool-count {
        font-size: 7px !important;
        padding: 1px 3px !important;
    }
    
    /* Hero grid 2 kolom */
    .hero-grid-2col {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1px !important;
        overflow-y: auto !important;
        max-height: 100% !important;
        padding: 1px !important;
    }
    
    .hero-card {
        padding: 1px !important;
        aspect-ratio: 1/1 !important;
    }
    
    .hero-image-wrapper {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* MIDDLE PANEL - BOARD (70%) */
    .middle-panel {
        width: 70% !important;
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
    }
    
    .board-container {
        padding: 2px !important;
        flex: 0 0 auto !important;
    }
    
    .blessing-info {
        padding: 1px 3px !important;
        margin-bottom: 1px !important;
    }
    
    .blessing-display span {
        font-size: 7px !important;
    }
    
    .board-grid {
        gap: 1px !important;
        padding: 1px !important;
    }
    
    .board-cell {
        border-radius: 1px !important;
    }
    
    /* Board hero di dalam cell */
    .board-hero-container {
        width: 90% !important;
        height: 90% !important;
        border-width: 1px !important;
    }
    
    .board-hero-stars {
        font-size: 5px !important;
        top: -3px !important;
    }
    
    .board-item-icon {
        width: 6px !important;
        height: 6px !important;
    }
    
    /* Filter panel di bawah board */
    .board-filter-panel {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 1px !important;
        margin-top: 1px !important;
    }
    
    .filter-row {
        margin-bottom: 1px !important;
    }
    
    .filter-chip {
        padding: 1px 2px !important;
        font-size: 6px !important;
        min-width: 15px !important;
        border-radius: 8px !important;
    }
    
    .synergy-image-chip {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
    }
    
    /* RIGHT PANEL - SYNERGIES (15%) */
    .right-panel {
        width: 15% !important;
        min-width: 100px !important;
        height: 100% !important;
        overflow: hidden !important;
        background: #1a1f2f;
        border-radius: 3px;
        padding: 2px !important;
    }
    
    .synergies-container {
        padding: 2px !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    .synergies-container h3 {
        font-size: 9px !important;
        margin-bottom: 2px !important;
        padding-bottom: 1px !important;
    }
    
    .traits-list-vertical {
        flex: 1 !important;
        overflow-y: auto !important;
        gap: 1px !important;
    }
    
    .trait-badge {
        padding: 1px 2px !important;
        font-size: 5px !important;
    }
    
    .trait-name {
        font-size: 5px !important;
    }
    
    .trait-count {
        font-size: 4px !important;
        padding: 0px 2px !important;
    }
    
    .trait-icon {
        width: 14px !important;
        height: 14px !important;
    }
    
    .trait-count-text {
        font-size: 5px !important;
    }
    
    .progress-bar-container {
        height: 2px !important;
        margin-bottom: 1px !important;
    }
    
    .threshold-dot {
        width: 8px !important;
        height: 6px !important;
        line-height: 6px !important;
        font-size: 4px !important;
    }
    
    /* FOOTER */
    .footer {
        padding: 1px !important;
        font-size: 6px !important;
        margin-top: 1px !important;
        height: 15px !important;
    }
}

/* ==================== ROTATE MESSAGE ==================== */
.rotate-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;
    z-index: 999999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.rotate-message .icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: rotatePhone 2s infinite;
}

.rotate-message h2 {
    color: #ffd700;
    font-size: 24px;
    margin-bottom: 10px;
}

.rotate-message p {
    color: #8e9cb5;
    font-size: 16px;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(90deg); }
    75% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}