/* games/ubuntu-logs/style.css — Bureau Ubuntu (GNOME, thème sombre façon Yaru) simulé.
   Fenêtres à barre d'en-tête intégrée, dock à gauche, barre du haut noire, accent orange.
   Mobile (≤ 760 px) : fenêtres plein écran, dock en bas. */
:root {
  --ub-accent: #E95420; --ub-accent-2: #f07746; --ub-top: #0b0b0b; --ub-win: #242424; --ub-head: #2e2e2e; --ub-side: #2a2a2a;
  --ub-line: #3a3a3a; --ub-line-2: #484848; --ub-text: #f2f2f2; --ub-sub: #b5b5b5; --ub-dim: #8a8a8a;
  --ub-ok: #3fb950; --ub-warn: #f0b429; --ub-err: #ff6b6b; --ub-mark: rgba(233, 84, 32, .45);
  --ub-mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", monospace;
  --ub-sans: "IBM Plex Sans", Cantarell, "Noto Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2c001e; }
body { font: 14px/1.45 var(--ub-sans); color: var(--ub-text); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ub-accent-2); outline-offset: 2px; }
.mono { font-family: var(--ub-mono); }
[hidden] { display: none !important; }

.ub { position: fixed; inset: 0; display: grid; grid-template-rows: 32px 1fr; grid-template-columns: 72px 1fr; }

/* ---------------------------------------------------------- barre du haut */
.ub-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--ub-top); position: relative; z-index: 9000; font-size: 13.5px; font-weight: 500; }
.ub-act, .ub-chip, .ub-tray { height: 24px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; display: inline-flex; align-items: center; gap: 8px; }
.ub-act:hover, .ub-chip:hover, .ub-tray:hover, .ub-tray[aria-expanded="true"] { background: rgba(255,255,255,.12); }
.ub-chip { font: 500 12.5px var(--ub-mono); color: var(--ub-sub); }
.ub-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ub-accent); box-shadow: 0 0 0 3px rgba(233,84,32,.25); }
.ub-chip-dot.ok { background: var(--ub-ok); box-shadow: 0 0 0 3px rgba(63,185,80,.25); }
.ub-clock { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.ub-tray { margin-left: auto; gap: 10px; }

/* ---------------------------------------------------------------- bureau */
.ub-desk { grid-column: 2; grid-row: 2; position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 85% 110%, rgba(233,84,32,.55), transparent 60%),
    radial-gradient(900px 600px at 10% -10%, rgba(119,33,111,.75), transparent 60%),
    linear-gradient(135deg, #2c001e 0%, #4a0f3d 45%, #77216f 75%, #a8321f 100%); }
.ub-desk::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.025) 0 2px, transparent 2px 46px); pointer-events: none; }

/* ------------------------------------------------------------------ dock */
.ub-dock { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; background: rgba(20,20,20,.82); border-right: 1px solid rgba(255,255,255,.06); z-index: 8000; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ub-dock-btn { position: relative; width: 56px; height: 56px; border: 0; border-radius: 12px; background: transparent; display: grid; place-items: center; }
.ub-dock-btn:hover { background: rgba(255,255,255,.1); }
.ub-dock-btn.active { background: rgba(255,255,255,.14); }
.ub-dock-btn.running::before { content: ""; position: absolute; left: 2px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--ub-accent); }
.ub-dock-btn.active::before { height: 14px; margin-top: -7px; border-radius: 2px; }
.ub-dock-grid { margin-top: auto; }

/* --------------------------------------------------------------- fenêtres */
.ub-win { position: absolute; display: flex; flex-direction: column; min-width: 300px; min-height: 200px; background: var(--ub-win); border: 1px solid #111; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 18px 48px rgba(0,0,0,.45); resize: both; }
.ub-win:not(.focused) { box-shadow: 0 2px 6px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.3); }
.ub-win:not(.focused) .ub-head { background: #262626; color: var(--ub-sub); }
.ub-win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.ub-head { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 46px; padding: 6px 8px 6px 10px; background: var(--ub-head); border-bottom: 1px solid #1a1a1a; user-select: none; touch-action: none; cursor: default; }
.ub-title { grid-row: 1; grid-column: 2; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.ub-head-tools { grid-row: 1; grid-column: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ub-ctrls { grid-row: 1; grid-column: 3; display: flex; gap: 8px; justify-self: end; }
.ub-ctrl { width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; color: var(--ub-text); }
.ub-ctrl svg { width: 12px; height: 12px; }
.ub-ctrl:hover { background: rgba(255,255,255,.2); }
.ub-ctrl.close { background: var(--ub-accent); }
.ub-ctrl.close:hover { background: var(--ub-accent-2); }
.ub-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.ub-pad { padding: 18px 20px 22px; }

/* champs, boutons */
.ub-search, .ub-input { height: 32px; min-width: 0; padding: 0 10px; border: 1px solid var(--ub-line-2); border-radius: 6px; background: #1c1c1c; color: var(--ub-text); }
.ub-search { width: min(360px, 100%); }
.ub-search:focus, .ub-input:focus { outline: none; border-color: var(--ub-accent); box-shadow: 0 0 0 2px rgba(233,84,32,.3); }
.ub-btn { height: 34px; padding: 0 14px; border: 1px solid var(--ub-line-2); border-radius: 6px; background: #3a3a3a; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.ub-btn:hover { background: #454545; }
.ub-btn.sug { background: var(--ub-accent); border-color: var(--ub-accent); color: #fff; }
.ub-btn.sug:hover { background: var(--ub-accent-2); }
.ub-btn.flat { background: transparent; }
.ub-btn.wide { width: 100%; margin-top: 6px; }
.ub-link { border: 0; background: none; padding: 2px 0; color: var(--ub-accent-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.ub-tool { width: 32px; height: 32px; border: 0; border-radius: 6px; background: rgba(255,255,255,.08); display: grid; place-items: center; flex: 0 0 auto; }
.ub-tool:hover { background: rgba(255,255,255,.16); }
.ub-count { color: var(--ub-sub); font-size: 12.5px; white-space: nowrap; }
.ub-empty { margin: 24px; color: var(--ub-dim); text-align: center; }
mark { background: var(--ub-mark); color: #fff; border-radius: 2px; padding: 0 1px; }

/* barre latérale commune (Journaux, Fichiers) */
.ub-side { display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--ub-side); border-right: 1px solid var(--ub-line); overflow: auto; }
.ub-side-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 13.5px; color: var(--ub-text); }
.ub-side-item small { color: var(--ub-dim); font: 12px var(--ub-mono); }
.ub-side-item:hover { background: rgba(255,255,255,.07); }
.ub-side-item.on { background: rgba(233,84,32,.22); }
.ub-side-item.on small { color: var(--ub-text); }

/* ------------------------------------------------------------ mission */
.ub-brief h2, .ub-report h2 { margin: 2px 0 10px; font-size: 20px; line-height: 1.25; }
.ub-brief p { margin: 0 0 12px; color: var(--ub-sub); }
.ub-kicker { margin: 0; font: 600 11.5px var(--ub-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ub-accent-2); }
.ub-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 6px; }
.ub-tips { padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--ub-line); border-left: 3px solid var(--ub-accent); border-radius: 6px; background: #1e1e1e; }
.ub-tips b:first-child { display: block; margin-bottom: 6px; }
.ub-tips p { margin: 4px 0 0; font-size: 13px; }
.ub-tips p b { color: var(--ub-text); }
.ub-note { font-size: 12px; color: var(--ub-dim) !important; }

/* ------------------------------------------------------------ Journaux */
.ub-logs { display: grid; grid-template-columns: 190px minmax(0, 1fr); height: 100%; }
.ub-logs-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; }
.ub-logs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 12px; border-bottom: 1px solid var(--ub-line); font-size: 12.5px; color: var(--ub-sub); }
.ub-logs-bar .ub-link { margin-left: auto; }
.ub-loglist { overflow: auto; font: 12px/1.55 var(--ub-mono); background: #1d1d1d; }
.ub-logrow { padding: 3px 12px; border-bottom: 1px solid #262626; white-space: pre; cursor: pointer; }
.ub-logrow:nth-child(even) { background: #212121; }
.ub-logrow:hover { background: #2b2b2b; }
.ub-logrow.sel { background: rgba(233,84,32,.2); }
.ub-detail { margin: 0; max-height: 110px; overflow: auto; padding: 10px 12px; border-top: 1px solid var(--ub-line); background: #262626; font: 12px/1.5 var(--ub-mono); white-space: pre-wrap; word-break: break-all; color: var(--ub-sub); }

/* ------------------------------------------------------------ Terminal */
.ub-term { background: #1b0f19; padding: 8px 10px 12px; font: 13px/1.5 var(--ub-mono); cursor: text; }
.ub-term-out div { white-space: pre-wrap; word-break: break-all; }
.ub-term-out .dim { color: #a99aa6; }
.ub-term-out .err { color: var(--ub-err); }
.ub-term-out mark { background: none; color: #ff7b57; font-weight: 600; padding: 0; }
.ub-term-line { display: flex; align-items: baseline; }
.ub-prompt { white-space: pre; }
.ub-prompt .u, .cmd .u { color: #8ae234; }
.ub-prompt .p, .cmd .p { color: #729fcf; }
.ub-term-in { flex: 1; min-width: 40px; border: 0; outline: none; background: transparent; padding: 0; font: inherit; color: #f2f2f2; caret-color: #f2f2f2; }

/* ------------------------------------------------------------ Fichiers */
.ub-files { display: grid; grid-template-columns: 190px minmax(0, 1fr); height: 100%; }
.ub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); align-content: start; gap: 6px; padding: 14px; overflow: auto; }
.ub-item { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: center; font-size: 13px; word-break: break-all; }
.ub-item small { color: var(--ub-dim); font-size: 11.5px; }
.ub-item:hover { background: rgba(255,255,255,.06); }
.ub-item.sel { background: rgba(233,84,32,.22); border-color: rgba(233,84,32,.5); }
.ub-path { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; padding: 0 4px; height: 32px; border-radius: 6px; background: #1c1c1c; border: 1px solid var(--ub-line-2); white-space: nowrap; font-size: 12.5px; }
.ub-path.mono { max-width: 280px; text-overflow: ellipsis; display: block; line-height: 30px; padding: 0 10px; color: var(--ub-sub); }
.ub-crumb { border: 0; background: none; padding: 2px 6px; border-radius: 4px; }
.ub-crumb:hover { background: rgba(255,255,255,.1); }
.ub-crumb + .ub-crumb::before { content: "/"; margin-right: 6px; color: var(--ub-dim); }
.ub-crumb:first-child + .ub-crumb::before { content: none; }

/* ------------------------------------------------------------ Éditeur */
.ub-body:has(.ub-editor) { display: flex; flex-direction: column; overflow: hidden; }
.ub-editor { flex: 1; min-height: 0; overflow: auto; background: #1e1e1e; font: 12.5px/1.6 var(--ub-mono); padding: 6px 0; }
.ub-line { display: flex; }
.ub-line.hit { background: rgba(233,84,32,.12); }
.ub-ln { flex: 0 0 56px; padding-right: 12px; text-align: right; color: #6a6a6a; user-select: none; }
.ub-code { white-space: pre; padding-right: 16px; }
.ub-editor-foot { flex: 0 0 auto; padding: 4px 12px; border-top: 1px solid var(--ub-line); background: var(--ub-head); color: var(--ub-dim); font-size: 12px; text-align: right; }

/* ------------------------------------------------------------ Rapport */
.ub-rep-head { margin-bottom: 14px; }
.ub-progress { height: 6px; border-radius: 3px; background: #3a3a3a; overflow: hidden; }
.ub-progress i { display: block; height: 100%; background: var(--ub-accent); transition: width .4s; }
.ub-sub { margin: 8px 0 0; color: var(--ub-sub); font: 12.5px var(--ub-mono); }
.ub-q { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--ub-line); border-radius: 8px; background: #2a2a2a; }
.ub-q.done { border-color: rgba(63,185,80,.45); background: rgba(63,185,80,.08); }
.ub-q.bonus { border-style: dashed; }
.ub-q-label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.ub-q-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: #3d3d3d; display: grid; place-items: center; font: 600 12px var(--ub-mono); }
.ub-q.done .ub-q-num { background: var(--ub-ok); color: #0b2410; }
.ub-q-num svg { width: 14px; height: 14px; }
.ub-q-row { display: flex; gap: 8px; margin: 10px 0 4px 32px; }
.ub-q-row .ub-input { flex: 1; font-family: var(--ub-mono); }
.ub-q-answer, .ub-q-state { margin: 6px 0 0 32px; color: var(--ub-sub); }
.ub-q-answer { color: #8fe39b; }
.ub-q > .ub-link { margin-left: 32px; }
.ub-q-msg { margin: 4px 0 0 32px; min-height: 0; color: var(--ub-err); font-size: 13px; }
.ub-q-msg:empty { display: none; }
.ub-hint { margin: 8px 0 0 32px; padding: 8px 10px; border-left: 3px solid var(--ub-warn); background: rgba(240,180,41,.08); color: #f3d68a; font-size: 13px; }
.ub-q.shake { animation: ub-shake .35s; }
@keyframes ub-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ------------------------------------------------ menu système, vue Activités */
.ub-menu { position: fixed; top: 38px; right: 8px; z-index: 9500; width: 300px; max-width: calc(100vw - 16px); padding: 10px; display: grid; gap: 4px; background: #2b2b2b; border: 1px solid #111; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.ub-menu-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; border-bottom: 1px solid var(--ub-line); margin-bottom: 4px; }
.ub-menu-row span { margin-right: auto; color: var(--ub-sub); }
.ub-lang { height: 30px; padding: 0 8px; border: 1px solid var(--ub-line-2); border-radius: 15px; background: #1c1c1c; color: var(--ub-text); font: 600 13px var(--ub-sans); }
.ub-lang:focus { outline: none; border-color: var(--ub-accent); }
.ub-pill { height: 28px; min-width: 44px; border: 1px solid var(--ub-line-2); border-radius: 14px; background: transparent; font-weight: 600; font-size: 12.5px; }
.ub-pill.on { background: var(--ub-accent); border-color: var(--ub-accent); color: #fff; }
.ub-menu-item { display: block; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--ub-text); text-decoration: none; font-size: 13.5px; }
.ub-menu-item:hover { background: rgba(255,255,255,.08); }
.ub-overview { position: fixed; inset: 32px 0 0 0; z-index: 8500; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 40px 16px; background: rgba(10,10,10,.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: auto; }
.ub-ov-search { width: min(420px, 100%); height: 40px; padding: 0 16px; border: 1px solid var(--ub-line-2); border-radius: 20px; background: #2b2b2b; text-align: center; }
.ub-ov-search:focus { outline: none; border-color: var(--ub-accent); }
.ub-ov-grid { display: grid; grid-template-columns: repeat(auto-fill, 128px); justify-content: center; gap: 12px; width: min(760px, 100%); }
.ub-ov-app { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; border: 0; border-radius: 14px; background: transparent; font-size: 13px; }
.ub-ov-app:hover { background: rgba(255,255,255,.1); }

/* ------------------------------------------------------------ notifications */
.ub-toasts { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); z-index: 9600; display: grid; gap: 8px; width: min(440px, calc(100vw - 16px)); pointer-events: none; }
.ub-toast { padding: 10px 14px; border-radius: 12px; background: #333; border: 1px solid #1a1a1a; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 13.5px; animation: ub-in .25s ease-out; transition: opacity .35s, transform .35s; }
.ub-toast.ok { border-left: 4px solid var(--ub-ok); }
.ub-toast.warn { border-left: 4px solid var(--ub-warn); }
.ub-toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes ub-in { from { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------------------------------------ bilan */
.ub-modal { position: fixed; inset: 0; z-index: 9700; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); overflow: auto; }
.ub-modal-box { width: min(620px, 100%); padding: 22px 24px; background: var(--ub-win); border: 1px solid #111; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.ub-modal-box h2 { margin: 4px 0 14px; font-size: 22px; }
.ub-timeline { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 0; border-left: 2px solid var(--ub-line-2); }
.ub-timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 6px 0 6px 14px; position: relative; font-size: 13.5px; color: var(--ub-sub); }
.ub-timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--ub-accent); }
.ub-timeline li span:first-child { color: var(--ub-text); }
.ub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ub-stats div { padding: 10px; border: 1px solid var(--ub-line); border-radius: 8px; background: #1e1e1e; }
.ub-stats small { display: block; color: var(--ub-dim); font: 11px var(--ub-mono); text-transform: uppercase; letter-spacing: .06em; }
.ub-stats b { font: 600 20px var(--ub-mono); }
.ub-learn { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--ub-accent); background: #1e1e1e; color: var(--ub-sub); font-size: 13.5px; }
.ub-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------ mobile */
@media (max-width: 760px) {
  .ub { grid-template-columns: minmax(0, 1fr); grid-template-rows: 32px 1fr 64px; }
  .ub-top { gap: 4px; padding: 0 4px; }
  .ub-act, .ub-chip, .ub-tray { padding: 0 8px; }
  .ub-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ub-desk { grid-column: 1; grid-row: 2; }
  .ub-dock { grid-column: 1; grid-row: 3; flex-direction: row; justify-content: space-around; padding: 4px 6px; border-right: 0; border-top: 1px solid rgba(255,255,255,.06); }
  .ub-dock-btn { width: 44px; height: 44px; flex: 0 0 auto; }
  .ub-dock-btn svg { width: 30px; height: 30px; }
  .ub-dock { overflow-x: auto; gap: 2px; justify-content: space-between; }
  .ub-dock-btn.running::before { left: 50%; top: auto; bottom: 1px; margin: 0 0 0 -2px; }
  .ub-dock-btn.active::before { width: 14px; height: 4px; margin-left: -7px; }
  .ub-dock-grid { margin-top: 0; }
  .ub-clock { display: none; }
  .ub-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; min-width: 0; }
  .ub-win .ub-ctrl.max { display: none; }
  .ub-title { max-width: 30vw; }
  .ub-head { grid-template-columns: minmax(0, 1fr) auto; }
  .ub-title { display: none; }
  .ub-ctrls { grid-column: 2; }
  .ub-logs, .ub-files { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ub-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ub-line); padding: 6px; }
  .ub-side-item { flex: 0 0 auto; }
  .ub-logrow { white-space: pre-wrap; word-break: break-all; }
  .ub-q-row { margin-left: 0; flex-wrap: wrap; }
  .ub-q-row .ub-input { flex-basis: 100%; }
  .ub-q-answer, .ub-q-state, .ub-q-msg, .ub-hint, .ub-q > .ub-link { margin-left: 0; }
  .ub-stats { grid-template-columns: repeat(2, 1fr); }
  .ub-timeline li { grid-template-columns: 52px 1fr; }
  .ub-path.mono { max-width: 40vw; }
}
@media (prefers-reduced-motion: reduce) { .ub-toast, .ub-q.shake, .ub-progress i { animation: none; transition: none; } }
