:root {
  --fg: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --glass: rgba(0,0,0,0.38);
  --border: rgba(255,255,255,0.10);
  --shadow: rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
  overflow: hidden; /* la page ne scroll pas, le code oui */
}

.bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 30% 20%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(900px 500px at 70% 80%, rgba(0,255,128,0.08), transparent 60%),
    linear-gradient(135deg, rgba(10,20,35,1), rgba(20,10,35,1));
  filter: saturate(1.1);
}

.panel{
  max-width: 1040px;
  margin: 24px auto;
  padding: 22px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.title{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 44px;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 var(--shadow);
}

.subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

.layout{
  margin-top: 18px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}

.side, .viewer{
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 0 var(--shadow);
}

.sideTitle{
  font-weight: 800;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.88);
}

.tab{
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.42);
  color: var(--fg);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--shadow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 14px;
}
.tab:hover{ background: rgba(255,255,255,0.06); }
.tab:active{ transform: translateY(1px); box-shadow: 0 1px 0 var(--shadow); }
.tab.is-active{
  outline: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.70);
  line-height: 1.5;
}

.viewHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.viewName{
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

.badge{
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.82);
}

.code{
  height: 62vh;          /* scroll garanti */
  overflow: auto;        /* ✅ scroll */
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.62);
  color: rgba(255,255,255,0.93);
  line-height: 1.65;
  font-size: 13px;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

.foot{
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.75);
}

.btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.42);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--shadow);
}
.btn:hover{ background: rgba(255,255,255,0.06); }
.btn:active{ transform: translateY(1px); box-shadow: 0 1px 0 var(--shadow); }
.btn.ghost{ background: transparent; }

@media (max-width: 980px){
  body{ overflow: auto; }   /* sur mobile, on autorise le scroll page */
  .layout{ grid-template-columns: 1fr; }
  .code{ height: 55vh; }
}
