/* Thème « Tek Casino » pour le dashboard : fond bleu nuit, barre bleue, accent vert, titres condensés avec curseur, libellés en mono.
   Polices embarquées (Bebas Neue, IBM Plex Sans — licence OFL). Les animations (GSAP) sont dans fx.js. */
@font-face { font-family: 'Bebas Neue'; font-weight: 400; font-display: swap; src: url('/fonts/bebas-neue-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-700.woff2') format('woff2'); }

:root {
  --bg: #070b16; --bg2: #0b1122; --surface: #0d1428; --surface-2: #131c38; --surface-3: #1a2547;
  --border: #1f2a52; --border-strong: #2c3a6e; --line: #1f2a52; --line2: #2c3a6e;
  --text: #e8ebf7; --text-2: #b4bcdb; --muted: #8f98ba; --accent: #00f59b; --link: #9aa6ff;
  --blue: #0a3cff; --green: #00f59b; --orange: #ff5a36;
  --grid: #1a2442; --axis: #2c3a6e;
  --good: #00f59b; --warn: #ffc44d; --serious: #ff8a5c; --crit: #ff5d73;
  --display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 3px;
}
html { background: var(--bg); }
body { background: transparent; font-family: var(--font); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }

/* ───── décor : mosaïque flottante (comme le pied de page du casino) ───── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 14px; height: 14px; background: #2d3a78; opacity: .12; }
.aurora i:nth-child(3n) { background: var(--green); opacity: .07; }
.aurora i:nth-child(3n + 1) { background: #4c5bc4; }
.aurora::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 56px 56px; opacity: .22; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--green); box-shadow: 0 0 10px rgba(0, 245, 155, .8); pointer-events: none; }

/* ───── barre bleue ───── */
.top { position: sticky; top: 0; z-index: 20; background: var(--blue); border-bottom: 0; backdrop-filter: none; }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 28px); min-height: 62px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 2rem; letter-spacing: .02em; color: #fff; line-height: 1; font-weight: 400; text-transform: uppercase; text-decoration: none; }
.brand img { border-radius: 3px; border: 2px solid #fff; padding: 1px; background: #04101f; }
.brand span b { color: var(--green); font-weight: 400; }
.tabs { display: flex; gap: 4px; align-self: stretch; position: relative; }
.tabs a { position: relative; z-index: 1; display: flex; align-items: center; padding: 0 14px; border-radius: 0; color: #dbe3ff; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .82rem; text-decoration: none; transition: color .15s; }
.tabs a:hover { background: transparent; color: #fff; }
.tabs a[aria-current="page"] { background: transparent; color: #fff; }
.tab-ind { position: absolute; z-index: 0; left: 0; bottom: 0; top: auto; height: 3px; width: 0; opacity: 0; border: 0; border-radius: 0; background: var(--green); box-shadow: 0 0 12px rgba(0, 245, 155, .7); pointer-events: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.upd { color: #b9c6ff; font-family: var(--mono); font-size: .72rem; min-width: 0; }
.seg { border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--radius); overflow: hidden; display: inline-flex; }
.seg button { background: transparent; color: #dbe3ff; border: 0; padding: 6px 11px; font-weight: 700; font-size: .78rem; letter-spacing: .05em; }
.seg button:hover { background: rgba(255, 255, 255, .12); }
.seg button[aria-pressed="true"] { background: var(--green); color: #03140d; }
.linkbtn { color: #dbe3ff; text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; }
.linkbtn:hover { color: #fff; }
.kbtn { display: inline-flex; align-items: center; gap: 10px; background: rgba(4, 16, 31, .35); border: 1px solid rgba(255, 255, 255, .45); color: #dbe3ff; border-radius: var(--radius); padding: 5px 8px 5px 12px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.kbtn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
kbd { font: 11px var(--mono); color: var(--text-2); background: rgba(255, 255, 255, .08); border: 1px solid var(--line2); border-radius: 2px; padding: 1px 5px; text-transform: none; letter-spacing: 0; }

/* ───── titres de page ───── */
.pagehead { display: flex; flex-direction: column; gap: 6px; border-bottom: 1px dashed var(--line2); padding-bottom: 16px; margin-bottom: 4px; }
.pagehead h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); color: #fff; margin: 0; }
.pagehead h1::after { content: ''; display: inline-block; width: .42em; height: .09em; background: var(--green); margin-left: .1em; }
.label, .h2 { font-family: var(--mono); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

/* ───── cartes et tuiles : plates, angles droits ───── */
.wrap { max-width: 1280px; padding: 26px clamp(12px, 3vw, 28px) 60px; }
.card, .tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s; backdrop-filter: none; }
.card { padding: 18px; }
.card > h3 { font-size: 1.3rem; letter-spacing: .03em; margin: 0 0 2px; color: #fff; }
.card > h3::before { content: '< '; color: var(--green); font-family: var(--mono); font-size: .8em; }
.card > h3::after { content: ' />'; color: var(--green); font-family: var(--mono); font-size: .8em; }
.card .sub { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted); margin-bottom: 14px; }
.tile::before, .card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 245, 155, .07), transparent 62%); }
.tile:hover::before, .card:hover::before { opacity: 1; }
.tile:hover, .card:hover { border-color: var(--line2); }
.tile { padding: 14px 16px 12px; border-left: 3px solid var(--blue); }
.tile:hover { border-left-color: var(--green); }
.tile .l { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-family: var(--display); font-weight: 400; font-size: 2.6rem; letter-spacing: .02em; line-height: 1; margin-top: 6px; color: #fff; background: none; -webkit-text-fill-color: currentColor; }
.tile .v.sm { font-size: 1.7rem; padding: 6px 0 3px; }
.tile .d { font-size: .78rem; }
.tile .v.good { color: var(--green); } .tile .v.crit { color: var(--crit); } .tile .v.warnc { color: var(--warn); }
.tbl th { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--line2); }
.tbl td { border-bottom: 1px solid var(--line); }
.banner { border-radius: var(--radius); }
.hb .fl { border-radius: 0; }
.meter .mt, .meter .mf { border-radius: 1px; }
.empty { font-family: var(--mono); font-size: .8rem; }
.tbtn { border-radius: 2px; }
.tip { border-radius: var(--radius); background: var(--surface-2); border-color: var(--line2); }
.note { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* ───── boutons ───── */
.btn { background: transparent; border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--radius); padding: 9px 16px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; font-size: .8rem; color: var(--text); transition: background .12s, border-color .12s, color .12s; }
.btn:hover:not([disabled]) { background: rgba(255, 255, 255, .09); border-color: #fff; box-shadow: none; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #03140d; }
.btn.primary:hover:not([disabled]) { background: #33ffb5; border-color: #33ffb5; }
.btn.danger { background: transparent; border-color: var(--orange); color: #ffb3a3; }
.btn.danger:hover:not([disabled]) { background: rgba(255, 90, 54, .15); border-color: var(--orange); }
.btn.ghost { border-color: var(--line2); }
.btn-discord { border-radius: var(--radius); background: #5865f2; text-transform: uppercase; letter-spacing: .07em; font-size: .85rem; }

/* ───── connexion ───── */
.gate-card { border-radius: var(--radius); border: 1px solid var(--line2); border-top: 4px solid var(--green); background: var(--surface); }
.gate-card h1 { font-size: 3.2rem; color: #fff; }
.gate-card h1::after { content: ''; display: inline-block; width: .42em; height: .09em; background: var(--green); margin-left: .1em; }
.gate-sub { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.gate-logo { border-radius: 3px; border: 2px solid #fff; padding: 3px; background: #04101f; }

/* ───── centre de contrôle ───── */
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); position: relative; }
.hero h2 { margin: 0; font-size: 2rem; color: #fff; }
.hero p { margin: 4px 0 0; color: var(--text-2); font-family: var(--mono); font-size: .8rem; }
.hero .grow { flex: 1; min-width: 220px; }
.orb { position: relative; width: 38px; height: 38px; flex: none; }
.orb i, .orb b { position: absolute; inset: 0; border-radius: 50%; background: var(--green); }
.orb.warn i, .orb.warn b { background: var(--warn); }
.orb.bad i, .orb.bad b { background: var(--crit); }
.hero:has(.orb.warn) { border-left-color: var(--warn); }
.hero:has(.orb.bad) { border-left-color: var(--crit); }
.svcgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.svc { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.svc .top2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.svc b { font-family: var(--mono); font-size: .9rem; }
.svc small { color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.pill { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 2px; border: 1px solid currentColor; white-space: nowrap; }
.svc .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.svc .btn { padding: 5px 12px; font-size: .72rem; }
.acts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.act { text-align: left; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font: inherit; text-decoration: none; transition: background .15s, border-color .15s; }
.act:hover:not([disabled]) { background: var(--surface-2); border-color: var(--green); }
.act[disabled] { opacity: .4; cursor: not-allowed; }
.act .ai { width: 34px; height: 34px; border-radius: 2px; display: grid; place-items: center; background: var(--blue); font-size: 16px; }
.act.warnish .ai { background: var(--orange); }
.act b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: .04em; text-transform: uppercase; }
.act .ds { color: var(--muted); font-size: .8rem; }
.act .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { background: var(--surface-2); border: 1px solid var(--line2); color: var(--text-2); padding: 3px 10px; font: .76rem var(--mono); cursor: pointer; border-radius: 2px; }
.chip:hover { border-color: var(--green); color: #fff; }

/* ───── console ───── */
.consolegrid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .consolegrid { grid-template-columns: 1fr; } }
.term { background: #04070f; border: 1px solid var(--line2); border-radius: var(--radius); display: flex; flex-direction: column; height: 520px; font: .82rem/1.5 var(--mono); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); }
.term-bar i:first-child { background: var(--orange); }
.term-bar i:nth-child(2) { background: var(--warn); }
.term-bar i:nth-child(3) { background: var(--green); }
.term-out { flex: 1; overflow: auto; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; color: #cfd6f0; }
.term-out .ln, .lg .ln { display: block; min-height: 1.5em; }
.term-out .cmd { color: #fff; }
.term-out .cmd::before { content: '$ '; color: var(--green); }
.term-out .ok, .lg .ok { color: var(--green); }
.term-out .bad, .lg .bad { color: var(--crit); }
.term-out .warn, .lg .warn { color: var(--warn); }
.term-out .dim, .lg .dim { color: var(--muted); }
.term-in-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px 14px; }
.term-in-row::before { content: '$'; color: var(--green); font-weight: 700; }
.term-in { flex: 1; background: transparent; border: 0; color: #fff; font: inherit; outline: none; padding: 4px 0; min-width: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.lgbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.lgbar select, .lgbar input[type="text"] { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius); color: var(--text); padding: 6px 8px; font: .8rem var(--mono); min-width: 0; }
.lgbar input[type="text"] { flex: 1; min-width: 90px; }
.lgbar label { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-2); font-family: var(--mono); }
.lg { background: #04070f; border: 1px solid var(--line); border-radius: var(--radius); height: 392px; overflow: auto; padding: 8px 10px; font: .72rem/1.55 var(--mono); color: #b9c2e4; }
.lg .ln { white-space: pre-wrap; word-break: break-word; }
.live { display: inline-flex; align-items: center; gap: 6px; font: .7rem var(--mono); color: var(--green); letter-spacing: .1em; text-transform: uppercase; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live.off { color: var(--muted); }

/* ───── notifications, fenêtres, palette ───── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 10px; justify-items: end; }
.toast { display: flex; gap: 10px; align-items: center; max-width: min(380px, 90vw); background: var(--surface-2); border: 1px solid var(--line2); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 12px 36px rgba(0, 0, 0, .55); cursor: pointer; font-size: .88rem; }
.toast.err { border-left-color: var(--crit); }
.toast.info { border-left-color: var(--blue); }
.toast .ti { color: var(--green); font-weight: 700; }
.toast.err .ti { color: var(--crit); }
.toast.info .ti { color: var(--link); }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(3, 5, 12, .74); display: grid; place-items: center; padding: 20px; }
.modal-back.top { align-items: start; padding-top: 14vh; }
.modal { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line2); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: 22px 22px 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
.modal.danger { border-top-color: var(--orange); }
.modal h3 { margin: 0 0 8px; font-size: 1.7rem; color: #fff; }
.modal p { margin: 0 0 18px; color: var(--text-2); line-height: 1.5; }
.modal-actions { display: flex; justify-content: center; margin-top: 12px; }
.slide { position: relative; height: 52px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line2); overflow: hidden; user-select: none; touch-action: none; }
.slide-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--orange); opacity: .8; }
.modal:not(.danger) .slide-fill { background: var(--blue); }
.slide-txt { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; padding-left: 40px; }
.knob { position: absolute; top: 4px; left: 4px; width: 42px; height: 42px; border-radius: 2px; border: 0; cursor: grab; background: var(--green); color: #03140d; font-size: 18px; font-weight: 700; }
.knob:active { cursor: grabbing; }
.pal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line2); border-top: 4px solid var(--green); border-radius: var(--radius); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); overflow: hidden; }
.pal-in { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: 1rem var(--mono); padding: 16px 18px; outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.pal-it { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 2px; cursor: pointer; color: var(--text-2); }
.pal-it.sel { background: var(--surface-3); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.pal-g { font: .68rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); min-width: 78px; }
.pal-l { flex: 1; }
.pal-empty { padding: 18px; text-align: center; color: var(--muted); }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font: .7rem var(--mono); }
@media (max-width: 640px) { .kbtn span { display: none; } .toasts { left: 12px; right: 12px; justify-items: stretch; } .top-in { gap: 10px; padding-top: 8px; } .tabs { order: 3; width: 100%; overflow-x: auto; } .tabs a { padding: 12px 12px; } .brand { font-size: 1.6rem; } }
