/* BUZZ — موقع البوت ولوحة التحكم. ثيم ذهبي على أسود (نفس صورة البوت) */
:root {
  --bg: #08080a; --bg2: #0e0e12; --panel: #131318; --panel2: #1a1a21; --line: #26262f; --line2: #33333e;
  --text: #f2f0ea; --muted: #a09d94; --dim: #6f6c66;
  --gold: #f1c40f; --gold2: #ffd84a; --gold-ink: #1a1400; --gold-soft: rgba(241, 196, 15, .12);
  --ok: #2ecc71; --warn: #f39c12; --bad: #e74c3c;
  --r: 14px; --r2: 10px;
  --font: 'Cairo', system-ui, sans-serif; --display: 'Russo One', 'Cairo', sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; min-height: 100vh;
  -webkit-font-smoothing: antialiased; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── شريط علوي */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: rgba(8, 8, 10, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 22px; letter-spacing: .06em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.top nav { display: flex; gap: 18px; margin-inline-start: 12px; }
.top nav a { color: var(--muted); font-weight: 700; }
.top nav a:hover, .top nav a.on { color: var(--text); text-decoration: none; }
.top .sp { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.who img { width: 32px; height: 32px; border-radius: 50%; }

/* ── أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--text); font-weight: 800; cursor: pointer; transition: transform .12s, background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--dim); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 6px 24px rgba(241, 196, 15, .25); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.danger { color: #ffb4ab; border-color: #5b2a25; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.lang { min-width: 44px; padding: 6px 12px; }

/* ── الصفحة الرئيسية */
.hero { position: relative; overflow: hidden; padding: 96px 24px 80px; text-align: center; border-bottom: 1px solid var(--line); }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto; height: 120%;
  background: radial-gradient(ellipse 50% 50% at 50% 40%, rgba(241, 196, 15, .18), transparent 70%); pointer-events: none; }
.hero .logo { width: 120px; height: 120px; margin: 0 auto 24px; filter: drop-shadow(0 0 30px rgba(241, 196, 15, .45)); }
.hero h1 { position: relative; margin: 0 0 12px; font-family: var(--display); font-size: clamp(44px, 8vw, 88px); letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #fffbe6, var(--gold2) 40%, var(--gold) 60%, #a87a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { position: relative; max-width: 640px; margin: 0 auto 28px; color: var(--muted); font-size: 19px; }
.hero .cta { position: relative; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section h2 { font-size: 32px; margin: 0 0 8px; }
.section .lead { color: var(--muted); margin: 0 0 32px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.feat { padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.feat .ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); font-size: 22px; margin-bottom: 12px; }
.feat h3 { margin: 0 0 6px; font-size: 18px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: s; }
.step { padding: 22px; border-radius: var(--r); border: 1px dashed var(--line2); }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); font-weight: 900; margin-bottom: 10px; }
.step h3 { margin: 0 0 4px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.showcase { margin-top: 32px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
footer { padding: 32px 24px; border-top: 1px solid var(--line); color: var(--dim); text-align: center; font-size: 14px; }
footer a { color: var(--muted); margin: 0 8px; }

/* ── لوحة التحكم */
.center { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 24px; }
.card-box { width: min(440px, 100%); padding: 32px; text-align: center; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.card-box h2 { margin: 12px 0 6px; }
.card-box p { color: var(--muted); margin: 0 0 22px; }
.page { max-width: 1140px; margin: 0 auto; padding: 32px 24px 80px; }
.page h1 { font-size: 28px; margin: 0 0 4px; }
.page .sub { color: var(--muted); margin: 0 0 24px; }
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.srv { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); text-align: center; }
.srv .gi { width: 72px; height: 72px; border-radius: 22px; background: var(--panel2) center / cover; display: grid; place-items: center;
  font-weight: 900; font-size: 24px; color: var(--muted); }
.srv b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv small { color: var(--dim); }
.srv.off { opacity: .8; }

.layout { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 66px); }
.side { border-inline-end: 1px solid var(--line); background: var(--bg2); padding: 20px 14px; position: sticky; top: 66px; height: calc(100vh - 66px); overflow: auto; }
.side .g { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.side .g .gi { width: 40px; height: 40px; border-radius: 12px; background: var(--panel2) center / cover; flex: none; display: grid; place-items: center; font-weight: 900; color: var(--muted); }
.side .g b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a.it { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 700; }
.side a.it:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.side a.it.on { background: var(--gold-soft); color: var(--gold2); }
.side a.it .dot { margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.side a.it .dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.side .back { display: block; margin-top: 16px; padding: 8px 12px; color: var(--dim); font-size: 14px; }
.main { padding: 28px 32px 100px; min-width: 0; }
.main h1 { margin: 0 0 4px; font-size: 26px; display: flex; align-items: center; gap: 12px; }
.main .sub { color: var(--muted); margin: 0 0 24px; }

.box { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 22px; margin-bottom: 16px; }
.box h3 { margin: 0 0 4px; font-size: 17px; }
.box .hint { color: var(--dim); font-size: 14px; margin: 0 0 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-weight: 700; font-size: 14px; color: var(--muted); }
.field small { color: var(--dim); font-size: 13px; }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r2); border: 1px solid var(--line2); background: var(--bg2); color: var(--text); }
textarea { min-height: 88px; resize: vertical; }
[data-k="card.bg"], [data-k="twitch"], [data-k="kick"], #reactions { direction: ltr; text-align: left; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir=rtl] select { background-position: 18px 50%, 13px 50%; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }

/* مفتاح تشغيل */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 800; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .tr { width: 48px; height: 28px; border-radius: 99px; background: var(--line2); position: relative; transition: background .15s; flex: none; }
.switch .tr::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch input:checked + .tr { background: var(--ok); }
.switch input:checked + .tr::after { inset-inline-start: 23px; }
.switch input:focus-visible + .tr { outline: 2px solid var(--gold); outline-offset: 2px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line2); background: var(--bg2); font-size: 14px; }
.chip button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.rb { display: grid; grid-template-columns: 1.2fr 1fr 110px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rb .x { border: 1px solid var(--line2); background: var(--bg2); border-radius: 10px; height: 40px; cursor: pointer; color: var(--muted); }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.note.warn { background: rgba(243, 156, 18, .1); border: 1px solid rgba(243, 156, 18, .35); color: #ffd59a; }
.note.info { background: var(--gold-soft); border: 1px solid rgba(241, 196, 15, .3); color: #fbe7a0; }
.note.bad { background: rgba(231, 76, 60, .1); border: 1px solid rgba(231, 76, 60, .4); color: #ffb4ab; }

.savebar { position: fixed; bottom: 20px; inset-inline-end: 24px; z-index: 30; display: none; align-items: center; gap: 14px; padding: 12px 14px 12px 20px;
  border-radius: 16px; background: #1d1d24; border: 1px solid var(--line2); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.savebar.on { display: flex; }
.savebar span { font-weight: 700; color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; z-index: 40;
  padding: 12px 20px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); font-weight: 700; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.ok { border-color: rgba(46, 204, 113, .5); }
.toast.bad { border-color: rgba(231, 76, 60, .6); }

/* معاينة الكرت */
.preview { position: relative; width: 100%; aspect-ratio: 1100 / 460; border-radius: 16px; overflow: hidden; background: #000; }
.preview iframe { position: absolute; top: 0; left: 0; width: 1100px; height: 460px; border: 0; transform-origin: 0 0; pointer-events: none; }
.dmsg { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: #313338; margin-top: 12px; direction: ltr; text-align: left; }
.dmsg .av { width: 40px; height: 40px; border-radius: 50%; background: #111 url('/assets/bot.svg') center / 70% no-repeat; flex: none; }
.dmsg .nm { font-weight: 700; color: #f1c40f; } .dmsg .tag { font-size: 11px; background: #5865f2; color: #fff; padding: 1px 5px; border-radius: 4px; margin-inline-start: 4px; }
.dmsg .tx { color: #dbdee1; white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; }
.dmsg .tx .mn { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dmsg .img { margin-top: 6px; max-width: 420px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.sw.on { border-color: #fff; }
input[type=color] { width: 40px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
.bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.bgopt { aspect-ratio: 1100/460; border-radius: 10px; border: 2px solid var(--line2); background: var(--bg2) center / cover; cursor: pointer; display: grid; place-items: center; color: var(--dim); font-size: 13px; font-weight: 700; }
.bgopt.on { border-color: var(--gold); }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.spin { width: 34px; height: 34px; border: 3px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 66px 0; inset-inline-start: 0; width: 270px; z-index: 25; transform: translateX(-100%); transition: transform .2s; height: auto; }
  [dir=rtl] .side { transform: translateX(100%); }
  .side.open { transform: none !important; }
  .menu-btn { display: inline-flex; }
  .main { padding: 20px 16px 110px; }
  .top { padding: 10px 16px; gap: 10px; }
  .top nav { display: none; }
  .who span { display: none; }
  .rb { grid-template-columns: 1fr 1fr; }
  .savebar { inset-inline: 16px; justify-content: space-between; }
}
