/* Shadow Company theme: smoke and ghostly, not embers. */

:root {
  color-scheme: dark;
  --bg-0: #020203;
  --bg-1: #0a0c10;
  --panel-bg: rgba(16, 18, 24, 0.72);
  --panel-border: rgba(20, 224, 227, 0.32);
  --panel-border-hover: rgba(20, 224, 227, 0.55);
  --text: #cfd6de;
  --text-dim: #838d99;
  --accent: #14e0e3;
  --accent-glow: 0 0 12px rgba(20, 224, 227, 0.45);
  --teal-glow: rgba(20, 224, 227, 0.5);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(20, 224, 227, 0.20);
  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-border: rgba(20, 224, 227, 0.28);
  --btn-hover-bg: rgba(255, 255, 255, 0.10);
  --danger: #f2a3a3;
  --ok: #a9e2c3;
  --row-border: rgba(20, 224, 227, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: radial-gradient(ellipse at top, var(--bg-1) 0%, var(--bg-0) 60%, #000 100%);
  position: relative;
  overflow-x: hidden;
}

/* Drifting fog layer - pure CSS, sits behind all content */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(180, 195, 210, 0.07), transparent 40%),
    radial-gradient(circle at 80% 15%, rgba(160, 175, 195, 0.05), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(190, 200, 215, 0.05), transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(170, 185, 200, 0.04), transparent 40%);
  filter: blur(50px);
  animation: drift 50s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -4%) scale(1.1); }
}

h1, h2 {
  color: var(--accent);
  text-shadow: var(--accent-glow);
}

input, textarea {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  width: 100%;
}
textarea { resize: vertical; }

button {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
button:hover { background: var(--btn-hover-bg); box-shadow: var(--accent-glow); }
button:disabled { background: rgba(255,255,255,0.02); color: var(--text-dim); cursor: not-allowed; box-shadow: none; }

button.small {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
  margin-right: 6px;
  font-weight: 500;
}
button.danger:hover { background: rgba(242, 163, 163, 0.10); border-color: rgba(242, 163, 163, 0.35); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--row-border); }
th { color: var(--text-dim); font-weight: 500; }

.msg { font-size: 13px; margin-top: 10px; min-height: 16px; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
.empty { color: var(--text-dim); font-size: 13px; }
.hidden { display: none; }
.fp { color: var(--text-dim); font-size: 12px; }
.file-meta { color: var(--text-dim); font-size: 12px; }
.countdown { font-variant-numeric: tabular-nums; }
.reveal-value { font-family: inherit; background: var(--input-bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--panel-border); }

.ok-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.bad-dot { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ========== LIQUID GLASS — frosted, reflective, ghostly-teal-lit containers ========== */
.card, .panel {
  background: rgba(16, 18, 24, 0.35);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px) saturate(160%) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(160%) brightness(1.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 3px rgba(20, 224, 227, 0.6),
    0 0 24px rgba(20, 224, 227, 0.35),
    0 0 70px rgba(20, 224, 227, 0.22),
    0 0 140px rgba(20, 224, 227, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Subtle grain texture for glass distortion feel */
.card::after, .panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}

/* Top-edge highlight line + diagonal reflective sheen, like light off glass */
.card::before, .panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent) top / 100% 1px no-repeat,
    linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.10) 0%,
      rgba(255, 255, 255, 0.03) 22%,
      transparent 42%,
      transparent 70%,
      rgba(20, 224, 227, 0.06) 100%
    );
  pointer-events: none;
  z-index: 1;
}

/* Hover glow intensify */
.card:hover, .panel:hover {
  border-color: var(--panel-border-hover);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 4px rgba(20, 224, 227, 0.7),
    0 0 32px rgba(20, 224, 227, 0.45),
    0 0 90px rgba(20, 224, 227, 0.30),
    0 0 180px rgba(20, 224, 227, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03) !important;
}

/* Slow breathing glow - an ominous pulse from behind the glass. The
   hover rule above wins over it (via !important) while actively hovered. */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.5),
      0 0 3px rgba(20, 224, 227, 0.35),
      0 0 24px rgba(20, 224, 227, 0.18),
      0 0 70px rgba(20, 224, 227, 0.09),
      0 0 140px rgba(20, 224, 227, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      inset 0 -1px 0 rgba(255, 255, 255, 0.02);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.5),
      0 0 4px rgba(20, 224, 227, 0.7),
      0 0 32px rgba(20, 224, 227, 0.42),
      0 0 90px rgba(20, 224, 227, 0.26),
      0 0 170px rgba(20, 224, 227, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.07),
      inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .panel {
    /* animation-delay is randomized per element in theme.js so panels
       don't breathe in a fixed, predictable pattern */
    animation: glow-pulse 14s ease-in-out infinite;
  }
}
