@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&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: "Lato", system-ui, sans-serif;
  --font-display: "Lato", system-ui, sans-serif;
  --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;
  --mc-gui: #c6c6c6;
  --mc-gui-dark: #373737;
  --mc-gui-light: #ffffff;
  --mc-gui-mid: #8b8b8b;
  --mc-text: #ffffff;
  --mc-text-shadow: #3f3f3f;
  --mc-plank: #9c7b4f;
  --mc-plank-light: #d4b896;
  --mc-plank-dark: #5c4030;
  --mc-stone: #7a7a7a;
  --mc-stone-light: #b0b0b0;
  --mc-stone-dark: #4a4a4a;
}

html.page-index {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
}

html.page-index body {
  display: flex;
  flex-direction: column;
  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;
}

/* Hide page scrollbar; scrolling still works */
html.page-index,
html.page-index body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html.page-index::-webkit-scrollbar,
html.page-index body::-webkit-scrollbar {
  display: none;
}

html.page-index h1,
html.page-index h2,
html.page-index h3,
html.page-index .brand,
html.page-index button,
html.page-index input,
html.page-index label,
html.page-index p,
html.page-index span {
  font-family: var(--font);
  letter-spacing: 0.01em;
}

html.page-index img {
  display: block;
  max-width: 100%;
}

html.page-index a {
  color: inherit;
}

html.page-index button,
html.page-index input {
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout shell ───────────────────────────────────────────── */

html.page-index .wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  width: 100%;
  padding: 1rem 1.25rem 1.5rem;
}

html.page-index .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-index .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-index .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-index .hero > * {
  position: relative;
}

html.page-index .hero-tag {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.55rem;
  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-index .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-index .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-index .content {
  padding: 1.5rem;
  background:
    linear-gradient(180deg, #e0e0e0 0%, #c6c6c6 100%);
}

/* ── Grid — clean block tiles ───────────────────────────────── */

html.page-index .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1.1rem;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
}

html.page-index .grid-item {
  --tile-accent: #5cb85c;
  --tile-accent-dark: #3d8b3d;
  --tile-tint: #eef8ee;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fffdf8;
  border: 3px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

html.page-index .grid-item:nth-child(1) { --tile-accent: #5cb85c; --tile-accent-dark: #3a8a3a; --tile-tint: #edf8ed; }
html.page-index .grid-item:nth-child(2) { --tile-accent: #7cb342; --tile-accent-dark: #558b2f; --tile-tint: #f2f8e8; }
html.page-index .grid-item:nth-child(3) { --tile-accent: #e57373; --tile-accent-dark: #c62828; --tile-tint: #fdf0f0; }
html.page-index .grid-item:nth-child(4) { --tile-accent: #9575cd; --tile-accent-dark: #6a4aab; --tile-tint: #f4f0fa; }
html.page-index .grid-item:nth-child(5) { --tile-accent: #a1887f; --tile-accent-dark: #6d4c41; --tile-tint: #f8f2ef; }
html.page-index .grid-item:nth-child(6) { --tile-accent: #ffb74d; --tile-accent-dark: #e65100; --tile-tint: #fff8ed; }
html.page-index .grid-item:nth-child(7) { --tile-accent: #4dd0e1; --tile-accent-dark: #00838f; --tile-tint: #edfafa; }
html.page-index .grid-item:nth-child(8) { --tile-accent: #7986cb; --tile-accent-dark: #3949ab; --tile-tint: #eef0fa; }
html.page-index .grid-item:nth-child(9) { --tile-accent: #f06292; --tile-accent-dark: #c2185b; --tile-tint: #fdf0f5; }

html.page-index a.grid-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

html.page-index a.grid-item:hover,
html.page-index a.grid-item:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.22);
}

html.page-index a.grid-item:active {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

html.page-index .grid-item--soon {
  opacity: 0.92;
}

html.page-index .grid-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  background: var(--tile-accent);
  border-bottom: 3px solid var(--line-strong);
}

html.page-index .grid-item-title {
  margin: 0;
  font-size: 0.925rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

html.page-index .card {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--tile-tint);
  border: none;
  padding: 0.65rem;
  gap: 0.55rem;
}

html.page-index .card-visual {
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

html.page-index .grid-item--soon .card-visual {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.65);
}

html.page-index .card-body {
  padding: 0;
  background: transparent;
  border: none;
  flex: 1;
}

html.page-index .card-body > p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a4a4a;
  line-height: 1.45;
}

html.page-index .card-tag {
  flex-shrink: 0;
  padding: 0.15rem 0.4rem;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  line-height: 1.2;
}

html.page-index .grid-item--live .card-tag {
  color: #1a4a1a;
  background: #fff;
}

html.page-index .grid-item--soon .card-tag {
  color: #555;
  background: rgba(255, 255, 255, 0.75);
}

/* Card image grids */
html.page-index .image-placeholder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  width: 86%;
  max-width: 9.5rem;
  margin: 0 auto;
}

html.page-index .slot {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  padding: 2px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: #8b8b8b;
}

html.page-index .slot-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #373737;
  border-radius: 3px;
  padding: 2px;
  overflow: hidden;
}

html.page-index .block-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

html.page-index .biome-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

html.page-index .slot--empty .slot-inner {
  background:
  repeating-linear-gradient(
    -45deg,
    #4a4a4a 0,
    #4a4a4a 2px,
    #353535 2px,
    #353535 4px
  );
  opacity: 0.55;
}

html.page-index .slot--empty {
  border-style: dashed;
  background: #9a9a9a;
}

/* WIP category icons */
html.page-index .wire-box {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  border: 3px solid var(--line-strong);
  border-radius: 10px;
  background: var(--tile-accent);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
}

/* ── Login / register modals ────────────────────────────────── */

html.page-index .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-index .modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

html.page-index .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-index .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-index .modal-top h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 0 #2a4a18;
}

html.page-index .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-index .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-index .modal form {
  padding: 1rem;
  background: linear-gradient(180deg, #e0e0e0 0%, #c6c6c6 100%);
}

html.page-index .field {
  margin-bottom: 0.85rem;
}

html.page-index .field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

html.page-index .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-index .field input:focus {
  outline: 2px solid var(--grass-dark);
  outline-offset: 1px;
}

html.page-index .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

html.page-index .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-index .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-index .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-index .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-index .modal-links {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

html.page-index .modal-links button {
  border: none;
  background: none;
  padding: 0;
  font-weight: 700;
  color: var(--grass-dark);
  text-decoration: underline;
  cursor: pointer;
}

html.page-index .modal-links button:hover {
  color: var(--grass);
}

html.page-index :focus-visible {
  outline: 2px solid var(--grass-dark);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 40rem) {
  html.page-index .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 30rem) {
  html.page-index .wire-box {
    width: 3rem;
    height: 3rem;
    font-size: 0.8rem;
  }
}
