/* ASCII-safe, black/white, Cold War tablet */
:root{
  --bg:#070707;
  --ink:#f2f2f2;
  --dim:#a9a9a9;
  --mid:#404040;
  --panel:#0b0b0b;
  --edge:#1a1a1a;
  --hard:#0f0f0f;
  --shadow: rgba(0,0,0,0.65);
  --glow: rgba(255,255,255,0.08);
  --warn:#ffffff;
  --ok:#ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 800px at 70% 10%, #0f0f0f 0%, var(--bg) 55%, #000 100%);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x:hidden;
}

.mono{ font-family: var(--mono); letter-spacing: 0.5px; }
.dim{ color: var(--dim); }
.tiny{ font-size: 12px; }

.noscript{
  padding:16px;
  background:#111;
  border:1px solid #333;
  margin:16px;
  border-radius:10px;
  color:#fff;
  font-family: var(--mono);
}

/* Boot overlay */
.boot{
  position:fixed;
  inset:0;
  background: #000;
  z-index: 9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.boot-inner{
  width:min(860px, 92vw);
  border:1px solid #333;
  border-radius:18px;
  background: linear-gradient(180deg, #070707, #000);
  box-shadow: 0 30px 90px var(--shadow);
  padding:18px 18px 16px 18px;
  position:relative;
}
.boot-top{
  display:flex;
  gap:16px;
  align-items:flex-start;
}
.boot-badge{
  width:92px;
  height:92px;
  border-radius:16px;
  border:1px solid #2a2a2a;
  background:#050505;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.boot-badge img{
  width:80%;
  height:auto;
  display:block;
  filter: grayscale(1) contrast(1.2);
}
.boot-lines{
  flex:1;
  padding-top:4px;
}
.boot-lines .mono{ line-height: 1.45; font-size: 13px; }

.boot-bar{
  height:12px;
  border:1px solid #2a2a2a;
  border-radius:999px;
  margin-top:14px;
  overflow:hidden;
  background:#050505;
}
.boot-bar-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, #111, #fff, #111);
  opacity:0.7;
}
.boot-hint{
  margin-top:14px;
  font-size:12px;
}
.key{
  display:inline-block;
  border:1px solid #333;
  border-bottom-color:#111;
  padding:2px 8px;
  border-radius:8px;
  background:#0a0a0a;
}

/* Tablet wrapper */
.wrap{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 26px 14px;
}

.tablet{
  width:min(1240px, 98vw);
}

.tablet-frame{
  position:relative;
  border-radius: 26px;
  background:
    radial-gradient(900px 600px at 10% 15%, #141414 0%, #0b0b0b 35%, #050505 70%, #000 100%);
  border: 1px solid #222;
  box-shadow:
    0 40px 120px rgba(0,0,0,0.72),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  overflow:hidden;
}

/* Wear layer: scratches, chips */
.tablet-wear{
  pointer-events:none;
  position:absolute;
  inset:0;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.06), rgba(255,255,255,0) 35%),
    radial-gradient(800px 300px at 80% 0%, rgba(255,255,255,0.08), rgba(255,255,255,0) 55%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 1px, rgba(0,0,0,0) 3px, rgba(0,0,0,0) 7px);
  mix-blend-mode: screen;
  opacity: 0.12;
}

/* Header */
.tablet-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 14px 16px;
  border-bottom:1px solid #1f1f1f;
  background: linear-gradient(180deg, rgba(0,0,0,0.65), rgba(0,0,0,0.2));
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 320px;
}
.brand-badge{
  width:44px;
  height:44px;
  border-radius: 12px;
  background:#050505;
  border:1px solid #2a2a2a;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.brand-badge img{
  width:82%;
  height:auto;
  filter: grayscale(1) contrast(1.2);
}
.brand-title{
  font-weight:800;
  letter-spacing: 2px;
  font-size: 14px;
}
.brand-sub{
  font-size:12px;
}

.header-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.stat{
  font-size:12px;
  padding:6px 10px;
  border:1px solid #232323;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
}
.btn{
  cursor:pointer;
  color: var(--ink);
  background: rgba(255,255,255,0.04);
  border:1px solid #2a2a2a;
  border-radius: 12px;
  padding: 8px 12px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  user-select:none;
}
.btn:hover{
  background: rgba(255,255,255,0.08);
  border-color:#3a3a3a;
  transform: translateY(-1px);
}
.btn:active{
  transform: translateY(0px);
}

/* Body split */
.tablet-body{
  display:grid;
  grid-template-columns: 220px 1fr;
  min-height: 680px;
}

/* Nav */
.nav{
  border-right:1px solid #1f1f1f;
  background: rgba(0,0,0,0.35);
  padding: 12px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav-item{
  text-align:left;
  width:100%;
  background: rgba(255,255,255,0.02);
  border:1px solid #1f1f1f;
  border-radius: 14px;
  padding: 10px 10px;
  color: var(--ink);
  cursor:pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.nav-item:hover{
  background: rgba(255,255,255,0.06);
  border-color:#2f2f2f;
  transform: translateY(-1px);
}
.nav-item.is-active{
  background: rgba(255,255,255,0.10);
  border-color:#3c3c3c;
}
.nav-item.ghost{
  opacity:0.72;
}
.nav-sep{
  height:1px;
  background:#1d1d1d;
  margin:8px 0;
}
.nav-foot{
  margin-top:auto;
  padding:10px 6px 4px 6px;
  font-size:12px;
  line-height:1.5;
}

/* Main */
.main{
  padding: 12px 12px 16px 12px;
  position:relative;
}

.topstrip{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}
.pill{
  font-size:12px;
  padding:6px 10px;
  border:1px solid #232323;
  border-radius: 999px;
  background: rgba(0,0,0,0.32);
}
.pill.right{ margin-left:auto; }

.view{ display:none; }
.view.is-active{ display:block; }

.panel{
  border:1px solid #232323;
  border-radius: 18px;
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  padding: 12px;
  margin-bottom: 12px;
}
.panel-title{
  font-size:12px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.panel-body{
  font-size:14px;
  line-height:1.55;
}

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap:12px;
}
.hero-title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
}
.hero-sub{
  margin-top:6px;
  font-size: 12px;
}
.hero-copy{
  margin-top:12px;
}
.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}

.badge-card{
  border:1px solid #232323;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
.badge-wrap{
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border:1px solid #2a2a2a;
  background:#050505;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.badge-wrap img{
  width:75%;
  height:auto;
  filter: grayscale(1) contrast(1.25);
}
.badge-meta{
  margin-top:10px;
  font-size:12px;
  line-height:1.55;
}

.mini-terminal{
  margin-top:12px;
  border:1px solid #232323;
  border-radius: 18px;
  overflow:hidden;
}
.mini-title{
  padding:8px 10px;
  border-bottom:1px solid #1f1f1f;
  background: rgba(0,0,0,0.45);
  font-size:12px;
}
.mini-body{
  padding:10px;
  min-height: 170px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* Grid panels */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
@media (max-width: 980px){
  .tablet-body{ grid-template-columns: 1fr; }
  .nav{ flex-direction:row; overflow:auto; }
  .nav-item{ min-width: 140px; }
  .grid{ grid-template-columns: 1fr; }
  .hero{ grid-template-columns: 1fr; }
}

.list{
  margin:0;
  padding-left: 18px;
}
.list li{ margin: 8px 0; }

.timeline{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.titem{
  border:1px dashed #2a2a2a;
  border-radius: 14px;
  padding:10px;
  background: rgba(255,255,255,0.02);
}
.tdate{ font-size: 12px; margin-bottom: 6px; }
.ttext{ font-size: 13px; }

.table{
  margin-top:12px;
  border:1px solid #232323;
  border-radius: 14px;
  overflow:hidden;
}
.row{
  display:grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap:0;
}
.row > div{
  padding: 10px;
  border-bottom:1px solid #1f1f1f;
}
.row.head{
  background: rgba(0,0,0,0.45);
}
.row:last-child > div{ border-bottom:none; }

.ops{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.op{
  border:1px solid #232323;
  border-radius: 14px;
  padding:10px;
  background: rgba(255,255,255,0.02);
}
.op-title{ font-size: 13px; }
.op-meta{ margin-top:4px; font-size: 12px; }
.op-body{ margin-top:8px; font-size: 13px; }

/* Form */
.form{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.frow{
  display:flex;
  flex-direction:column;
  gap:6px;
}
input, textarea{
  background: rgba(0,0,0,0.5);
  border:1px solid #2a2a2a;
  border-radius: 14px;
  padding: 10px;
  color: var(--ink);
  font-family: var(--mono);
  outline:none;
}
input:focus, textarea:focus{
  border-color:#4a4a4a;
}
.factions{
  border:1px solid #232323;
  border-radius: 14px;
  padding:10px;
  background: rgba(255,255,255,0.02);
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:12px;
}
.factions label{ cursor:pointer; }

.form-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.form-result{
  min-height:18px;
  font-size:12px;
}

/* Ghost console */
.ghost-console{
  margin-top:10px;
  border:1px solid #232323;
  border-radius: 14px;
  padding:10px;
  min-height: 180px;
  background: rgba(0,0,0,0.5);
  white-space: pre-wrap;
}
.ghost-actions{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Footer */
.footer{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding: 8px 4px 2px 4px;
  font-size:12px;
}

/* FX overlay */
.fx{
  pointer-events:none;
  position:absolute;
  inset:0;
}
.scanlines{
  position:absolute;
  inset:0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 6px
  );
  opacity:0.12;
}
.vignette{
  position:absolute;
  inset:-2px;
  background: radial-gradient(1100px 700px at 50% 30%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.75) 100%);
  opacity:0.9;
}
.grain{
  position:absolute;
  inset:0;
  opacity:0.08;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.35), rgba(0,0,0,0) 35%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.22), rgba(0,0,0,0) 40%),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.18), rgba(0,0,0,0) 45%);
  mix-blend-mode: overlay;
}

.glitch{
  position:absolute;
  inset:0;
  opacity:0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08), rgba(0,0,0,0) 35%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 2px, rgba(0,0,0,0) 4px, rgba(0,0,0,0) 10px);
}

/* Hidden key catcher */
.keycatch{
  position:fixed;
  left:-9999px;
  top:-9999px;
  opacity:0;
  pointer-events:none;
}
