/* Theme "Испытание": a foggy night trial where every assignment is a generator to repair. */
:root {
  --bg: #09080b; --card: rgba(22, 19, 24, .88); --text: #ebe4dc; --muted: #8e858f; --line: #2d2429;
  --accent: #d11a22; --blood: #8f0e14; --lamp: #f5c25b; --lamp-glow: rgba(245, 194, 91, .55);
  --green: #f5c25b; --red: #ff4a4f; --orange: #ff8a3d; --yellow: #e6b34a; --blue: #9fb7c9;
  --idle: #4d434a; --track: #2a2227;
}
body.trial {
  background: radial-gradient(120% 70% at 50% -10%, #2a0d10 0%, #120a0d 45%, var(--bg) 80%) fixed, var(--bg);
  font-family: "Oswald", -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .01em;
  overflow-x: hidden;
}
.trial button, .trial input { font-family: inherit; }

/* drifting fog */
.fog { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fog i { position: absolute; width: 220%; height: 60%; left: -60%;
  background: radial-gradient(closest-side, rgba(170, 160, 175, .17), transparent 70%);
  filter: blur(18px); animation: drift 38s linear infinite alternate; }
.fog i:nth-child(1) { top: 8%; }
.fog i:nth-child(2) { top: 42%; animation-duration: 52s; animation-delay: -20s; opacity: .8; }
.fog i:nth-child(3) { top: 70%; animation-duration: 64s; animation-delay: -35s; opacity: .7; }
@keyframes drift { from { transform: translateX(-12%); } to { transform: translateX(18%); } }

.trial h1, .trial h2, .trial .subject, .trial .btn, .trial .badge, .trial .title-x, .trial .escaped, .trial .sc .msg {
  text-transform: uppercase; letter-spacing: .06em; }
.trial h1 { font-size: 26px; font-weight: 700; color: #f3ece4;
  text-shadow: 0 0 14px rgba(209, 26, 34, .75), 0 0 2px #000; animation: flicker 7s infinite; }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } }
.trial h2 { color: #c9bfc4; font-weight: 500; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.trial a { color: #ff6b6f; }
.trial .card { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); border-radius: 6px;
  border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.45); }
.trial a.card { transition: transform .15s, border-color .15s; }
.trial a.card:active { transform: scale(.985); border-color: var(--accent); }
.trial .card.lit { box-shadow: 0 0 22px rgba(245, 194, 91, .12), 0 8px 24px rgba(0,0,0,.45); }
.trial .gen.on { color: #b9a77a; }
.trial .gen.busy .lamp { fill: #9fb7c9; }
.trial .gen.fail .lamp { filter: drop-shadow(0 0 5px var(--red)); }
.trial .repair b { background: linear-gradient(90deg, var(--blood), var(--lamp)); }
.trial .btn { border-radius: 4px; background: linear-gradient(180deg, #d9232b, #8f0e14); font-weight: 600;
  box-shadow: 0 0 18px rgba(209, 26, 34, .35); }
.trial .btn.secondary { background: transparent; color: #ff6b6f; border: 1.5px solid var(--accent); box-shadow: none; }
.trial .badge { border-radius: 3px; font-size: 12px; }
.trial .hint { background: rgba(0,0,0,.35); border-left: 3px solid var(--blood); border-radius: 3px; }
.trial input[type=text], .trial input[type=password] { background: rgba(0,0,0,.45); border-radius: 4px; }
.trial input[type=text]:focus, .trial input[type=password]:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 26, 34, .25); }
.trial .flash { border-left-color: var(--accent); }
.trial .escaped { letter-spacing: .08em; }

.trial input[type=file] { color: var(--muted); font-size: 14px; }
.trial input[type=file]::file-selector-button { font: inherit; text-transform: uppercase; letter-spacing: .05em;
  background: #241c21; color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; margin-right: 10px; }

@media (prefers-reduced-motion: reduce) {
  .fog i, .trial h1 { animation: none; }
}
