@font-face {
  font-family: "Monocraft";
  src: url(../assets/fonts/Monocraft.ttf) format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --mc-font: "Monocraft", "Courier New", Consolas, monospace;
  --ink: #f6f1d1;
  --shadow: #17110b;
  --panel: rgba(36, 25, 15, 0.94);
  --panel-edge: #0f0b07;
  --gold: #f4c95d;
  --red: #d33b2d;
  --green: #5da846;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #6aa2d8;
  font-family: var(--mc-font);
  image-rendering: pixelated;
}

body {
  position: relative;
  color: var(--ink);
}

#world {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  /* Classic Minecraft "dirt" loading background: a darkened, tiled dirt block. */
  background-color: #4c4133;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)),
    url(../assets/minecraft/textures/block/dirt.png);
  background-size: 48px 48px;
  image-rendering: pixelated;
  transition: opacity 0.4s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-inner {
  width: min(420px, 78vw);
  text-align: center;
}

.loading-title {
  margin: 0 0 22px;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #000;
}

.loading-bar {
  width: 100%;
  height: 12px;
  padding: 2px;
  background: #2b2b2b;
  border: 2px solid #1a1a1a;
  box-shadow: inset 0 0 0 1px #555;
  image-rendering: pixelated;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: #7fb238;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.28);
  transition: width 0.18s linear;
}

.loading-status {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  color: #d8d8d8;
  font-size: 0.92rem;
  text-shadow: 2px 2px 0 #000;
}

.panel {
  position: fixed;
  z-index: 10;
  padding: 28px 30px;
  color: var(--ink);
  /* Minecraft's modern dialog/popup panel (nine-slice, border 6). */
  background: none;
  border: 14px solid transparent;
  border-image: url(../assets/minecraft/textures/gui/sprites/popup/background.png) 6 fill / 14px / 0 stretch;
  image-rendering: pixelated;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.5);
  text-shadow: 2px 2px 0 var(--shadow);
}

.start-panel {
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  text-align: center;
}

.project-panel {
  top: 50%;
  left: 50%;
  width: min(620px, calc(100vw - 24px));
  transform: translate(-50%, -50%);
}

.help-panel {
  top: 50%;
  left: 50%;
  width: min(380px, calc(100vw - 32px));
  padding: 16px 18px 18px;
  transform: translate(-50%, -50%);
}

.panel.help-panel h2 {
  margin-top: 2px;
  font-size: 1.5rem;
}

.panel.help-panel p {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.help-panel .controls-grid {
  gap: 6px 10px;
  margin-top: 12px;
}

.help-panel .controls-grid span,
.help-panel .controls-grid strong {
  padding: 5px 8px;
  font-size: 0.78rem;
}

.help-panel .pixel-button {
  margin-top: 14px;
}

.panel h1,
.panel h2,
.panel p {
  margin: 0;
}

.panel h1 {
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.95;
  color: #fff7b5;
}

.pixel-heading {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.45));
}

.start-panel .pixel-heading {
  margin: 4px auto 0;
}

.panel h2 {
  margin-top: 6px;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1;
  color: #fff7b5;
}

.summary,
#project-description,
.help-panel p {
  margin-top: 16px;
  font-size: 1rem;
  line-height: 1.55;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nickname {
  margin-top: 6px;
  color: #8fe0c8;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Authentic Minecraft button: 200x20 nine-slice sprite (3px border). */
.pixel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 20px;
  padding: 8px 22px;
  color: #ffffff;
  background: none;
  border: 9px solid transparent;
  border-image: url(../assets/minecraft/textures/gui/sprites/widget/button.png) 3 fill / 9px / 0 stretch;
  font: 700 1rem var(--mc-font);
  text-decoration: none;
  text-shadow: 2px 2px 0 #2b2b2b;
  image-rendering: pixelated;
  cursor: pointer;
}

.pixel-button:hover,
.pixel-button:focus-visible {
  border-image-source: url(../assets/minecraft/textures/gui/sprites/widget/button_highlighted.png);
  color: #ffffa0;
  outline: none;
}

.pixel-button:disabled {
  border-image-source: url(../assets/minecraft/textures/gui/sprites/widget/button_disabled.png);
  color: #a0a0a0;
  cursor: default;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.top-left {
  position: fixed;
  top: 14px;
  left: 14px;
  width: min(560px, calc(100vw - 80px));
}

.status-row {
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 2px 2px 0 #000;
}

.heart {
  display: inline-block;
  width: 18px;
  height: 18px;
  /* Full heart over the dark container socket = the bordered HUD look. */
  background-image:
    url(../assets/minecraft/textures/gui/sprites/hud/heart/full.png),
    url(../assets/minecraft/textures/gui/sprites/hud/heart/container.png);
  background-size: contain, contain;
  background-repeat: no-repeat, no-repeat;
  image-rendering: pixelated;
}

.hint {
  margin-top: 8px;
  padding: 7px 9px;
  width: fit-content;
  max-width: 100%;
  color: #fff7d1;
  background: rgba(0, 0, 0, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  line-height: 1.35;
  text-shadow: 2px 2px 0 #000;
}

.hint .key {
  display: inline-block;
  min-width: 1.1em;
  padding: 0 4px;
  margin-right: 2px;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-shadow: 1px 1px 0 #000;
}

/* Onboarding guideline — a single instruction near the bottom-centre. */
.tutorial {
  position: fixed;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  padding: 9px 16px;
  color: #fff7d1;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.22);
  font: 700 0.98rem var(--mc-font);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
  animation: tut-pulse 1.6s ease-in-out infinite;
}
.tutorial .key {
  display: inline-block;
  min-width: 1.2em;
  padding: 0 5px;
  margin: 0 1px;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
@keyframes tut-pulse { 0%, 100% { opacity: 0.78; } 50% { opacity: 1; } }

/* Minecraft-style advancement toast, slides in from the top-right. */
.advancement {
  position: fixed;
  top: 14px;
  right: -360px;
  width: 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(#2b2719, #211e14);
  border: 2px solid #4a432c;
  box-shadow: inset 0 0 0 2px #5b5236, 0 4px 0 rgba(0, 0, 0, 0.5);
  z-index: 60;
  transition: right 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.advancement.show { right: 14px; }
.advancement .adv-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.advancement .adv-text { display: flex; flex-direction: column; line-height: 1.2; }
.advancement .adv-kicker { color: #f8e36b; font: 700 0.74rem var(--mc-font); }
.advancement .adv-title { color: #fff; font: 700 0.96rem var(--mc-font); text-shadow: 1px 1px 0 #000; }

/* On-screen touch controls (mobile). Hidden until touch mode is entered.
   Polished 2026-06-03: warm Minecraft-gold rings, depth from inner/outer
   shadow + blur, a tactile pressed state, and safe-area insets so nothing
   sits under a notch / home indicator (needs viewport-fit=cover). */
.touch-ui {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-ui[hidden] { display: none; }
/* Right ~60% is the look-drag area. */
.touch-look {
  position: absolute; top: 0; right: 0; bottom: 0; left: 38%;
  pointer-events: auto; touch-action: none;
}
/* Left move stick — recessed gold ring with a soft inner glow. */
.touch-stick {
  position: absolute;
  left: calc(26px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, rgba(255, 247, 209, 0.10), rgba(8, 6, 3, 0.5));
  border: 3px solid rgba(244, 201, 93, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  pointer-events: auto; touch-action: none;
}
.touch-thumb {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px;
  margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #fff7d1, #e6c879);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
/* Shared round control button — chunky, tactile, Minecraft-warm. */
/* Authentic Minecraft GUI button (button.png 9-slice), per request, for the
   jump / sneak buttons and the hologram nav (prev / next / close) buttons. */
.touch-btn {
  position: absolute; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; touch-action: none;
  -webkit-user-select: none; user-select: none;
  font: 700 1.55rem var(--mc-font); color: #ffffff; line-height: 1;
  text-shadow: 2px 2px 0 #2b2b2b;
  background: none;
  border: 12px solid transparent;
  border-image: url(../assets/minecraft/textures/gui/sprites/widget/button.png) 3 fill / 12px / 0 stretch;
  image-rendering: pixelated;
}
.touch-btn:active, .touch-btn.active {
  border-image-source: url(../assets/minecraft/textures/gui/sprites/widget/button_highlighted.png);
  color: #ffffa0;
}
/* Minecraft PE layout: jump (lower-middle right) + sneak below it, equal size,
   clear of the right / bottom safe areas. */
.touch-jump {
  right: calc(30px + env(safe-area-inset-right));
  bottom: calc(132px + env(safe-area-inset-bottom));
  width: 92px; height: 76px;
}
.touch-sneak {
  right: calc(30px + env(safe-area-inset-right));
  bottom: calc(36px + env(safe-area-inset-bottom));
  width: 92px; height: 76px;
}
.touch-holo-nav {
  position: absolute; left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex; gap: 16px; pointer-events: none;
}
.touch-holo-nav[hidden] { display: none; }
.touch-holo-nav .touch-btn { position: static; width: 78px; height: 54px; font-size: 1.4rem; }

/* Rotate-to-landscape gate — shown only on touch devices held in portrait. */
.rotate-screen { display: none; }
@media (pointer: coarse) and (orientation: portrait) {
  .rotate-screen {
    display: flex; position: fixed; inset: 0; z-index: 200;
    align-items: center; justify-content: center; text-align: center;
    background: #0b1430; color: #fff7d1; padding: 28px;
    font-family: var(--mc-font);
  }
}
.rotate-inner { max-width: 360px; }
.rotate-icon {
  font-size: 88px; line-height: 1; display: inline-block;
  animation: rotate-hint 2s ease-in-out infinite;
}
.rotate-title { font-size: 1.5rem; margin: 18px 0 8px; text-shadow: 2px 2px 0 #000; }
.rotate-sub { font-size: 0.92rem; opacity: 0.82; line-height: 1.45; }
@keyframes rotate-hint { 0%, 100% { transform: rotate(0); } 55% { transform: rotate(90deg); } }

/* Clickable link bar shown while a hologram is open. */
.holo-links {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 92vw;
  pointer-events: auto; z-index: 55;
}
.holo-links[hidden] { display: none; }
.holo-links a {
  font: 700 0.82rem var(--mc-font); color: #cdecff; text-decoration: none;
  padding: 7px 13px; background: rgba(7, 17, 24, 0.86);
  border: 2px solid rgba(120, 220, 255, 0.6); text-shadow: 1px 1px 0 #000;
}
.holo-links a:hover { background: rgba(120, 220, 255, 0.2); color: #fff; }

.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  background-image: url(../assets/minecraft/textures/gui/sprites/hud/crosshair.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  /* Matches Minecraft's inverting crosshair blend against the world. */
  mix-blend-mode: difference;
  transition: width 0.12s ease, height 0.12s ease;
}

/* Cue that what you're aiming at is clickable (a lantern or a hologram link). */
.crosshair.interact {
  width: 22px;
  height: 22px;
  background-image: none;
  border: 3px solid #ffe06a;
  border-radius: 50%;
  mix-blend-mode: normal;
  box-shadow: 0 0 8px rgba(255, 224, 106, 0.8);
}

/* Real Minecraft hotbar strip (hotbar.png, 182x22 = 9 slots) behind the icons. */
.hotbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(9, 48px);
  gap: 0;
  padding: 2px;
  transform: translateX(-50%);
  background-image: url(../assets/minecraft/textures/gui/sprites/hud/hotbar.png);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  image-rendering: pixelated;
}

.slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: none;
  border: 0;
}

.slot.active::after {
  content: "";
  position: absolute;
  inset: -5px;
  background-image: url(../assets/minecraft/textures/gui/sprites/hud/hotbar_selection.png);
  background-size: 100% 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.slot-number {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #fff;
  font: 700 0.66rem var(--mc-font);
  text-shadow: 1px 1px 0 #000;
}

/* Control-item glyph (day/night ☀/☾, language RU/EN) shown in a hotbar slot. */
.slot-glyph {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff7d1;
  font: 700 1.05rem var(--mc-font);
  text-shadow: 1px 1px 0 #000;
}

.block-icon {
  width: 32px;
  height: 32px;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4));
}

/* Hotbar navbar item icons (real 16x16 item textures, scaled up crisp). */
.item-icon {
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.45));
}

/* Hearts + hunger row, centered above the hotbar like Minecraft's HUD. */
.stats {
  position: fixed;
  bottom: 74px;
  left: 50%;
  width: 432px;
  max-width: calc(100vw - 24px);
  display: flex;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.hearts,
.hunger {
  display: flex;
  gap: 1px;
}

.hunger {
  flex-direction: row-reverse;
}

.food {
  width: 18px;
  height: 18px;
  background-image:
    url(../assets/minecraft/textures/gui/sprites/hud/food_full.png),
    url(../assets/minecraft/textures/gui/sprites/hud/food_empty.png);
  background-size: contain, contain;
  background-repeat: no-repeat, no-repeat;
  image-rendering: pixelated;
}

.item-name {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-shadow: 2px 2px 0 #000;
}

.item-name.visible {
  opacity: 1;
}

.item-name .pixel-heading {
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 90px;
  max-width: min(380px, calc(100vw - 28px));
  padding: 10px 12px;
  color: #fff8d8;
  background: rgba(0, 0, 0, 0.56);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease;
  text-shadow: 2px 2px 0 #000;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.corner-button {
  position: fixed;
  top: 14px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 44px;
  color: #ffffff;
  background: none;
  border: 9px solid transparent;
  border-image: url(../assets/minecraft/textures/gui/sprites/widget/button.png) 3 fill / 9px / 0 stretch;
  font: 700 1.3rem var(--mc-font);
  image-rendering: pixelated;
  pointer-events: auto;
  cursor: pointer;
  text-shadow: 2px 2px 0 #2b2b2b;
}

.corner-button:hover {
  border-image-source: url(../assets/minecraft/textures/gui/sprites/widget/button_highlighted.png);
  color: #ffffa0;
}

#sound-button {
  right: 14px;
}

.help-button {
  right: 68px;
}

#day-button {
  right: 122px;
}

#lang-button {
  right: 176px;
  font-size: 0.95rem;
}

#sound-button.muted {
  color: #c98b8b;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tags span {
  padding: 6px 8px;
  color: #22170c;
  background: #c4d56a;
  border: 2px solid #4b5b24;
  font-size: 0.8rem;
  text-shadow: none;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px 12px;
  margin-top: 18px;
}

.controls-grid span,
.controls-grid strong {
  padding: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.16);
}

/* ---- Written-book GUI (real book.png + page-turn sprites) ---- */
.book {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.5);
}

/* The real Minecraft written-book GUI: book.png is a single page (146x180) in
   the top-left of a 256x256 sheet. */
.book-page {
  position: relative;
  width: min(360px, calc(100vw - 40px));
  aspect-ratio: 146 / 180;
  background-image: url(../assets/minecraft/textures/gui/book.png);
  background-repeat: no-repeat;
  /* The book art sits at x20-165,y1-180 in the 256x256 sheet (not top-left). */
  background-position: 18.2% 1.3%;
  background-size: 175.4% 142.3%;
  image-rendering: pixelated;
}

/* Writable area sits on the parchment, clear of the binding and frame. */
.book-content {
  position: absolute;
  left: 22%;
  right: 8%;
  top: 11%;
  bottom: 9%;
  display: flex;
  flex-direction: column;
  text-align: left;
  color: #3a2914;
}

.book-heading {
  min-height: 24px;
  margin-bottom: 10px;
  text-align: center;
}

.book-heading .pixel-heading {
  margin: 0 auto;
  filter: none;
}

.book-body {
  flex: 1;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.42;
  text-shadow: none;
}

.book-body p {
  margin: 0 0 3px;
  min-height: 0.6em;
}

.book-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.book-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  text-shadow: 1px 1px 0 #2b2b2b;
  border: 7px solid transparent;
  border-image: url(../assets/minecraft/textures/gui/sprites/widget/button.png) 3 fill / 7px / 0 stretch;
  image-rendering: pixelated;
}

.book-link:hover {
  border-image-source: url(../assets/minecraft/textures/gui/sprites/widget/button_highlighted.png);
  color: #ffffa0;
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.book-arrow {
  width: 46px;
  height: 26px;
  font-size: 0;
  color: transparent;
  background: none;
  border: 0;
  cursor: pointer;
  background-image: url(../assets/minecraft/textures/gui/sprites/widget/page_forward.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
}

#book-prev {
  background-image: url(../assets/minecraft/textures/gui/sprites/widget/page_backward.png);
}

.book-arrow:hover {
  background-image: url(../assets/minecraft/textures/gui/sprites/widget/page_forward_highlighted.png);
}

#book-prev:hover {
  background-image: url(../assets/minecraft/textures/gui/sprites/widget/page_backward_highlighted.png);
}

.book-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.book-pageno {
  font-size: 0.76rem;
  color: #5a4424;
}

#book-done {
  margin-top: 0;
}

/* ---- Dimension-travel fade ---- */
.fade {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.fade.show {
  opacity: 1;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .hotbar {
    grid-template-columns: repeat(9, 34px);
    gap: 0;
  }

  .slot {
    width: 34px;
    height: 34px;
  }

  .block-icon {
    width: 24px;
    height: 24px;
  }

  .hint {
    font-size: 0.7rem;
  }

  .panel {
    padding: 18px;
  }
}


/* ============================================================
   Mobile (touch) only. Scoped via body.touch-mode, set in
   enterTouchMode(). Keyboard/desktop affordances are pointless
   alongside the on-screen controls, so they're suppressed here.
   ============================================================ */
/* Working inventory bar: the hotbar lives in .hud (pointer-events:none)
   and sits beneath the full-screen .touch-look drag layer (z-index:40),
   which was swallowing taps. Lift it above and re-enable pointer events
   so its existing slot click handlers fire on tap. */
.touch-mode .hotbar { pointer-events: auto; z-index: 50; }
.touch-mode .slot { pointer-events: auto; }

/* Hide the keyboard-shortcut number badges (1-9) on the inventory slots. */
.touch-mode .slot-number { display: none; }

/* Remove WASD / keyboard hints: the in-game onboarding tutorial and the
   help screen's keyboard controls grid don't apply to touch. */
.touch-mode .tutorial { display: none; }
.touch-mode .controls-grid { display: none; }
