@font-face {
  font-family: "Minecraft Ten";
  src: url("/assets/fonts/minecraft-ten/MinecraftTen-VGORe.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Minecraft Text";
  src: url("/assets/fonts/minecraft/MinecraftRegular-Bmg3.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Minecraft Text";
  src: url("/assets/fonts/minecraft/MinecraftBold-nMK1.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Minecraft Text";
  src: url("/assets/fonts/minecraft/MinecraftItalic-R8Mo.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Minecraft Text";
  src: url("/assets/fonts/minecraft/MinecraftBoldItalic-1y1e.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font-heading: "Minecraft Ten", "Impact", fantasy;
  --font-body: "Minecraft Text", "Trebuchet MS", sans-serif;
  --panel: rgba(7, 16, 12, 0.76);
  --panel-border: rgba(214, 226, 204, 0.28);
  --accent: #72d767;
  --accent-2: #ffd56f;
  --text: #f4ffe9;
  --muted: #c8d9c0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-synthesis: none;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(126, 211, 124, 0.18), transparent 32%),
    linear-gradient(180deg, #18241a 0%, #08110c 100%);
  overflow-x: hidden;
}

#world,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#world {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.vignette {
  content: "";
  background:
    radial-gradient(circle at 64% 42%, transparent 20%, rgba(0, 0, 0, 0.38) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.48));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 92%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 80px;
  position: relative;
  z-index: 2;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 104px 0 126px;
}

.home .hero {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-content {
  max-width: 620px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8);
}

.hero-portal {
  min-height: auto;
  display: block;
  padding: 48px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 33, 20, 0.92), rgba(8, 17, 12, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-color: rgba(216, 169, 74, 0.28);
}

.hero-portal h1 {
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  max-width: 12ch;
}

.badge {
  font-family: var(--font-body);
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(126, 211, 124, 0.14);
  border: 1px solid rgba(126, 211, 124, 0.22);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  margin-bottom: 18px;
}

h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0 0 16px;
  font-size: clamp(3.7rem, 8vw, 7.6rem);
  line-height: 0.95;
  max-width: 100%;
  letter-spacing: 0.012em;
}

.lede {
  max-width: 62ch;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid rgba(231, 245, 223, 0.18);
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
}

.button.primary {
  background: linear-gradient(180deg, rgba(126, 211, 124, 0.95), rgba(69, 150, 68, 0.95));
  color: #08110c;
  border-color: transparent;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 0;
  position: relative;
  z-index: 3;
}

.card {
  padding: 22px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.035em;
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.card a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 860px) {
  .hero {
    min-height: 92vh;
    padding: 88px 0 96px;
    align-items: flex-end;
  }
  .hero-portal { padding: 28px; }
  h1 { font-size: clamp(2.45rem, 12vw, 3.65rem); }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #world { display: none; }
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(16px, 4vw, 42px);
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.brand,
.topbar a {
  color: inherit;
  text-decoration: none;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: 0.035em;
}

.topbar nav {
  display: flex;
  gap: 18px;
  font-weight: 700;
}

.crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.48;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
}

.crosshair::before {
  left: 10px;
  top: 0;
  width: 2px;
  height: 22px;
}

.crosshair::after {
  top: 10px;
  left: 0;
  width: 22px;
  height: 2px;
}

.hotbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: flex;
  gap: 3px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.7;
}

.slot {
  position: relative;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(80, 80, 80, 0.9);
  background: rgba(22, 22, 22, 0.45);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.slot.active {
  border-color: rgba(255, 255, 255, 0.9);
}

.slot::before,
.slot::after {
  content: "";
  position: absolute;
  image-rendering: pixelated;
}

.slot.grass::before {
  left: 9px;
  top: 8px;
  width: 16px;
  height: 16px;
  background: linear-gradient(#56ad43 0 35%, #7a5230 35% 100%);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}

.slot.pickaxe::before {
  left: 17px;
  top: 7px;
  width: 4px;
  height: 22px;
  background: #8b5a2b;
  transform: rotate(38deg);
}

.slot.pickaxe::after {
  left: 10px;
  top: 7px;
  width: 18px;
  height: 5px;
  background: #c6c6c6;
  transform: rotate(38deg);
}

.slot.sword::before {
  left: 17px;
  top: 6px;
  width: 5px;
  height: 22px;
  background: linear-gradient(#d8f3ff 0 68%, #73481d 68% 100%);
  transform: rotate(35deg);
}

.slot.apple::before {
  left: 11px;
  top: 10px;
  width: 15px;
  height: 15px;
  background: #cf2f26;
  box-shadow: inset 5px 0 0 #f05a41;
}

.slot.torch::before {
  left: 17px;
  top: 8px;
  width: 5px;
  height: 21px;
  background: linear-gradient(#ffc247 0 28%, #8b5527 28% 100%);
  transform: rotate(14deg);
}

.slot.compass::before {
  left: 10px;
  top: 9px;
  width: 16px;
  height: 16px;
  border: 3px solid #b9b9b9;
  background: #5c2e27;
}

.status-bars {
  position: fixed;
  left: 50%;
  bottom: 63px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  width: min(356px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.health,
.hunger {
  display: flex;
  gap: 5px;
}

.health i,
.hunger i {
  width: 12px;
  height: 12px;
  display: block;
  border: 2px solid rgba(0, 0, 0, 0.42);
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.22);
}

.health i {
  background: #d64031;
  transform: rotate(45deg);
}

.hunger i {
  background: #d08a2e;
}

@media (max-width: 640px) {
  .topbar nav { gap: 12px; }
  .hotbar,
  .status-bars { display: none; }
  .crosshair { display: none; }
}

.portal-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(55, 100, 46, 0.16) 25%, transparent 25%) 0 0 / 42px 42px,
    linear-gradient(225deg, rgba(98, 68, 35, 0.18) 25%, transparent 25%) 0 0 / 42px 42px,
    radial-gradient(circle at 72% 20%, rgba(126, 211, 124, 0.18), transparent 32%),
    linear-gradient(180deg, #172716 0%, #08110c 100%);
}

.portal-topbar {
  background: linear-gradient(180deg, rgba(6, 13, 9, 0.86), rgba(6, 13, 9, 0.28));
  backdrop-filter: blur(8px);
}

.portal-topbar nav {
  align-items: center;
}

.nav-form {
  margin: 0;
}

.nav-form button {
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.portal-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 112px 0 80px;
  position: relative;
  z-index: 2;
}

.portal-panel {
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(11, 26, 15, 0.92), rgba(7, 15, 10, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.login-panel {
  max-width: 560px;
}

.portal-page h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  max-width: 12ch;
}

.portal-panel h2 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: 0.035em;
}

.portal-grid {
  margin-bottom: 22px;
}

.portal-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 4px;
  border: 2px solid rgba(231, 245, 223, 0.22);
  color: var(--text);
  background: rgba(5, 10, 7, 0.72);
  font: inherit;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(114, 215, 103, 0.16);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid rgba(231, 245, 223, 0.18);
  background: rgba(7, 16, 12, 0.86);
}

.alert.success {
  color: #dcffd5;
  border-color: rgba(114, 215, 103, 0.34);
}

.alert.error {
  color: #ffd8d3;
  border-color: rgba(255, 105, 86, 0.34);
}

.muted {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.portal-table th,
.portal-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(231, 245, 223, 0.13);
  text-align: left;
}

.portal-table th {
  color: var(--accent);
  font-weight: 700;
}

.portal-table a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 760px) {
  .portal-shell {
    padding-top: 96px;
  }

  .portal-topbar {
    align-items: flex-start;
    gap: 10px;
  }

  .portal-topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-form {
    grid-template-columns: 1fr;
  }
}
