:root {
  --bg: #0a0d10;
  --fg: #b7ffcf;
  --muted: #7bd09c;
  --accent: #a6ffe0;
  --error: #ff6b6b;
  --ok: #7dffa3;
  --glass: #0b1419cc;
  --grid: rgba(255, 255, 255, 0.02);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(
      1200px 600px at 50% 20%,
      #0e141a 0%,
      #090c10 60%,
      #07090c 100%
    ),
    var(--bg);
  color: var(--fg);
  font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.grid {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 98%, var(--grid) 99%) 0 0/40px
      100%,
    linear-gradient(0deg, transparent 98%, var(--grid) 99%) 0 0/100% 40px;
  pointer-events: none;
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 60%, transparent 100%);
}

.crt {
  width: min(980px, 96vw);
  min-height: 560px;
  background: linear-gradient(
        0deg,
        transparent 97%,
        rgba(255, 255, 255, 0.05) 98%,
        transparent
      )
      0 0/100% 3px,
    radial-gradient(
      1200px 600px at 50% -20%,
      rgba(166, 255, 224, 0.09),
      transparent 70%
    ),
    var(--glass);
  border: 2px solid #21343a;
  border-radius: 14px;
  box-shadow: 0 0 0 1px #132329 inset, 0 20px 80px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(76, 255, 196, 0.12);
  position: relative;
  overflow: hidden;
}
.crt::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgba(255, 255, 255, 0.02),
    transparent
  );
  mix-blend-mode: overlay;
  animation: flick 4s infinite;
}

@keyframes flick {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
}

.bezel {
  position: absolute;
  inset: 0;
  padding: 24px 28px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

main {
  display: grid;
  place-items: center;
  padding: 8px;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.12em;
  opacity: 0.9;
}
header .brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}
header .lamp {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #243c33;
  box-shadow: 0 0 0 1px #123, 0 0 14px rgba(125, 255, 163, 0);
}
.led.on {
  background: #39ff88;
  box-shadow: 0 0 0 1px #123, 0 0 18px rgba(125, 255, 163, 0.55);
}

.panel {
  width: min(620px, 90vw);
  background: linear-gradient(
    180deg,
    rgba(20, 40, 38, 0.55),
    rgba(9, 18, 20, 0.55)
  );
  border: 1px solid #244a42;
  border-radius: 10px;
  box-shadow: 0 0 0 1px #0e2020 inset;
  padding: 22px 20px;
  backdrop-filter: blur(2px);
}
.panel.explorer {
  width: min(760px, 92vw);
  height: 100%;
  overflow: auto;
}

.title {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--muted);
  margin-bottom: 12px;
}

.prompt {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

input[type='password'] {
  font: 16px/1.4 ui-monospace, monospace;
  color: var(--fg);
  background: #0a1518;
  border: 1px solid #2a4642;
  border-radius: 8px;
  padding: 12px;
  outline: none;
  width: 100%;
  box-shadow: 0 0 0 2px transparent inset;
}
input[type='password']:focus {
  box-shadow: 0 0 0 2px #275a4d inset;
  border-color: #3e7c72;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 13px/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 14px;
  min-height: 40px;
  min-width: 144px;
  border-radius: 8px;
  border: 1px solid #2a5;
  background: #0f2a22;
  color: var(--ok);
  cursor: pointer;
  transition: 0.15s;
  box-sizing: border-box;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(62, 164, 128, 0.2);
}
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

a.button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 13px/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 14px;
  min-height: 40px;
  min-width: 144px;
  border-radius: 8px;
  border: 1px solid #355;
  background: #0f2020;
  color: #9fe0c4;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s;
  box-sizing: border-box;
}
a.button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(62, 164, 128, 0.2);
}

.msg {
  min-height: 24px;
  font-size: 13px;
}
.msg.ok {
  color: var(--ok);
}
.msg.err {
  color: var(--error);
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  font-size: 12px;
  color: #89bca0;
  opacity: 0.8;
}

.explorer {
  display: none;
}
.explorer.on {
  display: block;
}

.fs-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 6px 0 12px;
}

.fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.fs-item {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #244a42;
  border-radius: 10px;
  background: #0a1518;
  cursor: pointer;
  transition: 0.15s;
}
.fs-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.fs-ico {
  width: 42px;
  height: 36px;
  background: linear-gradient(180deg, #1a3c35, #0b2320);
  border: 1px solid #2c5a51;
  border-radius: 6px 6px 4px 4px;
  position: relative;
}
.fs-ico.folder::before {
  content: '';
  position: absolute;
  left: 6px;
  top: -8px;
  width: 22px;
  height: 10px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #1a3c35, #0b2320);
  border: 1px solid #2c5a51;
  border-bottom: none;
}
.fs-ico.txt {
  border-radius: 4px;
  background: linear-gradient(180deg, #243d38, #0d1a18);
}

.fs-name {
  font-size: 12px;
  text-align: center;
  color: #9fe0c4;
}
.tag {
  font-size: 10px;
  color: #77bfa0;
  opacity: 0.9;
}
.lock {
  font-size: 11px;
  color: #ffbdad;
}
.fs-item.unlocked .lock {
  color: var(--ok);
}

.fs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 10px;
}
.fs-breadcrumb {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.9;
  user-select: none;
}
.fs-nav .back {
  min-width: auto;
  padding: 8px 10px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 20px;
  z-index: 1000;
}
.modal.on {
  display: grid;
}

.card {
  width: min(640px, 94vw);
  max-height: 80vh;
  overflow: auto;
  background: #0b1419;
  border: 1px solid #2a4642;
  border-radius: 12px;
  padding: 18px 18px 14px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.card .row {
  grid-template-columns: 1fr auto;
}

.close {
  float: right;
  border: 1px solid #355;
  border-radius: 8px;
  background: #0f2020;
  color: #9fe0c4;
  padding: 8px 10px;
  cursor: pointer;
}

.viewer {
  font-size: 14px;
  line-height: 1.5;
  color: #c9ffe3;
  border-top: 1px dashed #345;
  margin-top: 10px;
  padding-top: 10px;
}
.viewer .actions {
  display: flex;
  gap: 10px;
  margin: 6px 0 10px;
}
.viewer .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border: 1px solid #244a42;
  border-radius: 8px;
  background: #0a1518;
}
.viewer iframe,
.viewer object {
  width: 100%;
  max-height: 70vh;
  border: 1px solid #244a42;
  border-radius: 8px;
  background: #0a1518;
}

.viewer pre {
  line-height: 1.65;
  padding: 14px 16px;
  border: 1px solid #244a42;
  border-radius: 8px;
  background: #0a1518;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  tab-size: 2;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.lightbox.on {
  display: flex;
}
.lightbox img {
  max-width: 96vw;
  max-height: 96vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.wall {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.wall-base {
  background: url(https://feathertail.ru/ks-events/ash-archive/assets/wallpaper-empty.webp)
    center/cover no-repeat;
  opacity: 0.28;
  filter: grayscale(0.3) contrast(0.9) brightness(0.9) saturate(0.9);
}
.wall-mask {
  background: url(https://feathertail.ru/ks-events/ash-archive/assets/wallpaper-pass.webp)
    center/cover no-repeat;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.25s ease;
}
.crt.cal .wall-mask {
  opacity: 1;
}

#pun-title,
.activees,
.activees2,
#stylelist,
.banners_bottom,
#pun-status,
#pun-crumbs1,
#pun-crumbs2,
.settings-menu__toggle,
#pun-ulinks,
#pun-navlinks,
#pun-about,
.kindred-info,
.scroll-rail,
.kindred-quote,
.knews {
  display: none;
}
#pun {
  background: none;
}
