/* ============ DonutRISK — theme tokens ============ */
:root {
  --bg:        #0a1220;
  --bg-2:      #0f1a2c;
  --panel:     #14223a;
  --panel-2:   #1b2d4a;
  --line:      #22385a;
  --text:      #eaf2ff;
  --muted:     #8ea3c4;
  --blue:      #1f7bff;
  --blue-2:    #00b7ff;
  --red:       #ff2e3f;
  --red-2:     #ff6a3d;
  --green:     #22e07a;
  --radius:    10px;
  --sidebar-w: 240px;
  --top-h:     64px;
  font-family: 'Outfit', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Buttons ============ */
.btn {
  height: 40px; padding: 0 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: transform .12s, filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn-blue { background: linear-gradient(180deg, #3b8dff, var(--blue)); box-shadow: 0 4px 14px #1f7bff55, inset 0 1px 0 #ffffff33; }
.btn-red  { background: linear-gradient(180deg, #ff4f5d, var(--red));  box-shadow: 0 4px 14px #ff2e3f55, inset 0 1px 0 #ffffff33; }
.btn-ghost { background: var(--panel-2); }
.btn-ghost:hover { background: var(--line); filter: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn i { font-size: 20px; }
.icon-btn.muted { color: #ff6b78; }
.btn i { font-size: 18px; vertical-align: -3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ============ Sidebar ============ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: var(--bg-2); border-right: 1px solid #ffffff08;
  display: flex; flex-direction: column; transition: width .2s, transform .25s;
}
.sidebar-top {
  height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 12px;
  box-shadow: 0 2px 10px #0006;
}
.mode-tabs { display: flex; gap: 6px; flex: 1; }
.mode-tab {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 8px;
  font-weight: 700; font-size: 13px; background: var(--panel); color: var(--muted);
}
.mode-tab.active { background: linear-gradient(180deg, #3b8dff, var(--blue)); color: #fff; }

.side-nav { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.side-group { background: var(--panel); border-radius: var(--radius); padding: 6px; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px;
  font-weight: 600; font-size: 14px; color: #c9d6ec; white-space: nowrap;
}
.side-link i { font-size: 20px; flex: none; color: #9fb4d6; width: 26px; text-align: center; transition: color .15s, transform .15s; }
.side-ico { width: 26px; height: 26px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 3px #0008); transition: transform .15s; }
.side-ico.donut { width: 24px; height: 24px; }
.side-link:hover { background: var(--panel-2); color: #fff; }
.side-link:hover i { color: #fff; }
.side-link:hover .side-ico, .side-link:hover i { transform: scale(1.12) rotate(-6deg); }
.side-link.active { background: linear-gradient(90deg, #1f7bff33, var(--panel-2)); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.side-link.active i { color: var(--blue-2); }

/* collapsed (desktop) */
body.nav-collapsed { --sidebar-w: 68px; }
body.nav-collapsed .mode-tabs,
body.nav-collapsed .side-link span,
body.nav-collapsed .side-label { display: none; }
body.nav-collapsed .side-nav { padding: 12px 8px; }
body.nav-collapsed .side-link { justify-content: center; }

/* ============ Layout ============ */
.main { margin-left: var(--sidebar-w); transition: margin-left .2s; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--bg-2); box-shadow: 0 2px 10px #0006;
}
.brand { flex: none; }
.brand img { height: 34px; display: block; }

.wallet { flex: 1; display: flex; justify-content: center; }
.wallet-balance {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  background: var(--bg); border-radius: 8px 0 0 8px; font-weight: 700;
}
.wallet-balance .coin {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #05301a; font-size: 12px; font-weight: 800;
}
.wallet-balance i { font-size: 14px; color: var(--muted); }
.wallet-balance .amount { min-width: 64px; text-align: left; font-variant-numeric: tabular-nums; }
.wallet-balance.up .amount { animation: balUp .6s; }
.wallet-balance.down .amount { animation: balDown .6s; }
@keyframes balUp { 30% { color: var(--green); } }
@keyframes balDown { 30% { color: #ff6b78; } }
.wallet-wrap { position: relative; }
.wallet-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 250px; padding: 14px; border-radius: 10px;
  background: var(--panel); box-shadow: 0 12px 40px #000a; display: none; flex-direction: column; gap: 10px; z-index: 50;
}
.wallet-menu.open { display: flex; }
.wm-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.wm-row b { color: var(--text); }
.wm-reset { width: 100%; }
.wm-note { font-size: 12px; color: var(--muted); line-height: 1.4; }
.scrim { position: fixed; inset: 0; background: #0008; z-index: 25; display: none; }
body.nav-open .scrim { display: block; }
.wallet-btn { border-radius: 0 8px 8px 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.content { max-width: 1260px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 28px; }

/* ============ Hero ============ */
.hero { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.hero-card {
  position: relative; overflow: hidden; border-radius: 14px; padding: 26px;
  background: var(--panel); min-height: 220px;
}
.hero-welcome {
  display: flex; align-items: center;
  background:
    radial-gradient(circle at 85% 50%, #1f7bff55, transparent 55%),
    radial-gradient(circle at 10% 110%, #ff2e3f33, transparent 50%),
    linear-gradient(135deg, #15284a, #0f1a2c);
}
.hero-text { position: relative; z-index: 1; max-width: min(420px, 62%); }
.hero h1 { font-size: 38px; line-height: 1.05; font-weight: 800; margin: 12px 0 10px; }
.hero p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.txt-blue { background: linear-gradient(90deg, var(--blue-2), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-donut {
  position: absolute; right: -10px; top: 50%; width: min(200px, 36%); transform: translateY(-50%) rotate(-14deg);
  filter: drop-shadow(0 18px 30px #0009); animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-56%) rotate(-8deg); } }

.pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #1f7bff33; color: #8cc2ff; font-size: 12px; font-weight: 700;
}
.pill-dark { background: #0006; color: #fff; }

.hero-promo { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.hero-promo h3 { font-size: 22px; font-weight: 800; margin-top: auto; }
.hero-promo p { color: #ffffffcc; font-size: 14px; }
.hero-promo .pill { position: absolute; top: 20px; left: 22px; }
.hero-promo { background: var(--panel) right center / cover no-repeat; transition: transform .2s; }
.hero-promo:hover { transform: translateY(-3px); }
.hero-promo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #000a, #0006 40%, transparent 65%); }
.hero-promo h3, .hero-promo p, .hero-promo a { position: relative; max-width: 50%; text-shadow: 0 2px 8px #000a; }
.link-arrow { font-weight: 700; font-size: 14px; margin-top: 6px; }

/* ============ Search ============ */
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  background: var(--bg-2); border: 2px solid var(--panel-2); border-radius: 999px;
}
.search:focus-within { border-color: var(--blue); }
.search i { font-size: 18px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--muted); }

/* ============ Game rows ============ */
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.row-head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.h2-ico { width: 24px; height: 24px; }
.view-all { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--panel); padding: 8px 14px; border-radius: 8px; }
.view-all:hover { color: #fff; }

.games { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.game {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 12px 8px;
  transition: transform .18s;
  box-shadow: inset 0 0 0 1px #ffffff14;
}
.game:hover { transform: translateY(-6px); }
.game-name { position: relative; font-weight: 800; font-size: 17px; letter-spacing: .04em; text-shadow: 0 2px 6px #0007; }
.game-tag  { position: relative; font-size: 11px; font-weight: 600; color: #ffffffbb; }

.game { background: var(--panel) center / cover no-repeat; }
.g-dice { background-image: url(assets/games/dice.webp); }
.g-mines { background-image: url(assets/games/mines.webp); }
.g-crash { background-image: url(assets/games/crash.webp); }
.g-plinko { background-image: url(assets/games/plinko.webp); }
.g-flip { background-image: url(assets/games/flip.webp); }
.g-limbo { background-image: url(assets/games/limbo.webp); }
.g-towers { background-image: url(assets/games/towers.webp); }
.g-bj { background-image: url(assets/games/bj.webp); }

/* ============ Bets table ============ */
.bet-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 999px; overflow-x: auto; }
.bet-tab { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bet-tab.active { background: var(--panel-2); color: #fff; }
.live-dot { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #22e07a33; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #22e07a00; } }

.table-wrap { background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.bets { width: 100%; border-collapse: collapse; font-size: 14px; }
.bets th { text-align: left; color: var(--muted); font-weight: 600; padding: 14px 16px; }
.bets td { padding: 14px 16px; font-weight: 600; }
.bets tbody tr:nth-child(odd) { background: var(--panel); }
.bets th:last-child, .bets td:last-child { text-align: right; }
.tg { display: inline-flex; align-items: center; gap: 8px; }
.tg img { width: 22px; height: 22px; object-fit: contain; }
.win  { color: var(--green); }
.loss { color: var(--muted); }

/* ============ Footer ============ */
.footer { margin-top: 40px; padding: 40px 24px 90px; background: var(--bg-2); border-top: 1px solid #ffffff08; }
.footer-cols { max-width: 1260px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-logo { height: 30px; margin-bottom: 12px; }
.footer h4 { font-size: 14px; margin-bottom: 10px; }
.footer-cols a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.footer-cols a:hover { color: #fff; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.footer-bottom { max-width: 1260px; margin: 28px auto 0; padding-top: 20px; border-top: 1px solid var(--line); }

/* ============ Mobile bottom nav ============ */
.bottom-nav { display: none; }

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .games { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-welcome { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: 260px; padding-bottom: 64px; }
  body.nav-open .sidebar { transform: none; box-shadow: 10px 0 40px #000a; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; gap: 10px; }
  .brand img { height: 26px; }
  .content { padding: 16px; gap: 22px; }
  .footer { padding: 32px 16px 90px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols > div:first-child { grid-column: 1 / -1; }

  .bottom-nav {
    display: flex; position: fixed; inset: auto 0 0 0; height: 64px; z-index: 40;
    background: var(--bg-2); box-shadow: 0 -2px 10px #0006;
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .bottom-nav a.active { color: #fff; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav i { font-size: 22px; }
  body.nav-collapsed .mode-tabs { display: flex; }
  body.nav-collapsed .side-link span { display: inline; }
  body.nav-collapsed .side-label { display: block; }
  body.nav-collapsed .side-link { justify-content: flex-start; }
  .hero-promo h3, .hero-promo p, .hero-promo a { max-width: 55%; }
}

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .wallet { justify-content: flex-end; }
  .wallet-btn { display: none; }
  .wallet-balance { border-radius: 8px; }
  .top-actions .btn-ghost { display: none; }
  .topbar .brand img { height: 22px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .hero-welcome { min-height: 260px; align-items: flex-start; padding-bottom: 110px; }
  .hero-donut { width: 140px; right: -24px; top: auto; bottom: -20px; transform: rotate(-14deg); animation: none; opacity: .9; }
  .hero-text { max-width: 100%; }
  .hero-actions .btn { flex: 1; }
  .hero-promo { min-height: 170px; padding-top: 60px; }
  .games { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .game { border-radius: 10px; padding: 8px 4px; }
  .game-name { font-size: 10px; letter-spacing: 0; }
  .game-tag { display: none; }
  .live-dot { display: none; }
  .bets { font-size: 13px; }
  .bets th, .bets td { padding: 12px 10px; }
}

/* ============ signed-in / out, user menu ============ */
body:not(.signed-in) .in-only, body.signed-in .out-only { display: none !important; }
body:not(.is-admin) .admin-only { display: none !important; }
.wallet.out-only { flex: 1; }
.user-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 5px; border-radius: 999px; background: var(--panel-2); font-weight: 700; font-size: 14px; }
.user-btn i { font-size: 14px; color: var(--muted); }
.u-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #3b8dff, var(--blue)); font-weight: 800; }
.user-menu { left: auto; right: 0; width: 220px; padding: 8px; gap: 2px; }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; color: #c9d6ec; }
.user-menu a:hover { background: var(--panel-2); color: #fff; }
.user-menu a i { font-size: 18px; }
.um-head { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.vip-pill { display: inline-block; align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: #ffc23d22; color: #ffc23d; font-size: 11px; font-weight: 800; }

/* ============ modals ============ */
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: #000a; backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal-wrap.open { opacity: 1; }
.modal {
  position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border-radius: 16px; background: var(--panel); box-shadow: 0 30px 80px #000c; transform: translateY(12px) scale(.97); transition: transform .2s;
}
.modal-wrap.open .modal { transform: none; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.modal-x:hover { background: var(--panel-2); color: #fff; }
.m-title { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.m-text { color: #b8c7df; font-size: 14px; line-height: 1.5; }
.m-text.small { font-size: 12px; color: var(--muted); }
.m-text code, .m-fair code { font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.m-login-art { display: grid; place-items: center; } .m-login-art img { width: 84px; animation: float 4s ease-in-out infinite; }
.m-login .m-title, .m-login .m-text { text-align: center; justify-content: center; }
.m-login [data-step1], .m-login [data-step2] { display: flex; flex-direction: column; gap: 12px; }
.m-login [hidden] { display: none !important; }
.dev-only { display: none !important; } .m-login.dev .dev-only, .dev .dev-only { display: flex !important; }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 2px dashed var(--blue); font-size: 16px; }
.cmd code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: #fff; }
.cmd i { color: var(--blue-2); font-size: 20px; }
.cmd:hover { background: #0d1a2e; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--panel-2); border-top-color: var(--blue-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.m-tabs { flex: none; }
.bot-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #ff9aa5; }
.bot-status span { width: 9px; height: 9px; border-radius: 50%; background: #ff4757; }
.bot-status.on { color: var(--green); } .bot-status.on span { background: var(--green); box-shadow: 0 0 0 4px #22e07a33; }
.wd-list { display: flex; flex-direction: column; gap: 4px; }
.wd-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); font-size: 13px; align-items: center; }
.wd-row .st { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; background: var(--panel-2); text-transform: capitalize; }
.wd-row .st.sent { color: var(--green); } .wd-row .st.rejected, .wd-row .st.failed { color: #ff6b78; } .wd-row .st.pending, .wd-row .st.review { color: #ffc23d; }
.tx-list { display: flex; flex-direction: column; max-height: 360px; overflow: auto; border-radius: 10px; background: var(--bg-2); }
.tx-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; padding: 9px 12px; font-size: 13px; align-items: center; }
.tx-row:nth-child(odd) { background: #ffffff05; }
.tx-type { font-weight: 800; text-transform: capitalize; }
.tx-row .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px !important; }
.pl-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.gb-edge { background: #1f7bff22; color: #7cc4ff; }
.g-chicken { background-image: url(assets/games/chicken.webp); }
.games { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)) !important; }
@media (max-width: 640px) { .games { grid-template-columns: repeat(3, 1fr) !important; } }
.case-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.case-row a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 14px; background: var(--panel); font-weight: 800; font-size: 14px; transition: transform .18s; }
.case-row a:hover { transform: translateY(-5px); }
.case-row img { width: 80%; filter: drop-shadow(0 10px 14px #0009); }
.case-row span { color: var(--green); font-size: 13px; }
@media (max-width: 900px) { .case-row { grid-template-columns: repeat(3, 1fr); } }

[hidden] { display: none !important; }

/* ============ side chat ============ */
:root { --chat-w: 320px; }
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--chat-w); z-index: 30; display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid #ffffff08; transform: translateX(100%); transition: transform .25s;
}
body.chat-open .chat { transform: none; }
body.chat-open .main { margin-right: var(--chat-w); }
.main { transition: margin .2s; }
.chat-head { height: var(--top-h); flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; box-shadow: 0 2px 10px #0006; }
.chat-title { display: flex; align-items: center; gap: 8px; } .chat-title > i { font-size: 22px; color: var(--blue-2); }
.chat-online { display: flex; align-items: center; gap: 6px; margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chat-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #22e07a33; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
.chat-empty { margin: auto; color: var(--muted); font-weight: 600; font-size: 14px; }
.cmsg { padding: 8px 10px; border-radius: 10px; background: var(--panel); animation: histIn .25s; }
.cmsg.me { background: #1f7bff1f; box-shadow: inset 2px 0 0 var(--blue); }
.cm-top { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.cm-av { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-size: 11px; font-weight: 800; }
.cm-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-tag { flex: none; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 4px; letter-spacing: .04em; }
.cm-tag.staff { background: var(--red); } .cm-tag.vip { background: #ffc23d22; color: #ffc23d; }
.cm-time { margin-left: auto; flex: none; color: var(--muted); font-size: 11px; }
.cm-mod { display: none; gap: 2px; } .cmsg:hover .cm-mod { display: flex; } .cmsg:hover .cm-time { display: none; }
.cm-mod button { width: 22px; height: 22px; border-radius: 5px; color: var(--muted); display: grid; place-items: center; }
.cm-mod button:hover { background: var(--panel-2); color: #ff6b78; }
.cm-text { margin-top: 4px; font-size: 14px; line-height: 1.4; color: #dbe6f7; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-new { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; background: var(--blue); font-weight: 700; font-size: 13px; box-shadow: 0 6px 18px #0008; }
.chat-foot { flex: none; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #ffffff08; }
.chat-in { display: flex; gap: 6px; }
.chat-in input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px 'Outfit', sans-serif; outline: 0; }
.chat-in input:focus { border-color: var(--blue); }
.chat-in button { width: 42px; height: 42px; border-radius: 8px; background: var(--blue); display: grid; place-items: center; font-size: 18px; }
.chat-signin { width: 100%; height: 42px; }
.chat-rules { font-size: 11px; color: var(--muted); text-align: center; }
.chat-toggle { position: relative; }
body.chat-open .chat-toggle { color: var(--blue-2); background: var(--panel-2); }
.chat-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
@media (max-width: 1100px) { body.chat-open .main { margin-right: 0; } .chat { box-shadow: -10px 0 40px #000a; } }
@media (max-width: 900px) { .chat { width: 100%; bottom: 64px; z-index: 45; } .chat-new { bottom: 120px; } }

@keyframes float { 50% { transform: translateY(-8px) rotate(-1.5deg); } }

/* ============ rain ============ */
.rain-bar:empty { display: none; }
.rain-bar { position: relative; overflow: hidden; flex: none; margin: 10px 10px 0; padding: 10px 12px; border-radius: 10px; background: linear-gradient(135deg, #1b2d4a, #14223a); box-shadow: inset 0 0 0 1px #ffffff0d; }
.rain-bar.live { background: linear-gradient(135deg, #1f7bff, #0b3fa8); box-shadow: 0 6px 20px #1f7bff55; animation: rainPulse 2s infinite; }
@keyframes rainPulse { 50% { box-shadow: 0 6px 30px #1f7bff99; } }
.rb-row { position: relative; display: flex; align-items: center; gap: 10px; }
.rb-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.rb-row b { font-size: 14px; }
.rb-row .muted { font-size: 11px; }
.rain-bar.live .muted { color: #dbeafe; }
.rb-ico { font-size: 22px; }
.rb-drops { position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: repeating-linear-gradient(105deg, transparent 0 14px, #fff 14px 15px, transparent 15px 30px); background-size: 60px 60px; animation: rainFall .6s linear infinite; }
@keyframes rainFall { to { background-position: -16px 60px; } }
.cmsg.sys { background: #1f7bff1a; box-shadow: inset 2px 0 0 var(--blue-2); }
.cmsg.sys .cm-text { margin: 0; font-size: 13px; }
.m-rain .rc-q { text-align: center; font-size: 18px; font-weight: 800; }
.rc-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rc-opt { aspect-ratio: 1; border-radius: 12px; background: var(--bg); display: grid; place-items: center; transition: transform .12s, box-shadow .12s; }
.rc-opt:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--blue); }
.rc-opt img { width: 64%; image-rendering: pixelated; }
.ref-ok { font-size: 12px; font-weight: 700; color: var(--green); } .ref-bad { font-size: 12px; font-weight: 700; color: #ff6b78; }
