:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --panel: rgba(9, 14, 24, 0.68);
  --panel-border: rgba(255, 255, 255, 0.18);
  --accent: #7ddf64;
  --accent-2: #6bb8ff;
  --danger: #ffbd6b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05070d;
}

button,
canvas {
  font: inherit;
}

#game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(#76b8ff, #cfefff 54%, #79c85d 55%);
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

.glass-panel,
.hud-card {
  border: 1px solid var(--panel-border);
  background: linear-gradient(135deg, rgba(9, 14, 24, 0.78), rgba(16, 28, 44, 0.58));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(130%);
}

#start-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: clamp(24px, 4vw, 44px);
  border-radius: 28px;
  color: #f8fbff;
  text-align: center;
  transition: opacity 260ms ease, transform 260ms ease, visibility 260ms ease;
  z-index: 20;
}

#start-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -48%) scale(0.98);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.08em;
  text-shadow: 0 7px 0 rgba(0, 0, 0, 0.28), 0 0 42px rgba(125, 223, 100, 0.3);
}

.lead {
  max-width: 620px;
  margin: 20px auto 20px;
  color: #d8e7f6;
  font-size: clamp(16px, 2.6vw, 20px);
  line-height: 1.7;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0 auto 24px;
  padding: 0;
  max-width: 620px;
  color: #dceaff;
  text-align: left;
  list-style: none;
}

.feature-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}

.feature-list i {
  color: var(--accent-2);
  margin-top: 3px;
}

#play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #82f05e, #32b968);
  color: #07110b;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(49, 203, 103, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

#play-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.small-note {
  margin: 16px 0 0;
  color: #a8bad0;
  font-size: 13px;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #fff;
  opacity: 0;
  transition: opacity 200ms ease;
}

#hud.visible {
  opacity: 1;
}

#top-hud {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 16px;
  color: #eaf5ff;
  font-size: 14px;
}

#biome-label {
  color: var(--accent);
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

#crosshair::before {
  left: 13px;
  top: 4px;
  width: 2px;
  height: 20px;
}

#crosshair::after {
  left: 4px;
  top: 13px;
  width: 20px;
  height: 2px;
}

#hotbar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(8, 58px);
  gap: 8px;
  transform: translateX(-50%);
}

.hotbar-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 -8px 20px rgba(0, 0, 0, 0.25);
}

.hotbar-slot.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(125, 223, 100, 0.4), inset 0 -8px 20px rgba(0, 0, 0, 0.25);
}

.block-chip {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 8px 8px 0 rgba(255, 255, 255, 0.16), inset -8px -8px 0 rgba(0, 0, 0, 0.18);
}

.slot-key {
  position: absolute;
  left: 6px;
  top: 3px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.slot-name {
  position: absolute;
  bottom: -22px;
  width: 90px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}

#help-panel {
  position: absolute;
  right: 18px;
  bottom: 104px;
  max-width: 390px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #dcecff;
  font-size: 13px;
  line-height: 1.7;
}

#toast {
  position: absolute;
  left: 50%;
  top: 22%;
  min-width: 180px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  text-align: center;
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  #hotbar {
    grid-template-columns: repeat(4, 52px);
    bottom: 18px;
  }

  .hotbar-slot {
    width: 52px;
    height: 52px;
  }

  #help-panel {
    display: none;
  }

  #top-hud {
    right: 12px;
    left: 12px;
    justify-content: space-between;
    font-size: 12px;
  }
}
