/* BALI RUST — общий стиль сайта и админ-панели. Тёмная тема, красные акценты. */

:root{
  --bg: #08080b;
  --bg-soft: #0d0d12;
  --panel: #121218;
  --panel-2: #16161d;
  --border: #241a1e;
  --border-soft: #1c1c24;
  --red: #e13a4b;
  --red-dark: #b8202f;
  --red-glow: rgba(225, 58, 75, .35);
  --text: #f2f0f2;
  --text-dim: #9a97a3;
  --text-dimmer: #6b6874;
  --green: #37c871;
  --yellow: #e0b23c;
  --radius: 14px;
  --radius-sm: 9px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background: radial-gradient(1200px 600px at 50% -10%, rgba(225,58,75,.08), transparent), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a{color: inherit; text-decoration: none;}
img{max-width:100%;}
h1,h2,h3,h4{margin:0; font-weight:800; letter-spacing:.2px;}
p{margin:0;}
::placeholder{color: var(--text-dimmer);}

/* ---------- layout shell (admin) ---------- */
.shell{display:flex; min-height:100vh;}
.sidebar{
  width:270px; flex-shrink:0; background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px; display:flex; flex-direction:column;
  position: sticky; top:0; height:100vh; overflow-y:auto;
}
.brand{display:flex; align-items:center; gap:12px; padding: 6px 8px 22px 8px;}
.brand-badge{
  width:42px;height:42px;border-radius:12px; flex-shrink:0;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  display:flex;align-items:center;justify-content:center;
  box-shadow: 0 0 22px var(--red-glow);
  font-weight:900; font-size:17px; color:#fff;
}
.brand-title{font-size:15px; font-weight:800; line-height:1.2;}
.brand-sub{font-size:11px; color: var(--red); font-weight:700; letter-spacing:.06em;}

.nav{display:flex; flex-direction:column; gap:2px; flex:1; margin-top:6px;}
.nav a{
  display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:10px;
  color: var(--text-dim); font-size:12.5px; font-weight:700; letter-spacing:.02em; text-transform:uppercase;
}
.nav a:hover{background: var(--panel); color: var(--text);}
.nav a.active{
  background: linear-gradient(90deg, rgba(225,58,75,.18), rgba(225,58,75,.03));
  color:#fff; box-shadow: inset 3px 0 0 var(--red);
}
.nav-icon{width:16px; text-align:center; opacity:.9; font-size:14px;}

.sidebar-foot{padding-top:14px; margin-top:10px; border-top:1px solid var(--border-soft);}
.back-link{display:flex; align-items:center; gap:8px; padding:11px 12px; border-radius:10px; color:var(--text-dim); font-weight:700; font-size:12.5px;}
.back-link:hover{background:var(--panel); color:#fff;}

.main{flex:1; padding: 28px 32px; max-width: 1500px;}
.pagehead{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap;}
.pagehead h1{font-size:20px;}
.pagehead .hint{color:var(--text-dim); font-size:12.5px; margin-top:4px;}

/* ---------- components ---------- */
.card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; flex-wrap:wrap;}
.card-title{font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; display:flex; align-items:center; gap:8px;}
.card-title .dot{width:7px;height:7px;border-radius:50%; background:var(--red); box-shadow:0 0 8px var(--red-glow);}
.card-sub{color:var(--text-dim); font-size:12px; margin-top:3px;}

.grid{display:grid; gap:16px;}
.grid-3{grid-template-columns: repeat(3, 1fr);}
.grid-4{grid-template-columns: repeat(4, 1fr);}
.grid-2{grid-template-columns: repeat(2, 1fr);}
@media (max-width: 1100px){ .grid-3,.grid-4{grid-template-columns: repeat(2,1fr);} }
@media (max-width: 680px){ .grid-3,.grid-4,.grid-2{grid-template-columns: 1fr;} .sidebar{display:none;} .main{padding:18px;} }

.btn{
  border:0; cursor:pointer; border-radius:10px; padding:10px 16px; font-weight:800; font-size:12.5px;
  letter-spacing:.03em; text-transform:uppercase; display:inline-flex; align-items:center; gap:8px;
  transition: transform .05s ease, opacity .15s ease;
}
.btn:active{transform: scale(.97);}
.btn-primary{background: linear-gradient(135deg, var(--red), var(--red-dark)); color:#fff; box-shadow:0 6px 18px -6px var(--red-glow);}
.btn-primary:hover{opacity:.92;}
.btn-ghost{background: var(--panel-2); color:var(--text); border:1px solid var(--border-soft);}
.btn-ghost:hover{background:#1d1d26;}
.btn-icon{padding:8px 10px; border-radius:8px;}
.btn-success{background: rgba(55,200,113,.15); color:var(--green); border:1px solid rgba(55,200,113,.3);}
.btn-danger{background: rgba(225,58,75,.15); color:var(--red); border:1px solid rgba(225,58,75,.3);}
.btn-sm{padding:7px 10px; font-size:11px;}
.btn[disabled]{opacity:.5; cursor:not-allowed;}

.badge{display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:999px; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;}
.badge-success{background:rgba(55,200,113,.14); color:var(--green); border:1px solid rgba(55,200,113,.28);}
.badge-danger{background:rgba(225,58,75,.14); color:var(--red); border:1px solid rgba(225,58,75,.28);}
.badge-warn{background:rgba(224,178,60,.14); color:var(--yellow); border:1px solid rgba(224,178,60,.28);}
.badge-muted{background:var(--panel-2); color:var(--text-dim); border:1px solid var(--border-soft);}

label{display:block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dim); margin-bottom:7px;}
.field{margin-bottom:16px;}
input[type=text],input[type=number],input[type=email],input[type=password],input[type=datetime-local],input[type=date],input[type=url],select,textarea{
  width:100%; background: var(--bg-soft); border:1px solid var(--border-soft); color:var(--text);
  padding:11px 12px; border-radius:10px; font-size:13px; font-family:inherit;
}
input:focus,select:focus,textarea:focus{outline:none; border-color: var(--red); box-shadow:0 0 0 3px var(--red-glow);}
textarea{resize:vertical; min-height:80px;}
.checkbox-row{display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--text-dim); font-weight:700;}

.toggle{position:relative; width:46px; height:26px; display:inline-block; flex-shrink:0;}
.toggle input{opacity:0; width:0; height:0;}
.toggle .track{position:absolute; inset:0; background: var(--panel-2); border:1px solid var(--border-soft); border-radius:999px; transition:.15s;}
.toggle .thumb{position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:var(--text-dimmer); transition:.15s;}
.toggle input:checked + .track{background: rgba(225,58,75,.25); border-color: var(--red);}
.toggle input:checked + .track .thumb{transform: translateX(20px); background: var(--red);}

table{width:100%; border-collapse:collapse;}
th{text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dimmer); padding:10px 12px; border-bottom:1px solid var(--border-soft);}
td{padding:12px; border-bottom:1px solid var(--border-soft); font-size:13px; vertical-align:middle;}
tr:last-child td{border-bottom:none;}
tr:hover td{background: rgba(255,255,255,.015);}

.item-row{display:flex; align-items:center; gap:12px;}
.item-thumb{width:42px;height:42px;border-radius:10px; background:var(--bg-soft); border:1px solid var(--border-soft); display:flex;align-items:center;justify-content:center; font-size:18px; flex-shrink:0; overflow:hidden;}
.item-thumb img{width:100%;height:100%;object-fit:cover;}
.muted{color:var(--text-dim);}
.dimmer{color:var(--text-dimmer);}
.price{color:var(--red); font-weight:800;}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px;}

.searchbar{display:flex; align-items:center; gap:8px; background:var(--bg-soft); border:1px solid var(--border-soft); border-radius:10px; padding:9px 12px; min-width:260px;}
.searchbar input{border:0; background:transparent; padding:0;}

.tabs{display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap;}
.tab{padding:9px 16px; border-radius:10px; background:var(--panel-2); color:var(--text-dim); font-weight:800; font-size:12px; text-transform:uppercase; display:flex; align-items:center; gap:8px; border:1px solid var(--border-soft);}
.tab.active{background: linear-gradient(135deg, var(--red), var(--red-dark)); color:#fff; border-color:transparent;}
.tab .count{background:rgba(0,0,0,.25); padding:1px 7px; border-radius:999px; font-size:10px;}

.progress{height:5px; border-radius:999px; background:var(--panel-2); overflow:hidden; margin-top:6px;}
.progress > div{height:100%; background: linear-gradient(90deg, var(--red), var(--red-dark));}

.empty{padding:40px 20px; text-align:center; color:var(--text-dimmer);}
.stat{display:flex; flex-direction:column; gap:6px;}
.stat .k{font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-dim); font-weight:700; display:flex; align-items:center; gap:6px;}
.stat .v{font-size:22px; font-weight:900;}

.modal-bg{position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; z-index:50; padding:20px;}
.modal-bg.open{display:flex;}
.modal{background: var(--panel); border:1px solid var(--border-soft); border-radius: var(--radius); padding:22px; width:100%; max-width:480px; max-height:88vh; overflow-y:auto;}
.modal h3{font-size:15px; margin-bottom:16px;}

.toast-wrap{position:fixed; bottom:20px; right:20px; z-index:80; display:flex; flex-direction:column; gap:8px;}
.toast{background:var(--panel); border:1px solid var(--border-soft); border-left:3px solid var(--red); padding:12px 16px; border-radius:10px; font-size:12.5px; font-weight:700; box-shadow:0 10px 30px rgba(0,0,0,.4);}
.toast.success{border-left-color:var(--green);}

/* ---------- storefront: тропическая тема BALI ---------- */
body.theme-tropic{
  --tp-bg: #120c07;
  --tp-bg-2: #1a1109;
  --tp-panel: #1e150c;
  --tp-panel-2: #241a0f;
  --tp-border: #33230f;
  --tp-orange: #f2994a;
  --tp-orange-2: #ff8c1a;
  --tp-orange-dark: #c96a1f;
  --tp-orange-glow: rgba(242,153,74,.35);
  --tp-text: #f5efe6;
  --tp-text-dim: #b9a892;
  --tp-text-dimmer: #7d6c58;
  --tp-green: #7fce6b;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(242,153,74,.10), transparent),
    radial-gradient(700px 380px at 90% 0%, rgba(126,74,26,.14), transparent),
    var(--tp-bg);
  color: var(--tp-text);
}

body.theme-tropic .site-header{
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:16px 5vw; border-bottom:1px solid var(--tp-border); position:sticky; top:0;
  background:rgba(18,12,7,.88); backdrop-filter:blur(10px); z-index:30;
}
body.theme-tropic .site-nav{display:flex; gap:4px; align-items:center; flex-wrap:wrap;}
body.theme-tropic .site-nav a{
  display:flex; align-items:center; gap:7px; color:var(--tp-text-dim); font-weight:700; font-size:12.5px;
  padding:9px 12px; border-radius:9px; position:relative; white-space:nowrap;
}
body.theme-tropic .site-nav a:hover{color:#fff; background:rgba(255,255,255,.04);}
body.theme-tropic .site-nav a.active{color:#fff; background:var(--tp-panel-2);}
body.theme-tropic .site-nav a .nav-badge{
  background:var(--tp-orange-2); color:#1a1109; font-size:9px; font-weight:900; padding:1px 5px;
  border-radius:6px; position:relative; top:-8px; letter-spacing:.03em;
}
body.theme-tropic .header-right{display:flex; align-items:center; gap:10px; flex-shrink:0;}
body.theme-tropic .balance-pill{
  display:flex; align-items:center; gap:8px; background:var(--tp-panel); border:1px solid var(--tp-border);
  padding:8px 14px; border-radius:999px; font-weight:800; color:var(--tp-orange-2); text-decoration:none; cursor:pointer;
}
body.theme-tropic .balance-pill:hover{border-color:var(--tp-orange);}
body.theme-tropic .user-chip{display:flex; align-items:center; gap:8px; font-weight:700; font-size:13px; color:var(--tp-text); padding:4px 10px 4px 4px; border-radius:999px; background:var(--tp-panel); border:1px solid var(--tp-border);}
body.theme-tropic .user-avatar{width:26px; height:26px; border-radius:50%; background:linear-gradient(135deg,var(--tp-orange),var(--tp-orange-dark)); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:900; color:#1a1109; object-fit:cover; flex-shrink:0;}

/* --- Личный кабинет игрока (страница /profile): боковое меню + вкладки --- */
.account-layout{display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap;}
.account-side{width:220px; flex-shrink:0; text-align:center; padding:22px 18px;}
.account-side .user-avatar-lg{width:64px; height:64px; border-radius:50%; margin:0 auto 12px; object-fit:cover; display:block; background:linear-gradient(135deg,var(--tp-orange),var(--tp-orange-dark)); align-items:center; justify-content:center; font-size:24px; font-weight:900; color:#1a1109;}
.account-side .account-name{font-weight:800; font-size:15px; margin-bottom:16px;}
.account-menu{display:flex; flex-direction:column; gap:4px; margin-bottom:16px;}
.account-menu-item{display:block; width:100%; text-align:left; padding:10px 12px; border-radius:10px; border:none; background:transparent; color:var(--tp-text); font-size:13px; font-weight:600; cursor:pointer; font-family:inherit;}
.account-menu-item:hover{background:var(--tp-panel-2, rgba(255,255,255,.04));}
.account-menu-item.active{background:var(--tp-orange); color:#1a1109;}
.account-content{flex:1; min-width:260px; display:flex; flex-direction:column; gap:18px;}
@media (max-width:640px){ .account-side{width:100%;} }

/* --- Медиа-партнёры: карточка в стиле референса + цветные бейджи площадок --- */
.media-panel-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.media-partner-card{text-align:center;}
.media-partner-card .partner-meta{font-size:11px; margin:6px 0 10px;}
.badge-twitch{background:rgba(145,70,255,.16); color:#a970ff; border:1px solid rgba(145,70,255,.35);}
.badge-youtube{background:rgba(255,60,60,.14); color:#ff6b6b; border:1px solid rgba(255,60,60,.32);}
.badge-kick{background:rgba(83,252,17,.14); color:#7dfb4a; border:1px solid rgba(83,252,17,.32);}
.badge-vkplay{background:rgba(48,143,255,.16); color:#5aa8ff; border:1px solid rgba(48,143,255,.35);}
body.theme-tropic .btn-primary{background:linear-gradient(135deg,var(--tp-orange),var(--tp-orange-dark)); box-shadow:0 6px 18px -6px var(--tp-orange-glow); color:#1a1109;}
body.theme-tropic .price{color:var(--tp-orange-2);}

/* баннер-джунгли */
body.theme-tropic .jungle-banner-wrap{padding: 22px 5vw 0; max-width:1400px; margin:0 auto; display:grid; grid-template-columns: 2fr 1fr; gap:16px;}
@media (max-width: 900px){ body.theme-tropic .jungle-banner-wrap{grid-template-columns: 1fr;} }
body.theme-tropic .jungle-banner{
  position:relative; border-radius:18px; overflow:hidden; min-height:220px; border:1px solid var(--tp-border);
  display:block;
}
body.theme-tropic a.jungle-banner{cursor:pointer;}
body.theme-tropic .jungle-banner img{width:100%; height:100%; min-height:220px; object-fit:cover; display:block; transition:.25s ease;}
body.theme-tropic a.jungle-banner:hover img{transform:scale(1.015); filter:brightness(1.06);}
body.theme-tropic .jungle-banner.jungle-banner-fallback{
  background:
    radial-gradient(140px 140px at 82% 18%, rgba(255,214,110,.65), rgba(255,214,110,0) 70%),
    linear-gradient(180deg, #f2a65a 0%, #d97a4a 16%, #7a5a6e 34%, #3d5a68 52%, #1c3f42 70%, #12281f 88%, #0c1a13 100%);
  display:flex; align-items:flex-end; padding:26px;
}
body.theme-tropic .jungle-banner-content{position:relative; z-index:2;}
body.theme-tropic .jungle-banner-content h1{font-size:30px; text-shadow:0 2px 12px rgba(0,0,0,.5);}
body.theme-tropic .jungle-banner-content p{color:#e7e2d6; margin-top:6px; font-size:13px; max-width:420px;}
body.theme-tropic .banner-tags{display:flex; align-items:center; gap:10px; margin-top:12px; flex-wrap:wrap;}
body.theme-tropic .banner-tag{display:inline-flex; align-items:center; gap:6px; color:#e7e2d6; font-weight:800; font-size:11.5px; letter-spacing:.03em;}
body.theme-tropic .banner-tag svg{opacity:.85;}
body.theme-tropic .banner-tags-sep{display:inline-flex; color:var(--tp-orange); opacity:.9;}
body.theme-tropic .discord-cta{
  margin-top:14px; display:inline-flex; align-items:center; gap:8px; background:rgba(18,12,7,.55);
  border:1px solid rgba(255,255,255,.18); padding:9px 16px; border-radius:12px; font-weight:800; font-size:12.5px; color:#fff;
  backdrop-filter:blur(4px);
}
body.theme-tropic .server-box-list{display:flex; flex-direction:column; gap:12px;}
body.theme-tropic .server-box{background:var(--tp-panel); border:1px solid var(--tp-border); border-radius:14px; padding:16px; display:flex; align-items:center; justify-content:space-between; gap:10px;}
body.theme-tropic .server-box .name{font-weight:900; font-size:14px;}
body.theme-tropic .server-box .sub{color:var(--tp-text-dimmer); font-size:11px; margin-top:3px;}
body.theme-tropic .server-box button{background:var(--tp-panel-2); border:1px solid var(--tp-border); color:var(--tp-text); font-weight:800; font-size:11px; padding:8px 12px; border-radius:9px; cursor:pointer; display:flex; align-items:center; gap:6px;}
body.theme-tropic .server-box button:hover{border-color:var(--tp-orange);}

body.theme-tropic .site-main{padding: 26px 5vw 70px; max-width:1400px; margin:0 auto;}
body.theme-tropic .tabs-row{display:flex; gap:14px; margin-bottom:18px; align-items:center; flex-wrap:wrap;}
body.theme-tropic .category-pills{display:flex; gap:8px; flex-wrap:wrap; background:var(--tp-panel); border:1px solid var(--tp-border); padding:6px; border-radius:14px;}
body.theme-tropic .category-pill{padding:10px 20px; border-radius:10px; color:var(--tp-text-dim); font-weight:800; font-size:12.5px;}
body.theme-tropic .category-pill.active{background:#fff; color:#1a1109;}
body.theme-tropic .search-row{flex:1; min-width:220px;}
body.theme-tropic .search-row .searchbar{background:var(--tp-panel); border-color:var(--tp-border); border-radius:12px;}

body.theme-tropic .product-grid{display:grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap:18px;}
body.theme-tropic .product-card{
  position:relative; background:linear-gradient(180deg,var(--tp-panel),var(--tp-panel-2)); border:1px solid var(--tp-border);
  border-radius:16px; padding:0; overflow:hidden; display:flex; flex-direction:column; transition:.15s;
}
body.theme-tropic .product-card:hover{border-color:var(--tp-orange); box-shadow:0 14px 34px -14px var(--tp-orange-glow); transform: translateY(-3px);}
body.theme-tropic .product-img{height:160px; border-radius:0; background:radial-gradient(circle at 50% 30%, #2a1d10, #170f08); display:flex; align-items:center; justify-content:center; font-size:40px; position:relative;}
body.theme-tropic .price-badge{position:absolute; top:10px; left:10px; background:rgba(18,12,7,.85); border:1px solid var(--tp-border); color:#fff; font-weight:900; font-size:13px; padding:5px 10px; border-radius:9px; z-index:2;}
body.theme-tropic .discount-badge{position:absolute; top:10px; right:10px; background:#e0473f; color:#fff; font-weight:900; font-size:10.5px; padding:4px 8px; border-radius:8px; z-index:2;}
body.theme-tropic .product-body{padding:14px 16px 16px; display:flex; flex-direction:column; gap:6px; flex:1;}
body.theme-tropic .product-name{font-weight:800; font-size:13.5px;}
body.theme-tropic .product-meta{color:var(--tp-text-dimmer); font-size:10.5px; text-transform:uppercase; font-weight:700;}
body.theme-tropic .product-foot{display:flex; align-items:center; justify-content:flex-end; margin-top:auto; padding-top:8px;}
body.theme-tropic .old-price{text-decoration:line-through; color:var(--tp-text-dimmer); font-size:11px; margin-right:6px;}
body.theme-tropic .site-footer{padding:40px 5vw; border-top:1px solid var(--tp-border); color:var(--tp-text-dimmer); font-size:12.5px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;}
body.theme-tropic .card{background:linear-gradient(180deg,var(--tp-panel),var(--tp-panel-2)); border:1px solid var(--tp-border);}
body.theme-tropic input,
body.theme-tropic select,
body.theme-tropic textarea{background:var(--tp-bg-2); border-color:var(--tp-border); color:var(--tp-text);}
body.theme-tropic input:focus, body.theme-tropic select:focus, body.theme-tropic textarea:focus{border-color:var(--tp-orange); box-shadow:0 0 0 3px var(--tp-orange-glow);}
body.theme-tropic .badge-success{color:var(--tp-green);}

.auth-card{max-width:400px; margin: 90px auto; }
.logo-text{font-weight:900; font-size:20px; letter-spacing:.02em;}
.logo-text .accent{color:var(--red);}
body.theme-tropic .logo-text .accent{color:var(--tp-orange-2);}

.kv-list{display:flex; flex-direction:column; gap:10px;}
.kv-list .row{display:flex; justify-content:space-between; font-size:12.5px; padding:8px 0; border-bottom:1px dashed var(--border-soft);}
.kv-list .row:last-child{border-bottom:none;}
