/* KublihanSMP — "Night Realm": pixel landscape, block buttons, inventory slots, emerald + gold */
:root {
  --ground: #0b0f14;
  --panel: #121820;
  --panel-2: #1a2029;
  --tip: #0f1310;
  --outline: #050806;
  --line: #1f2731;
  --text: #e5e1e4;
  --soft: #c9d0d8;
  --muted: #aab3bd;
  --dim: #8c96a1;
  --emerald: #1fd17a;
  --emerald-ink: #06210f;
  --gold: #f5b82e;
  --gold-ink: #2a1a00;
  --stone: #3a414b;
  --discord: #4752c4;
  --dirt: #3d2918;
  --dirt-dark: #2a1c10;
  --font: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--emerald); }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.1; color: #fff; }
p { margin: 0; }
code { font-family: var(--font-mono); color: var(--emerald); }
.px { image-rendering: pixelated; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: 10px 14px; }

/* Block buttons (Minecraft-style bevel) */
.mc {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 2px solid var(--outline); border-radius: 4px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.38), inset -2px -3px 0 rgba(0, 0, 0, 0.32);
  transition: transform 0.12s var(--ease), filter 0.15s ease;
}
.mc:hover { filter: brightness(1.08); }
.mc:active { transform: translateY(2px); box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.25); }
.mc-emerald { background: var(--emerald); color: var(--emerald-ink); font-weight: 800; }
.mc-emerald:hover { color: var(--emerald-ink); }
.mc-gold { background: var(--gold); color: var(--gold-ink); font-weight: 800; }
.mc-gold:hover { color: var(--gold-ink); }
.mc-stone { background: var(--stone); color: #fff; }
.mc-stone:hover { color: #fff; }
.mc-discord { background: var(--discord); color: #fff; }
.mc-discord:hover { color: #fff; }
.mc-lg { padding: 15px 24px; font-size: 17px; }

/* Hero: the pixel night landscape */
.hero {
  position: relative; display: flex; flex-direction: column;
  background: #070a14 url("../img/pixel/hero-scene.png") center bottom / cover no-repeat;
  image-rendering: pixelated;
}
.hero-home { min-height: 720px; }
.hero-page { min-height: 380px; }
.shadowed { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }

/* Header (sits on the hero) */
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; font-weight: 800; font-stretch: 112%; font-size: 18px; }
.brand:hover { color: #fff; }
.brand img { width: 40px; height: 40px; }
.brand-name span { color: var(--gold); }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a { color: #d7dde4; text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
.main-nav a:hover { color: var(--gold); }
.main-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: var(--emerald); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; background: rgba(5, 8, 6, 0.6); color: #fff; border: 2px solid var(--outline); border-radius: 4px; }

@media (max-width: 960px) {
  .header-row { flex-wrap: wrap; }
  .menu-toggle { display: inline-flex; }
  .main-nav, .header-actions { display: none; width: 100%; }
  .site-header.open .main-nav { display: flex; flex-direction: column; align-items: stretch; background: rgba(5, 8, 6, 0.88); border: 2px solid var(--outline); border-radius: 4px; padding: 6px; }
  .site-header.open .header-actions { display: flex; }
  .site-header.open .header-actions .mc { flex: 1; }
}

.hero-inner { flex: 1; max-width: 900px; margin: 0 auto; padding: 56px 24px 200px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.hero-logo { width: min(560px, 86vw); height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.45)); }
.hero-lead { max-width: 560px; font-size: 20px; line-height: 1.5; color: #e6eaef; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-note { font-size: 14px; color: #c3cad3; }
.page-title { flex: 1; max-width: 900px; margin: 0 auto; padding: 32px 24px 150px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.page-title h1 { font-size: clamp(40px, 6vw, 64px); }
.page-title p { max-width: 560px; font-size: 18px; color: #e6eaef; }

/* Sections */
.section { padding-top: 88px; padding-bottom: 40px; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); }
.label { font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); }

/* Inventory slots + item tooltips */
.inventory { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
.item { display: flex; gap: 16px; align-items: flex-start; }
.slot { flex: none; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); box-shadow: inset 3px 3px 0 #06090c, inset -3px -3px 0 #2b333d; }
.slot img { width: 48px; height: 48px; }
.tip {
  background: var(--tip); border: 2px solid rgba(31, 209, 122, 0.35); outline: 2px solid var(--outline); border-radius: 3px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
.item .tip { flex: 1; }
.item:hover .tip { border-color: var(--emerald); transform: translateY(-2px); }
.tip-title { font-weight: 800; font-size: 18px; color: #fff; }
.tip p, .tip li { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Rank cards */
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: stretch; }
.rank { position: relative; background: var(--panel); border: 2px solid var(--outline); border-radius: 4px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.rank.max { background: #17150c; border-color: var(--gold); outline: 2px solid var(--outline); }
.rank .badge { position: absolute; top: -14px; left: 24px; background: var(--gold); color: var(--gold-ink); border: 2px solid var(--outline); font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; padding: 3px 8px; }
.rank .tag { height: 34px; width: auto; align-self: flex-start; }
.price { font-weight: 800; font-stretch: 110%; font-size: 34px; line-height: 1.1; color: #fff; }
.price small { font-size: 15px; font-weight: 500; color: var(--dim); }
.rank.max .price { color: var(--gold); }
.rank.max .price small { color: #a69a7a; }
.rank.booster .price { color: #f47fff; font-size: 28px; }
.rank p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.rank.max p, .rank.max li { color: #c9c0a6; }
.rank .mc { margin-top: auto; }

/* Cosmetic crate cards: each card sets --crate to its set colour */
.crates { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: stretch; }
.crate { background: var(--panel); border: 2px solid var(--outline); border-radius: 4px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.crate-head { display: flex; gap: 16px; align-items: center; }
.crate-head .slot { width: 80px; height: 80px; }
.crate-head .slot img { width: 64px; height: 64px; object-fit: contain; }
.crate-name { font-size: 26px; line-height: 1.1; color: var(--crate); }
.crate-count { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }
.crate .price { font-size: 26px; }
.crate-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crate-items li { font-size: 14px; color: var(--soft); background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px; }
.crate .mc { margin-top: auto; }
.crate-note { margin-top: 20px; font-size: 15px; color: var(--muted); }
.perks { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); }
.perks li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; background: var(--emerald); box-shadow: 1px 1px 0 var(--outline); }
.rank.max .perks li::before { background: var(--gold); }
.rank.booster .perks li::before { background: #f47fff; }

/* Compare table */
.table-box { overflow-x: auto; background: var(--panel); border: 2px solid var(--outline); border-radius: 4px; padding: 8px 24px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 16px 0; font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; color: var(--dim); }
th img { height: 28px; width: auto; display: block; }
td { padding: 14px 0; color: var(--muted); border-top: 1px solid var(--line); }
td:first-child { color: #fff; font-weight: 600; }

/* Commands + rules */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
.cmd-group { padding: 20px 22px 8px; }
.cmd-group h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 6px; }
.cmd-group h2 img { width: 24px; height: 24px; }
.cmd-list { list-style: none; margin: 0; padding: 0; }
.cmd-list li { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--dim); }
.cmd-list code { font-size: 15px; }
.cmd-list li > span { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); }
.cmd-list span code { font-size: 13px; }
.rules-group { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.rules + .rules-group { margin-top: 40px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: rule; }
.rules li { counter-increment: rule; display: flex; gap: 16px; align-items: center; background: var(--panel); border: 2px solid var(--outline); border-radius: 4px; padding: 16px 18px; }
.rules li::before { content: counter(rule); flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); box-shadow: inset 2px 2px 0 #06090c, inset -2px -2px 0 #2b333d; font-family: var(--font-mono); font-weight: 700; color: var(--emerald); }
.rules p { font-size: 16px; color: var(--soft); }

/* Staff on grass-block pedestals */
.staff-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 40px; }
.staff { display: flex; flex-direction: column; align-items: center; }
.staff .tip { align-items: center; margin-bottom: 14px; padding: 10px 14px; }
.staff .tip img { height: 22px; width: auto; }
.staff-skin { position: relative; z-index: 1; height: 230px; width: auto; margin-bottom: -8px; }
.pedestal { width: 200px; height: 40px; border: 2px solid var(--outline); background: #6e4a2c url("../img/pixel/grass-strip.png") left top / 256px 40px repeat-x; image-rendering: pixelated; }
.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.split > div:first-child { flex: 1 1 380px; display: flex; flex-direction: column; gap: 14px; }

/* Banner + dirt footer */
.banner { background: var(--panel); border: 2px solid var(--outline); border-radius: 4px; padding: 28px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.banner > div { flex: 1 1 440px; display: flex; flex-direction: column; gap: 8px; }
.banner h2 { font-size: 28px; }
.dirt { margin-top: 72px; padding-top: 40px; background: #5a3c24 url("../img/pixel/grass-strip.png") left top / 256px 40px repeat-x; image-rendering: pixelated; }
.dirt-cta { background: var(--dirt); padding: 64px 0 56px; }
.dirt-cta .wrap { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.dirt-cta h2 { font-size: clamp(30px, 4vw, 40px); }
.dirt-cta p { margin-top: 8px; font-size: 16px; color: #e0cdb4; }
.site-footer { background: var(--dirt-dark); border-top: 2px solid #1a1109; }
.footer-row { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 13px; color: #c9b69c; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-row a { color: #e8d7c0; }
.footer-row strong { color: #f1e4d2; }

/* Copied toast, styled as an item tooltip */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--tip); border: 2px solid var(--emerald); outline: 2px solid var(--outline); color: #fff; font-weight: 700; padding: 10px 16px; transition: opacity 0.18s ease, transform 0.18s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Motion ---------- */
/* Hero sky: stars, clouds and fireflies are added by main.js into .sky. */
.site-header, .hero-inner, .page-title { position: relative; z-index: 2; }
.sky { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.sky.paused * { animation-play-state: paused; }
.star { position: absolute; width: 3px; height: 3px; background: #e8ecf4; animation: twinkle 3.2s steps(4) infinite; }
.star.gold { background: var(--gold); }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.cloud { position: absolute; left: 0; height: 18px; background: rgba(214, 222, 240, 0.12); animation: drift linear infinite; }
.cloud::before { content: ""; position: absolute; left: 18%; right: 30%; top: -12px; height: 12px; background: inherit; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
.firefly { position: absolute; width: 4px; height: 4px; background: #ffd75e; box-shadow: 0 0 8px 2px rgba(245, 184, 46, 0.55); animation: wander 7s ease-in-out infinite alternate, glow 2.4s ease-in-out infinite; }
@keyframes wander { 0% { transform: translate(0, 0); } 33% { transform: translate(18px, -14px); } 66% { transform: translate(-10px, -26px); } 100% { transform: translate(14px, -8px); } }
@keyframes glow { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* Title-screen logo: gentle float plus a Minecraft-style splash */
.logo-wrap { position: relative; display: inline-block; }
.logo-float { animation: float 4.5s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.splash {
  position: absolute; right: -2%; bottom: 8%; z-index: 3; white-space: nowrap;
  font-family: var(--font); font-weight: 800; font-size: clamp(14px, 2vw, 22px); line-height: 1; letter-spacing: 0;
  color: #ffff55; text-shadow: 3px 3px 0 #3f3f15;
  transform: rotate(-16deg); transform-origin: center; animation: splash 0.55s ease-in-out infinite alternate;
}
@keyframes splash { from { transform: rotate(-16deg) scale(1); } to { transform: rotate(-16deg) scale(1.08); } }

/* Scroll reveal (classes added by main.js, so content shows without JS) */
.reveal { opacity: 0; transform: translateY(14px); filter: blur(4px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), filter 0.5s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* Hover life */
.slot img { transition: transform 0.25s var(--ease); }
.item:hover .slot img { transform: translateY(-4px) rotate(-8deg) scale(1.08); }
.rank { transition: transform 0.25s var(--ease); }
.rank:hover { transform: translateY(-4px); }
.staff-skin { transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite; }
.staff:nth-child(2) .staff-skin { animation-delay: -2.5s; }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

/* XP orbs that burst from a Copy IP button */
.orb { position: fixed; z-index: 60; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #b6ff5c; border: 2px solid #3a7d10; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mc, .tip, .toast, .slot img, .rank { transition: none; }
  .star, .cloud, .firefly, .logo-float, .splash, .staff-skin { animation: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}
