/*  THE SITE'S LOOK - THE SAME PALETTE AS THE SCRIPT, ON PURPOSE.
 *
 *  Every colour here is lifted from Pub_Strength_Director/config.lua, so the
 *  site a customer buys from and the menu he opens in game are recognisably
 *  the same product. Change one there and it should change here.
 *
 *  @import MUST BE FIRST. CSS silently drops an @import that appears after
 *  any style rule - not "later", DROPPED - and the symptom is a site that
 *  looks right on the machine that has Tajawal installed and broken
 *  everywhere else.
 */
@import url('fonts/fonts.css');

:root {
    /* straight from config.lua Config.Colors */
    --accent:      #8b5cf6;
    --accentLight: #a78bfa;
    --panel:       #160d24;
    --panelSoft:   #1e1330;
    --border:      #2f2145;
    --text:        #f3efff;
    --textFaint:   #a094c0;
    --danger:      #ef4444;
    --warning:     #f59e0b;

    /* derived, for depth the config does not need to know about */
    --bg:        #0b0714;
    --card:      #1a1030;
    --card2:     #221541;
    --ok:        #22c55e;
    --accentDim: rgba(139, 92, 246, .14);
    --glow:      rgba(139, 92, 246, .35);
    --shadow:    0 18px 50px rgba(0, 0, 0, .5);
    --radius:    16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* the quiet moving glow behind everything - two slow blobs, no library */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .18;
    z-index: 0;
    pointer-events: none;
}
body::before {
    background: var(--accent);
    top: -20vw; inset-inline-start: -15vw;
    animation: drift1 22s ease-in-out infinite alternate;
}
body::after {
    background: #6d28d9;
    bottom: -25vw; inset-inline-end: -15vw;
    animation: drift2 27s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-8vw, -8vh) scale(1.1); } }

/* people who asked their system for less motion get none of it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

a { color: var(--accentLight); text-decoration: none; }
a:hover { color: var(--text); }

/* ---------------- layout ---------------- */

.wrap { position: relative; z-index: 1; }

header.site {
    background: linear-gradient(180deg, rgba(22, 13, 36, .92), rgba(11, 7, 20, .75));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0 26px;
    position: sticky; top: 0; z-index: 20;
}
.head-in {
    max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; gap: 18px;
    min-height: 68px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; }
.brand img { width: 30px; height: 30px; }
.brand span { background: linear-gradient(90deg, var(--text), var(--accentLight));
              -webkit-background-clip: text; background-clip: text; color: transparent; }

nav.tabs { display: flex; gap: 3px; margin-inline-start: auto; flex-wrap: wrap; }
nav.tabs a {
    padding: 9px 17px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
    color: var(--textFaint); transition: all .18s ease; white-space: nowrap;
}
nav.tabs a:hover { color: var(--text); background: rgba(167, 139, 250, .09); }
nav.tabs a.sel { color: var(--text); background: var(--accentDim);
                 box-shadow: inset 0 0 0 1px var(--border); }

.me { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--textFaint); }
.me img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }

main { max-width: 1180px; margin: 0 auto; padding: 30px 26px 70px; }

/* ---------------- cards ---------------- */

.card {
    background: linear-gradient(180deg, rgba(30, 19, 48, .75), rgba(22, 13, 36, .85));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card h2 {
    font-size: 16px; margin: 0 0 16px; color: var(--textFaint);
    font-weight: 700; letter-spacing: .3px;
    display: flex; align-items: center; gap: 9px;
}

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: .2px; }
.sub { color: var(--textFaint); font-size: 14px; margin: 0 0 22px; }

/* ---------------- stats ---------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
         gap: 13px; margin-bottom: 18px; }
.stat {
    background: linear-gradient(180deg, rgba(30, 19, 48, .8), rgba(22, 13, 36, .8));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 17px 19px; transition: transform .2s ease, border-color .2s ease;
    animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
.stat:hover { transform: translateY(-3px); border-color: var(--glow); }
.stat .n { font-size: 30px; font-weight: 800; line-height: 1.2; }
.stat .l { color: var(--textFaint); font-size: 12.5px; }
.stat.good .n { color: var(--ok); }
.stat.bad  .n { color: var(--danger); }
.stat.warn .n { color: var(--warning); }
.stat.acc  .n { color: var(--accentLight); }

/* ---------------- tables ---------------- */

.wrapx { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: start; color: var(--textFaint); font-weight: 700; font-size: 12px;
    padding: 10px 13px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: rgba(167, 139, 250, .04); }

/* ---------------- controls ---------------- */

input, textarea, select {
    background: var(--card); border: 1px solid var(--border); border-radius: 11px;
    color: var(--text); padding: 11px 14px; font: inherit; font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accentDim);
}
input::placeholder { color: var(--textFaint); opacity: .7; }

button, .btn {
    background: linear-gradient(180deg, var(--accentLight), var(--accent));
    border: none; border-radius: 11px; color: #fff;
    font: inherit; font-weight: 700; font-size: 14px;
    padding: 11px 22px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, .btn:hover { transform: translateY(-2px);
                           box-shadow: 0 10px 26px rgba(139, 92, 246, .34); }
button:active, .btn:active { transform: translateY(0); }
button.ghost, .btn.ghost { background: var(--card); border: 1px solid var(--border);
                           color: var(--textFaint); }
button.ghost:hover, .btn.ghost:hover { background: var(--card2); color: var(--text); }
button.danger { background: linear-gradient(180deg, #f87171, var(--danger)); }
button.ok     { background: linear-gradient(180deg, #4ade80, var(--ok)); }
button.sm     { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

form.inline { display: inline; }
.row { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }

code, .mono {
    background: var(--card); border: 1px solid var(--border);
    padding: 4px 10px; border-radius: 8px; font-size: 13px; color: var(--accentLight);
    font-family: ui-monospace, Consolas, monospace;
    direction: ltr; display: inline-block; unicode-bidi: embed;
}

.muted { color: var(--textFaint); font-size: 12.5px; }
.hint  { color: var(--textFaint); font-size: 13.5px; margin: -8px 0 16px; }

/* ---------------- state dots ---------------- */

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
       margin-inline-end: 8px; vertical-align: middle; }
.dot.on   { background: var(--ok); box-shadow: 0 0 10px var(--ok);
            animation: pulse 2.4s ease-in-out infinite; }
.dot.idle { background: var(--accent); }
.dot.off  { background: var(--danger); }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------------- notes ---------------- */

.note {
    background: var(--accentDim); border: 1px solid var(--border);
    border-inline-start: 3px solid var(--accent);
    border-radius: 12px; padding: 15px 18px; margin-bottom: 18px;
    font-size: 14px; color: var(--textFaint);
}
.note b { color: var(--text); }
.note.warn { background: rgba(245, 158, 11, .09); border-color: rgba(245, 158, 11, .34);
             border-inline-start-color: var(--warning); }
.note.bad  { background: rgba(239, 68, 68, .09);  border-color: rgba(239, 68, 68, .34);
             border-inline-start-color: var(--danger); }
.note.good { background: rgba(34, 197, 94, .09);  border-color: rgba(34, 197, 94, .3);
             border-inline-start-color: var(--ok); }

/* ---------------- the key, revealed on request ---------------- */

.keybox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.keyval {
    font-family: ui-monospace, Consolas, monospace; font-size: 15px;
    letter-spacing: 1px; direction: ltr; unicode-bidi: embed;
    background: var(--card); border: 1px solid var(--border);
    padding: 11px 16px; border-radius: 11px; color: var(--accentLight);
    user-select: all;
}

/* ---------------- login ---------------- */

.login {
    min-height: 100vh; display: grid; place-items: center; padding: 30px;
    position: relative; z-index: 1;
}
.login-card {
    width: min(430px, 100%); text-align: center;
    background: linear-gradient(180deg, rgba(30, 19, 48, .88), rgba(22, 13, 36, .92));
    border: 1px solid var(--border); border-radius: 22px;
    padding: 44px 36px; box-shadow: var(--shadow);
    animation: pop .6s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.login-card img.logo { width: 68px; height: 68px; margin-bottom: 18px;
                       animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-7px); } }
.login-card h1 { font-size: 25px; margin-bottom: 8px; }
.login-card p  { color: var(--textFaint); font-size: 14.5px; margin: 0 0 28px; }

.btn-discord {
    width: 100%; justify-content: center; padding: 14px 22px; font-size: 15.5px;
    background: linear-gradient(180deg, #5b6eae, #4752c4);
}
.btn-discord:hover { box-shadow: 0 12px 30px rgba(71, 82, 196, .4); }
.btn-discord svg { width: 21px; height: 21px; fill: currentColor; }

/* ---------------- the guide ---------------- */

.guide { max-width: 860px; font-size: 15.5px; }
.guide h2 { font-size: 21px; color: var(--text); margin: 38px 0 12px;
            padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 17px; color: var(--accentLight); margin: 24px 0 8px; }
.guide p  { margin: 0 0 14px; }
.guide ol, .guide ul { margin: 0 0 16px; padding-inline-start: 26px; }
.guide li { margin-bottom: 9px; }
.guide .box { background: var(--card); border: 1px solid var(--border);
              border-radius: 13px; padding: 16px 20px; margin: 0 0 18px; }

kbd { background: var(--card2); border: 1px solid var(--border);
      border-bottom-width: 2px; border-radius: 7px; padding: 3px 9px;
      font-size: 13px; font-family: inherit; }

/* ---------------- log ---------------- */

.log { font-size: 13.5px; color: var(--textFaint); max-height: 560px; overflow: auto; }
.log div { padding: 9px 3px; border-bottom: 1px solid var(--border);
           animation: rise .4s ease both; }
.log b { color: var(--text); font-weight: 700; }
.log .t { color: var(--textFaint); opacity: .7; font-size: 12px; }

/* ---------------- toast ---------------- */

.toast {
    position: fixed; inset-block-end: 26px; inset-inline-start: 50%;
    transform: translateX(50%) translateY(120px);
    background: var(--card2); border: 1px solid var(--border);
    border-radius: 13px; padding: 13px 24px; font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow); z-index: 100; opacity: 0;
    transition: transform .35s cubic-bezier(.2, .8, .3, 1), opacity .35s ease;
}
.toast.show { transform: translateX(50%) translateY(0); opacity: 1; }
.toast.ok  { border-color: rgba(34, 197, 94, .5); }
.toast.bad { border-color: rgba(239, 68, 68, .5); }

/* ---------------- small screens ---------------- */

@media (max-width: 640px) {
    main { padding: 22px 16px 60px; }
    header.site { padding: 0 16px; }
    .head-in { min-height: 60px; }
    nav.tabs { width: 100%; margin-inline-start: 0; padding-bottom: 10px; }
    nav.tabs a { padding: 8px 13px; font-size: 13.5px; }
    .card { padding: 19px 17px; }
    h1 { font-size: 22px; }
}
