:root {
  color-scheme: dark;
  --ink: #111714;
  --rail: #151d18;
  --panel: #1b241e;
  --well: #131b16;
  --edge: #303e33;
  --text: #eef2e7;
  --muted: #adbcad;
  --green: #b8e877;
  --green-dark: #25351d;
  --warning: #efd39a;
  --radius: 13px;
  --safe-t: var(--discord-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-r: var(--discord-safe-area-inset-right, env(safe-area-inset-right, 0px));
  --safe-b: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-l: var(--discord-safe-area-inset-left, env(safe-area-inset-left, 0px));
  font-family: "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--ink); min-height: 100vh; min-height: 100dvh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 1.04; letter-spacing: -.055em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .95rem; }
small { color: var(--muted); font-size: .82rem; }
code { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; color: #d8e8d5; }
ul { padding: 0; list-style: none; margin: 0; }
button, summary, select, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.dashboard {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
}
.rail {
  border-right: 1px solid var(--edge);
  background: var(--rail);
  padding: max(25px, var(--safe-t)) 15px max(20px, var(--safe-b)) max(15px, var(--safe-l));
  position: sticky;
  height: 100dvh;
  top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.13rem; letter-spacing: -.025em; }
.rail .brand { margin: 0 7px 35px; }
.brand > div { display: grid; gap: 2px; }
.brand small { font: 700 .68rem/1.1 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(135deg, #d4fba0 0 12%, var(--green) 12% 75%, #8bbf53 75%);
  box-shadow: inset 0 -3px 0 #749747;
  font: 900 1.25rem/1 ui-monospace, Consolas, monospace;
  border-radius: 6px;
}
.rail nav { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 4px; padding: 3px; scrollbar-width: thin; }
.navigation {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 0 10px;
  gap: 11px;
  white-space: nowrap;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 550;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}
.navigation:hover { background: #223028; color: var(--text); }
.navigation[aria-current] { background: var(--green-dark); color: var(--green); border-color: #496135; }
.nav-icon { flex: none; width: 20px; height: 20px; }
.navigation[aria-current] .nav-icon { filter: sepia(.4) saturate(1.7); }
.rail-bottom { margin-top: auto; padding: 10px 9px 0; }
.text-button { background: transparent; color: var(--muted); border: 1px solid transparent; min-height: 40px; border-radius: 7px; }
.text-button:hover { color: var(--text); }

.area { min-width: 0; }
.topbar, .activity-main, .notice { width: min(100%, 1280px); margin-inline: auto; }
.topbar {
  min-height: 64px;
  padding: max(0px, var(--safe-t)) max(28px, var(--safe-r)) 0 max(28px, var(--safe-l));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .88rem;
  color: var(--muted);
}
.activity-main { padding: 5px max(28px, var(--safe-r)) max(28px, var(--safe-b)) max(28px, var(--safe-l)); }
.notice { padding: 9px 28px; color: var(--warning); font-size: .92rem; }
.section-title { padding: 23px 0 26px; }
.section-title p { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.section-title.scene {
  min-height: clamp(190px, 24vw, 270px);
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 25px clamp(19px, 3.5vw, 36px);
  border: 1px solid #40513c;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #111c17ef 0%, #142319a0 40%, #10171019 90%), url('/assets/landscape.png') 70% 53%/cover #21362b;
  margin-bottom: 17px;
}
.eyebrow { color: var(--green); font: 700 .76rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .13em; margin-bottom: 9px; }
.scene p { color: #e0e9de; }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); }
.profile {
  padding: 18px;
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 14px;
}
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border: 1px solid #677954;
  border-radius: 8px;
  background:
    conic-gradient(#46603a 25%, #405334 0 50%, #4f673d 0 75%, #34492d 0) 0/14px 14px;
  color: #f2ffe5;
  font: 800 1.2rem ui-monospace, Consolas, monospace;
}
.profile-name h2 { font-size: clamp(1.1rem, 2.2vw, 1.65rem); overflow-wrap: anywhere; }
.profile-name span { font-size: .9rem; }
.uuid {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px 14px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--edge);
  padding-top: 12px;
}
.uuid small, .uuid code { grid-column: 1; }
.uuid button { grid-column: 2; grid-row: 1 / 3; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #48554a;
  border-radius: 100px;
  background: #242e26;
  padding: 5px 10px;
  white-space: nowrap;
  font-size: .82rem;
  color: #e2e9dd;
}
.badge.good { background: var(--green-dark); border-color: #4a6534; color: #d4f2b4; }
.badge i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #89978a; }
.badge.good i { background: var(--green); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block: 14px; }
.metrics.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-width: 0; display: grid; justify-items: start; align-content: start; gap: 7px; padding: 15px; }
.metric strong { font-size: clamp(1.12rem, 2vw, 1.85rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric .muted { font-size: .88rem; }
.mini-icon, .achievement-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 6px;
  border: 1px solid #425638;
  background: #233420;
  color: var(--green);
  font: 600 1rem ui-monospace, Consolas, monospace;
}
.content-card, .chest { padding: clamp(13px, 2.3vw, 23px); margin-bottom: 13px; }
.content-card > * + * { margin-top: 15px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.primary, .secondary {
  min-height: 42px;
  font-weight: 660;
  font-size: .88rem;
  padding: 8px 13px;
  border-radius: 7px;
  border: 1px solid transparent;
}
.primary { background: var(--green); color: #13220e; border-color: #c8f296; box-shadow: inset 0 -2px #90b65f; }
.primary:hover { background: #cdf59d; }
.secondary { background: #222f24; color: var(--text); border-color: #445548; }
.secondary:not(:disabled):hover { background: #2b3b2f; }
.message { padding: 28px 17px; display: grid; justify-items: center; gap: 11px; text-align: center; min-height: 150px; align-content: center; }
.message p { max-width: 44ch; }
.message-symbol { color: var(--green); font-size: 1.8rem; }
.actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.rows li, .achievements li, .events li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--edge);
  font-size: .94rem;
}
.rows li:last-child, .events li:last-child, .achievements li:last-child { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.person .avatar { width: 31px; height: 31px; font-size: .8rem; }
.plot { height: 170px; display: grid; grid-template-columns: repeat(30,minmax(0,1fr)); gap: clamp(1px, .5vw, 5px); align-items: end; }
.column { height: 100%; background: repeating-linear-gradient(to top, #354535 0 1px, transparent 1px 25%); }
.column meter { appearance: none; display: block; width: 100%; height: 100%; writing-mode: vertical-lr; direction: rtl; }
.column meter::-webkit-meter-bar { background: transparent; border: none; border-radius: 2px; }
.column meter::-webkit-meter-optimum-value { background: #a6d075; border-radius: 2px; }
.column meter::-moz-meter-bar { background: #a6d075; }
.column.unknown { background: repeating-linear-gradient(135deg, #1b241e 0 3px, #253127 3px 5px); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; }

.chest {
  display: grid;
  grid-template-columns: minmax(0, 590px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 2.2vw, 25px);
}
.chest-grids { display: grid; gap: 12px; min-width: 0; }
.chest-grids h3 { color: var(--muted); margin-top: 4px; }
.slots { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: clamp(2px, .55vw, 6px); }
.slot {
  padding: 0;
  display: grid;
  min-width: 0;
  place-items: center;
  position: relative;
  aspect-ratio: 1;
  color: #b8c7bd;
  background: var(--well);
  border: 1px solid #48554b;
  border-radius: 4px;
  box-shadow: inset 2px 2px 0 #0d140e, inset -1px -1px 0 #344137;
}
.slot.filled { background: #263229; }
.slot.filled:hover, .slot.filled[aria-pressed=true] { color: #ecf2e2; background: #354730; border-color: #9ac570; }
.hotbar .slot { border-color: #5b7149; }
.slot b { position: absolute; right: 3px; bottom: 1px; font: 700 clamp(.58rem,1.4vw,.82rem) ui-monospace, Consolas, monospace; color: #fff; text-shadow: 1px 1px #000; }
.slot .item-icon { display: block; width: min(76%, 42px); height: auto; filter: drop-shadow(0 2px 1px #09130ca8); }
.item-icon > canvas, .item-icon > img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.item-icon > img { image-rendering: pixelated; }
.item-detail {
  display: grid;
  gap: 9px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: #17211a;
  padding: 14px;
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.item-detail h3 { font-size: 1.14rem; line-height: 1.2; }
.inspected-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inspected-item .item-icon { flex: none; width: 38px; height: 38px; }
.item-detail .card-heading { margin-bottom: -4px; }
.item-close { min-height: 32px; padding-inline: 6px; }
.durability { display: grid; gap: 4px; }
progress {
  display: block;
  width: 100%;
  height: 7px;
  appearance: none;
  border: none;
  border-radius: 5px;
  overflow: hidden;
  background: #334037;
  accent-color: var(--green);
}
progress::-webkit-progress-bar { background: #334037; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.item-properties { display: flex; gap: 5px; flex-wrap: wrap; font-size: .84rem; }
.enchant { color: #e0cbfa; background: #30283c; border: 1px solid #4a3b59; border-radius: 5px; padding: 2px 7px; }
.item-identifiers { font-size: .8rem; color: var(--muted); }
.item-identifiers summary { cursor: pointer; }
.item-identifiers code { display: block; padding-top: 5px; }
.achievement-overview {
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.achievement-progress { flex: 1 1 250px; display: grid; gap: 8px; }
.achievement-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.achievement-filters button[aria-pressed=true] { background: var(--green-dark); border-color: #64884b; color: var(--green); }
.achievement-group { margin-bottom: 10px; padding: 0 14px; }
.achievement-group summary { cursor: pointer; padding: 14px 0; overflow: hidden; }
.achievement-group summary strong { margin-left: 4px; }
.achievement-group summary span { float: right; color: var(--muted); }
.achievement-group[open] summary { border-bottom: 1px solid var(--edge); }
.achievements li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.achievements p { color: var(--muted); line-height: 1.4; margin: 4px 0; }
.achievement-icon:not(.done) { color: var(--muted); background: #29312b; }
.achievement-status { color: var(--muted); font-size: .8rem; text-align: right; flex: none; }
.achievement-status.done { color: var(--green); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { flex: 1 1 145px; min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: .84rem; }
.field input, .field select {
  min-height: 42px;
  width: 100%;
  background: var(--well);
  color: var(--text);
  border: 1px solid #4a5a4a;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 1rem;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td, th { border-bottom: 1px solid var(--edge); padding: 10px 8px; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .82rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .9rem; }
.summary { display: flex; flex-wrap: wrap; gap: 5px; }
.events li { flex-wrap: wrap; }

.gate {
  display: grid;
  place-items: center;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l));
}
.gate-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(165deg, #0c1715aa, #101814b0 56%, #0d1410ed), url('/assets/landscape.png') 65% center / cover #1c312a;
}
.gate-card {
  width: min(100%, 550px);
  padding: clamp(22px, 5.4vw, 42px);
  display: grid;
  gap: 18px;
  border: 1px solid #435445;
  border-radius: 17px;
  background: #17231ced;
  box-shadow: 0 22px 80px #0a120c99;
}
.gate-card h1 { font-size: clamp(1.75rem, 5.3vw, 2.65rem); }
.gate-card p { color: var(--muted); margin-bottom: 9px; }
#gate-feedback:empty { display: none; }

@media (max-width: 980px) {
  .dashboard { grid-template-columns: 185px minmax(0,1fr); }
  .navigation { gap: 7px; padding-inline: 6px; font-size: .87rem; }
  .metrics.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chest { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 690px) {
  .dashboard { display: block; }
  .rail {
    position: sticky;
    z-index: 2;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
    padding: max(8px, var(--safe-t)) max(10px, var(--safe-r)) 4px max(10px, var(--safe-l));
    border: 0;
    border-bottom: 1px solid var(--edge);
  }
  .rail .brand { margin: 0; }
  .rail .brand-mark { width: 30px; height: 30px; }
  .rail nav { grid-column: 1 / -1; display: flex; overflow: auto; scrollbar-width: thin; }
  .rail-bottom { grid-column: 2; grid-row: 1; margin: 0; padding: 0; }
  .navigation { min-height: 40px; padding: 0 9px; }
  .topbar, .activity-main, .notice { padding-inline: max(11px, var(--safe-l)) max(11px, var(--safe-r)); }
  .topbar { min-height: 49px; padding-top: 0; }
  .section-title.scene { min-height: 160px; background-position: 66% 55%; }
  .section-title { padding-block: 15px; }
  .profile { padding: 11px; gap: 8px; }
  .profile .avatar { width: 43px; height: 43px; }
  .badge { font-size: .75rem; padding-inline: 7px; white-space: normal; }
  .uuid { gap: 5px; }
  .uuid code { font-size: .8rem; }
  .uuid button { padding-inline: 6px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .metric { padding: 11px; }
  .plot { height: 115px; }
  .chest { padding: 9px; }
  .achievement-group { padding-inline: 10px; }
  .achievements li { column-gap: 8px; }
  .item-detail:not([data-active]) { display: none; }
  .item-detail[data-active] {
    position: fixed;
    z-index: 3;
    width: auto;
    inset-inline: max(8px, var(--safe-l)) max(8px, var(--safe-r));
    bottom: max(8px, var(--safe-b));
    max-height: 36dvh;
    overflow: auto;
    box-shadow: 0 12px 32px #060d08dd;
    animation: item-open .16s ease-out;
  }
  .item-close { display: inline-block; min-height: 34px; color: var(--text); }
}
@keyframes item-open { from { transform: translateY(11px); opacity: .6; } }
@media (max-width: 350px) {
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile > .badge { grid-column: 1 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
