:root{
  --bg: #171c14;
  --bg-deep: #10130e;
  --panel: #362d22;
  --panel-light: #423628;
  --border: #6b5842;
  --border-light: #8a7154;
  --grass: #5b8731;
  --grass-bright: #7bb147;
  --stone: #8a8a86;
  --stone-dark: #55554f;
  --parchment: #e8e4d8;
  --parchment-dim: #b7b0a0;
  --redstone: #b23a2e;
  --diamond: #5ec8d8;
  --gold: #f0c94a;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body{
  margin:0;
  background:
    radial-gradient(ellipse at top, #23291c 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--parchment);
  font-family: var(--font-mono);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; }

::selection { background: var(--grass); color: #10130e; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--diamond);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap{
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.sr-only{ position:absolute; left:-9999px; }

/* ---------- nav ---------- */
nav{ padding: 28px 0 0; }
.nav-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--parchment);
  text-decoration:none;
}
.brand-mark{
  width: 22px; height: 22px;
  background: var(--grass);
  box-shadow:
    3px 0 0 var(--grass-bright),
    0 -3px 0 var(--grass-bright),
    -3px 3px 0 #4a6e27,
    3px 3px 0 #4a6e27;
  image-rendering: pixelated;
  cursor: pointer;
}
.nav-link{
  font-size: 14px;
  color: var(--parchment-dim);
  text-decoration:none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-link:hover{ color: var(--parchment); border-color: var(--border-light); }
.nav-discord{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background-color .15s, transform .15s;
}
.nav-discord:hover{
  color: var(--parchment);
  background-color: rgba(255,255,255,0.08);
  border-color: transparent;
  transform: translateY(-1px);
}

/* ---------- hero ---------- */
header.hero{
  padding: 88px 0 56px;
  text-align:center;
  position: relative;
  overflow: hidden;
}
header.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(45deg, rgba(123,177,71,.05) 25%, transparent 25%, transparent 75%, rgba(123,177,71,.05) 75%),
    linear-gradient(45deg, rgba(123,177,71,.05) 25%, transparent 25%, transparent 75%, rgba(123,177,71,.05) 75%);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
  pointer-events:none;
}
header.hero .wrap{ z-index:1; }

h1.hero-title{
  font-family: var(--font-pixel);
  font-size: clamp(20px, 4.6vw, 36px);
  line-height: 1.55;
  margin: 0 0 18px;
  color: var(--parchment);
  text-shadow: 3px 3px 0 rgba(0,0,0,.4);
}
h1.hero-title .accent{ color: var(--grass-bright); }
.hero-sub{
  max-width: 480px;
  margin: 0 auto 40px;
  color: var(--parchment-dim);
  font-size: 16px;
}

/* ---------- tabs ---------- */
.tab-switch{
  max-width: 620px;
  margin: 0 auto 18px;
  display:flex;
  gap: 8px;
}
.tab-btn{
  flex:1;
  background: var(--stone);
  border: 2px solid var(--bg-deep);
  color: #2b2b26;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13.5px;
  padding: 13px 10px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab-btn:hover{ background: #97978f; }
.tab-btn.active{
  background: var(--grass);
  color: #10130e;
  border-color: #34500f;
}
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* ---------- search / lookup bar ---------- */
.lookup{
  max-width: 620px;
  margin: 0 auto;
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: inset 0 0 0 3px var(--bg-deep), 6px 6px 0 rgba(0,0,0,.35);
  padding: 6px;
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lookup input, .lookup select{
  flex:1;
  min-width: 120px;
  background: var(--bg-deep);
  border: none;
  color: var(--parchment);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 14px 16px;
}
.lookup select{ flex: 0 0 150px; cursor: pointer; }
.lookup input::placeholder{ color: #6f6a5c; }
.lookup input:focus, .lookup select:focus{ outline: 2px solid var(--grass-bright); outline-offset: -2px; }
.lookup .port-input{ flex: 0 0 110px; }
.lookup button{
  background: var(--grass);
  border: none;
  color: #10130e;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  padding: 0 22px;
  cursor: pointer;
  transition: background .15s ease;
}
.lookup button:hover{ background: var(--grass-bright); }
.lookup button:disabled{ opacity: .55; cursor: not-allowed; }

.lookup-hint{
  margin-top: 12px;
  font-size: 12.5px;
  color: #756f5f;
  text-align: center;
}
.lookup-hint.error{ color: #e4a49e; }

/* ---------- idle state ---------- */
.idle-state{
  max-width: 620px;
  margin: 24px auto 0;
  text-align:center;
  padding: 22px 18px;
  border: 2px dashed var(--border);
  color: var(--parchment-dim);
  font-size: 13.5px;
}

/* ---------- result cards ---------- */
.result-area{ max-width: 620px; margin: 24px auto 0; text-align:left; }
.result-area.hidden{ display:none; }

.card{
  background: var(--panel-light);
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 rgba(0,0,0,.3);
  padding: 0;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(6px);
  animation: reveal .4s ease forwards;
  transition: transform .5s ease;
}
@keyframes reveal{ to{ opacity: 1; transform: translateY(0); } }

/* Dinnerbone / Grumm easter egg: named entities render upside-down in-game */
.card.flipped{ transform: rotate(180deg); }

.card-top{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 2px solid var(--border);
}
.card-body{ padding: 16px 18px; }
.card-body + .card-body{ border-top: 2px solid var(--border); }

.server-icon, .player-avatar{
  width: 48px; height: 48px;
  flex-shrink:0;
  background: linear-gradient(var(--stone-dark) 0 8px, var(--grass) 8px 100%);
  box-shadow: inset 0 0 0 2px var(--bg-deep);
  image-rendering: pixelated;
  object-fit: cover;
}
.card-top .name{ font-size: 14.5px; font-weight: 700; }
.card-top .sub{ font-size: 12.5px; color: var(--parchment-dim); margin-top: 2px; word-break: break-word; }
.status-pill{
  margin-left:auto;
  flex-shrink: 0;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 6px 8px;
  background: var(--grass);
  color: #10130e;
  white-space:nowrap;
}
.status-pill.offline{ background: var(--redstone); color: #f4e9e7; }

.motd-box{
  background: var(--bg-deep);
  border-left: 3px solid var(--grass-bright);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--parchment-dim);
  white-space: pre-line;
  margin: 0 18px 16px;
}

/* inventory-slot styling for info rows */
.info-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 16px;
}
@media (max-width: 520px){ .info-grid{ grid-template-columns: 1fr; } }
.info-item{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  background: var(--bg-deep);
  padding: 9px 12px;
  font-size: 12.5px;
  box-shadow:
    inset 0 0 0 2px var(--border),
    inset -2px -2px 0 rgba(0,0,0,.35),
    inset 2px 2px 0 rgba(255,255,255,.05);
}
.info-item .k{ color: var(--parchment-dim); }
.info-item .v{ font-weight: 600; word-break: break-word; text-align: right; }

.bar-row{ padding: 0 18px 16px; }
.bar-label{ display:flex; justify-content:space-between; font-size: 12.5px; margin-bottom: 6px; color: var(--parchment-dim); }
.bar-track{
  height: 16px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 2px var(--border);
}
.bar-fill{
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--grass-bright) 0 6px, var(--grass) 6px 9px);
  transition: width .6s ease;
}

.player-list{
  margin: 0 18px 18px;
  background: var(--bg-deep);
  padding: 10px 12px;
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: inset 0 0 0 2px var(--border);
}
.player-list div{ padding: 3px 0; }
.player-list .more{ color: var(--parchment-dim); }

.links-row{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  padding: 0 18px 18px;
}
.link-btn{
  font-size: 12.5px;
  padding: 9px 14px;
  background: var(--bg-deep);
  border: 2px solid var(--border-light);
  color: var(--parchment);
  text-decoration:none;
  transition: background .15s, transform .1s;
}
.link-btn:hover{ background: #2a241b; transform: translateY(-1px); }

.profile-hero{
  display:flex;
  gap: 16px;
  align-items:center;
  padding: 18px;
}
.profile-hero img{ width: 72px; height: 72px; image-rendering: pixelated; box-shadow: inset 0 0 0 2px var(--bg-deep); }
.profile-hero .name{ font-size: 17px; font-weight:700; }
.profile-hero .uuid{ font-size: 11.5px; color: var(--parchment-dim); word-break: break-all; margin-top: 4px; }

/* jeb_ easter egg: rainbow sheep reference */
.profile-hero.rainbow .name{
  background: linear-gradient(90deg,#ff5c5c,#ffb84d,#fff066,#7bffb0,#6ec8ff,#b98bff,#ff5c5c);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-shift 4s linear infinite;
}
@keyframes rainbow-shift{ to{ background-position: 250% center; } }

/* Notch easter egg */
.profile-hero.legendary .name{
  color: var(--gold);
  text-shadow: 0 0 10px rgba(240,201,74,.55);
}

/* rare404 easter egg: creator's name cycles through the full RGB spectrum */
.name.rgb-cycle{
  animation: rgb-hue-cycle 3s linear infinite;
}
@keyframes rgb-hue-cycle{
  0%   { color: #ff3b3b; text-shadow: 0 0 8px rgba(255,59,59,.5); }
  16%  { color: #ff9d3b; text-shadow: 0 0 8px rgba(255,157,59,.5); }
  33%  { color: #f0f04d; text-shadow: 0 0 8px rgba(240,240,77,.5); }
  50%  { color: #4dff7a; text-shadow: 0 0 8px rgba(77,255,122,.5); }
  66%  { color: #4dcfff; text-shadow: 0 0 8px rgba(77,207,255,.5); }
  83%  { color: #b34dff; text-shadow: 0 0 8px rgba(179,77,255,.5); }
  100% { color: #ff3b3b; text-shadow: 0 0 8px rgba(255,59,59,.5); }
}

.egg-note{
  margin: -8px 18px 14px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--parchment-dim);
}

.creator-panel{
  background: var(--bg-deep);
  border-left: 3px solid var(--diamond);
  padding: 12px 14px;
  margin: -4px 18px 16px;
}
.creator-panel-label{
  font-size: 12px;
  color: var(--parchment-dim);
  margin-bottom: 10px;
}
.creator-panel-row{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}
.copy-chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 9px 14px;
  background: var(--panel);
  border: 2px solid var(--border-light);
  color: var(--parchment);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.copy-chip:hover{ background: #2a241b; transform: translateY(-1px); }
.copy-chip-icon{ font-size: 13px; color: var(--diamond); }

/* ---------- review form ---------- */
.review-form{
  max-width: 620px;
  margin: 0 auto;
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: inset 0 0 0 3px var(--bg-deep), 6px 6px 0 rgba(0,0,0,.35);
  padding: 20px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.star-rating{ display:flex; gap:6px; }
.star-btn{
  background:none;
  border:none;
  cursor:pointer;
  font-size: 26px;
  line-height:1;
  color: var(--stone-dark);
  padding:0;
  transition: color .1s;
}
.star-btn.filled{ color: var(--gold); }
.review-form input[type="text"], .review-form textarea{
  background: var(--bg-deep);
  border: none;
  color: var(--parchment);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 14px 16px;
  resize: vertical;
}
.review-form input::placeholder, .review-form textarea::placeholder{ color: #6f6a5c; }
.review-form input:focus, .review-form textarea:focus{ outline: 2px solid var(--grass-bright); outline-offset: -2px; }
.review-submit{
  align-self:flex-start;
  background: var(--grass);
  border:none;
  color:#10130e;
  font-family: var(--font-mono);
  font-weight:700;
  font-size:14px;
  padding:14px 26px;
  cursor:pointer;
  transition: background .15s ease;
}
.review-submit:hover{ background: var(--grass-bright); }
.review-submit:disabled{ opacity:.55; cursor:not-allowed; }

.body-render{
  text-align:center;
  padding: 18px;
}
.body-render img{ max-width: 140px; image-rendering: pixelated; }

.cape-row{ padding: 0 18px 18px; display:none; }
.cape-row.show{ display:block; }
.cape-row img{ width: 64px; image-rendering: pixelated; box-shadow: inset 0 0 0 2px var(--bg-deep); }
.cape-row .k{ font-size: 12.5px; color: var(--parchment-dim); margin-bottom: 8px; }

.loading-row{
  padding: 22px 18px;
  text-align:center;
  color: var(--parchment-dim);
  font-size: 13.5px;
}
.loading-dots{ display:inline-flex; gap:4px; margin-left:8px; vertical-align:middle; }
.loading-dots span{
  width:6px; height:6px;
  background: var(--grass-bright);
  display:inline-block;
  animation: blocky-pulse 1s steps(2) infinite;
}
.loading-dots span:nth-child(2){ animation-delay:.15s; }
.loading-dots span:nth-child(3){ animation-delay:.3s; }
@keyframes blocky-pulse{ 0%,100%{ opacity:.2; } 50%{ opacity:1; } }

.error-card{
  background: var(--panel-light);
  border: 3px solid var(--redstone);
  padding: 18px;
  font-size: 13.5px;
}
.error-card .title{ font-family: var(--font-pixel); font-size: 12px; color: #e4a49e; margin-bottom: 10px; line-height: 1.7; }

/* ---------- advancement toast ---------- */
.mc-toast{
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 250px;
  max-width: 320px;
  background: var(--panel-light);
  border: 2px solid var(--gold);
  box-shadow: 4px 4px 0 rgba(0,0,0,.45);
  padding: 12px 14px;
  display:flex;
  gap:12px;
  align-items:center;
  transform: translateX(140%);
  transition: transform .35s ease;
  z-index: 100;
}
.mc-toast.show{ transform: translateX(0); }
.mc-toast-icon{
  width:32px; height:32px;
  flex-shrink:0;
  background: linear-gradient(var(--gold), #c9971f);
  box-shadow: inset 0 0 0 2px var(--bg-deep);
}
.mc-toast-title{ font-family: var(--font-pixel); font-size:8.5px; color: var(--gold); margin-bottom:5px; }
.mc-toast-sub{ font-size: 12.5px; color: var(--parchment); line-height:1.5; }
@media (max-width: 520px){
  .mc-toast{ left:16px; right:16px; min-width:auto; }
}

/* ---------- konami easter egg ---------- */
body.creative-mode{ animation: creative-flash 6s ease; }
@keyframes creative-flash{
  0%,100%{ filter:none; }
  15%,85%{ filter: hue-rotate(190deg) saturate(1.3); }
}

/* ---------- sections ---------- */
section{ padding: 64px 0; }

.feature-row{
  display:flex;
  gap:18px;
  align-items:flex-start;
  padding: 20px 0;
  border-top: 1px solid #2c2b23;
}
.feature-row:last-child{ border-bottom: 1px solid #2c2b23; }
.feature-mark{ width:10px; height:10px; margin-top:6px; flex-shrink:0; background: var(--grass-bright); }
.feature-row h4{ margin:0 0 4px; font-size:15.5px; font-weight:700; }
.feature-row p{ margin:0; font-size:14px; color: var(--parchment-dim); max-width: 500px; }

h2.section-title{
  font-family: var(--font-pixel);
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 8px;
}
.section-sub{ color: var(--parchment-dim); font-size: 14.5px; margin: 0 0 8px; max-width: 460px; }

/* ---------- CTA ---------- */
.cta{ text-align:center; padding: 72px 0 88px; }
.cta h2{
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3.4vw, 24px);
  line-height:1.8;
  margin: 0 0 30px;
}
.btn-diamond{
  display:inline-block;
  font-family: var(--font-mono);
  font-weight:700;
  font-size: 16px;
  text-decoration:none;
  color: #0c1517;
  background: var(--diamond);
  padding: 18px 38px;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.2), inset 4px 4px 0 rgba(255,255,255,.35), 6px 6px 0 rgba(0,0,0,.35);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-diamond:hover{
  transform: translate(-2px,-2px);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.2), inset 4px 4px 0 rgba(255,255,255,.35), 8px 8px 0 rgba(0,0,0,.35);
}
.btn-diamond:active{
  transform: translate(2px,2px);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.2), inset 2px 2px 0 rgba(255,255,255,.35);
}
.cta-note{ margin-top:16px; font-size:12.5px; color:#756f5f; }

/* ---------- creator credit ---------- */
footer.credit{
  border-top: 1px solid #2c2b23;
  padding: 26px 0 44px;
  text-align:center;
}
.creator{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: var(--parchment-dim);
}
.creator .creator-name{ color: var(--parchment); font-weight: 700; }
.verified-badge{
  width: 15px; height: 15px;
  flex-shrink:0;
  vertical-align: middle;
}
.creator .handle{ color: #756f5f; }
