:root {
  --bg: #0b0b0d;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.04);

  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.65);

  --accent: #ffffff;
  --accent-2: #7a0b12;
  --accent-3: #b3121f;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: .2px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  z-index: 0;
}

body::after{
  content:"";
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
  background: radial-gradient(1000px 260px at 50% 0%,
    color-mix(in srgb, var(--accent-2), transparent 65%),
    transparent 70%);
  z-index: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0 8px;
  padding: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(122, 11, 18, 0.35) 0%, transparent 60%),
    rgba(0,0,0,0.25);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow);
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent-2), var(--accent) 45%, #2a2a2e 60%, var(--accent-2));
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.45), 0 0 40px rgba(179, 18, 31, 0.25);
  position: relative;
  isolation: isolate;
}

.logo::after {
  content: "g10";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #0b0b0d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 38px);
  letter-spacing: .8px;
}

.sub { color: var(--muted); margin-top: 4px; }

.toplinks {
  margin-top: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

section { margin: 28px 0; }

section h2 {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card img {
  width: 100%;
  border-radius: 8px;
  margin: 10px 0;
  border: 1px solid rgba(255,255,255,0.08);
}

.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.glitch::before { transform: translate(1px, 0); color: var(--accent); opacity: 0.85; }
.glitch::after  { transform: translate(-1px, 0); color: var(--accent-2); opacity: 0.85; }

.btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  line-height: 1;
}

.btn:hover, .btn:focus {
  background: var(--accent);
  color: #0b0b0d;
  box-shadow: 0 0 14px rgba(255,255,255,0.45);
  outline: none;
}

.btn-red {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(179, 18, 31, 0.85);
  border-radius: 6px;
  color: #ffd8dc;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  background: rgba(122, 11, 18, 0.18);
  cursor: pointer;
  line-height: 1;
}

.btn-red:hover, .btn-red:focus {
  background: rgba(179, 18, 31, 0.95);
  color: #0b0b0d;
  box-shadow: 0 0 14px rgba(179, 18, 31, 0.55);
  outline: none;
}

footer {
  margin: 26px 0 60px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(800px 400px at 20% 120%, rgba(122, 11, 18, 0.28) 0%, transparent 60%),
    rgba(0,0,0,0.25);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.sig { opacity: .85; }

@media (max-width: 600px) {
  .logo { width: 48px; height: 48px; }
  footer { flex-direction: column; align-items: flex-start; }
}

body.theme-slate {
  --accent: #cfe3e3;
  --accent-2: #2f4f4f;
  --accent-3: #3f6f6f;
  background: var(--bg);
}

body.theme-red {
  --accent: #ffffff;
  --accent-2: #7a0b12;
  --accent-3: #b3121f;
  background: var(--bg);
}

body.theme-grey {
  --accent: #d0d3d6;
  --accent-2: #8b8f94;
  --accent-3: #b0b5bb;
  background: var(--bg);
}

body.theme-slate .btn-red {
  border-color: #2f4f4f !important;
  color: #cfe3e3 !important;
  background: rgba(47, 79, 79, 0.18) !important;
  box-shadow: 0 0 14px rgba(47, 79, 79, 0.45) !important;
}

body.theme-slate header,
body.theme-slate footer {
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(47, 79, 79, 0.35), transparent 60%),
    rgba(0,0,0,0.25) !important;
}

body.theme-grey .btn-red {
  border-color: #8b8f94 !important;
  color: #e0e0e0 !important;
  background: rgba(139, 143, 148, 0.18) !important;
  box-shadow: 0 0 14px rgba(139, 143, 148, 0.45) !important;
}

body.theme-grey header,
body.theme-grey footer {
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(160, 160, 160, 0.28), transparent 60%),
    rgba(0,0,0,0.25) !important;
}

body.theme-red {
  --accent-2: #7a0b12;
  --accent-3: #b3121f;
}

a.btn[href*="kiverix.net"] {
  border-color: #ffffff !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35) !important;
}

a.btn[href*="kiverix.net"]:hover,
a.btn[href*="kiverix.net"]:focus {
  background: #ffffff !important;
  color: #0b0b0d !important;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.65) !important;
}

.archive-pages .btn,
.archive-pages a {
  transition: all 0.2s ease;
}

.archive-pages .btn:hover,
.archive-pages .btn:focus,
.archive-pages a:hover,
.archive-pages a:focus {
  background: var(--accent-2);
  color: #0b0b0d;
  box-shadow: 0 0 18px rgba(212, 160, 23, 0.65);
}

body.theme-slate a.btn-red,
body.theme-grey a.btn-red,
body.theme-red a.btn-red {
  transition: all 0.2s ease !important;
}

body.theme-slate a.btn-red:hover,
body.theme-slate a.btn-red:focus {
  background: var(--accent-2) !important;
  color: #0b0b0d !important;
  box-shadow: 0 0 18px rgba(47, 79, 79, 0.65) !important;
  outline: none !important;
}

body.theme-grey a.btn-red:hover,
body.theme-grey a.btn-red:focus {
  background: var(--accent-2) !important;
  color: #0b0b0d !important;
  box-shadow: 0 0 18px rgba(139, 143, 148, 0.55) !important;
  outline: none !important;
}

body.theme-red a.btn-red:hover,
body.theme-red a.btn-red:focus {
  background: rgba(179, 18, 31, 0.95) !important;
  color: #0b0b0d !important;
  box-shadow: 0 0 14px rgba(179, 18, 31, 0.55) !important;
  outline: none !important;
}

.sysline {
  position: relative;
  width: 100%;
  height: 28px;
  background: #000;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-2), transparent 55%);
  overflow: hidden;
  z-index: 5;
}

.sysline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    color-mix(in srgb, var(--accent-2), transparent 65%),
    color-mix(in srgb, var(--accent-2), transparent 65%) 1px,
    transparent 2px,
    transparent 3px
  );
  pointer-events: none;
}

.sysline span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;

  color: var(--accent-2);
  text-shadow:
    0 0 6px color-mix(in srgb, var(--accent-2), transparent 35%),
    0 0 14px color-mix(in srgb, var(--accent-2), transparent 65%);

  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.theme-red .sysline span {
  color: #ff365f;
  text-shadow: 0 0 6px rgba(255, 54, 95, 0.65);
}

body.theme-grey .sysline span {
  color: #d0d3d6;
  text-shadow: 0 0 6px rgba(208, 211, 214, 0.55);
}

body.theme-slate .sysline span {
  color: #9fd3d3;
  text-shadow: 0 0 6px rgba(159, 211, 211, 0.65);
}

main img {
  display: block;
  margin: 24px auto;
}

img[src*="archive.png"] {
  display: block;
  margin: 20px auto !important;
}

.grid{
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.card{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 22px 20px 18px;
  border-radius: 14px;

  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));

  border: 2px solid color-mix(in srgb, var(--accent-2), transparent 20%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.65) inset,
    0 0 22px color-mix(in srgb, var(--accent-2), transparent 60%),
    var(--shadow);
}

.card::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent-2), transparent 55%);
  pointer-events:none;
  opacity: .9;
}

.card h3{
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: 0.6px;
  color: var(--accent);
  text-shadow:
    0 0 10px color-mix(in srgb, var(--accent-2), transparent 35%),
    0 0 22px color-mix(in srgb, var(--accent-2), transparent 55%);
}

.game-tag{
  align-self: center;
  margin-top: 4px;

  padding: 6px 12px;
  border-radius: 8px;

  border: 1px solid color-mix(in srgb, var(--accent-2), transparent 20%);
  background: color-mix(in srgb, #000, transparent 20%);
  color: var(--accent-2);

  font-weight: 800;
  letter-spacing: 2px;
  font-size: 12px;

  text-shadow: 0 0 10px color-mix(in srgb, var(--accent-2), transparent 35%);
}

.card img{
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;

  border-radius: 10px;
  margin: 6px 0 2px;

  border: 1px solid color-mix(in srgb, var(--accent-2), transparent 45%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.65) inset,
    0 0 18px rgba(0,0,0,0.55);
}

.card p{
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.card a.btn,
.card a.btn-red{
  display: block;
  width: 100%;
  text-align: center;

  padding: 10px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
  font-size: 13px;
}

.card a[download]{
  margin-top: 12px;
  opacity: .9;
}

@media (max-width: 520px){
  .grid{ grid-template-columns: 1fr; }
  .card h3{ font-size: 24px; }
}

.card .meta-actions{
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.btn-outline{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 35%);
  color: var(--accent);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent-2), transparent 75%);
  cursor: pointer;
}

.btn-outline:hover{
  border-color: color-mix(in srgb, var(--accent), transparent 15%);
  background: rgba(0,0,0,0.32);
}

.info-block{
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(0,0,0,.35);
  box-shadow: 0 0 18px rgba(0,0,0,.5);
  transition: max-height 320ms ease, opacity 200ms ease;
}

.info-block.open{
  margin: 8px 0 10px 0;
  max-height: 1000px;
  opacity: 1;
  padding-top: 12px;
  padding-bottom: 14px;
}

.info-title{
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 10px;
  color: var(--accent);
}

.info-text{
  line-height: 1.45;
  white-space: pre-wrap;
}

.map-actions,
.meta-actions{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.map-actions .btn-outline,
.meta-actions .btn-outline{
  margin: 0;
}

body.theme-purple {
  --accent: #d6b3ff;
  --accent-2: #6a00ff;
  --accent-3: #9d4dff;

  --ink: #ffffff;
  --muted: rgba(220, 190, 255, 0.75);
}

body.theme-purple header,
body.theme-purple footer {
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(106, 0, 255, 0.35), transparent 60%),
    rgba(0,0,0,0.25) !important;
}

body.theme-purple .sysline span {
  color: #9d4dff;
  text-shadow:
    0 0 6px rgba(157, 77, 255, 0.65),
    0 0 14px rgba(106, 0, 255, 0.45);
}

body.theme-purple .btn-red {
  border-color: #6a00ff !important;
  color: #d6b3ff !important;
  background: rgba(106, 0, 255, 0.18) !important;
  box-shadow: 0 0 14px rgba(106, 0, 255, 0.45) !important;
}

body.theme-purple .btn-red:hover,
body.theme-purple .btn-red:focus {
  background: #6a00ff !important;
  color: #0b0b0d !important;
  box-shadow: 0 0 18px rgba(106, 0, 255, 0.65) !important;
}