/* Wizzy — habillage "Luna" façon années 2003-2005, entièrement recréé en CSS */
:root {
  --font: Tahoma, "Segoe UI", Verdana, Geneva, sans-serif;
  --luna-1: #0a5ee8; --luna-2: #3d95ff; --luna-3: #0050d8; --luna-dark: #0831d9;
  --panel-1: #f3f8ff; --panel-2: #d6e6fb; --panel-border: #7f9db9;
  --link: #0044cc; --text: #000; --muted: #7a8794; --group: #1a3e8c;
  --sel: #c5ddfa; --sel-border: #84acdd;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 12px/1.35 var(--font); color: var(--text); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; user-select: none; -webkit-user-select: none; }
input, textarea, button, select { font: inherit; }
a { color: var(--link); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.svgbox { display: inline-block; overflow: hidden; }
.svgbox > svg { width: 100%; height: 100%; display: block; }
.emo { display: inline-block; vertical-align: -4px; flex: none; }
.emo > svg { width: 100%; height: 100%; display: block; }

/* ---------- version navigateur : simple fond neutre ---------- */
body.web { background: linear-gradient(#f4f7fb, #e3e9f2); }
body.web #desktop { position: fixed; inset: 0; }

/* ---------- fenêtre XP ---------- */
.xp-window { position: absolute; display: flex; flex-direction: column; border-radius: 8px 8px 0 0; overflow: hidden;
  background: var(--luna-3); padding: 0 3px 3px; box-shadow: 2px 3px 12px rgba(0,0,0,.45); border: 1px solid var(--luna-dark); }
body.native .xp-window { position: fixed; inset: 0; box-shadow: none; }
.xp-window.inactive { background: #7a96df; border-color: #6a85cf; }
.titlebar { height: 28px; flex: none; display: flex; align-items: center; gap: 5px; padding: 0 2px 0 4px; margin: 0 -3px; color: #fff;
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 9%, #0050ee 18%, #06f 46%, #0066ff 60%, #005bff 80%, #003dd7 100%);
  font: bold 13px var(--font); text-shadow: 1px 1px #0a1f6e; cursor: default; -webkit-app-region: drag; }
.xp-window.inactive .titlebar { background: linear-gradient(#a7bdf2, #7d9ce6 30%, #7894e3); text-shadow: none; color: #d8e4f8; }
.titlebar .ticon { width: 16px; height: 16px; flex: none; }
.titlebar .ttext { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.titlebar .tbtn { width: 21px; height: 21px; border-radius: 3px; border: 1px solid #fff; -webkit-app-region: no-drag; display: grid; place-items: center;
  background: linear-gradient(135deg, #3c8cff, #1a62f0 45%, #0d4fe0); box-shadow: inset 0 0 2px #fff6; cursor: pointer; }
.titlebar .tbtn:hover { filter: brightness(1.15); }
.titlebar .tbtn.close { background: linear-gradient(135deg, #f0a08a, #e1593a 45%, #c63a1c); }
.titlebar .tbtn svg { width: 11px; height: 11px; }
.menubar { display: flex; gap: 2px; padding: 1px 4px; background: #ece9d8; border-bottom: 1px solid #fff; margin: 0 -3px; flex: none; position: relative; }
.menubar > div { padding: 2px 7px; border-radius: 2px; cursor: default; position: relative; }
.menubar > div:hover, .menubar > div.open { background: #316ac5; color: #fff; }
.client { flex: 1; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(#f6faff, #dfeafa 60%, #cfe0f7); position: relative; }

/* menus déroulants / contextuels */
.menu { position: fixed; z-index: 100000; min-width: 170px; background: #fff; border: 1px solid #8a8a8a; box-shadow: 2px 2px 4px rgba(0,0,0,.35); padding: 2px; color: #000; }
.menu .mi { padding: 4px 20px 4px 24px; white-space: nowrap; position: relative; }
.menu .mi:hover { background: #316ac5; color: #fff; }
.menu .mi.disabled { color: #aaa; pointer-events: none; }
.menu .mi .ico { position: absolute; left: 4px; top: 2px; }
.menu .sep { height: 1px; background: #c5c5c5; margin: 3px 2px; }
.menu .mi.checked::before { content: "•"; position: absolute; left: 9px; font-weight: bold; }

/* ---------- contrôles ---------- */
.btn { min-width: 75px; height: 24px; padding: 0 12px; border: 1px solid #003c74; border-radius: 3px; cursor: pointer; color: #000;
  background: linear-gradient(#fff, #ecebe6 86%, #d6d0c5); box-shadow: inset -1px -1px #d6d0c5, inset 1px 1px #fff; }
.btn:hover { box-shadow: inset 0 0 0 2px #f8b330, inset 0 -2px 0 2px #e5a01a; }
.btn:active { background: linear-gradient(#e5e4de, #f0efea); }
.btn.default { box-shadow: inset 0 0 0 2px #98b8ea, inset 0 -2px 0 2px #7aa1dc; }
.btn:disabled { color: #aca899; border-color: #c9c7ba; box-shadow: none; cursor: default; }
.btn.big { height: 30px; font-weight: bold; padding: 0 20px; }
.field { width: 100%; height: 22px; padding: 2px 5px; border: 1px solid var(--panel-border); background: #fff; border-radius: 0; outline: none; user-select: text; -webkit-user-select: text; }
.field:focus { border-color: #3c7fb1; box-shadow: 0 0 0 1px #c5daf3; }
label.chk { display: flex; align-items: center; gap: 6px; margin: 3px 0; cursor: pointer; }
label.chk input { margin: 0; accent-color: #2a6be6; }
.error { color: #c00; min-height: 16px; margin: 4px 0; }
.dropdown { cursor: pointer; display: inline-flex; align-items: center; gap: 3px; border-radius: 2px; padding: 1px 3px; }
.dropdown:hover { background: rgba(255,255,255,.7); outline: 1px solid #a9c4e8; }
.dropdown::after { content: ""; border: 4px solid transparent; border-top-color: #333; margin-top: 4px; }

/* ---------- écran de connexion ---------- */
.login { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 18px 26px 12px; overflow-y: auto; overflow-x: hidden; position: relative; }
.login::after { content: ""; position: absolute; right: -40px; bottom: 0; width: 220px; height: 220px; opacity: .09; background: var(--wm) no-repeat center/contain; pointer-events: none; }
.login .bigpic { width: 104px; height: 104px; border-radius: 7px; border: 1px solid #8eaedb; background: #fff; padding: 6px; box-shadow: 0 2px 4px rgba(40,80,150,.25); margin-bottom: 14px; }
.login .bigpic svg, .login .bigpic img { width: 100%; height: 100%; object-fit: cover; }
.login form { width: 100%; max-width: 240px; position: relative; z-index: 1; }
.login .lbl { margin: 6px 0 2px; }
.login .status-pick { margin: 10px 0 8px; }
.login .actions { text-align: center; margin: 14px 0 10px; }
.login .links { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 8px; position: relative; z-index: 1; width: 100%; max-width: 240px; }
.login .social { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.login .social .btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login .tabs { display: flex; gap: 14px; margin-bottom: 4px; }
.login .tabs a.on { font-weight: bold; color: #000; text-decoration: none; cursor: default; }
.logo { display: flex; align-items: center; gap: 4px; font: italic bold 18px var(--font); color: #1c3f94; letter-spacing: -.5px; }
.logo .bolt { width: 18px; height: 18px; }
.panelhead { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: linear-gradient(#ffffff, #e3eefc); border-bottom: 1px solid #b6cbe9; color: #1c3f94; font-weight: bold; flex: none; }
.panelhead .roundbtn { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #7f9db9; background: linear-gradient(#fff, #d8e4f4); display: grid; place-items: center; font-size: 9px; }

/* ---------- liste de contacts ---------- */
.me-header { display: flex; gap: 10px; padding: 8px 10px; background: linear-gradient(#fdfeff, #e5effc); border-bottom: 1px solid #b6cbe9; flex: none; }
.me-header .pic { width: 58px; height: 58px; border: 1px solid #8eaedb; border-radius: 4px; background: #fff; padding: 2px; flex: none; cursor: pointer; overflow: hidden; }
.me-header .pic > * { width: 100%; height: 100%; object-fit: cover; }
.me-header .info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.me-header .name { font-size: 14px; font-weight: bold; color: #000; }
.me-header .name .st { font-weight: normal; color: var(--muted); font-size: 12px; }
.me-header .pm { color: #333; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me-header .pm.empty { color: var(--muted); font-style: italic; }
.me-header .pm-edit { height: 20px; font-size: 12px; }
.me-header .bar { display: flex; gap: 14px; margin-top: 2px; }
.trial-bar { flex: none; padding: 5px 10px; background: linear-gradient(#fff9d6, #ffeea0); border-bottom: 1px solid #e3c55c; display: flex; align-items: center; gap: 8px; font-size: 11px; }
.trial-bar b { color: #8a5a00; }
.trial-bar a { margin-left: auto; font-weight: bold; white-space: nowrap; }
.trial-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-tabs { display: flex; flex: 1; min-height: 0; }
.contact-list { flex: 1; overflow-y: auto; background: #fff; padding: 4px 0 8px; border-top: 1px solid #c3d4ec; }
.group-h { display: flex; align-items: center; gap: 5px; padding: 3px 8px; color: var(--group); font-weight: bold; cursor: pointer; margin-top: 3px; }
.group-h .tog { width: 11px; height: 11px; border: 1px solid #7f9db9; background: linear-gradient(#fff, #dce7f5); display: grid; place-items: center; font: bold 10px/1 monospace; color: #234; }
.contact { display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 24px; white-space: nowrap; overflow: hidden; cursor: default; border: 1px solid transparent; }
.contact:hover { background: #eef4fd; border-color: #d7e5f8; }
.contact.sel { background: var(--sel); border-color: var(--sel-border); }
.contact .nm { overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 65%; }
.contact .st, .contact .status-icon { flex: none; }
.contact .st { color: var(--muted); }
.contact .pm { color: #555; font-style: italic; overflow: hidden; text-overflow: ellipsis; }
.contact .badge { margin-left: auto; background: #e1352a; color: #fff; border-radius: 8px; font-size: 10px; font-weight: bold; padding: 0 5px; min-width: 16px; text-align: center; }
.contact.offline .nm { color: #555; }
.contact.request { padding-left: 24px; background: #fffbe0; }
.contact.request .acts { margin-left: auto; display: flex; gap: 6px; }
.empty-hint { color: var(--muted); padding: 2px 8px 2px 26px; font-style: italic; }
.empty-hint .box { display: inline-block; border: 1px solid #c3d4ec; padding: 1px 6px; }
.list-foot { flex: none; border-top: 1px solid #c3d4ec; background: linear-gradient(#f2f7fe, #dde9f9); padding: 6px 10px; display: flex; flex-direction: column; gap: 6px; }
.list-foot .add { display: flex; align-items: center; gap: 5px; font-weight: bold; }
.list-foot .add .plus { color: #2a9a2a; font-size: 16px; line-height: 1; }
.searchrow { display: flex; gap: 6px; align-items: center; }
.promo { margin: 0 10px 8px; height: 56px; border: 1px solid #7aa4dc; border-radius: 3px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: linear-gradient(135deg, #0f5ccd, #4aa2f2 60%, #b7e0ff); color: #fff; font-weight: bold; cursor: pointer; overflow: hidden; flex: none; }
.promo .new { background: #8ad43e; color: #134d00; font-size: 10px; padding: 1px 5px; transform: rotate(-12deg); border-radius: 2px; }
.promo small { display: block; font-weight: normal; opacity: .95; }

/* ---------- fenêtre de conversation ---------- */
.chat-toolbar { display: flex; gap: 2px; padding: 4px 8px 2px; flex: none; align-items: flex-end; border-bottom: 1px solid #c4d6f0; background: linear-gradient(#fbfdff, #e5effc); }
.tool { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 7px; border-radius: 3px; border: 1px solid transparent; cursor: pointer; min-width: 52px; }
.tool:hover { border-color: #a9c4e8; background: linear-gradient(#fff, #e3eefc); }
.tool .ti { width: 30px; height: 30px; }
.tool span { font-size: 11px; color: #222; }
.tool span u { text-decoration: underline; }
.chat-toolbar .brand { margin-left: auto; align-self: center; }
.chat-main { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 8px; }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pics { width: 128px; flex: none; display: flex; flex-direction: column; justify-content: space-between; }
.picbox { border: 1px solid #8eaedb; border-radius: 6px; background: linear-gradient(#fff, #e6effb); padding: 6px; box-shadow: 0 1px 3px rgba(40,80,150,.2); }
.picbox .pic { width: 114px; height: 114px; border-radius: 4px; overflow: hidden; border: 1px solid #b7c9e3; background: #fff; display: block; }
.picbox .pic > * { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel { border: 1px solid var(--panel-border); border-radius: 5px; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.to-line { padding: 4px 8px; border-bottom: 1px solid #d5e1f1; background: linear-gradient(#fff, #eef4fc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-line b { font-weight: bold; }
.to-line .pm { color: #555; font-style: italic; }
.history { flex: 1; overflow-y: auto; padding: 6px 10px; user-select: text; -webkit-user-select: text; }
.msg-head { color: #555; margin-top: 6px; }
.msg-head .time { color: #9aa; font-size: 10px; margin-left: 4px; }
.msg-body { padding-left: 12px; word-wrap: break-word; white-space: pre-wrap; }
.msg-body .emo { display: inline-block; vertical-align: -4px; }
.msg-body .emo svg { width: 100%; height: 100%; }
.sys { color: #666; margin: 6px 0; display: flex; align-items: center; gap: 6px; }
.sys .ico { width: 16px; height: 16px; flex: none; }
.sys.wizz { color: #b05000; font-weight: bold; }
.sys .act { margin-left: 6px; }
.day-sep { text-align: center; color: #9aa; font-size: 10px; margin: 10px 0 4px; border-bottom: 1px solid #eee; line-height: .1em; }
.day-sep span { background: #fff; padding: 0 6px; }
.read-mark { color: #9aa; font-size: 10px; text-align: right; }
.status-line { height: 18px; padding: 0 8px; color: #555; font-size: 11px; flex: none; }
.compose { height: 112px; flex: none; }
.compose .ctools { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border-bottom: 1px solid #d5e1f1; background: linear-gradient(#fdfeff, #e8f0fb); }
.ctool { height: 24px; min-width: 26px; display: inline-flex; align-items: center; gap: 2px; padding: 0 4px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 11px; }
.ctool:hover { border-color: #a9c4e8; background: #fff; }
.ctool .emo, .ctool svg { width: 18px; height: 18px; }
.ctool.font { font: bold 17px Georgia, serif; color: #1c3f94; }
.ctool.on { background: #d7e6fb; border-color: #84acdd; }
.compose .row { flex: 1; display: flex; min-height: 0; }
.compose textarea { flex: 1; border: 0; resize: none; padding: 5px 7px; outline: none; user-select: text; -webkit-user-select: text; font-size: 13px; }
.compose .sendcol { display: flex; flex-direction: column; gap: 5px; padding: 6px; }
.compose .sendcol .btn { width: 76px; height: 34px; }
.picker { position: absolute; z-index: 1000; background: #fff; border: 1px solid #7f9db9; box-shadow: 2px 3px 8px rgba(0,0,0,.3); padding: 4px; display: grid; gap: 2px; }
.picker.emos { grid-template-columns: repeat(6, 30px); }
.picker .pk { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; cursor: pointer; }
.picker .pk:hover { border-color: #316ac5; background: #e3eefc; }
.picker .pk .emo { width: 22px; height: 22px; }
.picker.list { grid-template-columns: 1fr; min-width: 180px; }
.picker.list .row { padding: 5px 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.picker.list .row:hover { background: #316ac5; color: #fff; }
.picker .swatch { width: 18px; height: 18px; border: 1px solid #777; }
.picker.colors { grid-template-columns: repeat(8, 20px); }
.picker.colors .pk { width: 20px; height: 20px; }
.statusbar { flex: none; height: 22px; display: flex; align-items: center; padding: 0 8px; border-top: 1px solid #b6cbe9; background: linear-gradient(#f5f9ff, #dce8f8); font-size: 11px; }
.statusbar a { font-weight: bold; }

/* Wizz : on secoue */
@keyframes shake {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-9px,4px); } 20% { transform: translate(8px,-5px); } 30% { transform: translate(-7px,-6px); }
  40% { transform: translate(9px,5px); } 50% { transform: translate(-6px,7px); } 60% { transform: translate(7px,-4px); } 70% { transform: translate(-8px,3px); }
  80% { transform: translate(5px,6px); } 90% { transform: translate(-4px,-5px); }
}
.shaking { animation: shake .55s linear 2; }

/* ---------- jeux ---------- */
.game-pane { position: absolute; inset: 8px; border: 1px solid var(--panel-border); border-radius: 5px; overflow: hidden; background: rgba(214,230,251,.96); z-index: 50; display: flex; flex-direction: column; }
.game-pane .ghead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: linear-gradient(#fff, #dce8f8); border-bottom: 1px solid #a9c4e8; font-weight: bold; color: #1c3f94; }
.game-pane .ghead .gquit { margin-left: auto; }
.game-pane .gbody { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 10px; overflow: auto; }
.game-info { text-align: center; margin: 6px 0; font-weight: bold; min-height: 18px; }
.ttt { display: grid; grid-template-columns: repeat(3, 72px); gap: 4px; background: #4a6ea9; padding: 4px; border-radius: 6px; }
.ttt div { width: 72px; height: 72px; background: linear-gradient(#fff, #e9f1fc); border-radius: 3px; display: grid; place-items: center; font: bold 44px Verdana, sans-serif; cursor: pointer; }
.ttt div.x { color: #d9372b; } .ttt div.o { color: #1d63d8; } .ttt div.win { background: #fff3a0; }
.c4 { display: grid; grid-template-columns: repeat(7, 38px); gap: 4px; background: linear-gradient(#2d6be0, #1849b5); padding: 6px; border-radius: 8px; }
.c4 div { width: 38px; height: 38px; border-radius: 50%; background: #e8f0fb; box-shadow: inset 2px 2px 4px rgba(0,0,0,.4); cursor: pointer; }
.c4 div.r { background: radial-gradient(circle at 35% 30%, #ff9d8a, #d9372b 60%, #8f1b14); }
.c4 div.y { background: radial-gradient(circle at 35% 30%, #fff38a, #ffc400 60%, #b07a00); }
.c4 div.win { outline: 3px solid #fff; }
.mines { display: grid; gap: 0; border: 3px solid; border-color: #808080 #fff #fff #808080; background: #c0c0c0; }
.mines div { width: 22px; height: 22px; display: grid; place-items: center; font: bold 13px Verdana, sans-serif; border: 2px solid; border-color: #fff #808080 #808080 #fff; background: #c0c0c0; cursor: default; }
.mines div.open { border: 1px solid #9a9a9a; background: #d4d4d4; }
.mines div.boom { background: #ff3b30; }
.mines-top { display: flex; justify-content: space-between; align-items: center; background: #c0c0c0; padding: 5px; border: 3px solid; border-color: #808080 #fff #fff #808080; margin-bottom: 6px; }
.lcd { font: bold 20px "Courier New", monospace; background: #000; color: #f00; padding: 0 4px; min-width: 46px; text-align: right; }
.smiley { width: 28px; height: 28px; border: 2px solid; border-color: #fff #808080 #808080 #fff; display: grid; place-items: center; cursor: pointer; background: #c0c0c0; }
.smiley .emo { width: 20px; height: 20px; }
canvas.snake { background: #9bbc0f; border: 6px solid #306230; border-radius: 4px; image-rendering: pixelated; }

/* ---------- divers ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.18); z-index: 9000; display: grid; place-items: center; }
.dialog { position: relative !important; min-width: 300px; max-width: 92vw; }
.dialog .client { padding: 14px 16px; background: #ece9d8; }
.dialog .dbuttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog .row { display: flex; gap: 12px; align-items: flex-start; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; margin: 10px 0; }
.avatar-grid .av { width: 64px; height: 64px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; background: #fff; overflow: hidden; }
.avatar-grid .av.sel { border-color: #316ac5; }
.avatar-grid .av > * { width: 100%; height: 100%; object-fit: cover; }

/* notification "toast" qui glisse en bas à droite */
.toast { position: fixed; right: 12px; bottom: 12px; width: 210px; height: 120px; z-index: 100001; border: 1px solid #5a7edc; border-radius: 4px 4px 0 0; overflow: hidden;
  background: linear-gradient(#e4eefd, #b7d0f5); box-shadow: 2px 2px 8px rgba(0,0,0,.35); animation: toastin .35s ease-out; cursor: pointer; }
body.toastwin .toast { position: fixed; inset: 0; width: auto; height: auto; right: 0; bottom: 0; animation: none; }
.toast .th { height: 20px; background: linear-gradient(#5d90f5, #2a62de); color: #fff; font-size: 11px; display: flex; align-items: center; gap: 4px; padding: 0 5px; }
.toast .th .x { margin-left: auto; cursor: pointer; }
.toast .tb { display: flex; gap: 8px; padding: 10px; align-items: center; height: calc(100% - 20px); }
.toast .tb .pic { width: 48px; height: 48px; flex: none; border: 1px solid #8eaedb; background: #fff; overflow: hidden; }
.toast .tb .pic > * { width: 100%; height: 100%; object-fit: cover; }
.toast .tb .txt { font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
@keyframes toastin { from { transform: translateY(140px); } to { transform: translateY(0); } }

/* clins d'œil (animations plein écran dans la conversation) */
.wink-layer { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.wink-layer .p { position: absolute; will-change: transform, opacity; }
