/* Death-NET — rojo degradado a negro, rebordes rojos brillantes, fondo negro */
:root {
  --bg: #000;
  --red: #ff1a1a;
  --red-glow: rgba(255, 26, 26, .75);
  --red-soft: rgba(255, 26, 26, .25);
  --grad: linear-gradient(160deg, #c00000 0%, #5a0000 38%, #140000 72%, #000 100%);
  --grad-hover: linear-gradient(160deg, #ff2020 0%, #7a0000 40%, #1c0000 75%, #000 100%);
  --text: #fff;
  --muted: #d9a0a0;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
code { color: #ff8080; }

.brand {
  font-weight: 800; letter-spacing: .05em; color: #fff;   /* título en blanco */
}

/* ---------- piezas comunes ---------- */
.card, .tile, .btn, .frame, .topbar, .app-card, select, input, .toast {
  border: 2px solid var(--red);
  box-shadow: 0 0 10px var(--red-glow), inset 0 0 14px var(--red-soft);
}
.card { background: var(--grad); border-radius: var(--radius); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  background: var(--grad); color: #fff; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none; transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--grad-hover); box-shadow: 0 0 16px var(--red), inset 0 0 14px var(--red-soft); }
.btn:active { transform: scale(.96); }
.btn-big { padding: .8rem 1.4rem; font-size: 1.05rem; width: 100%; }
.btn-small { padding: .35rem .7rem; font-size: .85rem; white-space: nowrap; }

select, input {
  background: #0b0000; color: #fff; border-radius: 9px; padding: .4rem .6rem; font: inherit; font-size: .9rem;
  box-shadow: 0 0 6px var(--red-soft);
}
input:focus, select:focus { outline: none; box-shadow: 0 0 14px var(--red); }

/* ---------- pantallas ---------- */
.screen { position: fixed; inset: 0; }
#login {
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(ellipse at center, #2a0000 0%, #000 70%);
}
.login-card { width: min(360px, 100%); padding: 2rem 1.6rem; display: flex; flex-direction: column; gap: .9rem; text-align: center; }
.login-card h1 { margin: 0; font-size: 1.7rem; }
.login-card p { margin: 0; }
.login-logo { width: 84px; height: 84px; margin: 0 auto; filter: drop-shadow(0 0 12px var(--red)); }
.login-card input { padding: .75rem; font-size: 1rem; text-align: center; }
.error { color: #ff6b6b; min-height: 1.2em; font-weight: 600; }

#app { display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: .8rem; padding: .5rem .8rem;
  padding-top: max(.5rem, env(safe-area-inset-top));
  background: linear-gradient(90deg, #7a0000, #1a0000 45%, #000);
  border-width: 0 0 2px 0; flex-shrink: 0;
}
.brand-btn { display: flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer; padding: 0; }
.brand-btn img { width: 32px; height: 32px; filter: drop-shadow(0 0 6px var(--red)); }
.brand-btn .brand { font-size: 1.05rem; }
.stats { flex: 1; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; font-size: .78rem; }
.clock { display: flex; align-items: baseline; gap: .55rem; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
#clockDate { font-size: .85rem; }
#clockTime { font-size: 1.05rem; font-weight: 800; }
.stat { padding: .15rem .55rem; border-radius: 99px; border: 1px solid var(--red); background: #140000; white-space: nowrap; }
.stat.warn { background: #5a0000; }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }

/* ---------- menú principal ---------- */
#view-home { align-items: center; justify-content: center; padding: 1.5rem; }
.tiles {
  width: min(1100px, 100%);
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  min-height: 190px; padding: 1.2rem; border-radius: var(--radius);
  background: var(--grad); color: #fff; text-decoration: none; cursor: pointer; font: inherit;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px); background: var(--grad-hover); outline: none;
  box-shadow: 0 0 24px var(--red), inset 0 0 18px var(--red-glow);
}
.tile { position: relative; }
.tile-corner { position: absolute; top: .5rem; right: .6rem; font-size: 1.2rem; padding: .2rem .35rem; border-radius: 8px;
  border: 1px solid var(--red); background: #000; }
.tile-icon { font-size: 3rem; filter: drop-shadow(0 0 8px var(--red)); }
.tile-title { text-align: center; font-size: 1.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; text-shadow: 0 0 8px var(--red); }
.tile-sub { font-size: .85rem; color: var(--muted); text-align: center; }

/* ---------- barras de herramientas y marcos ---------- */
.toolbar {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding: .55rem .8rem;
  background: linear-gradient(180deg, #1a0000, #000); border-bottom: 1px solid #400;
}
.state { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; font-size: .8rem; color: var(--muted); }
.state i { width: 10px; height: 10px; border-radius: 50%; background: #444; }
.state.on i { background: var(--red); box-shadow: 0 0 8px var(--red); }

.frame { position: relative; flex: 1; min-height: 0; margin: .6rem; border-radius: var(--radius); background: #000; overflow: hidden; }
.desk-frame { display: flex; align-items: center; justify-content: center; }
#deskCanvas { max-width: 100%; max-height: 100%; touch-action: none; outline: none; cursor: default; }
.overlay-msg button { pointer-events: auto; }
.overlay-msg code { color: #ff8080; user-select: all; pointer-events: auto; }
.overlay-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem;
  text-align: center; color: var(--muted); pointer-events: none;
}
#mobileKbd { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.term-frame { padding: .4rem; }
#term { width: 100%; height: 100%; }
#webAppFrame, #godFrame { width: 100%; height: 100%; border: 0; background: #000; display: block; }
.small-brand { font-size: .95rem; }

/* ---------- rejillas de aplicaciones ---------- */
.app-grid {
  display: grid; gap: .9rem; padding: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.app-card {
  display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .9rem .6rem;
  border-radius: 12px; background: var(--grad); color: #fff; cursor: pointer; font: inherit; text-align: center;
  transition: transform .12s, box-shadow .12s;
}
.app-card:hover { transform: translateY(-3px); box-shadow: 0 0 18px var(--red), inset 0 0 14px var(--red-glow); }
.app-card img, .app-card .ph {
  width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 0, 0, .6));
}
.app-card .ph {
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800;
  border-radius: 12px; background: #200; border: 1px solid var(--red);
}
.app-card .name { font-weight: 700; font-size: .9rem; line-height: 1.15; }
.app-card .desc { font-size: .72rem; color: var(--muted); line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.app-card .tag { font-size: .65rem; padding: .05rem .4rem; border-radius: 99px; border: 1px solid var(--red); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 50;
  background: var(--grad); padding: .7rem 1.2rem; border-radius: 12px; font-weight: 600; max-width: 90vw;
}

/* ---------- eliminar apps ---------- */
.btn-danger { background: linear-gradient(160deg, #ff0000 0%, #6a0000 55%, #000 100%); }
.btn-danger.active { background: #ff1a1a; color: #000; box-shadow: 0 0 20px var(--red); }
.remove-hint { margin: .6rem 1rem 0; padding: .5rem .8rem; border-radius: 10px; border: 1px dashed var(--red); color: #ffb3b3; }
body.remove-mode #appGrid .app-card { position: relative; animation: shake 1.2s infinite ease-in-out; }
body.remove-mode #appGrid .app-card::after {
  content: "✕"; position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 900;
  background: #000; border: 2px solid var(--red); box-shadow: 0 0 8px var(--red);
}
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-.8deg); } 75% { transform: rotate(.8deg); } }

/* ---------- procesos ---------- */
.check { display: inline-flex; align-items: center; gap: .3rem; }
.check input { box-shadow: none; accent-color: var(--red); }
.table-wrap { flex: 1; overflow: auto; margin: .6rem; border: 2px solid var(--red); border-radius: var(--radius);
  box-shadow: 0 0 10px var(--red-glow), inset 0 0 14px var(--red-soft); }
.proc-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.proc-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: .55rem .6rem;
  background: linear-gradient(180deg, #8a0000, #2a0000); border-bottom: 2px solid var(--red); white-space: nowrap; }
.proc-table td { padding: .4rem .6rem; border-bottom: 1px solid #2a0000; vertical-align: middle; }
.proc-table tr:hover td { background: #1a0000; }
.proc-table .pname { font-weight: 700; }
.proc-table .pcmd { display: block; color: var(--muted); font-size: .72rem; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proc-table .hot { color: #ff6b6b; font-weight: 700; }
.proc-table .acts { white-space: nowrap; text-align: right; }
.proc-table .acts .btn { margin-left: .3rem; }

/* ---------- Run (editor) ---------- */
.run-toolbar label.btn { position: relative; }
.run-status { display: flex; align-items: center; gap: .4rem; padding: .3rem .9rem; font-size: .82rem; color: #fff;
  border-bottom: 1px solid #300; background: #070000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dirty { color: var(--red); text-shadow: 0 0 6px var(--red); }
.run-body { flex: 1; min-height: 0; display: flex; gap: .5rem; padding: .5rem; }
.run-panel { width: 290px; flex-shrink: 0; display: flex; flex-direction: column; gap: .4rem; padding: .5rem; border-radius: var(--radius);
  border: 2px solid var(--red); background: linear-gradient(180deg, #160000, #000); box-shadow: 0 0 10px var(--red-glow); min-height: 0; }
.run-panel.closed { display: none; }
.run-path { display: flex; gap: .3rem; }
.run-path input { flex: 1; min-width: 0; font-size: .78rem; }
.run-panel-actions { display: flex; align-items: center; justify-content: space-between; }
.run-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; font-size: .85rem; }
.run-list li { padding: .32rem .45rem; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.run-list li:hover { background: #3a0000; }
.run-list li.active { background: #7a0000; }
.run-list li .sz { float: right; color: var(--muted); font-size: .7rem; margin-left: .4rem; }
.run-editor { flex: 1; min-width: 0; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--red);
  box-shadow: 0 0 10px var(--red-glow), inset 0 0 14px var(--red-soft); background: #000; }
.run-editor .CodeMirror { height: 100%; font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: 14px; }
.btn-run { padding: .4rem 1.1rem; font-size: 1rem; font-weight: 800; background: linear-gradient(160deg, #ff2a2a, #7a0000 60%, #200000);
  box-shadow: 0 0 16px var(--red), inset 0 0 10px rgba(255, 255, 255, .15); }
/* Tema Death-NET para CodeMirror */
.cm-s-deathnet.CodeMirror { background: #000; color: #f5e6e6; }
.cm-s-deathnet .CodeMirror-gutters { background: #0d0000; border-right: 1px solid #400; }
.cm-s-deathnet .CodeMirror-linenumber { color: #8a4a4a; }
.cm-s-deathnet .CodeMirror-cursor { border-left: 2px solid #ff1a1a; }
.cm-s-deathnet .CodeMirror-selected, .cm-s-deathnet .CodeMirror-focused .CodeMirror-selected { background: #5a0000 !important; }
.cm-s-deathnet .CodeMirror-activeline-background { background: #1a0000; }
.cm-s-deathnet .CodeMirror-matchingbracket { color: #fff !important; background: #8a0000; }
.cm-s-deathnet .cm-keyword { color: #ff4d4d; font-weight: 600; }
.cm-s-deathnet .cm-def, .cm-s-deathnet .cm-variable-2 { color: #ffb86b; }
.cm-s-deathnet .cm-variable, .cm-s-deathnet .cm-property { color: #f5e6e6; }
.cm-s-deathnet .cm-string, .cm-s-deathnet .cm-string-2 { color: #9dff8a; }
.cm-s-deathnet .cm-number, .cm-s-deathnet .cm-atom { color: #ff9ad5; }
.cm-s-deathnet .cm-comment { color: #8a6a6a; font-style: italic; }
.cm-s-deathnet .cm-tag { color: #ff4d4d; }
.cm-s-deathnet .cm-attribute, .cm-s-deathnet .cm-type, .cm-s-deathnet .cm-variable-3 { color: #ffd166; }
.cm-s-deathnet .cm-builtin, .cm-s-deathnet .cm-qualifier { color: #7ad7ff; }
.cm-s-deathnet .cm-operator, .cm-s-deathnet .cm-meta { color: #ff8080; }
.cm-s-deathnet .cm-header { color: #fff; font-weight: 800; }
.CodeMirror-dialog { background: #1a0000; color: #fff; border-color: var(--red) !important; }
.CodeMirror-dialog input { color: #fff; background: #000; box-shadow: none; border: 1px solid var(--red); }

/* ---------- ruedas de almacenamiento ---------- */
.rings { display: grid; gap: .9rem; padding: .3rem .8rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.ring-card { border-radius: var(--radius); border: 2px solid var(--red); background: #050000; box-shadow: 0 0 10px var(--red-glow), inset 0 0 14px var(--red-soft); padding-bottom: .6rem; }
.ring-card .section-title { margin-top: .7rem; }
.ring-box { display: flex; gap: 1rem; align-items: center; padding: .4rem .8rem; flex-wrap: wrap; min-height: 220px; color: #fff; }
.ring-box svg { width: 210px; height: 210px; flex-shrink: 0; }
.ring-box svg path { cursor: pointer; transition: opacity .12s; }
.ring-box svg.hovering path:not(.hot) { opacity: .35; }
.ring-center .big { font-size: 26px; font-weight: 800; fill: #fff; }
.ring-center .small { font-size: 11px; fill: #ddd; }
.ring-legend { flex: 1; min-width: 180px; list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.ring-legend li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: .5rem; align-items: center; padding: .22rem .3rem; border-radius: 6px; cursor: default; }
.ring-legend li:hover, .ring-legend li.hot { background: #2a0000; }
.ring-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.ring-legend .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.ring-legend .sz { color: #ddd; font-variant-numeric: tabular-nums; }
.ring-legend .pc { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
.ring-note { font-size: .72rem; color: #ccc; padding: 0 .9rem; }
.usb-card { border-style: dashed; }
.usb-card .actions { margin-top: .6rem; display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Cloud ---------- */
.cl-actions { padding-top: .35rem; }
.cl-sep { width: 1px; align-self: stretch; background: #500; margin: 0 .2rem; }
.sel-only[disabled], .sel-one[disabled] { opacity: .4; cursor: default; }
.cl-wrap { position: relative; flex: 1; overflow: auto; }
.cl-table td:first-child, .cl-table th:first-child { width: 2rem; }
.cl-table input[type=checkbox] { accent-color: var(--red); box-shadow: none; width: 1rem; height: 1rem; }
.cl-table tr.sel td { background: #3a0000; }
.cl-table .nm { cursor: pointer; color: #fff; font-weight: 600; }
.cl-table .nm:hover { text-decoration: underline; }
.cl-drophint { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 800;
  background: rgba(60, 0, 0, .85); color: #fff; border-radius: var(--radius); pointer-events: none; }
.cl-wrap.drag .cl-drophint { display: flex; }
.cl-progress { margin: 0 .8rem; height: 22px; border-radius: 99px; border: 1px solid var(--red); background: #000; position: relative; overflow: hidden; }
.cl-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #ff4d4d, #8a0000); box-shadow: 0 0 10px var(--red); }
.cl-progress span { position: relative; display: block; text-align: center; font-size: .75rem; line-height: 20px; color: #fff; font-weight: 700; }

/* ---------- reproductor ---------- */
.media-tab.active, .out-tab.active { background: #ff1a1a; box-shadow: 0 0 16px var(--red); }
.player-body { flex: 1; min-height: 0; display: flex; gap: .6rem; padding: .6rem; }
.player-list { width: 320px; }
.player-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.player-stage { flex: 1; min-height: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  border: 2px solid var(--red); box-shadow: 0 0 12px var(--red-glow), inset 0 0 18px var(--red-soft); }
.player-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: radial-gradient(circle, #3a0000 0%, #000 70%); color: #fff; text-align: center; padding: 1rem; }
.player-cover img { width: min(40%, 180px); filter: drop-shadow(0 0 18px var(--red)); }
.player-cover.playing img { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); filter: drop-shadow(0 0 30px #ff0000); } }
.player-cover span { font-size: 1.1rem; font-weight: 700; }
.player-now { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-seek { display: flex; align-items: center; gap: .6rem; color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums; }
.player-seek input { flex: 1; }
input[type=range] { accent-color: var(--red); box-shadow: none; border: 0; background: none; padding: 0; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.player-controls .btn { min-width: 3rem; height: 2.6rem; font-size: 1.1rem; }
.player-controls .play-btn { min-width: 4rem; height: 3.2rem; font-size: 1.5rem; border-radius: 99px; }
.player-controls .btn.on { background: #ff1a1a; }
#plVol { width: 110px; }
.run-list li.playing { background: #7a0000; font-weight: 700; }

/* ---------- imágenes ---------- */
.im-path { flex: 1; min-width: 200px; }
.im-grid { flex: 1; overflow-y: auto; display: grid; gap: .6rem; padding: .8rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; }
.im-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; background: #0a0000;
  border: 1.5px solid #500; transition: transform .12s, box-shadow .12s; padding: 0; color: #fff; font: inherit; }
.im-item:hover { transform: scale(1.03); border-color: var(--red); box-shadow: 0 0 14px var(--red); }
.im-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-item .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .25rem .4rem; font-size: .7rem; background: rgba(0, 0, 0, .7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.im-item.folder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: var(--grad); border-color: var(--red); }
.im-item.folder .ico { font-size: 2.6rem; }
.viewer { position: fixed; inset: 0; z-index: 35; background: #000; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; padding-top: max(.5rem, env(safe-area-inset-top));
  background: linear-gradient(180deg, #2a0000, #000); border-bottom: 1px solid var(--red); flex-wrap: wrap; }
.viewer-name { flex: 1; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 100px; }
.viewer-stage { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.viewer-stage img { max-width: 100%; max-height: 100%; transition: transform .15s; user-select: none; -webkit-user-drag: none; }
.viewer-stage.zoomed img { max-width: none; max-height: none; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 5rem; font-size: 2.4rem; color: #fff; cursor: pointer;
  background: rgba(0, 0, 0, .55); border: 2px solid var(--red); border-radius: 12px; box-shadow: 0 0 10px var(--red-glow); }
.viewer-nav.prev { left: .6rem; }
.viewer-nav.next { right: .6rem; }
.viewer-strip { display: flex; gap: .35rem; overflow-x: auto; padding: .45rem; border-top: 1px solid #400; background: #070000; }
.viewer-strip img { height: 56px; width: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .55; border: 2px solid transparent; flex-shrink: 0; }
.viewer-strip img.active { opacity: 1; border-color: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------- almacenamiento ---------- */
.disk-cards { display: grid; gap: .9rem; padding: .6rem .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.disk-card { padding: .9rem 1rem; border-radius: var(--radius); background: var(--grad); border: 2px solid var(--red);
  box-shadow: 0 0 10px var(--red-glow), inset 0 0 14px var(--red-soft); color: #fff; }
.disk-card h4 { margin: 0 0 .2rem; font-size: 1.05rem; }
.disk-card .src { font-size: .72rem; color: #f0caca; margin-bottom: .6rem; }
.bar { height: 14px; border-radius: 99px; background: #000; border: 1px solid var(--red); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ff4d4d, #b00000); box-shadow: 0 0 10px var(--red); }
.bar.full > i { background: linear-gradient(90deg, #ffffff, #ff1a1a); }
.disk-card .nums { display: flex; justify-content: space-between; font-size: .8rem; margin-top: .45rem; }
.disk-card .big { font-size: 1.6rem; font-weight: 800; text-shadow: 0 0 10px var(--red); }
.du-total { margin: 0 .8rem; color: #fff; }
.du-list { margin: .4rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.du-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 130px; gap: .7rem; align-items: center; padding: .45rem .6rem;
  border-radius: 9px; border: 1px solid #400; background: #0a0000; color: #fff; cursor: pointer; font: inherit; text-align: left; }
.du-row:hover { border-color: var(--red); box-shadow: 0 0 10px var(--red-soft); }
.du-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.du-row .s { text-align: right; font-variant-numeric: tabular-nums; }
.du-row .bar { height: 10px; }

/* ---------- dispositivos ---------- */
.dev-wrap { flex: 1; overflow: auto; padding: .4rem .2rem 1rem; }
.section-title { margin: .9rem .8rem .2rem; font-size: 1rem; color: #fff; }
.table-wrap.static { flex: none; }
.block-form { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem .8rem; }
.block-form input { flex: 1; min-width: 160px; }
.you { font-size: .65rem; padding: .05rem .45rem; border-radius: 99px; background: var(--red); margin-left: .35rem; }

/* ---------- chat ---------- */
.badge { top: .5rem; right: .6rem; min-width: 1.6rem; text-align: center; font-weight: 800; font-size: .85rem;
  background: var(--red); color: #fff; box-shadow: 0 0 10px var(--red); }
.chat-list { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.chat-day { align-self: center; font-size: .72rem; color: #fff; padding: .15rem .7rem; border: 1px solid #400; border-radius: 99px; }
.msg { max-width: min(75%, 640px); align-self: flex-start; padding: .5rem .75rem; border-radius: 14px 14px 14px 4px;
  background: #0c0000; border: 1.5px solid var(--red); box-shadow: 0 0 8px var(--red-soft); position: relative; }
.msg.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--grad); box-shadow: 0 0 10px var(--red-glow); }
.msg .who { font-size: .74rem; font-weight: 800; color: #fff; margin-bottom: .15rem; }
.msg .who .type { font-weight: 600; opacity: .85; }
.msg .text { color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.msg .text a { color: #fff; }
.msg .meta { font-size: .68rem; color: #fff; opacity: .8; text-align: right; margin-top: .2rem; }
.msg .del { position: absolute; top: -.55rem; right: -.4rem; display: none; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1px solid var(--red); background: #000; color: #fff; cursor: pointer; font-size: .7rem; line-height: 1; }
.msg.mine:hover .del, .msg.mine.show-del .del { display: block; }
.chat-typing { min-height: 1.1rem; padding: 0 1rem; font-size: .75rem; color: #fff; }
#view-chat, #view-chat .muted, #chatOnline { color: #fff; }
.chat-form { display: flex; gap: .5rem; padding: .6rem .8rem; padding-bottom: max(.6rem, env(safe-area-inset-bottom));
  border-top: 1px solid #400; background: linear-gradient(0deg, #1a0000, #000); }
.chat-form textarea { flex: 1; resize: none; max-height: 8rem; background: #0b0000; color: #fff; font: inherit; padding: .6rem .8rem;
  border: 2px solid var(--red); border-radius: 12px; box-shadow: 0 0 6px var(--red-soft); }
.chat-form textarea:focus { outline: none; box-shadow: 0 0 14px var(--red); }
.chat-form .chat-send { padding: 0 1.2rem; font-size: 1rem; color: #fff; }
.chat-form textarea::placeholder { color: #bbb; }

/* ---------- ventana modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0, 0, 0, .75); }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.modal-card h2 { margin: 0; font-size: 1.2rem; }
.modal-body { color: #f3dede; font-size: .92rem; line-height: 1.4; }
.modal-body ul { margin: .4rem 0; padding-left: 1.2rem; max-height: 9rem; overflow: auto; }
.modal-body .warn { color: #ff8080; font-weight: 700; }
.modal-output { margin: 0; max-height: 40vh; overflow: auto; padding: .6rem; background: #000; border: 1px solid var(--red);
  border-radius: 8px; font-size: .75rem; white-space: pre-wrap; color: #f5e6e6; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; }

/* ---------- fondo animado sutil ---------- */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(circle at 50% 120%, rgba(255, 0, 0, .18), transparent 60%);
}

@media (max-width: 640px) {
  .stats { display: none; }
  #btnLogout { margin-left: auto; }
  .clock { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.1; }
  #clockDate { font-size: .7rem; }
  #clockTime { font-size: .9rem; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .tile { min-height: 140px; padding: .8rem; }
  .tile { position: relative; }
.tile-corner { position: absolute; top: .5rem; right: .6rem; font-size: 1.2rem; padding: .2rem .35rem; border-radius: 8px;
  border: 1px solid var(--red); background: #000; }
.tile-icon { font-size: 2.3rem; }
  .tile-title { font-size: .95rem; }
  .tile-sub { font-size: .72rem; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .frame { margin: .3rem; }
  .proc-table .hide-m { display: none; }
  .proc-table .pcmd { max-width: 40vw; }
  .msg { max-width: 88%; }
  #chatOnline { display: none; }
  .player-body { flex-direction: column; }
  .player-list { width: auto; max-height: 34vh; }
  .player-stage { min-height: 30vh; }
  .im-grid { grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .4rem; }
  .viewer-nav { width: 2.4rem; height: 4rem; font-size: 1.8rem; }
  .viewer-strip img { height: 44px; width: 44px; }
  .run-body { position: relative; }
  .run-panel { position: absolute; z-index: 5; top: .5rem; bottom: .5rem; left: .5rem; width: calc(100% - 1rem); }
  .run-toolbar .btn { padding: .3rem .5rem; font-size: .78rem; }
}
