* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; max-width: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0f172a; color: #f8fafc; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }

/* TRAKA KATEGORIJA */
.nav-categories { 
    background: #1e293b; 
    border-bottom: 1px solid #334155; 
    width: 100%; 
    position: relative; 
    z-index: 90; 
}
.categories-wrapper { 
    max-width: 1240px; 
    margin: 0 auto; 
    padding: 10px 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 8px; 
    width: 100%;
    overflow: hidden;
}
.categories-visible-items {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
}
.cat-chip { 
    padding: 7px 16px; 
    background: #0f172a; 
    color: #cbd5e1; 
    border: 1px solid #334155; 
    border-radius: 20px; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 700; 
    white-space: nowrap; 
    transition: all 0.2s; 
    flex-shrink: 0;
    display: inline-block;
}
.cat-chip:hover { border-color: #f59e0b; color: #f59e0b; transform: translateY(-1px); }
.cat-chip.active { background: #f59e0b; color: #0f172a; border-color: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,0.35); }

.btn-all-cats { 
    background: #0f172a; 
    color: #f59e0b; 
    border: 1px solid #f59e0b; 
    cursor: pointer; 
    flex-shrink: 0;
    margin-left: auto;
}
.btn-all-cats:hover { background: #f59e0b; color: #0f172a; }

.portal-layout { max-width: 1240px; margin: 25px auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; width: 100%; }
.main-game-feed { min-width: 0; width: 100%; }

/* MODAL ZA SVE KATEGORIJE */
.cat-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); z-index: 99999; justify-content: center; align-items: center; }
.cat-modal-content { background: #1e293b; width: 90%; max-width: 700px; max-height: 80vh; border-radius: 16px; padding: 25px; display: flex; flex-direction: column; border: 1px solid #475569; box-shadow: 0 10px 30px rgba(0,0,0,0.5); color: #f8fafc; }
.cat-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #334155; padding-bottom: 10px; }
.cat-modal-body { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding-right: 5px; }
.cat-modal-item { padding: 10px 14px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; text-decoration: none; color: #cbd5e1; font-size: 13px; font-weight: 700; transition: 0.2s; }
.cat-modal-item:hover { background: #f59e0b; color: #0f172a; border-color: #f59e0b; }
.close-modal { background: none; border: none; font-size: 24px; cursor: pointer; color: #94a3b8; }

/* GRID IGRICA */
.games-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-bottom: 30px; width: 100%; }
.game-card { background: #1e293b; border: 1px solid #334155; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; min-width: 0; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); border-color: #f59e0b; }
.game-thumb-wrap { position: relative; width: 100%; height: 160px; background: #0f172a; overflow: hidden; }
.game-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.game-card:hover .game-thumb-img { transform: scale(1.06); }
.game-card-body { padding: 14px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; min-width: 0; }
.game-card-title { font-size: 15px; font-weight: 800; color: #f8fafc; text-decoration: none; line-height: 1.35; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.game-card-title:hover { color: #f59e0b; }
.game-card-desc { font-size: 12.5px; color: #94a3b8; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.game-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #64748b; margin-bottom: 12px; }
.btn-play-action { background: #f59e0b; color: #0f172a; padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 800; font-size: 13px; text-align: center; display: block; transition: background 0.2s; }
.btn-play-action:hover { background: #d97706; }

/* SINGLE PLAY BOX */
.single-game-box { background: #1e293b; border-radius: 16px; border: 1px solid #334155; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.4); min-width: 0; width: 100%; margin-bottom: 25px; }
.single-game-title { font-size: 24px; font-weight: 800; color: #f8fafc; margin-bottom: 8px; line-height: 1.3; word-break: break-word; }
.single-game-meta { font-size: 13px; color: #4ade80; font-weight: 700; margin-bottom: 18px; }
.game-iframe-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 480px; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid #334155; margin-bottom: 16px; }
.game-iframe-wrapper iframe { width: 100%; height: 100%; border: none; }
.btn-fullscreen { background: #334155; color: #f8fafc; padding: 10px 20px; border-radius: 8px; border: 1px solid #475569; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-fullscreen:hover { background: #f59e0b; color: #0f172a; border-color: #f59e0b; }

.single-desc-box { margin-top: 25px; padding-top: 20px; border-top: 1px solid #334155; font-size: 14.5px; color: #cbd5e1; line-height: 1.65; word-break: break-word; }
.single-desc-box h3 { font-size: 16px; color: #f59e0b; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; }

/* SOCIAL SHARE BUTTONS */
.social-share-strip { display: flex; align-items: center; gap: 8px; margin-top: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.share-label { font-size: 12.5px; font-weight: 700; color: #94a3b8; margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; text-decoration: none; font-size: 14px; font-weight: bold; transition: opacity 0.2s, transform 0.2s; }
.share-btn:hover { opacity: 0.85; transform: scale(1.08); }
.share-fb { background: #1877f2; }
.share-tw { background: #000000; }
.share-wa { background: #25d366; }
.share-vb { background: #7360f2; }
.share-tg { background: #24a1de; }

/* SIDEBAR */
.sidebar-wrapper { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; width: 100%; min-width: 0; }
.side-card { background: #1e293b; border: 1px solid #334155; border-radius: 16px; padding: 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); width: 100%; min-width: 0; }
.side-card-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #334155; display: flex; justify-content: space-between; align-items: center; }

/* DISCOVERY WIDGET ISPOD IGRICE */
.bottom-discovery-box { margin-top: 30px; padding: 20px; background: #1e293b; border: 1px solid #334155; border-radius: 14px; width: 100%; }
.discovery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; width: 100%; }
.discovery-card { background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; transition: transform 0.2s; min-width: 0; }
.discovery-card:hover { transform: translateY(-2px); border-color: #f59e0b; }

.pagination-box { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 30px 0; flex-wrap: wrap; }
.pagination-box a, .pagination-box span { padding: 8px 12px; background: #1e293b; border: 1px solid #334155; border-radius: 8px; color: #f59e0b; text-decoration: none; font-weight: 700; font-size: 13px; }
.pagination-box a.active, .pagination-box span.active { background: #f59e0b; color: #0f172a; border-color: #f59e0b; }
.pagination-box span.dots { background: transparent; border: none; color: #64748b; }

@keyframes blesak {
    0% { background-color: #1e293b; }
    50% { background-color: #334155; border-color: #f59e0b; }
    100% { background-color: #1e293b; }
}
.prevedeno-efekat { animation: blesak 0.8s ease; }

@media (max-width: 1024px) {
    .portal-layout { grid-template-columns: 1fr; }
    .sidebar-wrapper { position: static; }
}

@media (max-width: 768px) {
    .portal-layout { padding: 0 10px; margin: 15px auto; gap: 20px; }
    .categories-wrapper { padding: 10px 10px; gap: 6px; }
    
    .games-grid-cards { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
    .game-thumb-wrap { height: 120px !important; }
    .game-card-body { padding: 10px !important; }
    .game-card-title { font-size: 13px !important; }
    .game-card-desc { display: none !important; }
    
    .game-iframe-wrapper { min-height: 260px !important; }
    .single-game-box { padding: 16px !important; }
    .single-game-title { font-size: 20px !important; }
    
    .discovery-grid { display: flex !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none !important; padding-bottom: 6px !important; gap: 10px !important; }
    .discovery-grid::-webkit-scrollbar { display: none !important; }
    .discovery-card { flex: 0 0 190px !important; width: 190px !important; min-width: 190px !important; }
}

/* ATRIBUCIJA I PRAVNI DISCLAIMER ISPOD IGRICE */
.game-source-attribution-bar {
    font-size: 11.5px;
    color: #94a3b8;
    background: #0f172a;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px !important; /* Čist razmak ispod igrice, bez preklapanja */
    margin-bottom: 16px !important;
}

.game-source-attribution-bar .disclaimer-tag {
    color: #cbd5e1;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}