/* ELIZA - stile comune (gianlu.it). Font locali nella cartella fonts/. */
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/VT323-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/VT323-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fonts/Poppins-Bold.ttf") format("truetype"); }

:root {
  --bg: #0b0f0c;
  --panel: #050805;
  --phosphor: #5cff8a;
  --phosphor-dim: #2f9c52;
  --user: #d8ffe2;
  --text: #c9d6cc;
  --muted: #8a9a8f;
  --border: #1d3324;
  --amber: #ffcf5c;
  --cyan: #00bcd4;
  --term-font: "VT323", "Cascadia Mono", Consolas, "Courier New", monospace;
  --term-size: 24px;
}
:lang(ru) { --term-font: "VT323", Consolas, "Cascadia Mono", "Courier New", monospace; --term-size: 20px; }
:lang(ar) { --term-font: "VT323", "Segoe UI", Tahoma, "Arial", sans-serif; --term-size: 21px; }
:lang(hi) { --term-font: "VT323", "Nirmala UI", "Mangal", sans-serif; --term-size: 21px; }
:lang(zh) { --term-font: "VT323", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif; --term-size: 21px; }
:lang(ja) { --term-font: "VT323", "Yu Gothic", "Meiryo", "Hiragino Sans", "Noto Sans CJK JP", sans-serif; --term-size: 21px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at top, #122016 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--text);
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  padding: 18px 16px 40px;
}
a { color: var(--cyan); }
.wrap { max-width: 880px; margin: 0 auto; }

.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 16px; font-size: 14px; }
.topbar .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; }
.topbar .brand img { height: 26px; width: auto; }
.topbar .back { text-decoration: none; }
.topbar .back:hover { text-decoration: underline; }

header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
h1 { font-family: "VT323", monospace; font-weight: 400; font-size: 46px; margin: 0; color: var(--phosphor); letter-spacing: 2px; text-shadow: 0 0 8px rgba(92,255,138,.55); line-height: 1; }
.sub { color: var(--muted); font-size: 14px; }

.controls { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.controls label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
button {
  font: inherit; font-size: 14px; color: var(--phosphor); background: transparent;
  border: 1px solid var(--phosphor-dim); border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
button:hover { background: rgba(92,255,138,.08); }

.crt {
  position: relative; background: var(--panel); border: 2px solid var(--border); border-radius: 18px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.9), 0 0 0 6px #0f1a12, 0 20px 50px rgba(0,0,0,.6);
  overflow: hidden;
}
.crt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.25) 2px 3px);
}
#log {
  height: min(60vh, 540px); overflow-y: auto; padding: 22px 22px 8px;
  font-family: var(--term-font); font-size: var(--term-size); line-height: 1.3;
  color: var(--phosphor); text-shadow: 0 0 6px rgba(92,255,138,.5);
  scrollbar-color: var(--phosphor-dim) transparent;
}
.line { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.line.user { color: var(--user); text-shadow: 0 0 4px rgba(216,255,226,.35); }
.line.user::before { content: "> "; color: var(--phosphor-dim); }
.line.sys { color: var(--amber); text-shadow: 0 0 6px rgba(255,207,92,.4); }
.caret { display: inline-block; width: .55em; height: 1em; background: var(--phosphor); vertical-align: -0.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

form { display: flex; gap: 10px; align-items: center; padding: 12px 22px 18px; border-top: 1px dashed var(--border); }
form .prompt { font-family: "VT323", monospace; font-size: 26px; color: var(--phosphor-dim); }
#input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  font-family: var(--term-font); font-size: var(--term-size); color: var(--user); caret-color: var(--phosphor);
}
#input::placeholder { color: #3d7650; }
#input:disabled { opacity: .5; }

.note { margin: 14px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

.langs { margin-top: 26px; }
.langs h2 { font-size: 15px; color: var(--text); margin: 0 0 10px; font-weight: 700; }
.langs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.langs a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 15px;
  transition: border-color .12s, transform .12s;
}
.langs a:hover { border-color: var(--cyan); transform: translateY(-1px); }
.langs a[aria-current="page"] { border-color: var(--phosphor-dim); color: var(--phosphor); }
.flag { width: 30px; height: 20px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }

footer { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  h1 { font-size: 38px; }
  #log { padding: 16px 14px 6px; --term-size: 20px; }
  form { padding: 10px 14px 14px; }
}
