:root {
  --bg-overlay: rgba(12, 14, 18, 0.35);
  --panel: rgba(20, 24, 32, 0.82);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8eaef;
  --muted: #9aa3b2;
  --slot-bg: #1a1510;
  --slot-edge: #2c2419;
  --slot-highlight: #5c4d3a;
  --time-glow: rgba(255, 214, 150, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: #0d0f12
    radial-gradient(ellipse 120% 80% at 50% 40%, #1a2838 0%, #0d0f12 55%);
  color: var(--text);
  overflow: hidden;
}

.game-frame {
  min-height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(12px, 2vw, 28px);
}

.hud {
  position: relative;
  width: min(1200px, 100%);
  aspect-ratio: 16 / 9;
  max-height: min(85vh, 900px);
  margin: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(30, 40, 55, 0.4) 0%, rgba(15, 18, 24, 0.65) 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Sol üst: Hungry / Energy / Stamina */
.hud-stats {
  position: absolute;
  top: clamp(14px, 2.2vw, 24px);
  left: clamp(14px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
}

.stat {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
}

.stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__track {
  height: 14px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.stat__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.stat__fill--hungry {
  background: linear-gradient(90deg, #8b4513, #e8a54b);
}

.stat__fill--energy {
  background: linear-gradient(90deg, #2d6a4f, #95d5b2);
}

.stat__fill--stamina {
  background: linear-gradient(90deg, #1d4ed8, #7dd3fc);
}

/* Üst orta: zaman */
.hud-time {
  position: absolute;
  top: clamp(14px, 2.2vw, 24px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 10px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 0 32px var(--time-glow);
}

.hud-time__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hud-time__value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: #ffe8c4;
}

/* Sağ üst: sırt çantası + harita */
.hud-shortcuts {
  position: absolute;
  top: clamp(14px, 2.2vw, 24px);
  right: clamp(14px, 2.2vw, 24px);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 16px;
}

.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.shortcut:hover {
  background: rgba(40, 48, 62, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

.shortcut:active {
  transform: scale(0.97);
}

.shortcut__icon {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.shortcut__key {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* Alt orta: 5 envanter slotu (Minecraft tarzı) */
.hud-inventory {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 2.2vw, 24px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 8px 10px;
  background: var(--panel);
  border: 2px solid #1a1410;
  border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.inv-slot {
  width: clamp(44px, 5.5vw, 56px);
  height: clamp(44px, 5.5vw, 56px);
  background: var(--slot-bg)
    linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
  border: 2px solid #0a0806;
  border-right-color: var(--slot-edge);
  border-bottom-color: var(--slot-edge);
  border-left-color: #3d3428;
  border-top-color: #3d3428;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.5), inset -1px -1px 0 rgba(255, 255, 255, 0.04);
  image-rendering: pixelated;
}

.inv-slot--active {
  outline: 2px solid var(--slot-highlight);
  outline-offset: 1px;
  z-index: 1;
}
