@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400&display=swap');

/* ── Cartoony Minecraft home page ───────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #1a1a1a;
  --muted: #5c4a32;
  --line: #8b7355;
  --line-strong: #1a1a1a;
  --paper: #c6c6c6;
  --surface: #d8d8d8;
  --grass: #5a9e3a;
  --grass-dark: #3d7a32;
  --dirt: #866043;
  --dirt-dark: #5c4030;
  --sky: #78b8e8;
  --font: "Nunito Sans", system-ui, sans-serif;
  --font-display: "Fredoka", "Nunito Sans", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --mc-btn-light: #565656;
  --mc-btn-dark: #1a1a1a;
  --mc-btn-face-top: #ececec;
  --mc-btn-face-bottom: #9a9a9a;
  --mc-btn-hover-top: #f8f8f8;
  --mc-btn-hover-bottom: #b0b0b0;
  --mc-btn-active-top: #dff5e4;
  --mc-btn-active-bottom: #7bc89a;
  --mc-btn-active-border: #4a9e6b;
  --slot-bg: #8b8b8b;
  --slot-inset: #373737;
}

html.page-home {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
}

html.page-home body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: #1a2e1a;
  background-image:
    linear-gradient(180deg, rgba(120, 184, 232, 0.45) 0%, rgba(120, 184, 232, 0.15) 28%, transparent 42%),
    url('../images/site/main_site.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

html.page-home h1,
html.page-home h2,
html.page-home .brand {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

html.page-home img {
  display: block;
  max-width: 100%;
}

html.page-home a {
  color: inherit;
}

html.page-home button,
html.page-home input {
  font: inherit;
}

/* ── Navbar overrides ───────────────────────────────────────── */

html.page-home .site-nav {
  background:
    linear-gradient(180deg, #9a7a5a 0%, #6e5238 55%, #5c4030 100%);
  border-bottom: 3px solid #2a1a0a;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

html.page-home .brand {
  color: #fff8e8;
  text-shadow:
    2px 2px 0 #2a1a0a,
    -1px -1px 0 rgba(255, 255, 255, 0.15);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

html.page-home .brand:hover {
  text-decoration: none;
  color: #fff;
}

html.page-home .nav-group a,
html.page-home .nav-group button,
html.page-home .site-nav-dropdown-trigger {
  --chip-face: #ececec;
  --chip-light: #565656;
  --chip-dark: #1a1a1a;
  border: 2px solid var(--chip-light);
  border-right-color: var(--chip-dark);
  border-bottom-color: var(--chip-dark);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, var(--chip-face) 0%, #9a9a9a 100%);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-family: var(--font);
}

html.page-home .nav-group a:hover,
html.page-home .nav-group button:hover,
html.page-home .site-nav-dropdown-trigger:hover {
  --chip-face: #f8f8f8;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(0, 0, 0, 0.2);
}

html.page-home .nav-group a.is-active {
  --chip-face: #dff5e4;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, #dff5e4 0%, #7bc89a 100%);
  border-color: #4a9e6b;
  color: #1a3a22;
}

html.page-home .nav-group-divider {
  background: rgba(255, 255, 255, 0.25);
}

html.page-home .user-username {
  color: #fff8e8;
  text-shadow: 1px 1px 0 #2a1a0a;
}

html.page-home .site-nav-dropdown-menu {
  border: 2px solid var(--line-strong);
  border-radius: 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* ── Layout shell ───────────────────────────────────────────── */

html.page-home .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 1.5rem 1.25rem;
}

html.page-home .page {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  background: var(--surface);
  border: 3px solid var(--line-strong);
  box-shadow:
    0 0 0 2px #565656,
    8px 8px 0 rgba(0, 0, 0, 0.35);
}

/* ── Hero ───────────────────────────────────────────────────── */

html.page-home .hero {
  position: relative;
  padding: 2.5rem 1.5rem 2rem;
  border-bottom: 3px solid var(--line-strong);
  background:
    linear-gradient(180deg, #8fd456 0%, #5a9e3a 38%, #4a8530 100%);
  overflow: hidden;
}

html.page-home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 15px,
      rgba(0, 0, 0, 0.03) 15px,
      rgba(0, 0, 0, 0.03) 16px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 15px,
      rgba(0, 0, 0, 0.03) 15px,
      rgba(0, 0, 0, 0.03) 16px
    );
  pointer-events: none;
}

html.page-home .hero > * {
  position: relative;
}

html.page-home .hero-tag {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8ffd8;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html.page-home .hero h1 {
  margin: 0 0 0.625rem;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  text-shadow:
    3px 3px 0 #2a4a18,
    0 0 20px rgba(255, 255, 255, 0.15);
}

html.page-home .hero > p:last-child {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8ffd0;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

/* ── Content & grid ─────────────────────────────────────────── */

html.page-home .content {
  padding: 1.5rem;
  background:
    linear-gradient(180deg, #e0e0e0 0%, #c6c6c6 100%);
}

/* ── Grid ───────────────────────────────────────────────────── */

html.page-home .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 15rem));
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 52rem;
}

/* ── Grid item (title bar + card) ─────────────────────────────── */

html.page-home .grid-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

html.page-home a.grid-item {
  text-decoration: none;
  color: inherit;
}

html.page-home a.grid-item:hover,
html.page-home a.grid-item:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.22);
}

html.page-home a.grid-item:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

html.page-home .grid-item--soon {
  opacity: 0.82;
  filter: saturate(0.75);
}

html.page-home .grid-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 3px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  background: linear-gradient(180deg, #8fd456 0%, #5a9e3a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

html.page-home .grid-item--soon .grid-item-header {
  background: linear-gradient(180deg, #b8b8b8 0%, #8a8a8a 100%);
}

html.page-home .grid-item-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

/* ── Cards ──────────────────────────────────────────────────── */

html.page-home .card {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--paper);
  border: 3px solid var(--line-strong);
  border-top: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html.page-home .card-visual {
  padding: 0.85rem 0.85rem 0;
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.page-home .card-body {
  padding: 0.75rem 0.85rem 1rem;
  background: linear-gradient(180deg, #d4d4d4 0%, #c0c0c0 100%);
  flex: 1;
}

html.page-home .card-body > p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

html.page-home .card-tag {
  flex-shrink: 0;
  padding: 0.1rem 0.45rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html.page-home .grid-item--live .card-tag {
  color: #e8ffe8;
  background: linear-gradient(180deg, #6fcf4a 0%, var(--grass-dark) 100%);
  border-color: #2a5a1a;
}

html.page-home .grid-item--soon .card-tag {
  color: #f0f0f0;
  background: linear-gradient(180deg, #9a9a9a 0%, #6a6a6a 100%);
  border-color: #3a3a3a;
}

/* ── Live card: hotbar block slots ──────────────────────────── */

html.page-home .image-placeholder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  width: 100%;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.18);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

html.page-home .slot {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  background: var(--slot-bg);
  padding: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html.page-home .slot-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slot-inset);
  border: 1px inset rgba(0, 0, 0, 0.4);
}

html.page-home .block-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── WIP category icons ─────────────────────────────────────── */

html.page-home .wire-box {
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  border: 3px solid var(--line-strong);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    4px 4px 0 rgba(0, 0, 0, 0.15);
}

html.page-home .grid-item:nth-child(2) .wire-box { background: linear-gradient(180deg, #5a9ae8 0%, #2a5a9a 100%); }
html.page-home .grid-item:nth-child(3) .wire-box { background: linear-gradient(180deg, #6fcf4a 0%, #3d7a32 100%); }
html.page-home .grid-item:nth-child(4) .wire-box { background: linear-gradient(180deg, #e85a8a 0%, #9a2a4a 100%); }
html.page-home .grid-item:nth-child(5) .wire-box { background: linear-gradient(180deg, #a86ae8 0%, #5a2a9a 100%); }
html.page-home .grid-item:nth-child(6) .wire-box { background: linear-gradient(180deg, #c49a6a 0%, #7a5a32 100%); }
html.page-home .grid-item:nth-child(7) .wire-box { background: linear-gradient(180deg, #f0d040 0%, #b08820 100%); }
html.page-home .grid-item:nth-child(8) .wire-box { background: linear-gradient(180deg, #5ae8e8 0%, #2a7a8a 100%); }

/* ── Login / register modals ────────────────────────────────── */

html.page-home .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

html.page-home .modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

html.page-home .modal {
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border: 3px solid var(--line-strong);
  box-shadow:
    0 0 0 2px #565656,
    8px 8px 0 rgba(0, 0, 0, 0.4);
}

html.page-home .modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 3px solid var(--line-strong);
  background: linear-gradient(180deg, #8fd456 0%, #5a9e3a 100%);
}

html.page-home .modal-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #2a4a18;
}

html.page-home .close-btn {
  border: 2px solid var(--mc-btn-light);
  border-right-color: var(--mc-btn-dark);
  border-bottom-color: var(--mc-btn-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, var(--mc-btn-face-top) 0%, var(--mc-btn-face-bottom) 100%);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html.page-home .close-btn:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, var(--mc-btn-hover-top) 0%, var(--mc-btn-hover-bottom) 100%);
}

html.page-home .modal form {
  padding: 1rem;
  background: linear-gradient(180deg, #e0e0e0 0%, #c6c6c6 100%);
}

html.page-home .field {
  margin-bottom: 0.85rem;
}

html.page-home .field label {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

html.page-home .field input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 2px solid var(--mc-btn-light);
  border-right-color: var(--mc-btn-dark);
  border-bottom-color: var(--mc-btn-dark);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

html.page-home .field input:focus {
  outline: 2px solid var(--grass-dark);
  outline-offset: 1px;
}

html.page-home .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

html.page-home .modal-actions button {
  flex: 1;
  min-width: 7rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--mc-btn-light);
  border-right-color: var(--mc-btn-dark);
  border-bottom-color: var(--mc-btn-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, var(--mc-btn-face-top) 0%, var(--mc-btn-face-bottom) 100%);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html.page-home .modal-actions button[type="submit"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, var(--mc-btn-active-top) 0%, var(--mc-btn-active-bottom) 100%);
  border-color: var(--mc-btn-active-border);
  color: #1a3a22;
}

html.page-home .modal-actions button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, var(--mc-btn-hover-top) 0%, var(--mc-btn-hover-bottom) 100%);
}

html.page-home .modal-actions button[type="submit"]:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, #e8fbe8 0%, #8ed4a8 100%);
}

html.page-home .modal-links {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

html.page-home .modal-links button {
  border: none;
  background: none;
  padding: 0;
  font-weight: 700;
  color: var(--grass-dark);
  text-decoration: underline;
  cursor: pointer;
}

html.page-home .modal-links button:hover {
  color: var(--grass);
}

html.page-home :focus-visible {
  outline: 2px solid var(--grass-dark);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 40rem) {
  html.page-home .wrap {
    padding: 1rem;
  }

  html.page-home .grid {
    grid-template-columns: minmax(0, 15rem);
    justify-content: center;
  }
}

@media (max-width: 30rem) {
  html.page-home .slot {
    width: 2.35rem;
    height: 2.35rem;
  }
}
