.home-wrap{
  max-width:1180px;
  margin:18px auto 0;
  padding:0 10px 24px;
  font-size:var(--fs-sm);
  color:var(--fg);
}

.home-main{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.home-main-single{
  max-width:100%;
}

.card,
.home-chat-card,
.home-mod-shell{
  background:linear-gradient(180deg, var(--card), var(--card-2));
  color:var(--fg);
  border:1px solid var(--line);
  box-shadow:var(--shadow-md);
  border-radius:22px;
}

.home-mod-shell,
.home-chat-card,
.home-topup-card{
  padding:18px;
}

.home-mod-head,
.home-chat-head,
.home-topup-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.home-mod-head h2,
.home-chat-card h3,
.home-topup-head h3{
  margin:0;
  font-size:var(--fs-xl);
  font-weight:900;
  color:var(--fg);
}

.home-mod-head p,
.home-chat-card p,
.home-topup-head p{
  margin:4px 0 0;
  font-size:var(--fs-sm);
  color:var(--muted);
  line-height:1.7;
}

/* ===== DANH MỤC DỊCH VỤ ===== */
.home-mod-shell{
  overflow:hidden;
}

.home-mod-list{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.home-mod-row{
  position:relative;
  display:flex;
  align-items:center;
  min-height:auto;
  aspect-ratio:5 / 2;
  padding:18px 22px;
  border-radius:22px;
  text-decoration:none;
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 14px 28px rgba(2,6,23,.18);
  overflow:hidden;
  transform:translateY(0);
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease;
  isolation:isolate;
}

.home-mod-row:hover{
  transform:translateY(-2px);
  filter:brightness(1.03);
  box-shadow:0 18px 34px rgba(2,6,23,.24);
}

.home-mod-row.no-cover{
  color:#fff;
}

.home-mod-row::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:6px;
  background:rgba(255,255,255,.26);
  z-index:2;
}

.home-mod-cover-layer{
  position:absolute;
  inset:-8%;
  z-index:0;
  background-size:cover;
  background-position:center center;
  background-repeat:no-repeat;
  transform:scale(1.08);
  animation:homeModCoverFloat 13s ease-in-out infinite alternate,
            homeModCoverZoom 18s ease-in-out infinite alternate;
  filter:saturate(1.02);
}

.home-mod-overlay{
  position:absolute;
  inset:0;
  z-index:1;
  background:
    linear-gradient(90deg, rgba(2,6,23,.78) 0%, rgba(2,6,23,.46) 38%, rgba(2,6,23,.38) 100%);
}

.home-mod-row.no-cover .home-mod-overlay{
  background:transparent;
}

.home-mod-title-wrap{
  position:relative;
  z-index:3;
  display:flex;
  align-items:center;
  min-width:0;
  width:100%;
  height:100%;
}

.home-mod-title{
  font-size:clamp(18px, 2.6vw, 30px);
  line-height:1.12;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:inherit;
  text-shadow:0 3px 14px rgba(0,0,0,.28);
  word-break:break-word;
}

/* màu mặc định khi chưa có ảnh */
.mod-color-yellow{
  background:
    linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
}
.mod-color-cyan{
  background:
    linear-gradient(135deg, #22d3ee 0%, #0ea5e9 100%);
}
.mod-color-pink{
  background:
    linear-gradient(135deg, #e879f9 0%, #d946ef 100%);
}
.mod-color-green{
  background:
    linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}
.mod-color-orange{
  background:
    linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
.mod-color-gray{
  background:
    linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* ===== CHAT ===== */
.home-chat-input-row{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}

.home-chat-input{
  flex:1 1 auto;
  min-width:0;
}

.home-chat-state{
  margin-bottom:12px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  font-size:var(--fs-sm);
  line-height:1.6;
}

.home-chat-state-muted{
  background:rgba(127,127,127,.05);
  color:var(--muted);
}

.home-chat-state a{
  color:inherit;
  font-weight:800;
}

.home-chat-list{
  max-height:360px;
  overflow:auto;
  border-radius:16px;
  border:1px solid var(--line);
  padding:8px 12px;
  background:rgba(127,127,127,.04);
}

.home-chat-item{
  font-size:var(--fs-sm);
  color:var(--fg);
  padding:10px 0;
  border-bottom:1px dashed var(--line);
  line-height:1.65;
  word-break:break-word;
}

.home-chat-item:last-child{
  border-bottom:none;
}

.home-chat-user{
  font-weight:800;
  margin-right:6px;
}

.home-chat-msg,
.home-chat-user,
.home-chat-system{
  white-space:inherit;
}

.home-chat-empty{
  font-size:var(--fs-sm);
  color:var(--muted);
  text-align:center;
  padding:16px 0;
}

.home-chat-system{
  color:#fb923c !important;
  font-weight:800;
  margin-right:6px;
}

.home-chat-money-plus{
  color:#22c55e;
  font-weight:800;
}

.home-chat-money-minus{
  color:#ef4444;
  font-weight:800;
}

.home-chat-foot{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
}

/* ===== TOP NẠP ===== */
.home-topup-table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(127,127,127,.04);
}

.home-topup-table{
  width:100%;
  border-collapse:collapse;
  min-width:520px;
}

.home-topup-table th,
.home-topup-table td{
  padding:14px 16px;
  border-bottom:1px dashed var(--line);
  text-align:left;
  font-size:var(--fs-sm);
}

.home-topup-table th{
  color:var(--muted);
  font-weight:800;
}

.home-topup-table tbody tr:last-child td{
  border-bottom:none;
}

.home-rank-cell,
.home-name-cell{
  font-weight:900;
}

.home-amount-cell{
  font-weight:900;
  color:#84cc16;
  white-space:nowrap;
}

.home-rank-gold{
  color:#facc15;
}
.home-rank-silver{
  color:#cbd5e1;
}
.home-rank-bronze{
  color:#fb923c;
}

@keyframes homeModCoverFloat{
  0%   { transform:translate3d(-1.2%, -1.2%, 0) scale(1.08); }
  50%  { transform:translate3d(1.2%, 1.0%, 0) scale(1.1); }
  100% { transform:translate3d(0.6%, -0.8%, 0) scale(1.12); }
}

@keyframes homeModCoverZoom{
  0%   { background-position:48% 50%; }
  100% { background-position:52% 50%; }
}

@media (max-width:860px){
  .home-wrap{
    padding:0 8px 20px;
  }

  .home-mod-shell,
  .home-chat-card,
  .home-topup-card{
    padding:14px;
  }

  .home-mod-row{
    padding:14px 16px;
    border-radius:18px;
  }

  .home-mod-title{
    font-size:clamp(16px, 4.6vw, 24px);
  }
}

@media (max-width:600px){
  .home-chat-input-row{
    flex-direction:column;
    align-items:stretch;
  }

  .home-topup-table{
    min-width:460px;
  }

  .home-mod-list{
    gap:12px;
  }

  .home-mod-row{
    padding:12px 14px;
    border-radius:16px;
  }

  .home-mod-title{
    font-size:clamp(15px, 5vw, 20px);
    letter-spacing:.02em;
  }
}