:root {
  color-scheme: dark;
  --bezel: #030503;
  --bg: #101210;
  --surface: rgba(12, 16, 11, 0.86);
  --surface-alt: rgba(17, 22, 16, 0.9);
  --text: #c5c7be;
  --title: #a0aa65;
  --command: #a5b16c;
  --command-bright: #b7c376;
  --system: #80a59d;
  --muted: #929990;
  --warning: #b5a16a;
  --error: #ca9387;
  --edge: #2b3228;
  --edge-dim: #232a20;
  --thumb: #4f5948;
  --glow: -0.45px 0 rgba(204, 121, 107, 0.28), 0.5px 0 rgba(98, 170, 164, 0.32),
          0 0 5px color-mix(in srgb, currentColor 28%, transparent);
  --font: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
  font-family: var(--font);
  line-height: 1.5;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--thumb) transparent;
}

html {
  background: var(--bezel);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 48% 36%, #21271d 0%, #151912 44%, #0b0e0a 78%, #050705 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 500 15px/1.55 var(--font);
  letter-spacing: 0.035em;
  text-shadow: var(--glow);
  position: relative;
}

/* Scanlines & subtle aperture grille (0ladushek.pro CRT aesthetic) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.34) 2px 3px, rgba(0, 0, 0, 0.1) 3px 4px),
    repeating-linear-gradient(to right, transparent 0 2px, rgba(3, 6, 3, 0.22) 2px 3px);
  background-size: 100% 4px, 3px 100%;
  opacity: 0.65;
}

/* Curved CRT tube shadow, glass vignette & top-left specular sheen */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 91;
  background:
    radial-gradient(ellipse 46% 32% at 24% 12%, rgba(214, 226, 192, 0.045), transparent 70%),
    linear-gradient(147deg, rgba(173, 188, 163, 0.08) 0%, rgba(149, 167, 137, 0.025) 14%, transparent 36%, transparent 80%, rgba(162, 178, 139, 0.045) 100%),
    radial-gradient(ellipse 80% 78% at 50% 48%, transparent 52%, rgba(0, 0, 0, 0.56) 100%);
  box-shadow:
    inset 0 0 56px 10px rgba(0, 0, 0, 0.68),
    inset 0 0 0 2px #0b1009,
    inset 0 1px 0 rgba(180, 195, 150, 0.2);
}

/* Gentle CRT refresh sweep bar */
.crt-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: -16vh;
  height: 14vh;
  pointer-events: none;
  z-index: 92;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(157, 183, 137, 0.025) 28%,
    rgba(202, 222, 180, 0.095) 50%,
    rgba(157, 183, 137, 0.02) 72%,
    transparent 100%
  );
  animation: crt-refresh 6.2s linear infinite;
}

@keyframes crt-refresh {
  from { transform: translateY(0); }
  to { transform: translateY(132vh); }
}

@media (prefers-reduced-motion: reduce) {
  .crt-sweep { display: none; }
}

::selection {
  background: var(--text);
  color: #0a0c08;
  text-shadow: none;
}

a {
  color: var(--command);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: background-color 80ms linear, color 80ms linear;
}

a:hover {
  background: var(--command);
  color: #0b0e08;
  text-decoration: none;
  text-shadow: none;
}

:focus-visible {
  outline: 1px dashed var(--system);
  outline-offset: 2px;
}

button, input, select {
  font: inherit;
  letter-spacing: inherit;
}

button {
  border: 1px solid var(--command);
  border-radius: 2px;
  background: rgba(11, 14, 9, 0.85);
  color: var(--command);
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-shadow: var(--glow);
  transition: background-color 80ms linear, color 80ms linear;
}

button:hover {
  background: var(--command);
  color: #0b0e08;
  text-shadow: none;
}

input, select {
  width: 100%;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: #080b07;
  color: var(--command-bright);
  padding: 0.52rem 0.68rem;
  min-height: 2.55rem;
  text-shadow: var(--glow);
}

input:focus, select:focus {
  border-color: var(--system);
  outline: none;
}

input[type=search]::placeholder,
input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

label {
  display: grid;
  gap: 0.28rem;
  color: var(--system);
  font-size: 0.84rem;
}

.shell {
  width: min(1160px, calc(100% - 3rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.mast {
  background: rgba(8, 11, 7, 0.92);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 4px 14px -8px #000;
}

.mast-inner {
  min-height: 3.7rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  padding: 0.45rem 0;
}

.brand {
  color: var(--title);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  padding: 0.1rem 0.25rem;
}

.brand::before {
  content: "operator> ";
  color: var(--command);
}

.brand strong {
  color: var(--system);
  font-weight: 700;
}

.brand:hover,
.brand:hover strong,
.brand:hover::before {
  color: #0b0e08;
}

.mast nav, .tabs, .pagination, .account {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mast nav a, .tabs a {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.16rem 0.35rem;
  text-decoration: none;
}

.mast nav a:hover, .tabs a:hover {
  background: var(--command);
  color: #0b0e08;
}

.mast nav [aria-current], .tabs [aria-current] {
  color: #0b0e08;
  background: var(--command);
  text-shadow: none;
  font-weight: 700;
}

.account {
  margin-left: auto;
  color: var(--system);
  font-size: 0.86rem;
}

.quiet {
  color: var(--muted);
  border: 1px solid var(--edge);
  background: transparent;
  padding: 0.22rem 0.55rem;
  font-weight: 500;
}

.quiet:hover {
  background: var(--command);
  border-color: var(--command);
  color: #0b0e08;
}

main {
  min-height: 74vh;
  padding: 2rem 0 3.5rem;
}

footer {
  border-top: 1px solid var(--edge-dim);
  padding: 1.15rem 0 1.6rem;
  color: var(--muted);
  font-size: 0.84rem;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  color: var(--title);
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h2 {
  color: var(--system);
  font-size: clamp(1.08rem, 1.8vw, 1.32rem);
  font-weight: 700;
  line-height: 1.25;
}

h3 {
  font-size: 0.98rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

small {
  font-size: 0.84rem;
  color: var(--muted);
}

p + form, .heading p, p + p {
  margin-top: 0.75rem;
}

.heading {
  margin-bottom: 1.35rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--edge);
}

.heading p, .hero p {
  color: var(--muted);
  max-width: 72ch;
}

.hero {
  padding: clamp(1.25rem, 3.2vw, 2.1rem);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(180, 195, 150, 0.08);
}

.hero h1::before {
  content: "> ";
  color: var(--command);
}

.hero p {
  margin-top: 0.7rem;
}

.hero .search {
  max-width: 48rem;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.search {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.search label:first-child {
  flex: 1 1 17rem;
}

.search label {
  flex: 0 1 10.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 1.4rem;
}

.stat, .card, .panel, .list {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(180, 195, 150, 0.06);
}

.stat {
  padding: 0.85rem 0.95rem;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.stat strong {
  display: block;
  color: var(--title);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat span {
  color: var(--system);
  font-size: 0.84rem;
}

.stat:hover {
  background: var(--command);
  border-color: var(--command);
  color: #0b0e08;
}

.stat:hover strong,
.stat:hover span {
  color: #0b0e08;
  text-shadow: none;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.85rem 0 0.75rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.65rem;
}

.card {
  padding: 0.9rem 1rem;
  min-width: 0;
}

.card h3 {
  margin: 0.25rem 0;
}

.card p {
  margin: 0.28rem 0 0.55rem;
  color: var(--muted);
  max-height: 6.2rem;
  overflow: hidden;
}

.type {
  font-size: 0.8rem;
  color: var(--system);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel {
  padding: 0.95rem 1.1rem;
}

.empty {
  color: var(--muted);
}

.error {
  color: var(--error);
  font-weight: 700;
}

.login {
  max-width: 30rem;
  margin: 7vh auto;
}

.login form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.login h1::before {
  content: "auth> ";
  color: var(--command);
}

.list {
  overflow: hidden;
}

.list-row {
  padding: 0.72rem 0.95rem;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: start;
  min-width: 0;
}

.list-row + .list-row,
.list > details,
.profile-entry + .profile-entry {
  border-top: 1px solid var(--edge-dim);
}

.list-row small, .list-row code {
  display: block;
  overflow-wrap: anywhere;
}

.list-row time {
  font-variant-numeric: tabular-nums;
  color: var(--system);
  overflow-wrap: anywhere;
}

.list-row strong {
  overflow-wrap: anywhere;
}

code {
  color: var(--system);
  background: rgba(8, 11, 7, 0.7);
  padding: 0.05rem 0.28rem;
  border: 1px solid var(--edge-dim);
  border-radius: 2px;
}

.pagination {
  margin: 1rem 0;
  color: var(--muted);
}

.tab, .tag, .count {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--system);
}

.tag {
  padding: 0.12rem 0.48rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: #0b0e09;
  margin: 0.12rem 0.22rem 0.12rem 0;
}

.tabs {
  margin: 1.1rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--edge);
}

.dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.8rem;
}

.dates strong {
  display: block;
  color: var(--title);
}

.profile-entry h3 {
  padding: 0.6rem 0.95rem 0;
}

.fragment, .book-text, .sign div {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

mark {
  color: #0b0e08;
  background: var(--command);
  text-shadow: none;
  padding: 0 0.12rem;
}

main section + section,
main .panel + .panel,
main .panel + section,
main section + .panel {
  margin-top: 1.2rem;
}

main section h2 {
  margin-bottom: 0.65rem;
}

ul {
  margin: 0.45rem 0 0;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.28rem;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(10rem, auto) 1fr;
  gap: 0.4rem 1.2rem;
}

dt {
  color: var(--system);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

details {
  padding: 0.6rem 0.95rem;
  color: var(--muted);
}

summary {
  cursor: pointer;
  color: var(--command);
}

pre {
  padding: 0.9rem;
  background: #080b07;
  border: 1px solid var(--edge);
  border-radius: 2px;
  overflow: auto;
  max-height: 35rem;
  color: var(--text);
  text-shadow: none;
}

/* Readable in-game Minecraft book & sign cards framed for CRT */
.book {
  max-width: 48rem;
  padding: clamp(1.2rem, 3.6vw, 2.2rem);
  background: #d5c7a3;
  color: #241b10;
  border: 1px solid var(--warning);
  border-radius: 2px;
  box-shadow: inset 0 0 2rem rgba(90, 68, 36, 0.38);
  margin-top: 1rem;
  text-shadow: none;
}

.book a, .book .pagination {
  color: #3d2c16;
}

.book a:hover {
  background: #3d2c16;
  color: #f4ebd2;
}

.book-text {
  min-height: 15rem;
  font: 1.1rem/1.6 Georgia, serif;
  letter-spacing: normal;
}

.signs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}

.signs .sign {
  margin: 0;
  padding: 1.15rem;
  background: repeating-linear-gradient(3deg, #3e2e1d, #3e2e1d 4px, #443220 6px, #443220 9px);
  border: 1px solid var(--edge);
  border-radius: 2px;
  min-width: min(100%, 19rem);
  text-align: center;
  text-shadow: none;
}

.sign small {
  color: #ead7b4;
}

.sign div {
  font-weight: 700;
  color: #fff4d6;
}

.mc-bold { font-weight: bold; }
.mc-italic { font-style: italic; }
.mc-underlined { text-decoration: underline; }
.mc-strikethrough { text-decoration: line-through; }
.mc-black { color: #000; }
.mc-dark_blue { color: #005; }
.mc-dark_green { color: #050; }
.mc-dark_aqua { color: #055; }
.mc-dark_red { color: #800; }
.mc-dark_purple { color: #805; }
.mc-gold { color: #a25400; }
.mc-gray { color: #555; }
.mc-dark_gray { color: #333; }
.mc-blue { color: #22a; }
.mc-green { color: #286100; }
.mc-aqua { color: #166; }
.mc-red { color: #a00; }
.mc-light_purple { color: #a26; }
.mc-yellow { color: #795600; }
.mc-white { color: #fff; }

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.55rem 0.9rem 0.55rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--edge-dim);
  font-variant-numeric: tabular-nums;
}

.table th {
  color: var(--system);
  font-weight: 700;
  border-bottom: 1px solid var(--edge);
}

.table tbody tr:hover {
  background: rgba(165, 177, 108, 0.08);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.activity-row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 20rem) 2.5rem;
  align-items: center;
  gap: 0.6rem;
}

.activity-row meter {
  width: 100%;
  height: 0.85rem;
  accent-color: var(--command);
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 1.4rem); }
  .mast-inner { gap: 0.65rem; }
  .mast nav { order: 3; gap: 0.65rem; width: 100%; padding-bottom: 0.3rem; }
  .mast nav a { white-space: nowrap; }
  .list-row { flex-wrap: wrap; }
  dl { grid-template-columns: 1fr; }
  main { padding-top: 1.25rem; }
}
