/* =====================================================================
   ITS Alto Adriatico · CTF PowerShell — stile condiviso (tema SOC scuro)
   ===================================================================== */
@import url("fonts.css");

:root {
  --bg: #0c0f13;
  --panel: #141a21;
  --panel-2: #1b232c;
  --panel-3: #222c37;
  --line: #2a3540;
  --line-2: #364453;
  --ink: #e9eef4;
  --ink-2: #9fb0c0;
  --ink-3: #6d7d8c;
  --red: #E2323C;
  --red-2: #C61620;
  --red-soft: #2a1417;
  --green: #35d07f;
  --green-soft: #10261b;
  --amber: #FFB020;
  --purple: #A673F2;
  --blue: #4c8dff;
  --ps: #0a2a6b;
  --term: #0a0e13;
  --f-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .75, .15, 1);
  --shadow: 0 20px 50px -30px rgba(0,0,0,.9);
}
* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, #17222e 0%, var(--bg) 55%) fixed;
  color: var(--ink); font-family: var(--f-sans); -webkit-font-smoothing: antialiased;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--blue); }
::selection { background: rgba(226,50,60,.35); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }

/* ---------- buttons / inputs ---------- */
.btn {
  font: 600 15px/1 var(--f-sans); padding: 12px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #f0454f; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

input.field, .field {
  font: 500 16px/1.2 var(--f-sans); padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #0e141a; color: var(--ink); width: 100%;
}
input.field:focus { outline: none; border-color: var(--red); }
input.mono { font-family: var(--f-mono); }
label.lbl { display: block; font: 600 12px/1 var(--f-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }

/* ---------- terminal ---------- */
.psterm {
  background: var(--term); border: 1px solid var(--line-2); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  font-family: var(--f-mono); box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), var(--shadow);
}
.psterm-screen {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px;
  font: 400 14.5px/1.5 var(--f-mono); color: #cdd6df; white-space: pre-wrap; word-break: break-word;
}
.psl { white-space: pre-wrap; }
.psl-prompt { color: #7fa0d0; }
.psl-dim { color: #7c8a97; }
.psl-hint { color: #7fd0b0; }
.psl-err { color: #ff8a86; }
.psl-flag { color: #0c0f13; background: var(--green); padding: 0 4px; border-radius: 3px; font-weight: 600; }
.psterm-inrow { display: flex; align-items: center; gap: 0; padding: 8px 18px 14px; border-top: 1px solid rgba(255,255,255,.05); }
.psterm-prompt { color: #7fa0d0; font: 500 14.5px/1.4 var(--f-mono); white-space: pre; flex: none; }
.psterm-input {
  flex: 1; background: transparent; border: none; outline: none; color: #eef3f8;
  font: 500 14.5px/1.4 var(--f-mono); caret-color: var(--green);
}

/* ---------- chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--f-sans);
  letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-2); }
.chip.solved { color: var(--green); border-color: rgba(53,208,127,.4); background: var(--green-soft); }
.chip.cat { color: var(--purple); border-color: rgba(166,115,242,.4); }
.pts { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* difficulty dots */
.lvl { display: inline-flex; gap: 4px; }
.lvl i { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid var(--red); display: inline-block; }
.lvl i.on { background: var(--red); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { padding: 13px 20px; border-radius: 10px; font: 600 15px/1.3 var(--f-sans); background: var(--panel-3);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-color: rgba(53,208,127,.6); color: #baf3d3; }
.toast.ok::before { content: "✓ "; color: var(--green); }
.toast.bad { border-color: rgba(226,50,60,.6); color: #ffc9c6; }
.toast.bad::before { content: "✕ "; color: var(--red); }

@media (prefers-reduced-motion: reduce) { * { transition-duration: .001s !important; animation-duration: .001s !important; } }
