/* Ghost Tunnel — CRT terminal look (sans JS) */

:root {
  --bg: #050806;
  --fg: #b6ffb6;
  --fg-dim: #7edb7e;
  --accent: #5dff87;
  --danger: #ff5d5d;
  --panel: rgba(10, 30, 18, 0.65);
  --border: rgba(90, 255, 140, 0.22);
  --shadow: rgba(0, 0, 0, 0.6);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: radial-gradient(1200px 700px at 50% 30%, rgba(60, 255, 140, 0.08), transparent 60%),
              radial-gradient(900px 600px at 30% 80%, rgba(60, 255, 140, 0.05), transparent 55%),
              var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  letter-spacing: 0.2px;
}

/* CRT scanlines + vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.0) 0%,
      rgba(0,0,0,0.08) 50%,
      rgba(0,0,0,0.0) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.0) 0px,
      rgba(0,0,0,0.0) 2px,
      rgba(0,0,0,0.14) 3px
    );
  mix-blend-mode: multiply;
  opacity: 0.8;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(0,0,0,0.35) 85%);
  opacity: 0.85;
}

/* Layout */
.gt-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 8, 5, 0.55);
  backdrop-filter: blur(2px);
}

.gt-brand { display: flex; gap: 10px; align-items: baseline; }
.gt-brand__name { color: var(--accent); text-shadow: 0 0 10px rgba(93,255,135,0.25); }
.gt-brand__sep { color: var(--fg-dim); }
.gt-brand__title { color: var(--fg); }

.gt-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.gt-nav a {
  color: var(--fg-dim);
  text-decoration: none;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 10px;
}
.gt-nav a:hover, .gt-nav a:focus-visible {
  color: var(--fg);
  border-color: var(--border);
  outline: none;
}
.gt-nav__user { color: var(--fg); opacity: 0.9; }

.gt-main {
  max-width: 860px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

.gt-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 12px 40px var(--shadow);
  border-radius: 18px;
  padding: 18px 18px 20px;
  position: relative;
}

/* Glow edges */
.gt-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(93,255,135,0.10),
              0 0 28px rgba(93,255,135,0.10);
}

.gt-title {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(93,255,135,0.25);
}

.gt-subtitle {
  margin-bottom: 14px;
  color: var(--fg-dim);
  font-size: 14px;
  opacity: 0.95;
}

.gt-prompt { color: var(--accent); }
.gt-path { color: var(--fg); }
.gt-text { margin: 10px 0 18px; color: var(--fg); opacity: 0.92; }

.gt-cursor {
  display: inline-block;
  animation: gtBlink 1.1s steps(2, end) infinite;
  color: var(--fg);
}
@keyframes gtBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Flash / alerts */
.gt-flash, .gt-alert {
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  padding: 10px 12px;
  border-radius: 14px;
  margin: 10px 0 14px;
  color: var(--fg);
}

.gt-flash--ok { border-color: rgba(93,255,135,0.35); }
.gt-alert--danger, .gt-flash--danger {
  border-color: rgba(255, 93, 93, 0.45);
  color: #ffd0d0;
}

/* Form */
.gt-form { margin-top: 12px; display: grid; gap: 10px; }

.gt-label {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.gt-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(93,255,135,0.22);
  background: rgba(0,0,0,0.35);
  color: var(--fg);
  font-family: var(--mono);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.0);
}

.gt-input::placeholder { color: rgba(126, 219, 126, 0.55); }

.gt-input:focus-visible {
  border-color: rgba(93,255,135,0.55);
  box-shadow: 0 0 0 3px rgba(93,255,135,0.12);
}

/* Buttons */
.gt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.gt-btn, .gt-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(93,255,135,0.22);
  background: rgba(0,0,0,0.35);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--mono);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.gt-btn:hover, .gt-btn:focus-visible {
  border-color: rgba(93,255,135,0.55);
  box-shadow: 0 0 0 3px rgba(93,255,135,0.12);
  outline: none;
}

.gt-btn--primary {
  background: rgba(93,255,135,0.12);
  border-color: rgba(93,255,135,0.40);
  color: var(--accent);
}

.gt-btn--danger {
  border-color: rgba(255, 93, 93, 0.45);
  color: #ffd0d0;
}

.gt-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(126, 219, 126, 0.75);
}

.gt-footer {
  max-width: 860px;
  margin: 18px auto 26px;
  padding: 0 16px;
  color: rgba(126, 219, 126, 0.55);
  font-size: 12px;
}
.gt-footer__line { padding-top: 10px; border-top: 1px solid var(--border); }

.gt-story {
  padding: 10px 12px;
  border: 1px dashed rgba(93,255,135,0.18);
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  margin: 10px 0 14px;
}
.gt-story em { color: rgba(126,219,126,0.9); }


.gt-captcha {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 6px;
}

.gt-captcha__img {
  border-radius: 14px;
  border: 1px solid rgba(93,255,135,0.22);
  background: rgba(0,0,0,0.35);
  box-shadow: 0 0 0 3px rgba(93,255,135,0.06);
}

.gt-captcha__side {
  display: grid;
  gap: 10px;
  min-width: 240px;
}

.gt-btn--small {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}


/* Anti-débordement pour longues chaînes (hex, tokens, URLs) dans les textes de salles */
.gt-story,
.gt-text,
.gt-subtitle,
.gt-panel {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Si tu affiches parfois du texte dans <code>/<pre> */
.gt-story code,
.gt-text code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gt-story pre,
.gt-text pre {
  white-space: pre-wrap;   /* garde les retours */
  overflow-wrap: anywhere; /* casse les longues chaînes */
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;        /* au cas où tu veux garder un scroll pour du vrai code */
}


/* Media block (audio / video) */
.gt-media{
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.20);
  box-shadow: 0 14px 40px var(--shadow);
  overflow: hidden;
}
.gt-media__head{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 30, 18, 0.40);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gt-media__title{
  font-weight: 700;
  letter-spacing: .8px;
  opacity: .95;
}

.gt-media__ctl{
  margin: 0;
}
.gt-media__iconbtn{
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--fg);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.gt-media__iconbtn:hover{
  background: rgba(0,0,0,0.35);
}
.gt-media__player, .gt-media__off{
  padding: 12px;
}
.gt-media__video{
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
}
.gt-media__audio{
  width: 100%;
}
.gt-muted { opacity: .7; }
