:root {
  --dirt: #4b3621;
  --dirt-2: #3a2817;
  --grass: #5b8c3e;
  --grass-2: #7ab34e;
  --stone: #6e6e6e;
  --stone-2: #555;
  --panel: #211a14;
  --panel-2: #2b2219;
  --border-light: #6b5a45;
  --border-dark: #0f0b08;
  --text: #e9e2d0;
  --dim: #a99f8b;
  --gold: #ffcc33;
  --gold-2: #b8860b;
  --red: #b03a2e;
  --green: #4caf50;
  --mono: "VT323", "Consolas", monospace;
  --pixel: "Press Start 2P", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
  background: var(--dirt-2);
  image-rendering: pixelated;
  cursor: default;
}

.sky {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, #8fc7e8 0%, #5e9fd6 32%, #3d7cb4 52%, #2a5a8a 68%, #1d3f63 82%, #14293f 100%);
  background-attachment: fixed;
  padding-bottom: 0;
}

/* pixel block texture layers */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .06;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

.clouds {
  position: absolute;
  inset: 0 0 auto 0;
  height: 320px;
  pointer-events: none;
  background-image:
    radial-gradient(closest-side, rgba(255,255,255,.85) 96%, transparent),
    radial-gradient(closest-side, rgba(255,255,255,.7) 96%, transparent),
    radial-gradient(closest-side, rgba(255,255,255,.8) 96%, transparent);
  background-repeat: no-repeat;
  background-size: 190px 60px, 130px 44px, 240px 70px;
  background-position: 8% 40px, 32% 110px, 66% 60px;
  animation: drift 90s linear infinite alternate;
  opacity: .55;
}
@keyframes drift { to { transform: translateX(60px); } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(#2f2419, #1b1410);
  border-bottom: 4px solid var(--border-dark);
  box-shadow: inset 0 2px 0 #57452f, 0 6px 18px rgba(0,0,0,.5);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-text {
  font-family: var(--pixel);
  font-size: 11px;
  letter-spacing: 1px;
  color: #d9e8c8;
  text-shadow: 2px 2px 0 #000;
}
.logo-text .dim { color: var(--grass-2); }

.block {
  width: 22px; height: 22px;
  display: inline-block;
  border: 2px solid #000;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.3);
}
.grass-block {
  background:
    linear-gradient(#6fbf4a 0 32%, transparent 32%),
    repeating-linear-gradient(90deg, #8b6444 0 6px, #7a563a 6px 12px);
  background-color: #8b6444;
}
.dirt-block {
  background: repeating-linear-gradient(90deg, #6b4a2f 0 6px, #5a3d26 6px 12px);
}

.hotbar { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.slot {
  position: relative;
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: var(--pixel);
  font-size: 8px;
  color: #cfc7b4;
  text-decoration: none;
  background: #3b2f22;
  border: 2px solid;
  border-color: #7a6750 #17110c #17110c #7a6750;
  transition: .12s;
}
.slot:hover, .slot:focus-visible {
  background: #54432f;
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}
.slot.gold { background: #4a3a13; color: var(--gold); border-color: #b08a2c #2a1f08 #2a1f08 #b08a2c; }

[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 15px;
  color: #e8e2cf;
  background: #100c09;
  border: 2px solid #6b5a45;
  padding: 3px 8px;
  z-index: 60;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  width: min(1180px, 100% - 28px);
  margin: 22px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.panel {
  background:
    linear-gradient(rgba(33,26,20,.96), rgba(24,19,14,.97));
  border: 4px solid;
  border-color: #5f4e3a #0d0a07 #0d0a07 #5f4e3a;
  box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.04);
  padding: 20px 22px 24px;
}
.panel > h2:first-child { margin-top: 0; }

.pixel {
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: .5px;
  color: #f0e7d2;
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 14px;
}
.ico { filter: grayscale(.2); }

.hero {
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 24px;
  align-items: start;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(122,179,78,.16), transparent 60%),
    linear-gradient(rgba(33,26,20,.96), rgba(22,17,12,.98));
}

.hero-frame {
  position: relative;
  border: 4px solid #0c0906;
  background: #0a0806;
  box-shadow: 0 0 0 3px #6d5b46;
}
.avatar {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.12;
  object-fit: cover;
  image-rendering: auto;
  filter: contrast(1.05) saturate(1.05);
}
.level-badge {
  position: absolute;
  bottom: -12px; left: -12px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-family: var(--pixel);
  font-size: 11px;
  color: #0a2b06;
  background: var(--grass-2);
  border: 3px solid #000;
  box-shadow: inset -3px -3px 0 #467a2c, inset 3px 3px 0 #a6d47a;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--grass-2);
}
h1.pixel { font-size: clamp(18px, 3.6vw, 30px); margin: 0 0 6px; color: #fff; }
.subtitle { margin: 0 0 14px; color: var(--dim); font-size: 17px; }

.hearts { display: flex; gap: 2px; font-size: 20px; color: #e0453a; text-shadow: 1px 1px 0 #000; line-height: 1; }
.hearts .half { opacity: .45; }
.xpbar {
  margin: 8px 0 4px;
  height: 12px;
  background: #14100c;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px #40342a;
}
.xpbar-fill { height: 100%; background: linear-gradient(90deg, #6bd34f, #b9f27a); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.xp-label { margin: 0 0 14px; font-size: 15px; color: var(--dim); }
.xp-label b { color: #cdeaa9; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag {
  font-family: var(--pixel);
  font-size: 8px;
  padding: 6px 8px;
  color: #14100c;
  background: #c9b98f;
  border: 2px solid #000;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), inset 2px 2px 0 rgba(255,255,255,.4);
  text-transform: lowercase;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pixel);
  font-size: 9px;
  text-decoration: none;
  color: #e9e2d0;
  background: #6b6b6b;
  border: 3px solid;
  border-color: #a5a5a5 #2b2b2b #2b2b2b #a5a5a5;
  padding: 11px 14px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.25);
  cursor: pointer;
  transition: .1s;
}
.btn:hover { background: #7d7d7d; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); border-color: #2b2b2b #a5a5a5 #a5a5a5 #2b2b2b; box-shadow: inset 3px 3px 0 rgba(0,0,0,.3); }
.btn.primary { background: #4c8f2c; border-color: #8fd160 #24450f #24450f #8fd160; color: #f2ffe6; }
.btn.primary:hover { background: #58a334; }
.btn.small { padding: 7px 10px; font-size: 8px; }
.btn.ghost { background: #33291e; border-color: #6b5a45 #100c08 #100c08 #6b5a45; }

.grid { display: grid; gap: 16px; align-items: start; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: linear-gradient(rgba(45,36,26,.72), rgba(31,24,17,.85));
  border: 3px solid;
  border-color: #4e4030 #100c08 #100c08 #4e4030;
  padding: 14px 16px 16px;
}
.card h3 {
  font-family: var(--pixel);
  font-size: 9px;
  color: #f0e7d2;
  margin: 0 0 10px;
  letter-spacing: .4px;
}
.card h3 + h3 { margin-top: 16px; }

.muted { color: var(--dim); font-size: 15px; }
.mono { font-family: var(--mono); font-size: 17px; }
code, .code { font-family: var(--mono); }

.count {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  padding: 0 6px;
  color: #14100c;
  background: var(--gold);
  border: 2px solid #000;
  vertical-align: middle;
}

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li {
  background: #1a150f;
  border-left: 4px solid var(--grass);
  padding: 6px 10px;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.list.grid-list { display: grid; grid-template-columns: repeat(2, 1fr); }

.chips { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-family: var(--mono);
  font-size: 15px;
  background: #2a2219;
  border: 2px solid #4b3d2c;
  padding: 3px 7px;
  overflow-wrap: anywhere;
}
.chips.scroll { max-height: 210px; overflow: auto; }

.kv { margin: 0; display: grid; gap: 5px; }
.kv > div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 17px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.email-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.email-groups .card h3 { color: var(--gold); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }

.search {
  flex: 1 1 240px;
  min-width: 180px;
  font-family: var(--mono);
  font-size: 17px;
  color: var(--text);
  background: #120e0a;
  border: 2px solid #4b3d2c;
  border-color: #4b3d2c #0a0806 #0a0806 #4b3d2c;
  padding: 8px 10px;
}
.search:focus { outline: 2px solid var(--grass-2); outline-offset: 1px; }
.search::placeholder { color: #7b7160; }

.table-wrap { overflow: auto; max-height: 620px; border: 2px solid #0c0906; }
.table { width: 100%; border-collapse: collapse; font-size: 17px; }
.table th {
  position: sticky; top: 0;
  text-align: left;
  font-family: var(--pixel);
  font-size: 8px;
  padding: 8px;
  background: #3a2d20;
  color: #e6dcc6;
  border-bottom: 2px solid #0c0906;
}
.table td { padding: 6px 8px; border-bottom: 1px solid #241c14; overflow-wrap: anywhere; }
.table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.table tr:hover td { background: rgba(122,179,78,.09); }
.table .pw { font-family: var(--mono); }
.table .pw.hidden { filter: blur(4px); user-select: none; }
.table a { color: var(--grass-2); }
.row-btn {
  font-family: var(--mono); font-size: 14px;
  background: #33291e; color: var(--text);
  border: 2px solid #5d4c39;
  padding: 2px 7px; cursor: pointer;
}
.row-btn:hover { background: #4a3a29; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  font-family: var(--pixel); font-size: 8px;
  color: #cfc7b4;
  background: #2a2118;
  border: 2px solid #4f402f;
  padding: 9px 11px;
  cursor: pointer;
}
.tab.active { background: #4c8f2c; color: #f2ffe6; border-color: #8fd160 #24450f #24450f #8fd160; }
.tabs.small .tab { font-size: 7px; padding: 6px 9px; }

.history li { border-left-color: #3d6fa8; display: flex; gap: 10px; align-items: baseline; }
.history .n { font-family: var(--pixel); font-size: 8px; color: var(--dim); min-width: 34px; }
.history .u { font-size: 15px; color: #9fc7ef; overflow-wrap: anywhere; }
.history .t { color: var(--dim); font-size: 15px; }

.pager { display: flex; gap: 6px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pager .page { font-family: var(--mono); font-size: 15px; background: #2a2118; border: 2px solid #4f402f; color: var(--text); padding: 3px 9px; cursor: pointer; }
.pager .page.active { background: var(--gold); color: #14100c; border-color: #000; }
.pager .page:disabled { opacity: .4; cursor: default; }
.pager .info { color: var(--dim); font-size: 15px; }

.media { margin: 0; padding: 10px; }
.media video, .media img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: #000;
  border: 2px solid #0c0906;
}
.media video { max-height: 520px; }
.media figcaption { margin-top: 8px; font-size: 15px; color: var(--dim); }
.media figcaption b { color: var(--text); }

footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 30px;
  background: linear-gradient(transparent, rgba(10,8,6,.85));
  font-size: 15px;
  color: var(--dim);
  text-align: center;
}
footer b { color: var(--text); }
footer .dirt-block { width: 18px; height: 18px; }

.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  font-family: var(--pixel);
  font-size: 8px;
  color: #eaffdc;
  background: #2c4a1c;
  border: 3px solid #8fd160;
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 900px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-frame { max-width: 260px; }
}

@media (max-width: 620px) {
  body { font-size: 18px; }
  main { width: calc(100% - 18px); }
  .panel { padding: 16px 13px; }
  .topbar { padding: 8px; gap: 8px; }
  .logo-text { font-size: 9px; }
  .hotbar { width: 100%; justify-content: space-between; gap: 3px; flex-wrap: nowrap; padding-bottom: 2px; }
  .slot { width: 30px; height: 30px; font-size: 6px; }
  .kv > div { grid-template-columns: 1fr; gap: 0; }
  .kv dt { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero-frame { max-width: none; }
  h1.pixel { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
