/* ============================================================
   APTYP — Minecraft 1.16 Java GUI style (fan re-creation, all
   textures generated in code — no game assets used)
   ============================================================ */

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("../fonts/vt323.woff2") format("woff2");
  font-display: swap;
}

:root {
  --mc-stone: #8B8B8B;
  --mc-panel: #C6C6C6;
  --mc-dark: #373737;
  --mc-green: #54FC54;
  --mc-yellow: #FCFC54;
  --mc-red: #FC5454;
  --mc-aqua: #54FCFC;
  --mc-gold: #FCA800;
  --mc-gray-text: #AAAAAA;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: "VT323", "Courier New", monospace;
  /* texture data-URLs injected by app.js at runtime */
  --tex-dirt: none;
  --tex-stone: none;
  --tex-planks: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.35;
  color: #E8E8E8;
  background-color: #2a1d12; /* fallback before JS paints dirt */
  background-image: var(--tex-dirt);
  background-size: 64px 64px;
  image-rendering: pixelated;
  overflow-x: hidden;
}

img, canvas { image-rendering: pixelated; }

::selection { background: #54FC54; color: #1a1a1a; }

h1, h2, h3, .pixel-title {
  font-family: var(--font-pixel);
  line-height: 1.4;
}

a { color: var(--mc-aqua); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }

:focus-visible { outline: 3px solid var(--mc-yellow); outline-offset: 1px; }

/* ---------------- Buttons ---------------- */

.mc-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 22px;
  color: #E8E8E8;
  text-shadow: 2px 2px 0 #3F3F3F;
  background-color: #6E6E6E;
  background-image: var(--tex-stone);
  background-size: 64px 64px;
  background-blend-mode: multiply;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.42),
              inset -2px -2px 0 rgba(0,0,0,.40);
  padding: 8px 20px 10px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: filter .05s;
}
.mc-btn:hover:not(:disabled) {
  color: #FFFFA0;
  border-color: #FFF;
  filter: brightness(1.18);
}
.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.40),
              inset -2px -2px 0 rgba(255,255,255,.25);
}
.mc-btn:disabled {
  color: #A0A0A0;
  cursor: not-allowed;
  filter: brightness(.7);
}
.mc-btn-green { background-color: #6FA85F; }
.mc-btn-red   { background-color: #A85F5F; }
.mc-btn-big   { font-size: 26px; padding: 12px 34px 14px; min-width: 300px; }
.mc-btn-sq    { padding: 6px 12px 8px; min-width: 44px; }

/* ---------------- Panels & slots ---------------- */

.mc-panel {
  background: var(--mc-panel);
  color: #3F3F3F;
  border: 3px solid #1b1b1b;
  box-shadow: inset 3px 3px 0 #FFFFFF,
              inset -3px -3px 0 #555555,
              0 6px 0 rgba(0,0,0,.35);
  padding: 22px;
}
.mc-panel h2, .mc-panel h3 { color: #3F3F3F; }

.mc-panel-dark {
  background: rgba(12, 12, 14, .82);
  color: #E8E8E8;
  border: 3px solid #1b1b1b;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.14),
              inset -3px -3px 0 rgba(0,0,0,.55);
  padding: 18px;
}

.mc-slot {
  width: 48px;
  height: 48px;
  background: var(--mc-stone);
  box-shadow: inset 2px 2px 0 #373737,
              inset -2px -2px 0 #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* ---------------- Inputs ---------------- */

.mc-input {
  font-family: var(--font-body);
  font-size: 22px;
  color: #E8E8E8;
  background: #000;
  border: 2px solid #A0A0A0;
  padding: 8px 12px;
  width: 100%;
}
.mc-input:focus { outline: none; border-color: #FFF; }
.mc-input::placeholder { color: #707070; }

/* ---------------- Tooltip ---------------- */

.mc-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  pointer-events: none;
  background: rgba(18, 3, 26, .96);
  border: 2px solid rgba(106, 63, 209, .9);
  box-shadow: 0 0 0 2px rgba(16, 0, 16, .94);
  color: #E8E8E8;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.3;
  padding: 8px 10px;
  display: none;
}
.mc-tooltip .tt-title { color: var(--mc-aqua); display: block; margin-bottom: 2px; }

/* ---------------- XP bar & hearts ---------------- */

.xp-bar {
  height: 12px;
  background: #1e1e1e;
  border: 2px solid #000;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.6);
  position: relative;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(#A0FF3F, #54C400);
  background-image: repeating-linear-gradient(90deg,
      rgba(0,0,0,.18) 0 2px, transparent 2px 14px),
    linear-gradient(#A0FF3F, #54C400);
  transition: width .25s steps(6);
}
.hearts { display: inline-flex; gap: 2px; align-items: center; }

/* ---------------- Badges ---------------- */

.mc-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 5px 8px 4px;
  border: 2px solid #000;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,.6);
  vertical-align: middle;
}
.badge-java    { background: #5B8731; }
.badge-bedrock { background: #666B8A; }
.badge-both    { background: #3A7E8C; }
.badge-op      { background: #8C3A3A; }
.badge-note    { background: #8C6E3A; }

/* ---------------- Layout ---------------- */

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

.section { padding: 70px 0; }

.section-head {
  text-align: center;
  margin-bottom: 34px;
}
.section-head h2 {
  font-size: clamp(18px, 3.4vw, 30px);
  color: #FFF;
  text-shadow: 3px 3px 0 #3F3F3F;
}
.section-head p {
  color: var(--mc-gray-text);
  margin-top: 12px;
  font-size: 22px;
}

/* ---------------- Top nav ---------------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(15, 10, 6, .92);
  border-bottom: 3px solid #000;
  box-shadow: 0 3px 0 rgba(255,255,255,.08);
}
.topnav .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.topnav .logo {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--mc-green);
  text-shadow: 2px 2px 0 #1c3b1c;
  margin-right: auto;
  cursor: pointer;
}
.topnav a.navlink {
  font-size: 21px;
  color: #E8E8E8;
  text-decoration: none;
  padding: 2px 8px;
}
.topnav a.navlink:hover { color: #FFFFA0; }

/* ---------------- Hero (title screen) ---------------- */

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(#6D8FE8 0%, #9DBBF2 55%, #C3D9F8 100%);
  border-bottom: 6px solid #000;
  padding: 60px 16px 90px;
}
.hero-sky { position: absolute; inset: 0; pointer-events: none; }
.hero .float-block {
  position: absolute;
  pointer-events: none;
  animation: bob 3.4s ease-in-out infinite;
  filter: drop-shadow(4px 6px 0 rgba(0,0,0,.18));
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.hero-inner { position: relative; z-index: 2; }

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(38px, 9vw, 84px);
  color: #FFFFFF;
  letter-spacing: 2px;
  text-shadow:
    3px 3px 0 #3F3F3F, 6px 6px 0 #2A2A2A,
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.hero-sub {
  margin-top: 14px;
  font-size: clamp(22px, 3vw, 30px);
  color: #1E2A4A;
  text-shadow: 1px 1px 0 rgba(255,255,255,.4);
}
.splash {
  position: absolute;
  top: -8px;
  right: -30px;
  transform: rotate(-14deg);
  font-family: var(--font-pixel);
  font-size: clamp(10px, 1.6vw, 15px);
  color: #FFFF00;
  text-shadow: 2px 2px 0 #3F3F00;
  animation: splashpulse .5s ease-in-out infinite alternate;
  z-index: 3;
  white-space: nowrap;
}
@keyframes splashpulse {
  from { transform: rotate(-14deg) scale(1); }
  to   { transform: rotate(-14deg) scale(1.09); }
}
.hero-title-wrap { position: relative; display: inline-block; }

.hero-menu {
  margin-top: 46px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.hero-stats {
  margin-top: 40px;
  display: flex;
  gap: 26px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 22px;
  color: #14213D;
}
.hero-stats b { color: #0A122B; }
.hero-version {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 19px;
  color: rgba(20, 33, 61, .75);
  z-index: 2;
}
.hero-disclaimer {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 19px;
  color: rgba(20, 33, 61, .75);
  z-index: 2;
}

/* ---------------- Command browser ---------------- */

.cmd-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.cmd-controls .mc-input { flex: 1 1 260px; width: auto; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn { font-size: 19px; padding: 6px 12px 8px; }
.tab-btn.active {
  color: #FFFFA0;
  border-color: #FFF;
  filter: brightness(1.25);
}

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.cmd-card {
  cursor: pointer;
  padding: 14px 14px 12px;
  position: relative;
  transition: transform .07s;
}
.cmd-card:hover {
  transform: translateY(-3px);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.22),
              inset -3px -3px 0 rgba(0,0,0,.55),
              0 0 0 2px #FFFFA0;
}
.cmd-card .cmd-name {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--mc-green);
  margin-bottom: 8px;
  word-break: break-all;
}
.cmd-card .cmd-short {
  font-size: 20px;
  color: #CFCFCF;
  min-height: 52px;
}
.cmd-card .cmd-meta { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

.cmd-count { font-size: 20px; color: var(--mc-gray-text); margin-bottom: 12px; }

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, .72);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 14px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal-window {
  width: 100%;
  max-width: 880px;
  animation: modalin .12s steps(3);
  margin-bottom: 6vh;
}
@keyframes modalin {
  from { transform: scale(.86); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.modal-head h3 {
  font-size: clamp(14px, 2.6vw, 22px);
  color: #3F3F3F;
  margin-right: auto;
  word-break: break-all;
}
.modal-body { font-size: 22px; }
.modal-body .desc { margin: 10px 0 16px; }

.subhead {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #5A5A5A;
  margin: 20px 0 10px;
  text-transform: uppercase;
}

/* syntax lines */
.syntax-line {
  background: #101014;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.08);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 22px;
  overflow-x: auto;
  white-space: nowrap;
}
.syntax-line .part {
  display: inline-block;
  padding: 0 3px;
  border-bottom: 2px dotted transparent;
  cursor: help;
}
.syntax-line .part:hover, .syntax-line .part.hl {
  background: rgba(84, 252, 252, .16);
  border-bottom-color: var(--mc-aqua);
}
.part-command  { color: var(--mc-yellow); }
.part-literal  { color: #E8E8E8; }
.part-arg      { color: var(--mc-aqua); }
.part-optional { color: #B08CFF; }

.syntax-hint { font-size: 19px; color: #6A6A6A; margin: 4px 0 0; }

/* examples */
.example-row {
  background: #101014;
  border: 2px solid #000;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.example-row .ex-cmd { color: var(--mc-green); word-break: break-all; }
.example-row .ex-note { color: #9A9A9A; font-size: 20px; margin-top: 4px; }
.example-row .ex-actions { margin-top: 8px; }

/* try-it console */
.console {
  background: rgba(6, 6, 8, .92);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07);
  padding: 10px;
}
.console-log {
  height: 170px;
  overflow-y: auto;
  font-size: 21px;
  padding: 4px 6px;
}
.console-log .line { margin-bottom: 3px; word-break: break-word; }
.console-log .c-cmd  { color: #E8E8E8; }
.console-log .c-out  { color: #CFCFCF; }
.console-log .c-ok   { color: var(--mc-green); }
.console-log .c-err  { color: var(--mc-red); }
.console-log .c-sys  { color: var(--mc-gray-text); font-style: italic; }
.console-input-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.console-input-row .prompt { color: var(--mc-gray-text); }

.fun-fact {
  margin-top: 18px;
  background: #EBDFA9;
  border: 2px solid #8C6E3A;
  color: #4A3A10;
  padding: 10px 12px;
  font-size: 21px;
}
.fun-fact b { color: #7A5A00; }

/* ---------------- Games ---------------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.game-card { text-align: center; padding: 20px 16px; }
.game-card .mc-slot { width: 64px; height: 64px; margin-bottom: 12px; }
.game-card h3 {
  font-size: 13px;
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #3F3F00;
  margin-bottom: 10px;
}
.game-card p { color: #CFCFCF; font-size: 20px; min-height: 56px; }
.game-card .mc-btn { margin-top: 12px; }

#game-mount { min-height: 340px; }

/* ---------------- Achievement toast ---------------- */

.toast {
  position: fixed;
  top: 16px;
  right: -420px;
  z-index: 900;
  width: 340px;
  background: #212121;
  border: 3px solid #555;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), 4px 4px 0 rgba(0,0,0,.4);
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: right .35s steps(8);
}
.toast.show { right: 16px; }
.toast .t-icon { flex: 0 0 40px; }
.toast .t-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--mc-yellow);
  margin-bottom: 5px;
}
.toast .t-text { font-size: 20px; color: #E8E8E8; }

/* ---------------- Footer ---------------- */

footer {
  border-top: 6px solid #000;
  background: rgba(10, 7, 4, .9);
  padding: 34px 0 40px;
  text-align: center;
  font-size: 20px;
  color: var(--mc-gray-text);
}
footer .foot-logo {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--mc-green);
  margin-bottom: 12px;
}
footer p { margin-top: 6px; }

/* ---------------- Scroll reveal ---------------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .4s, transform .4s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Misc ---------------- */

.center { text-align: center; }
.mt { margin-top: 18px; }

@media (max-width: 640px) {
  body { font-size: 19px; }
  .mc-btn-big { min-width: 240px; }
  .splash { right: -8px; }
  .hero-disclaimer { position: static; margin-top: 26px; }
  .hero-version { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
